Back to index

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

List of all members.

Public Member Functions

def __init__
def round
def start_header
def end_header
def end_descriptions
def end_alignment
def end_hsp
def end_database_report
def end_parameters
def __getattr__
def version
def reference
def query_info
def database_info
def start_descriptions
def description_header
def description
def model_sequences
def nonmodel_sequences
def converged
def no_hits
def start_alignment
def title
def length
def multalign
def start_hsp
def score
def identities
def strand
def frame
def query
def align
def sbjct
def start_database_report
def database
def posted_date
def num_letters_in_database
def num_sequences_in_database
def ka_params
def gapped
def ka_params_gap
def start_parameters
def matrix
def gap_penalties
def num_hits
def num_sequences
def num_extends
def num_good_extends
def num_seqs_better_e
def hsps_no_gap
def hsps_prelim_gapped
def hsps_prelim_gapped_attempted
def hsps_gapped
def query_length
def database_length
def effective_hsp_length
def effective_query_length
def effective_database_length
def effective_search_space
def effective_search_space_used
def frameshift
def threshold
def window_size
def dropoff_1st_pass
def gap_x_dropoff
def gap_x_dropoff_final
def gap_trigger
def blast_cutoff

Public Attributes

 data

Detailed Description

Definition at line 1485 of file NCBIStandalone.py.


Constructor & Destructor Documentation

Reimplemented in Bio.Blast.NCBIStandalone._BlastErrorConsumer.

Definition at line 1495 of file NCBIStandalone.py.

01495 
01496     def __init__(self):
01497         self.data = None

Here is the caller graph for this function:


Member Function Documentation

def Bio.ParserSupport.AbstractConsumer.__getattr__ (   self,
  attr 
) [inherited]

Reimplemented in Bio.ParserSupport.TaggingConsumer.

Definition at line 79 of file ParserSupport.py.

00079 
00080     def __getattr__(self, attr):
00081         if attr[:6] == 'start_' or attr[:4] == 'end_':
00082             method = self._unhandled_section
00083         else:
00084             method = self._unhandled
00085         return method

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HSPConsumer.align (   self,
  line 
) [inherited]

Definition at line 1222 of file NCBIStandalone.py.

01222 
01223     def align(self, line):
01224         seq = line[self._query_start_index:].rstrip()
01225         if len(seq) < self._query_len:
01226             # Make sure the alignment is the same length as the query
01227             seq = seq + ' ' * (self._query_len-len(seq))
01228         elif len(seq) < self._query_len:
01229             raise ValueError("Match is longer than the query in line\n%s" \
01230                              % line)
01231         self._hsp.match = self._hsp.match + seq

def Bio.Blast.NCBIStandalone._ParametersConsumer.blast_cutoff (   self,
  line 
) [inherited]

Definition at line 1468 of file NCBIStandalone.py.

01468 
01469     def blast_cutoff(self, line):
01470         score, bits = _re_search(
01471             r"S2: (\d+) \(\s*([0-9,.]+) bits\)", line,
01472             "I could not find the blast cutoff in line\n%s" % line)
01473         self._params.blast_cutoff = _safe_int(score), _safe_float(bits)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._DescriptionConsumer.converged (   self,
  line 
) [inherited]

Definition at line 925 of file NCBIStandalone.py.

00925 
00926     def converged(self, line):
00927         self._converged = 1

def Bio.Blast.NCBIStandalone._DatabaseReportConsumer.database (   self,
  line 
) [inherited]

Definition at line 1267 of file NCBIStandalone.py.

01267 
01268     def database(self, line):
01269         m = re.search(r"Database: (.+)$", line)
01270         if m:
01271             self._dr.database_name.append(m.group(1))
01272         elif self._dr.database_name:
01273             # This must be a continuation of the previous name.
01274             self._dr.database_name[-1] = "%s%s" % (self._dr.database_name[-1],
01275                                                    line.strip())

def Bio.Blast.NCBIStandalone._HeaderConsumer.database_info (   self,
  line 
) [inherited]

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:

def Bio.Blast.NCBIStandalone._ParametersConsumer.database_length (   self,
  line 
) [inherited]

