expression_plot: Expression Plot

Description Usage Arguments Details Value Examples

View source: R/expression_plot.R

Description

Displays the level of expression of a gene in each cell on the 2D projected data.

Usage

1
expression_plot(data, name, tsne, colors = c("default", "rainbow", "heat"))

Arguments

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"

Details

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.

Value

The function returns a R plot.

Examples

1
2
3
4
5
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)

SingleCellSignalR documentation built on Nov. 8, 2020, 5:17 p.m.