library(knitr) options(width=80)
hook_output = knit_hooks$get('output') knit_hooks$set(output = function(x, options) { # this hook is used only when the linewidth option is not NULL if (!is.null(n <- options$linewidth)) { x = knitr:::split_lines(x) # any lines wider than n should be wrapped if (any(nchar(x) > n)) x = strwrap(x, width = n) x = paste(x, collapse = '\n') } hook_output(x, options) })
The GENE.E
package provides the ability to transfer matrices, dendrograms, and annotations between R and GENE-E. Two methods are provided:
from.genee Gets the current selection from GENE-E.
to.genee Sends a matrix and annotations to GENE-E.
For illustration of GENE.E
usage, we use the Golub et al. data
set on acute leukemia from the golubEsets
package. First, load the GENE.E
and golubEsets
packages:
library(GENE.E) library(golubEsets)
suppressPackageStartupMessages(library(GENE.E)) suppressPackageStartupMessages(library(golubEsets))
Next, ensure that GENE-E is running and then issue the following commands to load the data and send the data to GENE-E:
data(Golub_Merge) to.genee(exprs(Golub_Merge), fData(Golub_Merge), show.colnames=F, pData(Golub_Merge)[,c('Gender', 'ALL.AML')], column.hclust=hclust(dist(t(exprs(Golub_Merge)))))
In GENE-E, (see video below), drag the dotted line to cut the sample dendrogram. Next, click a dendrogram branch to select the samples in that branch.
Finally, get the selected data in GENE-E back into our R session:
Sys.sleep(5) selection <- from.genee()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.