A wrapper function which visualizes outputs from the runTSCANClusterDEAnalysis function. Each point is a cell in the cluster and is colored by its pseudotime value along the path to which it was assigned.

plotClusterPseudo(inSCE, useClusters, pathIndex = NULL, useReducedDim)

Arguments

inSCE

Input SingleCellExperiment object.

useClusters

Choose the cluster containing the branch point in the data in order to recompute the pseudotimes so that the root lies at the cluster center, allowing us to detect genes that are associated with the divergence of the branches.

pathIndex

Path number for which the pseudotime values should be used. PathIndex corresponds to one path from the root node to one of the terminal nodes.

useReducedDim

Saved dimension reduction name in inSCE. Required.

Value

A plots with the TSCAN-derived pseudotimes of all the cells along the path belonging to the cluster

Author

Nida Pervaiz

Examples

data("scExample", package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
rowData(sce)$Symbol <- rowData(sce)$feature_name
rownames(sce) <- rowData(sce)$Symbol
sce <- scaterlogNormCounts(sce, assayName = "logcounts")
sce <- runDimReduce(inSCE = sce, method = "scaterPCA", 
                    useAssay = "logcounts", reducedDimName = "PCA")
#> Thu Apr 28 11:25:15 2022 ... Computing Scater PCA.
sce <- runDimReduce(inSCE = sce, method = "rTSNE", useReducedDim = "PCA", 
                    reducedDimName = "TSNE")
#> Thu Apr 28 11:25:15 2022 ... Computing RtSNE.
#> Warning: using `useReducedDim`, `run_pca` and `ntop` forced to be FALSE/NULL
sce <- runTSCAN (inSCE = sce, useReducedDim = "PCA", seed = NULL)
#> Thu Apr 28 11:25:15 2022 ... Running 'scran SNN clustering'
#> Cluster involved in path 4 are: 1:5
#> Number of estimated paths is 1
sce <- runTSCANDEG(inSCE = sce, pathIndex = 4)
sce <- runTSCANClusterDEAnalysis(inSCE = sce, useClusters = 5)
#> Clusters involved in path 4 are: c(1, 4, 5)
#> Clusters involved in path 3 are: c(2, 3, 5)
#> Number of estimated paths of cluster 5 is 2. Following are the terminal nodes for each path respectively: c("4", "3")
plotClusterPseudo(inSCE = sce, useClusters = 5, pathIndex = NULL, 
                  useReducedDim = "TSNE")
#> Warning: Removed 4 rows containing missing values (geom_text_repel).