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

None

Attributes

annotations

Tip Annotations.

controller

Active essentials controller instance.

data

Phylogenetic Tree.

is_buckled

Is current essentials instance is mounted or not.

is_mounted

True if current essentials instance is mounted or not.

metadata

The essential instance metadata.

name

The essential instance name.

shape

Return the shape/size of the essential instance.

xrid

Feature identifiers.

Methods

copy()

Copy of the instance.

export(output_fp[, _add_ext])

Exports the Newick formatted phylogenetic tree into specified file.

get_annotated_tree()

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_polytomy()

Resolve tree polytomy.

write(output_fp[, mode])

Writes the Newick tree into specified file.