scFates.tl.cellrank_to_tree#
- scFates.tl.cellrank_to_tree(adata, time, Nodes, method='ppt', ppt_lambda=100, auto_root=False, root_params={}, reassign_pseudotime=False, key_cellrank='term_states_fwd_memberships', copy=False, **kwargs)#
Converts CellRank [Lange21] fate probabilities into a principal tree that can be analysed by scFates.
It combines the projection generated by cr.pl.circular_projection with any measure of differentiation (CytoTRACE, latent time). A tree is fitted onto this new embedding.
- Parameters:
- adata
Annotated data matrix.
- time
time key to use for the additional dimension used in combination with cr.pl.circular_projection.
- Nodes
int Number of nodes that compose the principal graph.
- method
Literal['ppt','epg'] (default:'ppt') If ppt, uses simpleppt approach, ppt_lambda and ppt_sigma are the parameters controlling the algorithm. If epg, uses ComputeElasticPrincipalTree function from elpigraph python package, epg_lambda epg_mu and epg_trimmingradius are the parameters controlling the algorithm.
- ppt_lambda
int(default:100) Parameter for simpleppt, penalty for the tree length [Mao15]. Usually works well at default for the conversion.
- auto_root
bool(default:False) Automatically select the root tip using the time key.
- min_val
min_val parameter from
scFates.tl.root()- reassign_pseudotime
bool(default:False) whether use the time key to replace the distances comptued from the tree.
- key_cellrank default:
'term_states_fwd_memberships' where to get the forward terminal fate memberships.
- copy default:
False Return a copy instead of writing to adata.
- kwargs
arguments to pass to function
scFates.tl.tree().
- Returns:
adata : anndata.AnnData if copy=True it returns or else add fields to adata:
- .obsm[‘X_fates’]
representation generated by combining the time key with projection generated by
cellrank.pl.circular_projection().- .uns[‘ppt’]
dictionnary containing information from simpelppt tree if method=’ppt’
- .uns[‘epg’]
dictionnary containing information from elastic principal tree if method=’epg’
- .uns[‘graph’][‘B’]
adjacency matrix of the principal points
- .uns[‘graph’][‘R’]
soft assignment of cells to principal point in representation space
- .uns[‘graph’][‘F’]
coordinates of principal points in representation spac