View source: R/averagePseudotime.R
averagePseudotime | R Documentation |
Compute the average pseudotime for each cell across all paths in which it is involved.
averagePseudotime(x, i = 1L)
x |
A numeric matrix-like object containing pseudotime orderings. Alternatively, a PseudotimeOrdering object containing such a matrix. |
i |
Integer scalar or string specifying the entry of |
Averaging the pseudotime is a convenient way to consolidate multiple paths into a single ordering for, e.g., visualization.
It is permissible as cells involved in multiple paths should generally have similar pseudotimes in each path,
under assumption that the cell is involved in the part of the trajectory that is common to those paths.
In such cases, the average is just a way of compressing those pseudotimes into a single value.
Conversely, for cells that are unique to a single path, the average collapses to that path's pseudotime (assuming that all other values are NA
).
A numeric vector containing the average pseudotime for each cell.
Aaron Lun
pseudotimes <- matrix(rnorm(200), ncol=2)
pseudotimes[1:40,1] <- NA
pseudotimes[61:100,2] <- NA
pseudotimes[41:60,] <- runif(20)
averagePseudotime(pseudotimes)
pto <- PseudotimeOrdering(pseudotimes)
averagePseudotime(pto)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.