View source: R/expression_plot.R
expression_plot | R Documentation |
Displays the level of expression of a gene in each cell on the 2D projected data.
expression_plot(data, name, tsne, colors = c("default", "rainbow", "heat"))
data |
a data frame of n rows (genes) and m columns (cells) of read or UMI counts (note : rownames(data)=genes) |
name |
the identifier of the gene of interest |
tsne |
a table of n rows and 2 columns with 2D projection coordinates for each cell |
colors |
"default" returns the default colorpanel, also accepts "rainbow" or "heat" |
This function displays the expression level of a gene of interest on a 2D projection.
'name' can be any character that corresponds to a row name of 'data'.
'tsne' corresponds to the 2D coordinates for each cell. Although t-SNE maps are widely used to display cells on a 2D projection, the user can provide any table with two columns and a number of rows equal to the number of columns of *data* (i.e. the two first components of a PCA).
'colors' must be "default", "rainbow" or "heat" exclusively. "rainbow" and "heat" are the color palettes provided in R.
The function returns a R plot.
data <- matrix(runif(5,0,1),ncol=5) data[2] <- data[5] <- 0 rownames(data) <- "gene 1" tsne <- matrix(runif(10,0,1),ncol=2) expression_plot(data,"gene 1",tsne)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.