phlower.tl.harmonic_stream_tree
- phlower.tl.harmonic_stream_tree(adata: AnnData, graph_name: str | None = None, evector_name=None, layout_name: str = 'cumsum', cluster: str = 'group', eigen_n=-1, min_bin_number=5, cut_threshold=1, trim_end=False, full_traj_matrix='full_traj_matrix', trajs_clusters='trajs_clusters', trajs_use=10000, retain_clusters=[], node_attribute='u', time_sync_u='edge_mid_u', pca_name='X_pca', node_bottom_up=True, min_kde_quant_rm=0.1, kde_sample_n=10000, random_seed=2022, stream_workdir='', verbose=False, iscopy=False)
create a pseudo tree based on the grouped trajectories using cumulative trajectory embedding to decide branching
Parameters
- adata: AnnData
an Annodata object
- graph_name: str
the graph name in adata.uns
- evector_name: str
the eigen vector name in adata.uns
- layout_name: str
the layout name in adata.obsm
- eigen_n: int
the number of eigen vectors to use, -1 would use vectors before knee
- min_bin_number:
the minimum number of bins to use
- cut_threshold:
the threshold to cut the tree, default 1
- trim_end:
whether to trim the end of the tree, default False
- full_traj_matrix: str
the full trajectory matrix name in adata.uns
- trajs_clusters: str
the trajectory clusters name in adata.uns
- trajs_use: int
the number of trajectories to use, default 10000
- retain_clusters: list
the clusters to retain, default []
- node_attribute: str
the node attribute to use, default ‘u’
- time_sync_u: str
the time sync u to use, default ‘edge_mid_u’
- pca_name: str
the pca name in adata.obsm, default ‘X_pca’
- node_bottom_up: bool
whether to use bottom up to construct the tree, default True
- min_kde_quant_rm: float
the minimum quantile to remove, default 0.1
- kde_sample_n: int
the number of samples to use in kde, default 10000
- random_seed: int
the random seed to use, default 2022
- stream_workdir: str
the workdir to save the stream tree, default ‘’
- iscopy: bool
whether to return a copy of adata, default False