Rosalind第76题:Character-Based Phylogeny

Problem

Because a tree having  nodes has  edges (see “Completing a Tree”), removing a single edge from a tree will produce two smaller, disjoint trees. Recall from “Creating a Character Table” that for this reason, each edge of an unrooted binary tree corresponds to a split , where  is a subset of the taxa.

consistent character table is one whose characters' splits do not conflict with the edge splits of some unrooted binary tree  on the  taxa. More precisely,  conflicts with  if all four intersections , , , and  are nonempty. As a simple example, consider the conflicting splits  and .

More generally, given a consistent character table , an unrooted binary tree  "models"  if the edge splits of  agree with the splits induced from the characters of .

Given: A list of  species () and an -column character table  in which the th column denotes the th species.

Return: An unrooted binary tree in Newick format that models .

因为一棵树有 节点有 (请参阅“完成树”),从树中删除一条边将产生两棵较小的,不相交的树。回想一下“创建字符表”,由于这个原因,无根二叉树的每个边缘都对应一个拆分 ,在哪里 是一个子集的的类群

一个一致的字符表是指其角色的分裂不要与一些无根二叉树的边缘分裂冲突 在 分类单元。更确切地说, 与...发生冲突 如果所有四个路口 , , 和 是非空的。作为一个简单的示例,请考虑冲突的拆分 和 。

更普遍地说,给定一致的字符表 ,无根的二叉树  “楷模”  如果边缘裂开 从诱发劈叉同意字符的。

给出:清单 种类() 和 列字符表  在其中 第列表示 th种。

返回值:Newick格式建模的无根二叉树。

Sample Dataset

cat dog elephant mouse rabbit rat
011101
001101
001100

Sample Output

(dog,(cat,rabbit),(rat,(elephant,mouse)));
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值