atlas.pl.plot_tree

Contents

atlas.pl.plot_tree#

atlas.pl.plot_tree(mudata, embedding_key='umap', fate_probability_key='fate_probabilities', time_key='pseudotime', nodes=300, method='ppt', ppt_lambda=100, auto_root=False, root_params=None, reassign_pseudotime=False, crowdedness=1, color=None, color_milestones=False, n_jobs=-1, n_map=1, save=None, random_state=42, **kwargs)#

Compute and visualize a principal tree from fate probabilities, using [FSKA22].

Parameters:
  • mudata (MuData) – Annotated multi-modal data object.

  • embedding_key (str (default: 'umap')) – Key in mudata.obsm for the embedding (expects "X_{embedding_key}").

  • fate_probability_key (str (default: 'fate_probabilities')) – Key in mudata.obsm where fate probabilities are stored.

  • nodes (int (default: 300)) – Number of nodes used to fit the principal tree.

  • method (Literal['ppt', 'epg'] (default: 'ppt')) – Tree inference method, one of {'ppt', 'epg'}.

  • ppt_lambda (int (default: 100)) – Regularization parameter for 'ppt' method.

  • auto_root (bool (default: False)) – Whether to automatically infer the root.

  • root_params (dict (default: None)) – Additional keyword arguments for root inference.

  • reassign_pseudotime (bool (default: False)) – Whether to recompute pseudotime after tree construction.

  • crowdedness (float (default: 1)) – Controls dendrogram layout spacing.

  • color (str | None (default: None)) – Key in mudata.obs used for coloring cells.

  • color_milestones (bool (default: False)) – Whether to color milestones in the dendrogram.

  • n_jobs (int (default: -1)) – Number of parallel jobs for pseudotime computation.

  • n_map (int (default: 1)) – Number of mappings used in pseudotime computation.

  • save (str | None (default: None)) – Filename or path to save the figures.

  • random_state (int (default: 42)) – Random seed.

  • **kwargs – Additional arguments passed to scFates.tl.cellrank_to_tree() and plotting functions.

Warns:
  • UserWarning – If keys are not correctly specified by the user.

  • UserWarning – If no terminal states are found or a single terminal state is recovered.

Return type:

None

Notes

Requires precomputed fate probabilities with at least 2 terminal states.