Definition at line 1382 of file NCBIStandalone.py.

01382 
01383     def database_length(self, line):
01384         self._params.database_length, = _get_cols(
01385             line.lower(), (-1,), ncols=4, expected={0:"length", 2:"database:"})
01386         self._params.database_length = _safe_int(self._params.database_length)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._DescriptionConsumer.description (   self,
  line 
) [inherited]

Definition at line 910 of file NCBIStandalone.py.

00910 
00911     def description(self, line):
00912         dh = self._parse(line)
00913         if self._type == 'model':
00914             self._model_sequences.append(dh)
00915         elif self._type == 'nonmodel':
00916             self._nonmodel_sequences.append(dh)
00917         else:
00918             self._descriptions.append(dh)

Here is the call graph for this function:

Definition at line 904 of file NCBIStandalone.py.

00904 
00905     def description_header(self, line):
00906         if line.startswith('Sequences producing'):
00907             cols = line.split()
00908             if cols[-1] == 'N':
00909                 self.__has_n = 1
    
def Bio.Blast.NCBIStandalone._ParametersConsumer.dropoff_1st_pass (   self,
  line 
) [inherited]

Definition at line 1444 of file NCBIStandalone.py.

01444 
01445     def dropoff_1st_pass(self, line):
01446         score, bits = _re_search(
01447             r"X1: (\d+) \(\s*([0-9,.]+) bits\)", line,
01448             "I could not find the dropoff in line\n%s" % line)
01449         self._params.dropoff_1st_pass = _safe_int(score), _safe_float(bits)
        

Here is the call graph for this function:

Definition at line 1399 of file NCBIStandalone.py.

01399 
01400     def effective_database_length(self, line):
01401         self._params.effective_database_length, = _get_cols(
01402             line.lower(), (-1,), ncols=5, expected={1:"length", 3:"database:"})
01403         self._params.effective_database_length = _safe_int(
01404             self._params.effective_database_length)
        

Here is the call graph for this function:

Definition at line 1387 of file NCBIStandalone.py.

01387 
01388     def effective_hsp_length(self, line):
01389         self._params.effective_hsp_length, = _get_cols(
01390             line, (-1,), ncols=4, expected={1:"HSP", 2:"length:"})
01391         self._params.effective_hsp_length = _safe_int(
01392             self._params.effective_hsp_length)

Here is the call graph for this function:

Definition at line 1393 of file NCBIStandalone.py.

01393 
01394     def effective_query_length(self, line):
01395         self._params.effective_query_length, = _get_cols(
01396             line, (-1,), ncols=5, expected={1:"length", 3:"query:"})
01397         self._params.effective_query_length = _safe_int(
01398             self._params.effective_query_length)

Here is the call graph for this function:

Definition at line 1405 of file NCBIStandalone.py.

01405 
01406     def effective_search_space(self, line):
01407         self._params.effective_search_space, = _get_cols(
01408             line, (-1,), ncols=4, expected={1:"search"})
01409         self._params.effective_search_space = _safe_int(
01410             self._params.effective_search_space)

Here is the call graph for this function:

Definition at line 1411 of file NCBIStandalone.py.

01411 
01412     def effective_search_space_used(self, line):
01413         self._params.effective_search_space_used, = _get_cols(
01414             line, (-1,), ncols=5, expected={1:"search", 3:"used:"})
01415         self._params.effective_search_space_used = _safe_int(
01416             self._params.effective_search_space_used)

Here is the call graph for this function:

Reimplemented from Bio.Blast.NCBIStandalone._AlignmentConsumer.

Definition at line 1513 of file NCBIStandalone.py.

01513 
01514     def end_alignment(self):
01515         _AlignmentConsumer.end_alignment(self)
01516         if self._alignment.hsps:
01517             self.data.alignments.append(self._alignment)
01518         if self._multiple_alignment.alignment:
01519             self.data.multiple_alignment = self._multiple_alignment

Reimplemented from Bio.Blast.NCBIStandalone._DatabaseReportConsumer.

Definition at line 1527 of file NCBIStandalone.py.

01527 
01528     def end_database_report(self):
01529         _DatabaseReportConsumer.end_database_report(self)
01530         self.data.__dict__.update(self._dr.__dict__)

Reimplemented from Bio.Blast.NCBIStandalone._DescriptionConsumer.

Definition at line 1510 of file NCBIStandalone.py.

01510 
01511     def end_descriptions(self):
01512         self.data.descriptions = self._descriptions

Reimplemented from Bio.Blast.NCBIStandalone._HeaderConsumer.

Definition at line 1506 of file NCBIStandalone.py.

01506 
01507     def end_header(self):
01508         _HeaderConsumer.end_header(self)
01509         self.data.__dict__.update(self._header.__dict__)

Reimplemented from Bio.Blast.NCBIStandalone._HSPConsumer.

Definition at line 1520 of file NCBIStandalone.py.

01520 
01521     def end_hsp(self):
01522         _HSPConsumer.end_hsp(self)
01523         try:
01524             self._alignment.hsps.append(self._hsp)
01525         except AttributeError:
01526             raise ValueError("Found an HSP before an alignment")

Reimplemented from Bio.Blast.NCBIStandalone._ParametersConsumer.

Definition at line 1531 of file NCBIStandalone.py.

01531 
01532     def end_parameters(self):
01533         _ParametersConsumer.end_parameters(self)
01534         self.data.__dict__.update(self._params.__dict__)

def Bio.Blast.NCBIStandalone._HSPConsumer.frame (   self,
  line 
) [inherited]

Definition at line 1183 of file NCBIStandalone.py.

01183 
01184     def frame(self, line):
01185         # Frame can be in formats:
01186         # Frame = +1
01187         # Frame = +2 / +2
01188         if line.find('/') != -1:
01189             self._hsp.frame = _re_search(
01190                 r"Frame\s?=\s?([-+][123])\s?/\s?([-+][123])", line,
01191                 "I could not find the frame in line\n%s" % line)
01192         else:
01193             self._hsp.frame = _re_search(
01194                 r"Frame = ([-+][123])", line,
01195                 "I could not find the frame in line\n%s" % line)

Here is the call graph for this function:

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.frameshift (   self,
  line 
) [inherited]

Definition at line 1417 of file NCBIStandalone.py.

01417 
01418     def frameshift(self, line):
01419         self._params.frameshift = _get_cols(
01420            line, (4, 5), ncols=6, expected={0:"frameshift", 2:"decay"})

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.gap_penalties (   self,
  line 
) [inherited]

Definition at line 1312 of file NCBIStandalone.py.

01312 
01313     def gap_penalties(self, line):
01314         x = _get_cols(
01315             line, (3, 5), ncols=6, expected={2:"Existence:", 4:"Extension:"})
01316         self._params.gap_penalties = map(_safe_float, x)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.gap_trigger (   self,
  line 
) [inherited]

Definition at line 1462 of file NCBIStandalone.py.

01462 
01463     def gap_trigger(self, line):
01464         score, bits = _re_search(
01465             r"S1: (\d+) \(\s*([0-9,.]+) bits\)", line,
01466             "I could not find the gap trigger in line\n%s" % line)
01467         self._params.gap_trigger = _safe_int(score), _safe_float(bits)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.gap_x_dropoff (   self,
  line 
) [inherited]

Definition at line 1450 of file NCBIStandalone.py.

01450 
01451     def gap_x_dropoff(self, line):
01452         score, bits = _re_search(
01453             r"X2: (\d+) \(\s*([0-9,.]+) bits\)", line,
01454             "I could not find the gap dropoff in line\n%s" % line)
01455         self._params.gap_x_dropoff = _safe_int(score), _safe_float(bits)
        

Here is the call graph for this function:

Definition at line 1456 of file NCBIStandalone.py.

01456 
01457     def gap_x_dropoff_final(self, line):
01458         score, bits = _re_search(
01459             r"X3: (\d+) \(\s*([0-9,.]+) bits\)", line,
01460             "I could not find the gap dropoff final in line\n%s" % line)
01461         self._params.gap_x_dropoff_final = _safe_int(score), _safe_float(bits)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._DatabaseReportConsumer.gapped (   self,
  line 
) [inherited]

