RepPhylogeny¶
- class RepPhylogeny(tree, feature_ids=None, prune=False, annotation=None, copy=True, ignore_polytomy=False, **kwargs)[source]¶
An essential class for handling phylogeny data.
Constructor for
RepPhylogeny- Parameters
tree (Union[pmaf.phylo.tree._tree.PhyloTree, pmaf.phylo.tree._backends._ete3.TreeEte3Base, _io.StringIO, str]) – Phylogeny data
feature_ids (Optional[Union[Sequence[Union[str, int]], numpy.ndarray, pandas.core.indexes.base.Index, str, int]]) – Target feature identifiers
prune (bool) – Whether to prune for feature_ids
annotation (Optional[Union[dict, pandas.core.series.Series]]) – Annotations for tips
copy (bool) – Whether to copy the original tree. May require long time if tree is large
ignore_polytomy (bool) – Whether to resolve tree polytomy or not
kwargs (Any) – Compatibility
- Return type
Attributes
annotationsTip Annotations.
controllerActive essentials controller instance.
dataPhylogenetic Tree.
is_buckledIs current essentials instance is mounted or not.
is_mountedTrue if current essentials instance is mounted or not.
metadataThe essential instance metadata.
nameThe essential instance name.
shapeReturn the shape/size of the essential instance.
xridFeature identifiers.
Methods
copy()Copy of the instance.
export(output_fp[, _add_ext])Exports the Newick formatted phylogenetic tree into specified file.
Retrieves annotated tree.
get_ascii_art([annotated])Creates ASCII art of the tree.
get_feature_ids([dtype])This function and its sample twin is a rescue method to fix RepPhylogeny index problem.
get_subset([rids])Get subset of the
RepPhylogeny.render_art(output_fp[, annotated])Renders tree into file.
Resolve tree polytomy.
write(output_fp[, mode])Writes the Newick tree into specified file.