Back to index

python-biopython  1.60
Public Member Functions
test_NCBI_BLAST_tools.Pairwise Class Reference

List of all members.

Public Member Functions

def test_blastp
def test_blastn
def test_tblastn

Detailed Description

Definition at line 68 of file test_NCBI_BLAST_tools.py.


Member Function Documentation

Pairwise BLASTN search

Definition at line 99 of file test_NCBI_BLAST_tools.py.

00099 
00100     def test_blastn(self):
00101         """Pairwise BLASTN search"""
00102         global exe_names
00103         cline = Applications.NcbiblastnCommandline(exe_names["blastn"],
00104                         query="GenBank/NC_005816.ffn",
00105                         subject="GenBank/NC_005816.fna",
00106                         evalue="0.000001")
00107         self.assertEqual(str(cline), exe_names["blastn"] \
00108                          + " -query GenBank/NC_005816.ffn -evalue 0.000001" \
00109                          + " -subject GenBank/NC_005816.fna")
00110         child = subprocess.Popen(str(cline),
00111                                  stdout=subprocess.PIPE,
00112                                  stderr=subprocess.PIPE,
00113                                  universal_newlines=True,
00114                                  shell=(sys.platform!="win32"))
00115         stdoutdata, stderrdata = child.communicate()
00116         return_code = child.returncode
00117         self.assertEqual(return_code, 0, "Got error code %i back from:\n%s"
00118                          % (return_code, cline))
00119         self.assertEqual(10, stdoutdata.count("Query= "))
00120         self.assertEqual(0, stdoutdata.count("***** No hits found *****"))
00121         #TODO - Parse it?

Pairwise BLASTP search

Definition at line 69 of file test_NCBI_BLAST_tools.py.

00069 
00070     def test_blastp(self):
00071         """Pairwise BLASTP search"""
00072         global exe_names
00073         cline = Applications.NcbiblastpCommandline(exe_names["blastp"],
00074                         query="Fasta/rose.pro",
00075                         subject="GenBank/NC_005816.faa",
00076                         evalue=1)
00077         self.assertEqual(str(cline), exe_names["blastp"] \
00078                          + " -query Fasta/rose.pro -evalue 1" \
00079                          + " -subject GenBank/NC_005816.faa")
00080         child = subprocess.Popen(str(cline),
00081                                  stdout=subprocess.PIPE,
00082                                  stderr=subprocess.PIPE,
00083                                  universal_newlines=True,
00084                                  shell=(sys.platform!="win32"))
00085         stdoutdata, stderrdata = child.communicate()
00086         return_code = child.returncode
00087         self.assertEqual(return_code, 0, "Got error code %i back from:\n%s"
00088                          % (return_code, cline))
00089         self.assertEqual(10, stdoutdata.count("Query= "))
00090         if stdoutdata.count("***** No hits found *****")==7:
00091             #This happens with BLAST 2.2.26+ which is potentially a bug
00092             pass
00093         else:
00094             self.assertEqual(9, stdoutdata.count("***** No hits found *****"))
00095         
00096         #TODO - Parse it? I think we'd need to update this obsole code :(
00097         #records = list(NCBIStandalone.Iterator(StringIO(stdoutdata),
00098         #                                       NCBIStandalone.BlastParser()))   

Pairwise TBLASTN search

Definition at line 122 of file test_NCBI_BLAST_tools.py.

00122 
00123     def test_tblastn(self):
00124         """Pairwise TBLASTN search"""
00125         global exe_names
00126         cline = Applications.NcbitblastnCommandline(exe_names["tblastn"],
00127                         query="GenBank/NC_005816.faa",
00128                         subject="GenBank/NC_005816.fna",
00129                         evalue="1e-6")
00130         self.assertEqual(str(cline), exe_names["tblastn"] \
00131                          + " -query GenBank/NC_005816.faa -evalue 1e-6" \
00132                          + " -subject GenBank/NC_005816.fna")
00133         child = subprocess.Popen(str(cline),
00134                                  stdout=subprocess.PIPE,
00135                                  stderr=subprocess.PIPE,
00136                                  universal_newlines=True,
00137                                  shell=(sys.platform!="win32"))
00138         stdoutdata, stderrdata = child.communicate()
00139         return_code = child.returncode
00140         self.assertEqual(return_code, 0, "Got error code %i back from:\n%s"
00141                          % (return_code, cline))
00142         self.assertEqual(10, stdoutdata.count("Query= "))
00143         self.assertEqual(0, stdoutdata.count("***** No hits found *****"))
00144         #TODO - Parse it?


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