Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.Blast.Record.HSP Class Reference

List of all members.

Public Member Functions

def __init__
def __str__

Public Attributes

 score
 bits
 expect
 num_alignments
 identities
 positives
 gaps
 align_length
 strand
 frame
 query
 query_start
 query_end
 match
 sbjct
 sbjct_start
 sbjct_end

Detailed Description

Stores information about one hsp in an alignment hit.

Members:
score           BLAST score of hit.  (float)
bits            Number of bits for that score.  (float)
expect          Expect value.  (float)
num_alignments  Number of alignments for same subject.  (int)
identities      Number of identities (int) if using the XML parser.
                Tuple of numer of identities/total aligned (int, int)
                if using the (obsolete) plain text parser.
positives       Number of positives (int) if using the XML parser.
                Tuple of numer of positives/total aligned (int, int)
                if using the (obsolete) plain text parser.
gaps            Number of gaps (int) if using the XML parser.
                Tuple of numer of gaps/total aligned (int, int) if
                using the (obsolete) plain text parser.
align_length    Length of the alignment. (int)
strand          Tuple of (query, target) strand.
frame           Tuple of 1 or 2 frame shifts, depending on the flavor.

query           The query sequence.
query_start     The start residue for the query sequence.  (1-based)
query_end       The end residue for the query sequence.  (1-based)
match           The match sequence.
sbjct           The sbjct sequence.
sbjct_start     The start residue for the sbjct sequence.  (1-based)
sbjct_end       The end residue for the sbjct sequence.  (1-based)

Not all flavors of BLAST return values for every attribute:
          score     expect     identities   positives    strand  frame
BLASTP     X          X            X            X
BLASTN     X          X            X            X          X
BLASTX     X          X            X            X                  X
TBLASTN    X          X            X            X                  X
TBLASTX    X          X            X            X                 X/X

Note: for BLASTX, the query sequence is shown as a protein sequence,
but the numbering is based on the nucleotides.  Thus, the numbering
is 3x larger than the number of amino acid residues.  A similar effect
can be seen for the sbjct sequence in TBLASTN, and for both sequences
in TBLASTX.

Also, for negative frames, the sequence numbering starts from
query_start and counts down.

Definition at line 97 of file Record.py.


Constructor & Destructor Documentation

Definition at line 144 of file Record.py.

00144 
00145     def __init__(self):
00146         self.score = None
00147         self.bits = None
00148         self.expect = None
00149         self.num_alignments = None
00150         self.identities = (None, None)
00151         self.positives = (None, None)
00152         self.gaps = (None, None)
00153         self.align_length = None
00154         self.strand = (None, None)
00155         self.frame = ()
00156         
00157         self.query = ''
00158         self.query_start = None
00159         self.query_end = None
00160         self.match = ''
00161         self.sbjct = ''
00162         self.sbjct_start = None
00163         self.sbjct_end = None

Here is the caller graph for this function:


Member Function Documentation

Definition at line 164 of file Record.py.

00164 
00165     def __str__(self):
00166         lines = ["Score %i (%i bits), expectation %0.1e, alignment length %i" \
00167                  % (self.score, self.bits, self.expect, self.align_length)]
00168         if self.align_length < 50:
00169             lines.append("Query:%s %s %s" % (str(self.query_start).rjust(8),
00170                                        str(self.query),
00171                                        str(self.query_end)))
00172             lines.append("               %s" \
00173                          % (str(self.match)))
00174             lines.append("Sbjct:%s %s %s" % (str(self.sbjct_start).rjust(8),
00175                                        str(self.sbjct),
00176                                        str(self.sbjct_end)))
00177         else:
00178             lines.append("Query:%s %s...%s %s" \
00179                          % (str(self.query_start).rjust(8),
00180                             str(self.query)[:45],
00181                             str(self.query)[-3:],
00182                             str(self.query_end)))
00183             lines.append("               %s...%s" \
00184                          % (str(self.match)[:45],
00185                             str(self.match)[-3:]))
00186             lines.append("Sbjct:%s %s...%s %s" \
00187                          % (str(self.sbjct_start).rjust(8),
00188                             str(self.sbjct)[:45],
00189                             str(self.sbjct)[-3:],
00190                             str(self.sbjct_end)))
00191         return "\n".join(lines)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 152 of file Record.py.

Definition at line 146 of file Record.py.

Definition at line 147 of file Record.py.

Definition at line 154 of file Record.py.

Definition at line 151 of file Record.py.

Definition at line 149 of file Record.py.

Definition at line 159 of file Record.py.

Definition at line 148 of file Record.py.

Definition at line 150 of file Record.py.

Definition at line 156 of file Record.py.

Definition at line 158 of file Record.py.

Definition at line 157 of file Record.py.

Definition at line 160 of file Record.py.

Definition at line 162 of file Record.py.

Definition at line 161 of file Record.py.

Definition at line 145 of file Record.py.

Definition at line 153 of file Record.py.


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