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

All Samples(9)  |  Call(7)  |  Derive(0)  |  Import(2)

src/b/i/biopython-HEAD/Tests/test_TreeConstruction.py   biopython(Download)
from Bio.Phylo.TreeConstruction import _Matrix
from Bio.Phylo.TreeConstruction import _DistanceMatrix
from Bio.Phylo.TreeConstruction import DistanceCalculator
from Bio.Phylo.TreeConstruction import DistanceTreeConstructor
from Bio.Phylo.TreeConstruction import ParsimonyScorer
    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')
        self.assertEqual(dm['Alpha', 'Beta'], 1 - (38 * 1.0 / 65))
 
        calculator = DistanceCalculator('trans')
        dm = calculator.get_distance(aln)
        self.assertEqual(dm['Alpha', 'Beta'], 1 - (49 * 1.0 / 78))
 
        calculator = DistanceCalculator('blosum62')

src/b/i/biopython-HEAD/Tests/test_Consensus.py   biopython(Download)
from Bio import Phylo
from Bio.Phylo import BaseTree
from Bio.Phylo.TreeConstruction import DistanceCalculator
from Bio.Phylo.TreeConstruction import DistanceTreeConstructor
from Bio.Phylo import Consensus
    def test_bootstrap_trees(self):
        calculator = DistanceCalculator('blosum62')
        constructor = DistanceTreeConstructor(calculator)
        trees = list(Consensus.bootstrap_trees(self.msa, 100, constructor))
        self.assertEqual(len(trees), 100)
        self.assertTrue(isinstance(trees[0], BaseTree.Tree))
 
    def test_bootstrap_consensus(self):
        calculator = DistanceCalculator('blosum62')