Definition at line 1295 of file NCBIStandalone.py.

01295 
01296     def gapped(self, line):
01297         self._dr.gapped = 1

def Bio.Blast.NCBIStandalone._ParametersConsumer.hsps_gapped (   self,
  line 
) [inherited]

Definition at line 1372 of file NCBIStandalone.py.

01372 
01373     def hsps_gapped(self, line):
01374         self._params.hsps_gapped, = _get_cols(
01375             line, (-1,), ncols=6, expected={3:"gapped"})
01376         self._params.hsps_gapped = _safe_int(self._params.hsps_gapped)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.hsps_no_gap (   self,
  line 
) [inherited]

Definition at line 1355 of file NCBIStandalone.py.

01355 
01356     def hsps_no_gap(self, line):
01357         self._params.hsps_no_gap, = _get_cols(
01358             line, (-1,), ncols=9, expected={3:"better", 7:"gapping:"})
01359         self._params.hsps_no_gap = _safe_int(self._params.hsps_no_gap)

Here is the call graph for this function:

Definition at line 1360 of file NCBIStandalone.py.

01360 
01361     def hsps_prelim_gapped(self, line):
01362         self._params.hsps_prelim_gapped, = _get_cols(
01363             line, (-1,), ncols=9, expected={4:"gapped", 6:"prelim"})
01364         self._params.hsps_prelim_gapped = _safe_int(
01365             self._params.hsps_prelim_gapped)

Here is the call graph for this function:

Definition at line 1366 of file NCBIStandalone.py.

01366 
01367     def hsps_prelim_gapped_attempted(self, line):
01368         self._params.hsps_prelim_gapped_attempted, = _get_cols(
01369             line, (-1,), ncols=10, expected={4:"attempted", 7:"prelim"})
01370         self._params.hsps_prelim_gapped_attempted = _safe_int(
01371             self._params.hsps_prelim_gapped_attempted)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HSPConsumer.identities (   self,
  line 
) [inherited]

Definition at line 1156 of file NCBIStandalone.py.

01156 
01157     def identities(self, line):
01158         x, y = _re_search(
01159             r"Identities = (\d+)\/(\d+)", line,
01160             "I could not find the identities in line\n%s" % line)
01161         self._hsp.identities = _safe_int(x), _safe_int(y)
01162         self._hsp.align_length = _safe_int(y)
01163 
01164         if line.find('Positives') != -1:
01165             x, y = _re_search(
01166                 r"Positives = (\d+)\/(\d+)", line,
01167                 "I could not find the positives in line\n%s" % line)
01168             self._hsp.positives = _safe_int(x), _safe_int(y)
01169             assert self._hsp.align_length == _safe_int(y)
01170 
01171         if line.find('Gaps') != -1:
01172             x, y = _re_search(
01173                 r"Gaps = (\d+)\/(\d+)", line,
01174                 "I could not find the gaps in line\n%s" % line)
01175             self._hsp.gaps = _safe_int(x), _safe_int(y)
01176             assert self._hsp.align_length == _safe_int(y)
01177 
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._DatabaseReportConsumer.ka_params (   self,
  line 
) [inherited]

Definition at line 1291 of file NCBIStandalone.py.

01291 
01292     def ka_params(self, line):
01293         x = line.split()
01294         self._dr.ka_params = map(_safe_float, x)

Definition at line 1298 of file NCBIStandalone.py.

01298 
01299     def ka_params_gap(self, line):
01300         x = line.split()
01301         self._dr.ka_params_gap = map(_safe_float, x)

def Bio.Blast.NCBIStandalone._AlignmentConsumer.length (   self,
  line 
) [inherited]

Definition at line 986 of file NCBIStandalone.py.

00986 
00987     def length(self, line):
00988         #e.g. "Length = 81" or more recently, "Length=428"
00989         parts = line.replace(" ","").split("=")
00990         assert len(parts)==2, "Unrecognised format length line"
00991         self._alignment.length = parts[1]
00992         self._alignment.length = _safe_int(self._alignment.length)

Here is the call graph for this function:

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.matrix (   self,
  line 
) [inherited]

Definition at line 1309 of file NCBIStandalone.py.

