Bio.Phylo.Consensus module¶
Classes and methods for finding consensus trees.
This module contains a _BitString
class to assist the consensus tree
searching and some common consensus algorithms such as strict, majority rule and
adam consensus.
- Bio.Phylo.Consensus.strict_consensus(trees)¶
Search strict consensus tree from multiple trees.
- Parameters
- treesiterable
iterable of trees to produce consensus tree.
- Bio.Phylo.Consensus.majority_consensus(trees, cutoff=0)¶
Search majority rule consensus tree from multiple trees.
This is a extend majority rule method, which means the you can set any cutoff between 0 ~ 1 instead of 0.5. The default value of cutoff is 0 to create a relaxed binary consensus tree in any condition (as long as one of the provided trees is a binary tree). The branch length of each consensus clade in the result consensus tree is the average length of all counts for that clade.
- Parameters
- treesiterable
iterable of trees to produce consensus tree.
- Bio.Phylo.Consensus.adam_consensus(trees)¶
Search Adam Consensus tree from multiple trees.
- Parameters
- treeslist
list of trees to produce consensus tree.
- Bio.Phylo.Consensus.get_support(target_tree, trees, len_trees=None)¶
Calculate branch support for a target tree given bootstrap replicate trees.
- Parameters
- target_treeTree
tree to calculate branch support for.
- treesiterable
iterable of trees used to calculate branch support.
- len_treesint
optional count of replicates in trees. len_trees must be provided when len(trees) is not a valid operation.
- Bio.Phylo.Consensus.bootstrap(msa, times)¶
Generate bootstrap replicates from a multiple sequence alignment object.
- Parameters
- msaMultipleSeqAlignment
multiple sequence alignment to generate replicates.
- timesint
number of bootstrap times.
- Bio.Phylo.Consensus.bootstrap_trees(msa, times, tree_constructor)¶
Generate bootstrap replicate trees from a multiple sequence alignment.
- Parameters
- msaMultipleSeqAlignment
multiple sequence alignment to generate replicates.
- timesint
number of bootstrap times.
- tree_constructorTreeConstructor
tree constructor to be used to build trees.
- Bio.Phylo.Consensus.bootstrap_consensus(msa, times, tree_constructor, consensus)¶
Consensus tree of a series of bootstrap trees for a multiple sequence alignment.
- Parameters
- msaMultipleSeqAlignment
Multiple sequence alignment to generate replicates.
- timesint
Number of bootstrap times.
- tree_constructorTreeConstructor
Tree constructor to be used to build trees.
- consensusfunction
Consensus method in this module:
strict_consensus
,majority_consensus
,adam_consensus
.