Esempio n. 1
0
 def test_strict_consensus(self):
     ref_trees = list(Phylo.parse('./TreeConstruction/strict_refs.tre', 'newick'))
     # three trees
     consensus_tree = Consensus.strict_consensus(self.trees)
     # tree_file = StringIO()
     # Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[0]))
     # tree 1 and tree 2
     consensus_tree = Consensus.strict_consensus(self.trees[:2])
     # tree_file = StringIO()
     # Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[1]))
     # tree 1 and tree 3
     consensus_tree = Consensus.strict_consensus(self.trees[::2])
     # tree_file = StringIO()
     # Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[2]))
 def test_strict_consensus(self):
     ref_trees = list(Phylo.parse('./TreeConstruction/strict_refs.tre', 'newick'))
     # three trees
     consensus_tree = Consensus.strict_consensus(self.trees)
     #tree_file = StringIO()
     #Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[0]))
     # tree 1 and tree 2
     consensus_tree = Consensus.strict_consensus(self.trees[:2])
     #tree_file = StringIO()
     #Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[1]))
     # tree 1 and tree 3
     consensus_tree = Consensus.strict_consensus(self.trees[::2])
     #tree_file = StringIO()
     #Phylo.write(consensus_tree, tree_file, 'newick')
     self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[2]))