Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Muscle_tool.MuscleApplication Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_Muscle_simple
def test_Muscle_with_options
def test_Muscle_profile_simple
def test_Muscle_profile_with_options

Public Attributes

 infile1
 infile2
 infile3
 outfile1
 outfile2
 outfile3
 outfile4

Detailed Description

Definition at line 60 of file test_Muscle_tool.py.


Member Function Documentation

Definition at line 62 of file test_Muscle_tool.py.

00062 
00063     def setUp(self):
00064         self.infile1  = "Fasta/f002"
00065         self.infile2  = "Fasta/fa01"
00066         self.infile3  = "Fasta/f001"
00067         self.outfile1 = "Fasta/temp align out1.fa" #with spaces!
00068         self.outfile2 = "Fasta/temp_align_out2.fa"
00069         self.outfile3 = "Fasta/temp_align_out3.fa"
00070         self.outfile4 = "Fasta/temp_align_out4.fa"

Definition at line 71 of file test_Muscle_tool.py.

00071 
00072     def tearDown(self):
00073         if os.path.isfile(self.outfile1):
00074             os.remove(self.outfile1)
00075         if os.path.isfile(self.outfile2):
00076             os.remove(self.outfile2)
00077         if os.path.isfile(self.outfile3):
00078             os.remove(self.outfile3)
00079         if os.path.isfile(self.outfile4):
00080             os.remove(self.outfile4)

Simple round-trip through app doing a profile alignment

Definition at line 111 of file test_Muscle_tool.py.

00111 
00112     def test_Muscle_profile_simple(self):
00113         """Simple round-trip through app doing a profile alignment"""
00114         cmdline = MuscleCommandline(muscle_exe)
00115         cmdline.set_parameter("out", self.outfile3)
00116         cmdline.set_parameter("profile", True)
00117         cmdline.set_parameter("in1", self.infile2)
00118         cmdline.set_parameter("in2", self.infile3)
00119         self.assertEqual(str(cmdline), muscle_exe + \
00120                          " -out Fasta/temp_align_out3.fa" + \
00121                          " -profile -in1 Fasta/fa01 -in2 Fasta/f001")
00122         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00123         output, error = cmdline()
00124         self.assertEqual(output, "")
00125         self.assertTrue("ERROR" not in error)
00126         self.assertTrue(error.strip().startswith("MUSCLE"), output)

Profile alignment, and switch and valued options

Definition at line 127 of file test_Muscle_tool.py.

00127 
00128     def test_Muscle_profile_with_options(self):
00129         """Profile alignment, and switch and valued options"""
00130         #Using some keyword arguments, note -stable isn't supported in v3.8
00131         cmdline = MuscleCommandline(muscle_exe, out=self.outfile4,
00132                                     in1=self.infile2, in2=self.infile3,
00133                                     profile=True, stable=True,
00134                                     cluster1="neighborjoining")
00135         self.assertEqual(str(cmdline), muscle_exe + \
00136                          " -out Fasta/temp_align_out4.fa" + \
00137                          " -profile -in1 Fasta/fa01 -in2 Fasta/f001" + \
00138                          " -cluster1 neighborjoining -stable")
00139         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00140         """
00141         #TODO - Why doesn't this work with MUSCLE 3.6 on the Mac?
00142         #It may be another bug fixed in MUSCLE 3.7 ...
00143         result, stdout, stderr = generic_run(cmdline)
00144         #NOTE: generic_run has been removed from Biopython
00145         self.assertEqual(result.return_code, 0)
00146         self.assertEqual(stdout.read(), "")
00147         self.assertTrue("ERROR" not in stderr.read())
00148         self.assertEqual(str(result._cl), str(cmdline))
00149         """

Simple round-trip through app just infile and outfile

Definition at line 81 of file test_Muscle_tool.py.

00081 
00082     def test_Muscle_simple(self):
00083         """Simple round-trip through app just infile and outfile"""
00084         cmdline = MuscleCommandline(muscle_exe,
00085                                     input=self.infile1,
00086                                     out=self.outfile1)
00087         self.assertEqual(str(cmdline), muscle_exe \
00088                          + ' -in Fasta/f002 -out "Fasta/temp align out1.fa"')
00089         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00090         output, error = cmdline()
00091         self.assertEqual(output, "")
00092         self.assertTrue("ERROR" not in error)

Round-trip through app with a switch and valued option

Definition at line 93 of file test_Muscle_tool.py.

00093 
00094     def test_Muscle_with_options(self):
00095         """Round-trip through app with a switch and valued option"""
00096         cmdline = MuscleCommandline(muscle_exe)
00097         cmdline.set_parameter("input", self.infile1) #"input" is alias for "in"
00098         cmdline.set_parameter("out", self.outfile2)
00099         #Use property:
00100         cmdline.objscore = "sp"
00101         cmdline.noanchors = True
00102         self.assertEqual(str(cmdline), muscle_exe +\
00103                          " -in Fasta/f002" + \
00104                          " -out Fasta/temp_align_out2.fa" + \
00105                          " -objscore sp -noanchors")
00106         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00107         output, error = cmdline()
00108         self.assertEqual(output, "")
00109         self.assertTrue("ERROR" not in error)
00110         self.assertTrue(error.strip().startswith("MUSCLE"), output)


Member Data Documentation

Definition at line 63 of file test_Muscle_tool.py.

Definition at line 64 of file test_Muscle_tool.py.

Definition at line 65 of file test_Muscle_tool.py.

Definition at line 66 of file test_Muscle_tool.py.

Definition at line 67 of file test_Muscle_tool.py.

Definition at line 68 of file test_Muscle_tool.py.

Definition at line 69 of file test_Muscle_tool.py.


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