View source: R/estimate_cycle_position.R
estimate_cycle_position | R Documentation |
Assign cell cycle position by the angle formed by PC1 and PC2 in the cell cycle space. If the cell cycle projection does not exist, the function will project the data.
estimate_cycle_position( x, exprs_values = "logcounts", dimred = "tricycleEmbedding", center.pc1 = 0, center.pc2 = 0, altexp = NULL, ... )
x |
A numeric matrix of **log-expression** values where rows are features and columns are cells. Alternatively, a SummarizedExperiment or SingleCellExperiment containing such a matrix. |
exprs_values |
Integer scalar or string indicating which assay of |
dimred |
The name of reducedDims in SingleCellExperiment ( |
center.pc1 |
The center of PC1 when defining the angle. Default: 0 |
center.pc2 |
The center of PC2 when defining the angle. Default: 0 |
altexp |
String or integer scalar specifying an alternative experiment containing the **log-expression** data, which will be used for projection. If the projection is already calculated and stored in the SingleCellExperiment as a dimred, leave this value to default NULL. |
... |
Arguments to be used by |
The function will use assign the cell cycle position by the angle formed by the PC1 and PC2 of cell cycle projections.
If the input is a numeric matrix or a SummarizedExperiment, the projection will be calculated with the input **log-expression** values.
For SingleCellExperiment, the projection will also be calculated if the designated dimred
does not exist.
Ohterwise, the dimred
will directly be used to assign cell cycle position.
Therefore, this function is a wrapper function if the input is a SingleCellExperiment.
Refer to project_cycle_space
to all arguments during the projection.
The estimated cell cycle position is bound between 0 and 2pi. Note that we strive to get high resolution of cell cycle state, and we think the continuous position is more appropriate when describing the cell cycle. However, to help users understand the position variable, we also note that users can approximately relate 0.5pi to be the start of S stage, pi to be the start of G2M stage, 1.5pi to be the middle of M stage, and 1.75pi-0.25pi to be G1/G0 stage.
If the input is a numeric matrix, the cell cycle position - a numeric vector bound between 0 \sim 2 π with the same length as the number of input coumlum will be returned.
If the input is SummarizedExperiment, the original SummarizedExperiment with cell cycle position stored in colData with name 'tricyclePosition' will be returned.
If the input is SingleCellExperiment, the original SingleCellExperiment with cell cycle position stored in colData with name 'tricyclePosition' will be returned
and the projection will be stored in reducedDims(..., dimred)
if it does not exist before.
Shijie C. Zheng
Zheng SC, et al. Universal prediction of cell cycle position using transfer learning. Genome Biology (2022) 23: 41 doi:10.1186/s13059-021-02581-y.
project_cycle_space
, for projecting new data with a pre-learned reference
data(neurosphere_example, package = "tricycle") neurosphere_example <- estimate_cycle_position(neurosphere_example) reducedDimNames(neurosphere_example) plot(reducedDim(neurosphere_example, "tricycleEmbedding")) plot(neurosphere_example$tricyclePosition, reducedDim(neurosphere_example, "tricycleEmbedding")[, 1]) plot(neurosphere_example$tricyclePosition, reducedDim(neurosphere_example, "tricycleEmbedding")[, 2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.