Back to index

python-biopython  1.60
Public Member Functions | Static Public Attributes
test_EmbossPhylipNew.DistanceTests Class Reference

List of all members.

Public Member Functions

def tearDown
def distances_from_alignment
def tree_from_distances
def test_distances_from_phylip_DNA
def test_distances_from_AlignIO_DNA
def test_distances_from_protein_phylip
def test_distances_from_protein_AlignIO

Static Public Attributes

list test_taxa

Detailed Description

Tests for calculating distance based phylogenetic trees with phylip

Definition at line 77 of file test_EmbossPhylipNew.py.


Member Function Documentation

def test_EmbossPhylipNew.DistanceTests.distances_from_alignment (   self,
  filename,
  DNA = True 
)
check we can make distance matrix from a given alignment

Definition at line 87 of file test_EmbossPhylipNew.py.

00087 
00088     def distances_from_alignment(self, filename, DNA = True):
00089         """check we can make distance matrix from a given alignment"""
00090         self.assertTrue(os.path.isfile(filename), "Missing %s" % filename)
00091         if DNA:
00092             cline =  FDNADistCommandline(exes["fdnadist"],
00093                                          method = 'j',
00094                                          sequence= filename,
00095                                          outfile = "test_file",
00096                                          auto = True)
00097         else:
00098             cline = FProtDistCommandline(exes["fprotdist"],
00099                                          method = 'j',
00100                                          sequence= filename,
00101                                          outfile = "test_file",
00102                                          auto = True)
00103         stdout, strerr = cline()
00104         #biopython can't grok distance matrices, so we'll just check it exists
00105         self.assertTrue(os.path.isfile("test_file"))
    

Here is the caller graph for this function:

Definition at line 80 of file test_EmbossPhylipNew.py.

00080 
00081     def tearDown(self):
00082         clean_up()

Here is the call graph for this function:

Calculate a distance matrix from an alignment written by AlignIO

Definition at line 122 of file test_EmbossPhylipNew.py.

00122 
00123     def test_distances_from_AlignIO_DNA(self):
00124         """Calculate a distance matrix from an alignment written by AlignIO"""
00125         write_AlignIO_dna()
00126         self.distances_from_alignment("Phylip/opuntia.phy")

Here is the call graph for this function:

Calculate a distance matrix from an phylip alignment

Definition at line 118 of file test_EmbossPhylipNew.py.

00118 
00119     def test_distances_from_phylip_DNA(self):
00120         """Calculate a distance matrix from an phylip alignment"""
00121         self.distances_from_alignment("Phylip/horses.phy")

Here is the call graph for this function:

Calculate distance matrix from an AlignIO written protein alignment

Definition at line 136 of file test_EmbossPhylipNew.py.

00136 
00137     def test_distances_from_protein_AlignIO(self):
00138         """Calculate distance matrix from an AlignIO written protein alignment"""
00139         write_AlignIO_protein()
00140         self.distances_from_alignment("Phylip/hedgehog.phy", DNA=False)

Here is the call graph for this function:

Calculate a distance matrix from phylip protein alignment

Definition at line 132 of file test_EmbossPhylipNew.py.

00132 
00133     def test_distances_from_protein_phylip(self):
00134         """Calculate a distance matrix from phylip protein alignment"""
00135         self.distances_from_alignment("Phylip/interlaced.phy", DNA=False)

Here is the call graph for this function:

Check we can estimate a tree from a distance matrix

Definition at line 106 of file test_EmbossPhylipNew.py.

00106 
00107     def tree_from_distances(self, filename):
00108         """Check we can estimate a tree from a distance matrix"""
00109         self.assertTrue(os.path.isfile(filename), "Missing %s" % filename)
00110         cline = FNeighborCommandline(exes["fneighbor"],
00111                                      datafile = filename,
00112                                      outtreefile = "test_file",
00113                                      auto= True, filter = True)
00114         stdout, stderr = cline()
00115         for tree in parse_trees("test_file"):
00116             tree_taxa = [t.replace(" ", "_") for t in tree.get_taxa()]
00117             self.assertEqual(self.test_taxa, sorted(tree_taxa))

Here is the call graph for this function:


Member Data Documentation

Initial value:
['Archaeohip', 'Calippus', 'Hypohippus', 'M._secundu',
                 'Merychippu', 'Mesohippus', 'Nannipus', 'Neohippari',
                 'Parahippus', 'Pliohippus']

Definition at line 83 of file test_EmbossPhylipNew.py.


The documentation for this class was generated from the following file: