The charts are saved to a temporary file and opened in a web browser, though you may also save them to a specific file, to be viewed later. We are focusing development on the Chrome browser. The graphs may also be viewed in other browsers, such as Safari, Opera and Firefox, but it can be hard to accommodate all possible browser differences.
You first need to load the package.
Let’s begin by considering the function
iplotCorr, which creates a heatmap of a correlation matrix, linked to scatterplots of the underlying variables.
We’ll first load the
geneExpr dataset, included with the R/qtlcharts package.
This is a list with two components. The first component,
geneExpr$expr, is a 491 × 100 matrix of gene expression data; the second component,
geneExpr$genotype, is a vector of genotypes (of length 491) at a QTL that influences those 100 genes’ expression values. (The genes were selected from a larger expression genetics study, on that basis: that they are all influenced by this QTL.)
Let’s pull out those two components of
geneExpr as separate objects,
expr <- geneExpr$expr geno <- geneExpr$genotype
The simplest use of
iplotCorr is with a numeric matrix, as with the
expr dataset. For example:
This will open an interactive figure in a web browser, with a heat map of the correlation matrix of the genes on the left linked to the underlying scatterplots. With the argument
reorder=TRUE, the genes are reordered (by hierarchical clustering with the R function
hclust) to bring genes with similar expression patterns next to each other.
The following is a snapshot. (See a live example at the R/qtlcharts website.)