cellrank.tl.estimators.GPCCA¶
-
class
cellrank.tl.estimators.
GPCCA
(obj, inplace=True, read_from_adata=False, obsp_key=None, g2m_key='G2M_score', s_key='S_score', write_to_adata=True, key=None)[source]¶ Generalized Perron Cluster Cluster Analysis [GPCCA18].
Coarse-grains a discrete Markov chain into a set of macrostates and computes coarse-grained transition probabilities among the macrostates. Each macrostate corresponds to an area of the state space, i.e. to a subset of cells. The assignment is soft, i.e. each cell is assigned to every macrostate with a certain weight, where weights sum to one per cell. Macrostates are computed by maximizing the ‘crispness’ which can be thought of as a measure for minimal overlap between macrostates in a certain inner-product sense. Once the macrostates have been computed, we project the large transition matrix onto a coarse-grained transition matrix among the macrostates via a Galerkin projection. This projection is based on invariant subspaces of the original transition matrix which are obtained using the real Schur decomposition [GPCCA18].
- Parameters
obj¶ (
Union
[KernelExpression
, ~AnnData,spmatrix
,ndarray
]) – Either acellrank.tl.kernels.Kernel
object, ananndata.AnnData
object which stores the transition matrix in.obsp
attribute ornumpy
orscipy
array.inplace¶ (
bool
) – Whether to modifyadata
object inplace or make a copy.read_from_adata¶ (
bool
) – Whether to read available attributes inadata
, if present.obsp_key¶ (
Optional
[str
]) – Key inobj.obsp
whenobj
is ananndata.AnnData
object.g2m_key¶ (
Optional
[str
]) – Key inadata
.obs
. Can be used to detect cell-cycle driven start- or endpoints.s_key¶ (
Optional
[str
]) – Key inadata
.obs
. Can be used to detect cell-cycle driven start- or endpoints.write_to_adata¶ (
bool
) – Whether to write the transition matrix toadata
.obsp
and the parameters toadata
.uns
.key¶ (
Optional
[str
]) – Key used when writing transition matrix toadata
. If None, thekey
is set to ‘T_bwd’ ifbackward
is True, else ‘T_fwd’. Only used whenwrite_to_adata=True
.
Attributes
Absorption probabilities.
Annotated data object.
Coarse-grained transition matrix.
Coarse initial distribution.
Coarse stationary distribution.
Differentiation potential.
Eigendecomposition.
Whether the Markov chain is irreducible or not.
Whether the transition matrix is sparse or not.
Underlying kernel.
Lineage absorption times.
Lineage drivers.
Macrostates.
Macrostates memberships.
Recurrent classes of the Markov chain.
Schur vectors.
Schur matrix.
Terminal states.
Terminal states probabilities.
Transient classes of the Markov chain.
Transition matrix.
Methods
compute_absorption_probabilities
([keys, …])Compute absorption probabilities of a Markov chain.
compute_eigendecomposition
([k, which, …])Compute eigendecomposition of transition matrix.
compute_gdpt
([n_components, key_added])Compute generalized Diffusion pseudotime from [Haghverdi16] using the real Schur decomposition.
compute_lineage_drivers
([lineages, method, …])Compute driver genes per lineage.
compute_macrostates
([n_states, n_cells, …])Compute the macrostates.
Compute communication classes for the Markov chain.
compute_schur
([n_components, …])Compute the Schur decomposition.
compute_terminal_states
([method, n_cells, …])Automatically select terminal states from macrostates.
copy
()Return a copy of self, including the underlying
adata
object.fit
([n_lineages, cluster_key, keys, method, …])Run the pipeline, computing the macrostates, initial or terminal states and optionally the absorption probabilities.
plot_absorption_probabilities
(data, prop[, …])Plot discrete states or probabilities in an embedding.
plot_coarse_T
([show_stationary_dist, …])Plot the coarse-grained transition matrix between macrostates.
plot_eigendecomposition
([left])Plot eigenvectors in an embedding.
plot_lineage_drivers
(lineage[, n_genes, use_raw])Plot lineage drivers discovered by
compute_lineage_drivers()
.plot_macrostates
(data, prop[, discrete, …])Plot discrete states or probabilities in an embedding.
plot_schur
(vectors, prop[, use, abs_value, …])Plot vectors in an embedding.
plot_schur_matrix
([title, cmap, figsize, …])Plot the Schur matrix.
plot_spectrum
([n, real_only, show_eigengap, …])Plot the top eigenvalues in real or complex plane.
plot_terminal_states
(data, prop[, discrete, …])Plot discrete states or probabilities in an embedding.
read
(fname)Deserialize self from a file.
rename_terminal_states
(new_names[, update_adata])Rename the names of
terminal_states
.set_terminal_states
(labels[, cluster_key, …])Set the approximate recurrent classes, if they are known a priori.
Manually select terminal states from macrostates.
write
(fname[, ext])Serialize self to a file.