Interactive visualization of QTL–gene relationships in 2D genomic space, separating cis and trans associations into stable Plotly traces.
Usage
qtl2dplotly(
d,
chrlen = gap::hg19,
qtl.id = "SNPid:",
qtl.prefix = "QTL:",
qtl.gene = "Gene:",
target.type = "Protein",
TSS = FALSE,
xlab = "QTL position",
ylab = "Gene position",
...
)Arguments
- d
Data frame containing QTL data. Must include SNP, chromosome, position, gene mapping, and cis/trans classification.
- chrlen
Chromosome length reference (default:
gap::hg19).- qtl.id
Prefix for SNP identifier in tooltip.
- qtl.prefix
Prefix for QTL coordinate label.
- qtl.gene
Prefix for gene coordinate label.
- target.type
Label for target entity type.
- TSS
Logical. If TRUE, uses transcription start site.
- xlab
Label for x-axis.
- ylab
Label for y-axis.
- ...
Additional arguments passed to
gap::qtl2dplot().
Details
This function wraps gap::qtl2dplot() and converts the output into an
interactive Plotly scatter plot.
Unlike the original implementation, this version:
avoids
color = ~cistrans(prevents row dropping in Plotly)uses explicit traces for cis/trans groups
ensures stable HTML widget rendering
eliminates "Ignoring observations" warnings
Examples
if (FALSE) { # \dontrun{
INF <- Sys.getenv("INF")
d <- read.csv(file.path(INF,"work","INF1.merge.cis.vs.trans"),as.is=TRUE)
r <- qtl2dplotly(d)
htmlwidgets::saveWidget(r,file="qtl2dplotly.html")
r
} # }