R/qtlcharts is an R package to create interactive charts for xQTL data, for use with R/qtl.
It is built with D3, using the following reusable components:
- lodchart: LOD curve panel
- scatterplot: scatter plot panel
- dotchart: dot plot panel
- cichart: confidence interval plot panel
- curvechart: panel for multiple curves
- mapchart: genetic marker map panel
- heatmap: heat map panel
- lodheatmap: panel for heat map of LOD curves
For example charts, see the R/qtlcharts web page.
R/qtlcharts is early in development and so is not yet available on CRAN.
You can install R/qtlcharts from its GitHub repository. You first need to install the R/qtl, jsonlite, and devtools packages.
install.packages(c("qtl", "jsonlite", "devtools"))
Then install R/qtlcharts using the install_github
function in the
devtools package.
library(devtools)
install_github("kbroman/qtlcharts")
If that doesn't work, you might have an older version of devtools, so try:
library(devtools)
install_github("qtlcharts", "kbroman")
Try the following example, which creates an interactive chart with LOD curves linked to estimated QTL effects.
library(qtlcharts)
data(hyper)
hyper <- calc.genoprob(hyper, step=1)
out <- scanone(hyper)
iplotScanone(out, hyper)
Also try iplotCorr
, an image of a correlation matrix (for the
gene expression of a set of 100 genes) linked to the underlying
scatterplots, with the points in the scatterplot colored by their
genotype at a QTL:
library(qtlcharts)
data(geneExpr)
iplotCorr(geneExpr$expr, geneExpr$genotype)
Finally, try iboxplot
, a plot of the quantiles of many
distributions, linked to the underlying histograms.
library(qtlcharts)
# simulate some data
n.ind <- 500
n.gene <- 10000
expr <- matrix(rnorm(n.ind * n.gene, (1:n.ind)/n.ind*3), ncol=n.gene)
dimnames(expr) <- list(paste0("ind", 1:n.ind),
paste0("gene", 1:n.gene))
# generate the plot
iboxplot(expr)
Licensed under the MIT license. (More information here.)
R/qtlcharts incorporates D3.js (see its license), d3.tip (see its license), and ColorBrewer (see its license).