01309 
01310     def matrix(self, line):
01311         self._params.matrix = line[8:].rstrip()

def Bio.Blast.NCBIStandalone._DescriptionConsumer.model_sequences (   self,
  line 
) [inherited]

Definition at line 919 of file NCBIStandalone.py.

00919 
00920     def model_sequences(self, line):
00921         self._type = 'model'

def Bio.Blast.NCBIStandalone._AlignmentConsumer.multalign (   self,
  line 
) [inherited]

Definition at line 993 of file NCBIStandalone.py.

00993 
00994     def multalign(self, line):
00995         # Standalone version uses 'QUERY', while WWW version uses blast_tmp.
00996         if line.startswith('QUERY') or line.startswith('blast_tmp'):
00997             # If this is the first line of the multiple alignment,
00998             # then I need to figure out how the line is formatted.
00999             
01000             # Format of line is:
01001             # QUERY 1   acttg...gccagaggtggtttattcagtctccataagagaggggacaaacg 60
01002             try:
01003                 name, start, seq, end = line.split()
01004             except ValueError:
01005                 raise ValueError("I do not understand the line\n%s" % line)
01006             self._start_index = line.index(start, len(name))
01007             self._seq_index = line.index(seq,
01008                                          self._start_index+len(start))
01009             # subtract 1 for the space
01010             self._name_length = self._start_index - 1
01011             self._start_length = self._seq_index - self._start_index - 1
01012             self._seq_length = line.rfind(end) - self._seq_index - 1
01013             
01014             #self._seq_index = line.index(seq)
01015             ## subtract 1 for the space
01016             #self._seq_length = line.rfind(end) - self._seq_index - 1
01017             #self._start_index = line.index(start)
01018             #self._start_length = self._seq_index - self._start_index - 1
01019             #self._name_length = self._start_index
01020 
01021         # Extract the information from the line
01022         name = line[:self._name_length]
01023         name = name.rstrip()
01024         start = line[self._start_index:self._start_index+self._start_length]
01025         start = start.rstrip()
01026         if start:
01027             start = _safe_int(start)
01028         end = line[self._seq_index+self._seq_length:].rstrip()
01029         if end:
01030             end = _safe_int(end)
01031         seq = line[self._seq_index:self._seq_index+self._seq_length].rstrip()
01032         # right pad the sequence with spaces if necessary
01033         if len(seq) < self._seq_length:
01034             seq = seq + ' '*(self._seq_length-len(seq))
01035             
01036         # I need to make sure the sequence is aligned correctly with the query.
01037         # First, I will find the length of the query.  Then, if necessary,
01038         # I will pad my current sequence with spaces so that they will line
01039         # up correctly.
01040 
01041         # Two possible things can happen:
01042         # QUERY
01043         # 504
01044         #
01045         # QUERY
01046         # 403
01047         #
01048         # Sequence 504 will need padding at the end.  Since I won't know
01049         # this until the end of the alignment, this will be handled in
01050         # end_alignment.
01051         # Sequence 403 will need padding before being added to the alignment.
01052 
01053         align = self._multiple_alignment.alignment  # for convenience
01054         align.append((name, start, seq, end))
01055 
01056         # This is old code that tried to line up all the sequences
01057         # in a multiple alignment by using the sequence title's as
01058         # identifiers.  The problem with this is that BLAST assigns
01059         # different HSP's from the same sequence the same id.  Thus,
01060         # in one alignment block, there may be multiple sequences with
01061         # the same id.  I'm not sure how to handle this, so I'm not
01062         # going to.
01063         
01064         # # If the sequence is the query, then just add it.
01065         # if name == 'QUERY':
01066         #     if len(align) == 0:
01067         #         align.append((name, start, seq))
01068         #     else:
01069         #         aname, astart, aseq = align[0]
01070         #         if name != aname:
01071         #             raise ValueError, "Query is not the first sequence"
01072         #         aseq = aseq + seq
01073         #         align[0] = aname, astart, aseq
01074         # else:
01075         #     if len(align) == 0:
01076         #         raise ValueError, "I could not find the query sequence"
01077         #     qname, qstart, qseq = align[0]
01078         #     
01079         #     # Now find my sequence in the multiple alignment.
01080         #     for i in range(1, len(align)):
01081         #         aname, astart, aseq = align[i]
01082         #         if name == aname:
01083         #             index = i
01084         #             break
01085         #     else:
01086         #         # If I couldn't find it, then add a new one.
01087         #         align.append((None, None, None))
01088         #         index = len(align)-1
01089         #         # Make sure to left-pad it.
01090         #         aname, astart, aseq = name, start, ' '*(len(qseq)-len(seq))
01091         # 
01092         #     if len(qseq) != len(aseq) + len(seq):
01093         #         # If my sequences are shorter than the query sequence,
01094         #         # then I will need to pad some spaces to make them line up.
01095         #         # Since I've already right padded seq, that means aseq
01096         #         # must be too short.
01097         #         aseq = aseq + ' '*(len(qseq)-len(aseq)-len(seq))
01098         #     aseq = aseq + seq
01099         #     if astart is None:
01100         #         astart = start
01101         #     align[index] = aname, astart, aseq

