Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Probcons_tool.ProbconsApplication Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_Probcons_alignment_fasta
def test_Probcons_alignment_clustalw
def test_Probcons_complex_commandline

Public Attributes

 infile1
 annotation_outfile

Detailed Description

Definition at line 31 of file test_Probcons_tool.py.


Member Function Documentation

Definition at line 33 of file test_Probcons_tool.py.

00033 
00034     def setUp(self):
00035         self.infile1 = "Fasta/fa01"
00036         self.annotation_outfile = "Fasta/probcons_annot.out"

Definition at line 37 of file test_Probcons_tool.py.

00037 
00038     def tearDown(self):
00039         if os.path.isfile(self.annotation_outfile):
00040             os.remove(self.annotation_outfile)

Round-trip through app and read clustalw alignment from stdout

Definition at line 56 of file test_Probcons_tool.py.

00056 
00057     def test_Probcons_alignment_clustalw(self):
00058         """Round-trip through app and read clustalw alignment from stdout
00059         """
00060         cmdline = ProbconsCommandline(probcons_exe)
00061         cmdline.set_parameter("input", "Fasta/fa01")
00062         cmdline.clustalw = True
00063         self.assertEqual(str(cmdline), probcons_exe + " -clustalw Fasta/fa01")
00064         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00065         stdout, stderr = cmdline()
00066         self.assertTrue(stderr.strip().startswith("PROBCONS"))
00067         align = AlignIO.read(StringIO(stdout), "clustal")
00068         records = list(SeqIO.parse(self.infile1,"fasta"))
00069         self.assertEqual(len(records),len(align))
00070         for old, new in zip(records, align):
00071             self.assertEqual(old.id, new.id)
00072             self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))

Round-trip through app and read fasta alignment from stdout

Definition at line 41 of file test_Probcons_tool.py.

00041 
00042     def test_Probcons_alignment_fasta(self):
00043         """Round-trip through app and read fasta alignment from stdout
00044         """
00045         cmdline = ProbconsCommandline(probcons_exe, input=self.infile1)
00046         self.assertEqual(str(cmdline), probcons_exe + " Fasta/fa01")
00047         self.assertEqual(str(eval(repr(cmdline))), str(cmdline))
00048         stdout, stderr = cmdline()
00049         self.assertTrue(stderr.startswith("\nPROBCONS"))
00050         align = AlignIO.read(StringIO(stdout), "fasta")
00051         records = list(SeqIO.parse(self.infile1,"fasta"))
00052         self.assertEqual(len(records),len(align))
00053         for old, new in zip(records, align):
00054             self.assertEqual(old.id, new.id)
00055             self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))
 
Round-trip through app with complex command line and output file

Definition at line 73 of file test_Probcons_tool.py.

00073 
00074     def test_Probcons_complex_commandline(self):
00075         """Round-trip through app with complex command line and output file
00076         """
00077         cmdline = ProbconsCommandline(probcons_exe, pre=1)
00078         cmdline.set_parameter("input", "Fasta/fa01")
00079         cmdline.consistency = 4
00080         cmdline.set_parameter("--iterative-refinement", 222)
00081         cmdline.set_parameter("a", True)
00082         cmdline.annot = self.annotation_outfile
00083         self.assertEqual(str(cmdline), probcons_exe +
00084                 " -c 4 -ir 222 -pre 1 -annot Fasta/probcons_annot.out "
00085                 "-a Fasta/fa01")
00086         stdout, stderr = cmdline()
00087         self.assertTrue(stderr.startswith("\nPROBCONS"))
00088         self.assertTrue(stdout.startswith(">AK1H_ECOLI/1-378"))
00089 


Member Data Documentation

Definition at line 35 of file test_Probcons_tool.py.

Definition at line 34 of file test_Probcons_tool.py.


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