Bio.Nexus.Trees模块

处理系统发生树的树类。

提供一组方法来读取和写入新格式的树描述、获取有关树的信息(分类单元集的单系性、树之间的一致性、共同祖先等.)并操纵树(重新根树、拆分终端节点)。

exception Bio.Nexus.Trees.TreeError

基类:Exception

管理树例外的规定。

__firstlineno__ = 32
__static_attributes__ = ()
class Bio.Nexus.Trees.NodeData(taxon=None, branchlength=0.0, support=None, comment=None)

基类:object

存储与节点(例如分支或otus)相关的树相关数据。

__init__(taxon=None, branchlength=0.0, support=None, comment=None)

初始化课程。

__firstlineno__ = 36
__static_attributes__ = ('branchlength', 'comment', 'support', 'taxon')
class Bio.Nexus.Trees.Tree(tree=None, weight=1.0, rooted=False, name='', data=NodeData, values_are_support=False, max_support=1.0)

基类:Chain

使用具有一个前身(=祖先)和多个后继(=子分支)的节点链来代表一棵树。

__init__(tree=None, weight=1.0, rooted=False, name='', data=NodeData, values_are_support=False, max_support=1.0)

Ntree(自我,树)。

node(node_id)

返回node_id的实例。

节点=节点(self,节点_id)

split(parent_id=None, n=2, branchlength=1.0)

物种形成:生成一个节点的n个(默认为两个)后代。

[new ids] =分裂(self,parent_id=无,n=2,branchlong =1.0):

search_taxon(taxon)

返回self.data. taxon中的第一个匹配分类单元。不限于终端节点。

节点_id = search_taxon(self,taxon)

prune(taxon)

从树上修剪末端分类群。

id_of_previous_note = prune(self,taxon)如果分类单元来自分叉,则连接节点将折叠,并将其分支长度添加到剩余的末端节点。这可能不再是一个有意义的价值”

get_taxa(node_id=None)

从节点向下返回所有otus的列表。

nodes = get_taxa(self,node_id=无)

get_terminals()

返回所有终端节点的列表。

is_terminal(node)

如果节点是终端节点,则返回True。

is_internal(node)

如果节点是内部节点,则返回True。

is_preterminal(node)

如果一个节点的所有后继节点都是终端节点,则返回True。

count_terminals(node=None)

计算连接到节点的终端节点数量。

collapse_genera(space_equals_underscore=True)

折叠属于同一属的所有子树。

(i.e它们的分类单元名称中使用相同的第一个词。)

sum_branchlength(root=None, node=None)

将从根(默认self.root)到节点的branchltax相加。

sum = sum_branchlong(self,root=无,节点=无)

set_subtree(node)

将子树作为一组嵌套集返回。

集合=集合_子树(self,节点)

is_identical(tree2)

比较tree和tree 2的身份。

结果= is_equal(self,tree 2)

is_compatible(tree2, threshold, strict=True)

比较支持>兼容性阈值的分支。

结果= is_compatible(self,tree 2,th阈值)

common_ancestor(node1, node2)

返回连接两个节点的共同祖先。

节点_id = common_ancestor(self,node1,node2)

distance(node1, node2)

相加并返回两个节点之间的分支长度之和。

dist =距离(自身、节点1、节点2)

is_monophyletic(taxon_list)

如果taxon_list是单系的,则返回共同祖先的节点_id,否则返回-1。

结果= is_monophyletic(self,taxon_list)

is_bifurcating(node=None)

如果节点下游的树严格分叉,则返回True。

branchlength2support()

将存储在data. branchsize中的值移动到data.support,并将branchsize设置为0.0。

当支持已存储为分支长度(例如paup)并因此被读取为分支长度时,这是必要的。

convert_absolute_support(nrep)

将绝对支持(进化枝计数)转换为rel。频率.

一些软件(例如PHYLIP consense)只是计算分支出现的频率,而不是计算相对频率。

has_support(node=None)

如果任何节点具有data.support,则返回True!=没有。

randomize(ntax=None, taxon_list=None, branchlength=1.0, branchlength_sd=None, bifurcate=True)

使用ntax分类单元和/或来自税单的分类单元生成随机树。

new_tree = randomize(self,ntax=无,taxon_list=无,branchlong = 1.0,branchlength_sd=无,burcate =True)默认情况下,树会分叉。(尚未支持多分体)。

display()

所有节点的快速肮脏列表。

to_string(support_as_branchlengths=False, branchlengths_only=False, plain=True, plain_newick=False, ladderize=None, ignore_comments=True)

返回paup兼容的树线。

__str__()

to_字符串()的简短版本,给出普通树。

unroot()

使用有根树的数据定义无根树结构。

root_with_outgroup(outgroup=None)

用参考组外组定义树的根。

merge_with_support(bstrees=None, constree=None, threshold=0.5, outgroup=None)

将进化枝支持(来自共识或引导树列表)与系统基因合并。

tree=merge_bootstrap(phylo,bs_tree=<list_of_trees>)或tree=merge_bootstrap(phylo,consree=consensus_tree with clade support)

__annotations__ = {}
__firstlineno__ = 47
__static_attributes__ = ('__values_are_support', 'branchlengths_only', 'dataclass', 'ignore_comments', 'max_support', 'name', 'plain', 'root', 'rooted', 'support_as_branchlengths', 'unrooted', 'weight')
Bio.Nexus.Trees.consensus(trees, threshold=0.5, outgroup=None)

从树列表中计算相对频率>=阈值的所有分支的多数规则共识树。