knitr::opts_chunk$set(cache=TRUE)
This is a prototype of embedding epiviz JS visualizations on Rmarkdown using the epivizWidgets package.
This infrastructure is built on htmlwidgets.
Plotting an ExpressionSet. Compute average for tumor and normal, then make an MA plot.
require(epivizr) require(antiProfilesData) data(apColonData)
keep <- pData(apColonData)$SubType!="adenoma" apColonData <- apColonData[,keep] status <- pData(apColonData)$Status Indexes <- split(seq(along=status),status) exprMat <- exprs(apColonData) mns <- sapply(Indexes, function(ind) rowMeans(exprMat[,ind])) mat <- cbind(colonM=mns[,"1"]-mns[,"0"], colonA=0.5*(mns[,"1"]+mns[,"0"])) assayDataElement(apColonData, "MA") <- mat show(apColonData)
This is how it's used. apColonData is an ExpressionSet, columns specify which columns in assay MA are going to be plotted.
library(epivizWidgets) epivizWidgets::scatterplot(apColonData, columns=c("colonA","colonM"), assay="MA")
TODO:
More advanced TODO:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.