def Bio.Blast.NCBIStandalone._DescriptionConsumer.no_hits (   self,
  line 
) [inherited]

Definition at line 928 of file NCBIStandalone.py.

00928 
00929     def no_hits(self, line):
00930         pass

Definition at line 922 of file NCBIStandalone.py.

00922 
00923     def nonmodel_sequences(self, line):
00924         self._type = 'nonmodel'

def Bio.Blast.NCBIStandalone._ParametersConsumer.num_extends (   self,
  line 
) [inherited]

Definition at line 1333 of file NCBIStandalone.py.

01333 
01334     def num_extends(self, line):
01335         if line.find('1st pass') != -1:
01336             x, = _get_cols(line, (-4,), ncols=9, expected={2:"extensions:"})
01337             self._params.num_extends = _safe_int(x)
01338         else:
01339             x, = _get_cols(line, (-1,), ncols=4, expected={2:"extensions:"})
01340             self._params.num_extends = _safe_int(x)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.num_good_extends (   self,
  line 
) [inherited]

Definition at line 1341 of file NCBIStandalone.py.

01341 
01342     def num_good_extends(self, line):
01343         if line.find('1st pass') != -1:
01344             x, = _get_cols(line, (-4,), ncols=10, expected={3:"extensions:"})
01345             self._params.num_good_extends = _safe_int(x)
01346         else:
01347             x, = _get_cols(line, (-1,), ncols=5, expected={3:"extensions:"})
01348             self._params.num_good_extends = _safe_int(x)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.num_hits (   self,
  line 
) [inherited]

Definition at line 1317 of file NCBIStandalone.py.

01317 
01318     def num_hits(self, line):
01319         if line.find('1st pass') != -1:
01320             x, = _get_cols(line, (-4,), ncols=11, expected={2:"Hits"})
01321             self._params.num_hits = _safe_int(x)
01322         else:
01323             x, = _get_cols(line, (-1,), ncols=6, expected={2:"Hits"})
01324             self._params.num_hits = _safe_int(x)

Here is the call graph for this function:

Definition at line 1281 of file NCBIStandalone.py.

01281 
01282     def num_letters_in_database(self, line):
01283         letters, = _get_cols(
01284             line, (-1,), ncols=6, expected={2:"letters", 4:"database:"})
01285         self._dr.num_letters_in_database.append(_safe_int(letters))

Here is the call graph for this function:

Definition at line 1349 of file NCBIStandalone.py.

01349 
01350     def num_seqs_better_e(self, line):
01351         self._params.num_seqs_better_e, = _get_cols(
01352             line, (-1,), ncols=7, expected={2:"sequences"})
01353         self._params.num_seqs_better_e = _safe_int(
01354             self._params.num_seqs_better_e)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.num_sequences (   self,
  line 
) [inherited]

Definition at line 1325 of file NCBIStandalone.py.

01325 
01326     def num_sequences(self, line):
01327         if line.find('1st pass') != -1:
01328             x, = _get_cols(line, (-4,), ncols=9, expected={2:"Sequences:"})
01329             self._params.num_sequences = _safe_int(x)
01330         else:
01331             x, = _get_cols(line, (-1,), ncols=4, expected={2:"Sequences:"})
01332             self._params.num_sequences = _safe_int(x)

