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

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

src/b/i/biopython-HEAD/Tests/test_TreeConstruction.py   biopython(Download)
    def test_distance_calculator(self):
        aln = AlignIO.read('TreeConstruction/msa.phy', 'phylip')
 
        calculator = DistanceCalculator('identity')
        dm = calculator.get_distance(aln)
        self.assertEqual(dm['Alpha', 'Beta'], 1 - (10 * 1.0 / 13))
 
        calculator = DistanceCalculator('blastn')
        dm = calculator.get_distance(aln)
 
        calculator = DistanceCalculator('trans')
        dm = calculator.get_distance(aln)
        self.assertEqual(dm['Alpha', 'Beta'], 1 - (49 * 1.0 / 78))
 
        calculator = DistanceCalculator('blosum62')
        dm = calculator.get_distance(aln)
    def setUp(self):
        self.aln = AlignIO.read('TreeConstruction/msa.phy', 'phylip')
        calculator = DistanceCalculator('blosum62')
        self.dm = calculator.get_distance(self.aln)
        self.constructor = DistanceTreeConstructor(calculator)