Example #1
0
 def testDnaRoundTrip(self):
     ape_c = ape.as_ape_object(self.dna_chars)
     dp_c = ape.as_dendropy_object(ape_c,
                                   taxon_set=self.dna_chars.taxon_set)
     self.assertDistinctButEqual(self.dna_chars,
                                 dp_c,
                                 distinct_taxa=False)
Example #2
0
def is_binary_tree(tree):
    """
    Determines if a tree is binary
    @param tree: dendropy tree
    @return: true/false
    @rtype: bool
    """
    r_tree = ape.as_ape_object(tree)
    return robjects.r['is.binary.tree'](r_tree)[0]
Example #3
0
 def testTreeListRoundTrip(self):
     ape_t = ape.as_ape_object(self.trees)
     rt = ape.as_dendropy_object(ape_t, taxon_set=self.trees.taxon_set)
     self.assertTrue(isinstance(rt, dendropy.TreeList), type(rt))
     self.assertDistinctButEqual(self.trees, rt, distinct_taxa=False)
Example #4
0
 def testTreeRoundTrip(self):
     for i, t1 in enumerate(self.trees):
         ape_t = ape.as_ape_object(t1)
         rt = ape.as_dendropy_object(ape_t, taxon_set=t1.taxon_set)
         self.assertTrue(isinstance(rt, dendropy.Tree), type(rt))
         self.assertDistinctButEqual(t1, rt, distinct_taxa=False)
Example #5
0
 def testDnaRoundTrip(self):
     ape_c = ape.as_ape_object(self.dna_chars)
     dp_c = ape.as_dendropy_object(ape_c, taxon_set=self.dna_chars.taxon_set)
     self.assertDistinctButEqual(self.dna_chars, dp_c, distinct_taxa=False)
Example #6
0
 def testTreeListRoundTrip(self):
     ape_t = ape.as_ape_object(self.trees)
     rt = ape.as_dendropy_object(ape_t, taxon_set=self.trees.taxon_set)
     self.assertTrue(isinstance(rt, dendropy.TreeList), type(rt))
     self.assertDistinctButEqual(self.trees, rt, distinct_taxa=False)
Example #7
0
 def testTreeRoundTrip(self):
     for i, t1 in enumerate(self.trees):
         ape_t = ape.as_ape_object(t1)
         rt = ape.as_dendropy_object(ape_t, taxon_set=t1.taxon_set)
         self.assertTrue(isinstance(rt, dendropy.Tree), type(rt))
         self.assertDistinctButEqual(t1, rt, distinct_taxa=False)