Web-based interactive charts (using D3.js) for the analysis of
experimental crosses to identify genetic loci (quantitative trait
loci, QTL) contributing to variation in quantitative traits.
For example charts, see the R/qtlcharts website.
Install R/qtlcharts from CRAN using
install.packages(c("qtl", "htmlwidgets", "devtools"))
Then install R/qtlcharts using the
install_github function in the
Try the following example, which creates an interactive chart with LOD curves linked to estimated QTL effects.
library(qtl)library(qtlcharts)data(hyper)hyper <- calc.genoprob(hyper, step=1)out <- scanone(hyper)iplotScanone(out, hyper)
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:
iboxplot, a plot of the quantiles of many
distributions, linked to the underlying histograms.
library(qtlcharts)# simulate some datan.ind <- 500n.gene <- 10000expr <- 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 plotiboxplot(expr)
The R/qtlcharts package as a whole is distributed under [GPL-3 (GNU General Public License version 3)[https://www.gnu.org/licenses/gpl-3.0.en.html].
R/qtlcharts incorporates the following other open source software components, which have their own license agreements.
Fix bug in
idotplot() so that it works with a single group.
Fix bug in
iplotMap() so that the drop-down menu works in Firefox.
Update to use CoffeeScript v 2.2.2. Using babel to compile to ES5.
scat2scat() so that the chart options
can be vectors of length of
scat2data, so that each dataset can
have different x- and y-axis labels. Default is to take them from
the column names of the datasets in
All charts can now take a
heading and a
chartOpts. The former will make an
<h2> heading above the
figure; the latter will make a
<div> at the bottom. These are
intended for stand-alone html files.
caption chart option, now using
.html() rather than
.text() so that you can insert a bit of html (such as
chartOptswhich will show up as text below the figure. This is intended for stand-alone html files.
Added new tool for exploring pleiotropy between two traits,
Fixed X chromosome case in iplotScantwo, so that only relevant two-locus genotypes are shown.
Added new chart option
In the coffeescript functions, ensure that list arguments like
margin have all of the necessary components. This avoid the
problem of everything being messed up if for example
specified within defining
lodcharts now includes a quantitative scale for position on the
x-axis in the case of a single chromosome
iplotScantwo, in phenotype x genotype plots
when switching between markers on the same chromosome, animate the
movement of the points rather than destroying and re-creating the
Add a new chart,
scat2scat. The idea is to summarize each of a
long series of scatterplots with a pair of numbers. Then a
scatterplot of those summary statistics is linked to the underlying
details: click on a point in the main scatterplot and have the
underlying scatterplot be shown.
Add a new chart,
itriplot, for plotting trinomial probabilities,
represented as points in an equilateral triangle.
idotplot so that
idotplot is the main
iplotPXG calls it.
Add some additional options, such as
Change the name of some options, such as
iplotCurves (in place of
digits argument for all plot functions, with the aim to
reduce the size of the datasets included in the resulting charts.
Removed the vignettes from the package (for complicated reasons); they're available at the R/qtlcharts website.
Fix proliferation of tool tips
For use with Shiny, clear SVG before drawing
Changed license and author list in order to post the package on CRAN, http://cran.r-project.org
iplot now use the names of the input data as
individual IDs if
indID is missing or
pxgtype="ci". In the case of phenotypes with missing values, the confidence intervals were incorrect.
scatterplotsthat controls whether scatterplots will be shown when clicking on pixels in the heatmap. (If
scatterplots=FALSE, we skip the scatterplots.)
iplotMScanone can plot just points (rather than curves) for the
LOD scores and QTL effects in the lower and right-hand panels.
Fix a bug in
iplotMScanone (x-axis labels in right-hand plot
weren't being shown)
setScreenSizefunction for controlling the default sizes of charts.
idotplot function for plotting a quantitative variable in
different categories. (It's just like
iplotPXG, but with data
values not connected to a cross object.)
Reorganized the d3panels code: just
d3panels.min.css rather than linking
to js code for individual panels.
To save a plot to a file, you now need to assign the result of a plot
function to an object and then use the
library(qtlcharts)library(qtl)data(hyper)hyper <- calc.genoprob(hyper, step=1)out <- scanone(hyper)chart <- iplotScanone(out, hyper)htmlwidgets::saveWidget(chart, file="hyper_scanone.html")
It's now simpler to include interactive charts within an R Markdown
document. You simply make the plots in a code chunk in the way that
you would at the R prompt. There's no longer a need to worry about