Back to index

python-biopython  1.60
Public Member Functions | Private Attributes
Bio.Blast.NCBIStandalone._HeaderConsumer Class Reference
Inheritance diagram for Bio.Blast.NCBIStandalone._HeaderConsumer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def start_header
def version
def reference
def query_info
def database_info
def end_header

Private Attributes

 _header

Detailed Description

Definition at line 837 of file NCBIStandalone.py.


Member Function Documentation

Definition at line 871 of file NCBIStandalone.py.

00871 
00872     def database_info(self, line):
00873         line = line.rstrip()
00874         if line.startswith('Database: '):
00875             self._header.database = line[10:]
00876         elif not line.endswith('total letters'):
00877             if self._header.database:
00878                 #Need to include a space when merging multi line datase descr
00879                 self._header.database = self._header.database + " " + line.strip()
00880             else:
00881                 self._header.database = line.strip()                
00882         else:
00883             sequences, letters =_re_search(
00884                 r"([0-9,]+) sequences; ([0-9,-]+) total letters", line,
00885                 "I could not find the sequences and letters in line\n%s" %line)
00886             self._header.database_sequences = _safe_int(sequences)
00887             self._header.database_letters = _safe_int(letters)

Here is the call graph for this function:

Reimplemented in Bio.Blast.NCBIStandalone._PSIBlastConsumer, and Bio.Blast.NCBIStandalone._BlastConsumer.

Definition at line 888 of file NCBIStandalone.py.

00888 
00889     def end_header(self):
00890         # Get rid of the trailing newlines
00891         self._header.reference = self._header.reference.rstrip()
00892         self._header.query = self._header.query.rstrip()

Definition at line 856 of file NCBIStandalone.py.

00856 
00857     def query_info(self, line):
00858         if line.startswith('Query= '):
00859             self._header.query = line[7:].lstrip()
00860         elif line.startswith('Length='):
00861             #New style way to give the query length in BLAST 2.2.22+ (the C++ code)
00862             self._header.query_letters = _safe_int(line[7:].strip())
00863         elif not line.startswith('       '):  # continuation of query_info
00864             self._header.query = "%s%s" % (self._header.query, line)
00865         else:
00866             #Hope it is the old style way to give the query length:
00867             letters, = _re_search(
00868                 r"([0-9,]+) letters", line,
00869                 "I could not find the number of letters in line\n%s" % line)
00870             self._header.query_letters = _safe_int(letters)
                

Here is the call graph for this function:

Definition at line 850 of file NCBIStandalone.py.

00850 
00851     def reference(self, line):
00852         if line.startswith('Reference: '):
00853             self._header.reference = line[11:]
00854         else:
00855             self._header.reference = self._header.reference + line
            

Definition at line 841 of file NCBIStandalone.py.

00841 
00842     def version(self, line):
00843         c = line.split()
00844         self._header.application = c[0]
00845         self._header.version = c[1]
00846         if len(c) > 2:
00847             #The date is missing in the new C++ output from blastx 2.2.22+
00848             #Just get "BLASTX 2.2.22+\n" and that's all.
00849             self._header.date = c[2][1:-1]


Member Data Documentation

Definition at line 839 of file NCBIStandalone.py.


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