omicverse.micro.attach_tree#
- omicverse.micro.attach_tree(adata, newick=None, tree_path=None, prune=True, store_key='tree', strict=False)[source]#
Attach a phylogenetic tree to
adata.uns[store_key].- Parameters:
adata (
AnnData) – The AnnData to annotate (var_names= ASV / OTU ids).newick (
Optional[str] (default:None)) – The tree as a newick string. Mutually exclusive withtree_path.tree_path (
Union[str,Path,None] (default:None)) – Path to a newick file. Mutually exclusive withnewick.prune (
bool(default:True)) – When True (default), the tree is restricted to tips that appear inadata.var_names. Tips absent from var_names are dropped.store_key (
str(default:'tree')) – Key underadata.unswhere the newick string is written.strict (
bool(default:False)) – If True, raise when any ASV invar_nameshas no matching tree tip. Default False only warns.
- Return type: