示例#1
0
 def test_TCoffee_2(self):
     """Round-trip through app and read pir alignment from file."""
     cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
     cmdline.infile = self.infile1
     cmdline.outfile = self.outfile3
     cmdline.output = "pir_aln"
     self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
                      "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
     stdout, stderr = cmdline()
     # Can get warnings in stderr output
     self.assertNotIn("error", stderr.lower(), stderr)
     align = AlignIO.read(self.outfile3, "pir")
     records = list(SeqIO.parse(self.infile1, "fasta"))
     self.assertEqual(len(records), len(align))
     for old, new in zip(records, align):
         self.assertEqual(old.id, new.id)
         self.assertEqual(str(new.seq).replace("-", ""), str(old.seq).replace("-", ""))
示例#2
0
 def test_TCoffee_pir(self):
     """Round-trip through app and read pir alignment from file."""
     cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
     cmdline.infile = self.infile1
     cmdline.outfile = self.outfile3
     cmdline.output = "pir_aln"
     self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
                      "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
     stdout, stderr = cmdline()
     # Can get warnings in stderr output
     self.assertNotIn("error", stderr.lower(), stderr)
     align = AlignIO.read(self.outfile3, "pir")
     records = list(SeqIO.parse(self.infile1, "fasta"))
     self.assertEqual(len(records), len(align))
     for old, new in zip(records, align):
         self.assertEqual(old.id, new.id)
         self.assertEqual(str(new.seq).replace("-", ""), str(old.seq).replace("-", ""))
 def test_TCoffee_2(self):
     """Round-trip through app and read pir alignment from file
     """
     cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
     cmdline.infile = self.infile1
     cmdline.outfile = self.outfile3
     cmdline.output = "pir_aln"
     self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
                 "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
     result, stdout, stderr = Application.generic_run(cmdline)
     self.assertEquals(result.return_code, 0)
     self.assertEquals(stderr.read(), "")
     align = AlignIO.read(open(self.outfile3), "pir")
     records = list(SeqIO.parse(open(self.infile1),"fasta"))
     self.assertEqual(len(records),len(align))
     for old, new in zip(records, align):
         self.assertEqual(old.id, new.id)
         self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))
示例#4
0
 def test_TCoffee_2(self):
     """Round-trip through app and read pir alignment from file
     """
     cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
     cmdline.infile = self.infile1
     cmdline.outfile = self.outfile3
     cmdline.output = "pir_aln"
     self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
                 "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
     result, stdout, stderr = Application.generic_run(cmdline)
     self.assertEquals(result.return_code, 0)
     self.assertEquals(stderr.read(), "")
     align = AlignIO.read(open(self.outfile3), "pir")
     records = list(SeqIO.parse(open(self.infile1),"fasta"))
     self.assertEqual(len(records),len(align))
     for old, new in zip(records, align) :
         self.assertEqual(old.id, new.id)
         self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))
示例#5
0
 def test_TCoffee_2(self):
     """Round-trip through app and read pir alignment from file
     """
     cmdline = TCoffeeCommandline(t_coffee_exe, quiet=True)
     cmdline.infile = self.infile1
     cmdline.outfile = self.outfile3
     cmdline.output = "pir_aln"
     self.assertEqual(str(cmdline), t_coffee_exe + " -output pir_aln "
                 "-infile Fasta/fa01 -outfile Fasta/tc_out.pir -quiet")
     child = subprocess.Popen(str(cmdline),
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE,
                              shell=(sys.platform!="win32"))
     return_code = child.wait()
     self.assertEqual(return_code, 0)
     self.assertEquals(child.stderr.read(), "")
     align = AlignIO.read(open(self.outfile3), "pir")
     records = list(SeqIO.parse(open(self.infile1),"fasta"))
     self.assertEqual(len(records),len(align))
     for old, new in zip(records, align):
         self.assertEqual(old.id, new.id)
         self.assertEqual(str(new.seq).replace("-",""), str(old.seq).replace("-",""))
     del child