Here is the call graph for this function:

Definition at line 1286 of file NCBIStandalone.py.

01286 
01287     def num_sequences_in_database(self, line):
01288         sequences, = _get_cols(
01289             line, (-1,), ncols=6, expected={2:"sequences", 4:"database:"})
01290         self._dr.num_sequences_in_database.append(_safe_int(sequences))

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._DatabaseReportConsumer.posted_date (   self,
  line 
) [inherited]

Definition at line 1276 of file NCBIStandalone.py.

01276 
01277     def posted_date(self, line):
01278         self._dr.posted_date.append(_re_search(
01279             r"Posted date:\s*(.+)$", line,
01280             "I could not find the posted date in line\n%s" % line))

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HSPConsumer.query (   self,
  line 
) [inherited]

Definition at line 1202 of file NCBIStandalone.py.

01202 
01203     def query(self, line):
01204         m = self._query_re.search(line)
01205         if m is None:
01206             raise ValueError("I could not find the query in line\n%s" % line)
01207         
01208         # line below modified by Yair Benita, Sep 2004.
01209         # added the end attribute for the query
01210         colon, start, seq, end = m.groups()
01211         self._hsp.query = self._hsp.query + seq
01212         if self._hsp.query_start is None:
01213             self._hsp.query_start = _safe_int(start)
01214 
01215         # line below added by Yair Benita, Sep 2004.
01216         # added the end attribute for the query
01217         self._hsp.query_end = _safe_int(end)
01218 
01219         #Get index for sequence start (regular expression element 3)
01220         self._query_start_index = m.start(3)
01221         self._query_len = len(seq)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HeaderConsumer.query_info (   self,
  line 
) [inherited]

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:

def Bio.Blast.NCBIStandalone._ParametersConsumer.query_length (   self,
  line 
) [inherited]

Definition at line 1377 of file NCBIStandalone.py.

01377 
01378     def query_length(self, line):
01379         self._params.query_length, = _get_cols(
01380             line.lower(), (-1,), ncols=4, expected={0:"length", 2:"query:"})
01381         self._params.query_length = _safe_int(self._params.query_length)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HeaderConsumer.reference (   self,
  line 
) [inherited]

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
            

Reimplemented from Bio.Blast.NCBIStandalone._DescriptionConsumer.

Definition at line 1498 of file NCBIStandalone.py.

01498 
01499     def round(self, line):
01500         # Make sure nobody's trying to pass me PSI-BLAST data!
01501         raise ValueError("This consumer doesn't handle PSI-BLAST data")
        
def Bio.Blast.NCBIStandalone._HSPConsumer.sbjct (   self,
  line 
) [inherited]

Definition at line 1235 of file NCBIStandalone.py.

01235 
01236     def sbjct(self, line):
01237         m = self._sbjct_re.search(line)
01238         if m is None:
01239             raise ValueError("I could not find the sbjct in line\n%s" % line)
01240         colon, start, seq, end = m.groups()
01241         #mikep 26/9/00
01242         #On occasion, there is a blast hit with no subject match
01243         #so far, it only occurs with 1-line short "matches"
01244         #I have decided to let these pass as they appear
01245         if not seq.strip():
01246             seq = ' ' * self._query_len
01247         self._hsp.sbjct = self._hsp.sbjct + seq
01248         if self._hsp.sbjct_start is None:
01249             self._hsp.sbjct_start = _safe_int(start)
01250 
01251         self._hsp.sbjct_end = _safe_int(end)
01252         if len(seq) != self._query_len:
01253             raise ValueError( \
01254                   "QUERY and SBJCT sequence lengths don't match in line\n%s" \
01255                   % line)
01256 
01257         del self._query_start_index   # clean up unused variables
01258         del self._query_len

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._HSPConsumer.score (   self,
  line 
) [inherited]

Definition at line 1140 of file NCBIStandalone.py.

