Description Usage Arguments Details Value Author(s) See Also Examples
A convenience wrapper to quickly compute a minimum spanning tree (MST) on the cluster centroids to obtain a pseudotime ordering of the cells.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | quickPseudotime(x, ...)
## S4 method for signature 'ANY'
quickPseudotime(x, clusters, others = NULL, ..., start = NULL, columns = NULL)
## S4 method for signature 'SummarizedExperiment'
quickPseudotime(x, ..., assay.type = "logcounts")
## S4 method for signature 'SingleCellExperiment'
quickPseudotime(
x,
clusters = colLabels(x, onAbsence = "error"),
...,
others = NULL,
use.dimred = NULL,
other.dimreds = TRUE
)
|
x |
A numeric matrix of coordinates where each row represents a cell/sample and each column represents a dimension (usually a PC or another low-dimensional embedding, but features or genes can also be used). Alternatively, a SummarizedExperiment or SingleCellExperiment object
containing such a matrix in its Alternatively, for SingleCellExperiments, this matrix may be extracted from its |
... |
For the generic, further arguments to pass to the specific methods. For the ANY method, further arguments to pass to For the SummarizedExperiment method, further arguments to pass to the ANY method. For the SingleCellExperiment method, further arguments to pass to the SummarizedExperiment method
(if |
clusters |
A vector or factor of length equal to the number of cells in |
others |
List of numeric matrices with the same number of rows as |
start |
Arguments passed to |
columns |
A character, logical or integer vector specifying the columns of |
assay.type |
An integer or string specifying the assay to use from a SummarizedExperiment |
use.dimred |
An integer or string specifying the reduced dimensions to use from a SingleCellExperiment |
other.dimreds |
Logical scalar indicating whether all dimensionality reduction results in |
This function simply calls, in order:
rowmean
, to compute the average low-dimensional coordinates for each cluster.
createClusterMST
on the average coordinates created from x
.
reportEdges
on the average coordinates for all entries of other
.
mapCellsToEdges
on the per-cell coordinates in x
with the constructed MST.
orderCells
on the mappings generated from x
onto the MST.
A List containing:
centered
, a list of numeric matrices containing the averaged coordinates for each cluster.
Each matrix corresponds to a dimensionality reduction result in x
.
mst
, a graph object containing the cluster-level MST computed on the coordinates from use
.
ordering
, a numeric matrix of pseudotimes for various paths through the MST computed from use
.
connected
, a list of data.frames containing the edge coordinates between centers.
Each data.frame corresponds to a dimensionality reduction result in x
.
Aaron Lun
createClusterMST
and friends, for the functions that do the actual work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Mocking up an SCE object:
ncells <- 100
u <- matrix(rpois(20000, 5), ncol=ncells)
pca <- matrix(runif(ncells*5), ncells)
tsne <- matrix(rnorm(ncells*2), ncells)
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays=list(counts=u),
reducedDims=SimpleList(PCA=pca, tSNE=tsne))
# Clustering on our pretend PCA values:
clusters <- kmeans(pca, 3)$cluster
# Quickly computing the pseudotime:
out <- quickPseudotime(sce, clusters, use.dimred="PCA")
out$mst
head(out$ordering)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.