cellrank.tl.estimators.CFLARE.predict¶
- CFLARE.predict(use=None, percentile=98, method='leiden', cluster_key=None, n_clusters_kmeans=None, n_neighbors=20, resolution=0.1, n_matches_min=0, n_neighbors_filtering=15, basis=None, n_comps=5, scale=None)[source]¶
Find approximate recurrent classes of the Markov chain.
Filter to obtain recurrent states in left eigenvectors. Cluster to obtain approximate recurrent classes in right eigenvectors.
- Parameters
use (
Union
[int
,Sequence
[int
],None
]) – Which or how many first eigenvectors to use as features for filtering and clustering. If None, use the eigengap statistic.percentile (
Optional
[int
]) – Threshold used for filtering out cells which are most likely transient states. Cells which are in the lowerpercentile
percent of each eigenvector will be removed from the data matrix.method (
Literal
[‘leiden’, ‘means’]) –Method to be used for clustering. Valid option are:
’kmeans’ -
sklearn.cluster.KMeans
.’leiden’ -
scanpy.tl.leiden()
.
cluster_key (
Optional
[str
]) – Key inanndata.AnnData.obs
in order to associate names and colors withterminal_states
.n_clusters_kmeans (
Optional
[int
]) – If None, this is set touse + 1
.n_neighbors (
int
) – Number of neighbors in a KNN graph. This is the \(K\) parameter for that, the number of neighbors for each cell. Only used whenmethod = 'leiden'
.resolution (
float
) – Resolution parameter forscanpy.tl.leiden()
. Should be chosen relatively small.n_matches_min (
int
) – Filters out cells which don’t have at leastn_matches_min
neighbors from the same category. This filters out some cells which are transient but have been misassigned.n_neighbors_filtering (
int
) – Parameter for filtering cells. Cells are filtered out if they don’t have at leastn_matches_min
neighbors among theirn_neighbors_filtering
nearest cells.basis (
Optional
[str
]) – Key fromanndata.AnnData.obsm
as additional features for clustering. If None, use only the right eigenvectors.n_comps (
int
) – Number of embedding components to be use whenbasis != None
.scale (
Optional
[bool
]) – Scale the values to z-scores. If None, scale the values ifbasis != None
.
- Return type
- Returns
Nothing, just updates the following fields:
terminal_states
- Categorical annotation of terminal states.terminal_states_probabilities
- Aggregated probability of cells to be in terminal states.