01140 
01141     def score(self, line):
01142         self._hsp.bits, self._hsp.score = _re_search(
01143             r"Score =\s*([0-9.e+]+) bits \(([0-9]+)\)", line,
01144             "I could not find the score in line\n%s" % line)
01145         self._hsp.score = _safe_float(self._hsp.score)
01146         self._hsp.bits = _safe_float(self._hsp.bits)
01147 
01148         x, y = _re_search(
01149             r"Expect\(?(\d*)\)? = +([0-9.e\-|\+]+)", line,
01150             "I could not find the expect in line\n%s" % line)
01151         if x:
01152             self._hsp.num_alignments = _safe_int(x)
01153         else:
01154             self._hsp.num_alignments = 1
01155         self._hsp.expect = _safe_float(y)

Here is the call graph for this function:

Definition at line 1264 of file NCBIStandalone.py.

Reimplemented in Bio.Blast.NCBIStandalone._PSIBlastConsumer.

Definition at line 894 of file NCBIStandalone.py.

00894 
00895     def start_descriptions(self):
00896         self._descriptions = []
00897         self._model_sequences = []
00898         self._nonmodel_sequences = []
00899         self._converged = 0
00900         self._type = None
00901         self._roundnum = None
00902 
00903         self.__has_n = 0   # Does the description line contain an N value?

Reimplemented from Bio.Blast.NCBIStandalone._HeaderConsumer.

Definition at line 1502 of file NCBIStandalone.py.

01502 
01503     def start_header(self):
01504         self.data = Record.Blast()
01505         _HeaderConsumer.start_header(self)

Definition at line 1137 of file NCBIStandalone.py.

01137 
01138     def start_hsp(self):
01139         self._hsp = Record.HSP()

Definition at line 1306 of file NCBIStandalone.py.

def Bio.Blast.NCBIStandalone._HSPConsumer.strand (   self,
  line 
) [inherited]

Definition at line 1178 of file NCBIStandalone.py.

01178 
01179     def strand(self, line):
01180         self._hsp.strand = _re_search(
01181             r"Strand\s?=\s?(\w+)\s?/\s?(\w+)", line,
01182             "I could not find the strand in line\n%s" % line)

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._ParametersConsumer.threshold (   self,
  line 
) [inherited]

Definition at line 1421 of file NCBIStandalone.py.

01421 
01422     def threshold(self, line):
01423         if line[:2] == "T:":
01424             #Assume its an old stlye line like "T: 123"
01425             self._params.threshold, = _get_cols(
01426                 line, (1,), ncols=2, expected={0:"T:"})
01427         elif line[:28] == "Neighboring words threshold:":
01428             self._params.threshold, = _get_cols(
01429                 line, (3,), ncols=4, expected={0:"Neighboring", 1:"words", 2:"threshold:"})
01430         else:
01431             raise ValueError("Unrecognised threshold line:\n%s" % line)
01432         self._params.threshold = _safe_int(self._params.threshold)
        

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone._AlignmentConsumer.title (   self,
  line 
) [inherited]

Definition at line 981 of file NCBIStandalone.py.

00981 
00982     def title(self, line):
00983         if self._alignment.title:
00984             self._alignment.title += " "
00985         self._alignment.title += line.strip()

def Bio.Blast.NCBIStandalone._HeaderConsumer.version (   self,
  line 
) [inherited]

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]

def Bio.Blast.NCBIStandalone._ParametersConsumer.window_size (   self,
  line 
) [inherited]

Definition at line 1433 of file NCBIStandalone.py.

01433 
01434     def window_size(self, line):
01435         if line[:2] == "A:":
01436             self._params.window_size, = _get_cols(
01437                 line, (1,), ncols=2, expected={0:"A:"})
01438         elif line[:25] == "Window for multiple hits:":
01439             self._params.window_size, = _get_cols(
01440                 line, (4,), ncols=5, expected={0:"Window", 2:"multiple", 3:"hits:"})
01441         else:
01442             raise ValueError("Unrecognised window size line:\n%s" % line)
01443         self._params.window_size = _safe_int(self._params.window_size)
        

Here is the call graph for this function:


Member Data Documentation

Definition at line 1496 of file NCBIStandalone.py.


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