plotGeneCount {tradeSeq}R Documentation

Plot the gene in reduced dimension space

Description

Plot the gene in reduced dimension space

Usage

plotGeneCount(curve, counts = NULL, gene = NULL, clusters = NULL,
  models = NULL, title = NULL)

Arguments

curve

The output from a lineage computation

counts

the count matrix.

gene

The name of gene for which you want to plot the count or the row number of that gene in the count matrix. Alternatively, one can specify the cluster arguments

clusters

The assignation of each cell to a cluster. Used to color the plot. Either clusters or gene and counts must be supplied.

models

the list of GAMs, typically the output from fitGAM. Used to display the knots.

title

Title for the plot.

Details

If both gene and clusters arguments are supplied, the plot will be colored according to gene count level.

Value

A ggplot object

Examples

set.seed(97)
library(slingshot)
data(crv, package="tradeSeq")
data(countMatrix, package="tradeSeq")
rd <- slingshot::reducedDim(crv)
cl <- kmeans(rd, centers = 7)$cluster
lin <- slingshot::getLineages(rd, clusterLabels = cl, start.clus = 4)
crv <- slingshot::getCurves(lin)
counts <- as.matrix(countMatrix)
gamList <- fitGAM(counts = counts,
 pseudotime = slingPseudotime(crv, na = FALSE),
 cellWeights = slingCurveWeights(crv))
plotGeneCount(crv, counts, gene = "Mpo")

[Package tradeSeq version 1.0.1 Index]