Esempio n. 1
0
    def test_EstimateDistances_fromUnaligned(self):
        """Excercising estimate distances from unaligned sequences"""
        d = EstimateDistances(self.collection,
                              JC69(),
                              do_pair_align=True,
                              rigorous_align=True)
        d.run(show_progress=False)
        canned_result = {
            ("b", "e"): 0.440840,
            ("c", "e"): 0.440840,
            ("a", "c"): 0.088337,
            ("a", "b"): 0.188486,
            ("a", "e"): 0.440840,
            ("b", "c"): 0.0883373,
        }
        result = d.get_pairwise_distances().to_dict()
        self.assertDistsAlmostEqual(canned_result, result)

        d = EstimateDistances(self.collection,
                              JC69(),
                              do_pair_align=True,
                              rigorous_align=False)
        d.run(show_progress=False)
        canned_result = {
            ("b", "e"): 0.440840,
            ("c", "e"): 0.440840,
            ("a", "c"): 0.088337,
            ("a", "b"): 0.188486,
            ("a", "e"): 0.440840,
            ("b", "c"): 0.0883373,
        }
        result = d.get_pairwise_distances().to_dict()
        self.assertDistsAlmostEqual(canned_result, result)
Esempio n. 2
0
 def test_EstimateDistances_fromThreeway(self):
     """testing (well, exercising at least), EsimateDistances fromThreeway"""
     d = EstimateDistances(self.al, JC69(), threeway=True)
     d.run(show_progress=False)
     canned_result = {
         ("b", "e"): 0.495312,
         ("c", "e"): 0.479380,
         ("a", "c"): 0.089934,
         ("a", "b"): 0.190021,
         ("a", "e"): 0.495305,
         ("b", "c"): 0.0899339,
     }
     result = d.get_pairwise_distances(summary_function="mean").to_dict()
     self.assertDistsAlmostEqual(canned_result, result)
Esempio n. 3
0
    def test_EstimateDistances(self):
        """testing (well, exercising at least), EstimateDistances"""
        d = EstimateDistances(self.al, JC69())
        d.run(show_progress=False)
        canned_result = {
            ("b", "e"): 0.440840,
            ("c", "e"): 0.440840,
            ("a", "c"): 0.088337,
            ("a", "b"): 0.188486,
            ("a", "e"): 0.440840,
            ("b", "c"): 0.0883373,
        }
        result = d.get_pairwise_distances().to_dict()
        self.assertDistsAlmostEqual(canned_result, result)

        # excercise writing to file
        d.write("junk.txt")
        try:
            os.remove("junk.txt")
        except OSError:
            pass  # probably parallel