plotTSCANDimReduceFeatures: Plot feature expression on cell 2D embedding with MST...

View source: R/runTSCAN.R

plotTSCANDimReduceFeaturesR Documentation

Plot feature expression on cell 2D embedding with MST overlaid

Description

A wrapper function which plots all cells or cells in chosen cluster. Each point is a cell colored by the expression of a feature of interest, the relevant edges of the MST are overlaid on top.

Usage

plotTSCANDimReduceFeatures(
  inSCE,
  features,
  useReducedDim = "UMAP",
  useAssay = "logcounts",
  by = "rownames",
  useCluster = NULL,
  featureDisplay = metadata(inSCE)$featureDisplay,
  combinePlot = c("all", "none")
)

Arguments

inSCE

Input SingleCellExperiment object.

features

Choose the feature of interest to explore the expression level on the trajectory. Required.

useReducedDim

A single character for the matrix of 2D embedding. Should exist in reducedDims slot. Default "UMAP".

useAssay

A single character for the feature expression matrix. Should exist in assayNames(inSCE). Default "logcounts".

by

Where should features be found? NULL, "rownames" for rownames(inSCE), otherwise will be regarded as rowData variable.

useCluster

Choose specific clusters where gene expression needs to be visualized. By default NULL, all clusters are chosen.

featureDisplay

Specify the feature ID type to display. Users can set default value with setSCTKDisplayRow. NULL or "rownames" specifies the rownames of inSCE. Other character values indicates rowData variable.

combinePlot

Must be either "all" or "none". "all" will combine plots of each feature into a single .ggplot object, while "none" will output a list of plots. Default "all".

Value

A .ggplot object of cell scatter plot, colored by the expression of a gene of interest, with the layer of trajectory.

Author(s)

Yichen Wang

Examples

data("mouseBrainSubsetSCE", package = "singleCellTK")
mouseBrainSubsetSCE <- runTSCAN(inSCE = mouseBrainSubsetSCE,
                                useReducedDim = "PCA_logcounts")
plotTSCANDimReduceFeatures(inSCE = mouseBrainSubsetSCE,
                           features = "Tshz1",
                           useReducedDim = "TSNE_logcounts")

compbiomed/singleCellTK documentation built on Feb. 10, 2024, 3:32 a.m.