def testFittedEdgesDeepCoalCount(self): for idx, gt in enumerate(self.gene_trees): ct = reconcile.ContainingTree(containing_tree=self.species_tree, contained_taxon_set=self.gene_trees.taxon_set, contained_to_containing_taxon_map=self.gene_taxon_to_population_taxon_map, contained_trees=[gt], fit_containing_edge_lengths=True, ) dc = ct.num_deep_coalescences() mesqf = pathmap.named_output_stream("ContainingTreeDeepCoalescence_Small_FittedEdges_t%02d_dc%02d.nex" % (idx+1, dc), False) ct.write_as_mesquite(mesqf)
def testFixedEdgesDeepCoalCount(self): results = [] for idx, gt in enumerate(self.gene_trees): ct = reconcile.ContainingTree(containing_tree=self.species_tree, contained_taxon_set=self.gene_trees.taxon_set, contained_to_containing_taxon_map=self.gene_taxon_to_population_taxon_map, contained_trees=[gt], fit_containing_edge_lengths=False, ) dc = ct.num_deep_coalescences() results.append(dc) mesqf = pathmap.named_output_stream("ContainingTreeDeepCoalescence_Small_FixedEdges_t%02d_dc%02d.nex" % (idx+1, dc), False) ct.write_as_mesquite(mesqf) self.assertEqual(results, self.expected_under_original_brlens)
def testFittedEdgesDeepCoalCount(self): for idx, gt in enumerate(self.gene_trees): ct = reconcile.ContainingTree( containing_tree=self.species_tree, contained_taxon_set=self.gene_trees.taxon_set, contained_to_containing_taxon_map=self. gene_taxon_to_population_taxon_map, contained_trees=[gt], fit_containing_edge_lengths=True, ) dc = ct.num_deep_coalescences() mesqf = pathmap.named_output_stream( "ContainingTreeDeepCoalescence_Small_FittedEdges_t%02d_dc%02d.nex" % (idx + 1, dc), False) ct.write_as_mesquite(mesqf)
def testFixedEdgesDeepCoalCount(self): results = [] for idx, gt in enumerate(self.gene_trees): ct = reconcile.ContainingTree( containing_tree=self.species_tree, contained_taxon_set=self.gene_trees.taxon_set, contained_to_containing_taxon_map=self. gene_taxon_to_population_taxon_map, contained_trees=[gt], fit_containing_edge_lengths=False, ) dc = ct.num_deep_coalescences() results.append(dc) mesqf = pathmap.named_output_stream( "ContainingTreeDeepCoalescence_Small_FixedEdges_t%02d_dc%02d.nex" % (idx + 1, dc), False) ct.write_as_mesquite(mesqf) self.assertEqual(results, self.expected_under_original_brlens)