Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/b/i/biopython-HEAD/Tests/test_Consensus.py   biopython(Download)
    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])
        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')