def test_adam_consensus(self): ref_trees = list(Phylo.parse('./TreeConstruction/adam_refs.tre', 'newick')) # three trees consensus_tree = Consensus.adam_consensus(self.trees) # tree_file = '/home/yeyanbo/adam.tres' # 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.adam_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.adam_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_adam_consensus(self): ref_trees = list(Phylo.parse('./TreeConstruction/adam_refs.tre', 'newick')) # three trees consensus_tree = Consensus.adam_consensus(self.trees) #tree_file = '/home/yeyanbo/adam.tres' #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.adam_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.adam_consensus(self.trees[::2]) #tree_file = StringIO() #Phylo.write(consensus_tree, tree_file, 'newick') self.assertTrue(Consensus._equal_topology(consensus_tree, ref_trees[2]))