plotTSCANClusterDEG: Plot features identified by 'runTSCANClusterDEAnalysis' on...

View source: R/runTSCAN.R

plotTSCANClusterDEGR Documentation

Plot features identified by runTSCANClusterDEAnalysis on cell 2D embedding with MST overlaid

Description

A wrapper function which plot the top features expression identified by runTSCANClusterDEAnalysis on the 2D embedding of the cells cluster used in the analysis. The related MST edges are overlaid.

Usage

plotTSCANClusterDEG(
  inSCE,
  useCluster,
  pathIndex = NULL,
  useReducedDim = "UMAP",
  topN = 9,
  useAssay = NULL,
  featureDisplay = metadata(inSCE)$featureDisplay,
  combinePlot = c("all", "none")
)

Arguments

inSCE

Input SingleCellExperiment object.

useCluster

Choose a cluster used for identifying DEG with runTSCANClusterDEAnalysis. Required.

pathIndex

Specifies one of the branching paths from useCluster and plot the top DEGs on this path. Ususally presented by the terminal cluster of a path. By default NULL plot top DEGs of all paths.

useReducedDim

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

topN

Integer. Use top N genes identified. Default 9.

useAssay

A single character for the feature expression matrix. Should exist in assayNames(inSCE). Default NULL for using the one used in runTSCANClusterDEAnalysis.

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 identified by runTSCANClusterDEAnalysis, with the layer of trajectory.

Author(s)

Yichen Wang

Examples

data("mouseBrainSubsetSCE", package = "singleCellTK")
mouseBrainSubsetSCE <- runTSCAN(inSCE = mouseBrainSubsetSCE,
                                useReducedDim = "PCA_logcounts")
mouseBrainSubsetSCE <- runTSCANClusterDEAnalysis(inSCE = mouseBrainSubsetSCE,
                                                 useCluster = 1)
plotTSCANClusterDEG(mouseBrainSubsetSCE, useCluster = 1,
                    useReducedDim = "TSNE_logcounts")

compbiomed/singleCellTK documentation built on Oct. 27, 2024, 3:26 a.m.