Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_TCoffee_tool.TCoffeeApplication Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_TCoffee_1
def test_TCoffee_2
def test_TCoffee_3

Public Attributes

 infile1
 outfile1
 outfile2
 outfile3
 outfile4

Detailed Description

Definition at line 33 of file test_TCoffee_tool.py.


Member Function Documentation

Definition at line 35 of file test_TCoffee_tool.py.

00035 
00036     def setUp(self):
00037         self.infile1 = "Fasta/fa01"
00038         self.outfile1 = "fa01.aln"
00039         self.outfile2 = "fa01.html" #Written by default when no output set
00040         self.outfile3 = "Fasta/tc_out.pir"
00041         self.outfile4 = "Fasta/tc_out.phy"

Definition at line 42 of file test_TCoffee_tool.py.

00042 
00043     def tearDown(self):
00044         if os.path.isfile(self.outfile1):
00045             os.remove(self.outfile1)
00046         if os.path.isfile(self.outfile2):
00047             os.remove(self.outfile2)
00048         if os.path.isfile(self.outfile3):
00049             os.remove(self.outfile3)
00050         if os.path.isfile(self.outfile4):
00051             os.remove(self.outfile4)

Round-trip through app and read clustal alignment from file

Definition at line 52 of file test_TCoffee_tool.py.

00052 
00053     def test_TCoffee_1(self):
00054         """Round-trip through app and read clustal alignment from file
00055         """
00056         cmdline = TCoffeeCommandline(t_coffee_exe, infile=self.infile1)
00057         self.assertEqual(str(cmdline), t_coffee_exe + " -infile Fasta/fa01")
00058         stdout, stderr = cmdline()
00059         self.assertTrue(stderr.strip().startswith("PROGRAM: T-COFFEE"))
00060         align = AlignIO.read(open(self.outfile1), "clustal")
00061         records = list(SeqIO.parse(open(self.infile1),"fasta"))
00062         self.assertEqual(len(records),len(align))
00063         for old, new in zip(records, align):
00064             self.assertEqual(old.id, new.id)
00065             self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))

Here is the call graph for this function:

Round-trip through app and read pir alignment from file

Definition at line 66 of file test_TCoffee_tool.py.

00066 
00067     def test_TCoffee_2(self):
00068         """Round-trip through app and read pir alignment from file
00069         """
00070         cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
00071         cmdline.infile = self.infile1
00072         cmdline.outfile = self.outfile3
00073         cmdline.output = "pir_aln"
00074         self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
00075                     "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
00076         stdout, stderr = cmdline()
00077         #Can get warnings in stderr output
00078         self.assertTrue("error" not in stderr.lower(), stderr)
00079         align = AlignIO.read(open(self.outfile3), "pir")
00080         records = list(SeqIO.parse(open(self.infile1),"fasta"))
00081         self.assertEqual(len(records),len(align))
00082         for old, new in zip(records, align):
00083             self.assertEqual(old.id, new.id)
00084             self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))

Here is the call graph for this function:

Round-trip through app and read clustalw alignment from file

Definition at line 85 of file test_TCoffee_tool.py.

00085 
00086     def test_TCoffee_3(self):
00087         """Round-trip through app and read clustalw alignment from file
00088         """
00089         cmdline = TCoffeeCommandline(t_coffee_exe, gapopen=-2)
00090         cmdline.infile = self.infile1
00091         cmdline.outfile = self.outfile4
00092         cmdline.set_parameter("output", "clustalw_aln")
00093         cmdline.outorder = "input"
00094         cmdline.set_parameter("gapext", -5)
00095         cmdline.type = "protein"
00096         self.assertEqual(str(cmdline), t_coffee_exe + " -output clustalw_aln "
00097                          "-infile Fasta/fa01 -outfile Fasta/tc_out.phy "
00098                          "-type protein -outorder input -gapopen -2 -gapext -5")
00099         stdout, stderr = cmdline()
00100         self.assertTrue(stderr.strip().startswith("PROGRAM: T-COFFEE"))
00101         align = AlignIO.read(open(self.outfile4), "clustal")
00102         records = list(SeqIO.parse(open(self.infile1),"fasta"))
00103         self.assertEqual(len(records),len(align))
00104         for old, new in zip(records, align):
00105             self.assertEqual(old.id, new.id)
00106             self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))

Here is the call graph for this function:


Member Data Documentation

Definition at line 36 of file test_TCoffee_tool.py.

Definition at line 37 of file test_TCoffee_tool.py.

Definition at line 38 of file test_TCoffee_tool.py.

Definition at line 39 of file test_TCoffee_tool.py.

Definition at line 40 of file test_TCoffee_tool.py.


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