Explore Data {scran} | R Documentation |
Generate an interactive Shiny app to explore gene expression patterns in single-cell data
exploreData(x, cell.data, gene.data, red.dim, run=TRUE)
x |
A numeric matrix of expression values to be visualized. |
cell.data |
A data frame of cell information, where each row corresponds to a column of |
gene.data |
A data frame of gene information, where each row corresponds to a row of |
red.dim |
A numeric matrix with two colums, specifying the reduced-dimension coordinates for each cell. |
run |
A logical scalar specifying whether the app should be run immediately. |
Note that this function is deprecated; we suggest using the iSEE package for data exploration instead.
This function will return a Shiny app object that can be run with runApp
.
The app allows the user to interactively explore gene expression patterns in single-cell RNA-seq data.
Explorative analysis is focused on comparing gene exression between different groups of cells, as defined by the covariates of cell.data
.
Three plots are shown in the app:
a scatterplot of cell locations based on the red.dim
coordinates, colored by a selected covariate
a scatterplot of cell locations based on the red.dim
coordinates, colored by expression of a selected gene
boxplot(s) of expression values for a selected gene, grouped by a selected covariate.
Several options are available within the app:
Covariate to be used for coloring the first scatter plot.
Covariate with which expression values are grouped in the boxplots.
In addition, the gene.data
data frame is rendered as an interactive table using the JavaScript library DataTable
.
This allows the user to subset/search the feature data and select a gene by clicking on the corresponding row.
If run=FALSE
, a Shiny app object is returned, which can be run with runApp
.
If run=TRUE
, a Shiny app object is created and run.
Karsten Bach
# Set up example data example(SingleCellExperiment) cell.data <- DataFrame(stuff=sample(LETTERS, ncol(sce), replace=TRUE)) gene.data <- DataFrame(lengths=runif(nrow(sce))) # Mocking up some reduced dimensions. pca <- prcomp(t(exprs(sce))) red.dim <- pca$x[,1:2] # Creating the app object. app <- exploreData(exprs(sce), cell.data, gene.data, red.dim, run=FALSE) if (interactive()) { shiny::runApp(app) } ## Not run: # Running directly from the function. saved <- exploreData(x, cell.data, gene.data, red.dim) ## End(Not run)