Back to index

python-biopython  1.60
Public Member Functions
test_EmbossPhylipNew.ParsimonyTests Class Reference

List of all members.

Public Member Functions

def tearDown
def parsimony_tree
def test_parsimony_tree_from_AlignIO_DNA
def test_parsimony_from_AlignIO_protein

Detailed Description

Tests for estimating parsimony based phylogenetic trees with phylip

Definition at line 155 of file test_EmbossPhylipNew.py.


Member Function Documentation

def test_EmbossPhylipNew.ParsimonyTests.parsimony_tree (   self,
  filename,
  format,
  DNA = True 
)
Estimate a parsimony tree from an alignment

Definition at line 161 of file test_EmbossPhylipNew.py.

00161 
00162     def parsimony_tree(self, filename, format, DNA=True):
00163         """Estimate a parsimony tree from an alignment"""
00164         self.assertTrue(os.path.isfile(filename), "Missing %s" % filename)
00165         if DNA:
00166             cline = FDNAParsCommandline(exes["fdnapars"],
00167                                         sequence = filename,
00168                                         outtreefile = "test_file",
00169                                         auto= True, stdout=True)
00170         else:
00171             cline = FProtParsCommandline(exes["fprotpars"],
00172                                          sequence = filename,
00173                                          outtreefile = "test_file",
00174                                          auto= True, stdout=True)
00175         stdout, stderr = cline()
00176         a_taxa = [s.name.replace(" ", "_") for s in
00177                   AlignIO.parse(open(filename, "r"), format).next()]
00178         for tree in parse_trees("test_file"):
00179             t_taxa = [t.replace(" ", "_") for t in tree.get_taxa()]
00180             self.assertEqual(sorted(a_taxa), sorted(t_taxa))
    

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 158 of file test_EmbossPhylipNew.py.

00158 
00159     def tearDown(self):
00160         clean_up()

Here is the call graph for this function:

Make a parsimony tree from protein alignment written with AlignIO

Definition at line 200 of file test_EmbossPhylipNew.py.

00200 
00201     def test_parsimony_from_AlignIO_protein(self):
00202         """Make a parsimony tree from protein alignment written with AlignIO"""
00203         write_AlignIO_protein()
00204         self.parsimony_tree("Phylip/interlaced.phy", "phylip", DNA=False)

Here is the call graph for this function:

Make a parsimony tree from an alignment written with AlignIO

Definition at line 186 of file test_EmbossPhylipNew.py.

00186 
00187     def test_parsimony_tree_from_AlignIO_DNA(self):
00188         """Make a parsimony tree from an alignment written with AlignIO"""
00189         write_AlignIO_dna()
00190         self.parsimony_tree("Phylip/opuntia.phy", "phylip")

Here is the call graph for this function:


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