Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Mafft_tool.MafftApplication Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_Mafft_simple
def test_Mafft_with_options
def test_Mafft_with_Clustalw_output
def test_Mafft_with_complex_command_line

Public Attributes

 infile1

Detailed Description

Definition at line 65 of file test_Mafft_tool.py.


Member Function Documentation

Definition at line 67 of file test_Mafft_tool.py.

00067 
00068     def setUp(self):
00069         self.infile1  = "Fasta/f002"

Definition at line 70 of file test_Mafft_tool.py.

00070 
00071     def tearDown(self):
00072         if os.path.isfile("Fasta/f002.tree"):
00073             os.remove("Fasta/f002.tree")

Simple round-trip through app with infile.
Result passed to stdout.

Definition at line 74 of file test_Mafft_tool.py.

00074 
00075     def test_Mafft_simple(self):
00076         """Simple round-trip through app with infile.
00077         Result passed to stdout.
00078         """
00079         #Use a keyword argument at init,
00080         cmdline = MafftCommandline(mafft_exe, input=self.infile1)
00081         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00082         stdoutdata, stderrdata = cmdline()
00083         self.assertTrue(stdoutdata.startswith(">gi|1348912|gb|G26680|G26680"))
00084         self.assertTrue("Progressive alignment ..." in stderrdata, stderrdata)
00085         self.assertTrue("$#=0" not in stderrdata)

Simple round-trip through app with clustal output

Definition at line 99 of file test_Mafft_tool.py.

00099 
00100     def test_Mafft_with_Clustalw_output(self):
00101         """Simple round-trip through app with clustal output"""
00102         cmdline = MafftCommandline(mafft_exe)
00103         #Use some properties:
00104         cmdline.input = self.infile1
00105         cmdline.clustalout = True
00106         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00107         stdoutdata, stderrdata = cmdline()
00108         #e.g. "CLUSTAL format alignment by MAFFT ..."
00109         #or "CLUSTAL (-like) formatted alignment by MAFFT FFT-NS-2 (v6.240)"
00110         self.assertTrue(stdoutdata.startswith("CLUSTAL"), stdoutdata)
00111         self.assertTrue("$#=0" not in stderrdata)

Round-trip with complex command line.

Definition at line 112 of file test_Mafft_tool.py.

00112 
00113     def test_Mafft_with_complex_command_line(self):
00114         """Round-trip with complex command line."""
00115         cmdline = MafftCommandline(mafft_exe)
00116         cmdline.set_parameter("input", self.infile1)
00117         cmdline.set_parameter("--localpair", True)
00118         cmdline.set_parameter("--weighti", 4.2)
00119         cmdline.set_parameter("retree", 5)
00120         cmdline.set_parameter("maxiterate", 200)
00121         cmdline.set_parameter("--nofft", True)
00122         cmdline.set_parameter("op", 2.04)
00123         cmdline.set_parameter("--ep", 0.51)
00124         cmdline.set_parameter("--lop", 0.233)
00125         cmdline.set_parameter("lep", 0.2)
00126         cmdline.set_parameter("--reorder", True)
00127         cmdline.set_parameter("--treeout", True)
00128         cmdline.set_parameter("nuc", True)
00129         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00130         self.assertEqual(str(cmdline), mafft_exe \
00131                          + " --localpair --weighti 4.2 --retree 5 " \
00132                          + "--maxiterate 200 --nofft --op 2.04 --ep 0.51" \
00133                          + " --lop 0.233 --lep 0.2 --reorder --treeout" \
00134                          + " --nuc Fasta/f002")
00135         stdoutdata, stderrdata = cmdline()
00136         self.assertTrue(stdoutdata.startswith(">gi|1348912|gb|G26680|G26680"))
00137         self.assertTrue("$#=0" not in stderrdata)
00138 

Simple round-trip through app with infile and options.
Result passed to stdout.

Definition at line 86 of file test_Mafft_tool.py.

00086 
00087     def test_Mafft_with_options(self):
00088         """Simple round-trip through app with infile and options.
00089         Result passed to stdout.
00090         """
00091         cmdline = MafftCommandline(mafft_exe)
00092         cmdline.set_parameter("input", self.infile1)
00093         cmdline.set_parameter("maxiterate", 100)
00094         cmdline.set_parameter("--localpair", True)
00095         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00096         stdoutdata, stderrdata = cmdline()
00097         self.assertTrue(stdoutdata.startswith(">gi|1348912|gb|G26680|G26680"))
00098         self.assertTrue("$#=0" not in stderrdata)


Member Data Documentation

Definition at line 68 of file test_Mafft_tool.py.


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