plotGeneCount: Plot gene expression in reduced dimension.

Description Usage Arguments Details Value Examples

Description

Plot the gene in reduced dimensional space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
plotGeneCount(curve, ...)

## S4 method for signature 'SlingshotDataSet'
plotGeneCount(
  curve,
  counts = NULL,
  gene = NULL,
  clusters = NULL,
  models = NULL,
  title = NULL
)

## S4 method for signature 'SingleCellExperiment'
plotGeneCount(
  curve,
  counts = NULL,
  gene = NULL,
  clusters = NULL,
  models = NULL,
  title = NULL
)

## S4 method for signature 'CellDataSet'
plotGeneCount(
  curve,
  counts = NULL,
  gene = NULL,
  clusters = NULL,
  models = NULL,
  title = NULL
)

Arguments

curve

One of three

  • A SlingshotDataSet object. The output from trajectory inference using Slingshot.

  • A SingleCellExperiment object. The output from trajectory inference using Slingshot.

  • A CellDataset object.

...

parameters including:

counts

The count matrix, genes in rows and cells in columns. Only needed if the input is of the type SlingshotDataSet and the gene argument is not NULL.

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 clusters argument.

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 fitted GAMs, typically the output from fitGAM. Used to display the knots. Does not work with a CellDataset object as input.

title

Title for the plot.

Details

If both gene and clusters arguments are supplied, the plot will be colored according to gene count level. If none are provided, the function will fail. When a CellDataset object is provided as input, the function relies on the plot_cell_trajectory function

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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")

tradeSeq documentation built on Nov. 8, 2020, 7:51 p.m.