blast
- Search related sequences in databases¶
- Blast(query, database, gap_open=11, gap_ext=1, matrix='BLOSUM62', blast_location=None, outfmt=0, filter_low_complexity=True)¶
Runs a protein vs. protein blast search. The results are returned according to the value of the
outfmt
parameter.- Parameters:
query (
seq.ConstSequenceHandle
) – the query sequencedatabase – The filename of the sequence database. Make sure that formatdb has been run on the database and the <database>.pin file exists.
matrix – The substitution matrix to be used. Must be one of ‘BLOSUM45’, ‘BLOSUM62’, ‘BLOSUM80’, ‘PAM30’, ‘PAM70’.
gap_open – Gap opening penalty. Note that only a subset of gap opening penalties is supported for each substitutition matrix. Consult the blast docs for more information.
gap_ext – Gap extension penalty. Only a subset of gap extension penalties are supported for each of the substitution matrices. Consult the blast docs for more information.
outfmt – output format, where ‘0’ corresponds to default output (parsed blast output and 1 to raw string output).
filter_low_complexity – Mask off segments of the query sequence that have low compositional complexity, as determined by the SEG program of Wootton & Federhen (Computers and Chemistry, 1993)
- Return type:
BlastHit
(withoutfmt=0
) orstr
(withoutfmt=1
)
- ParseBlastOutput(string, seqid_thres=0, evalue_thres=inf)¶
Parses the blast output and returns a list of BlastHits setting no seqid_thres or evalue_thres, restores default behaviour without filtering
- class AlignedPatch(aln, bit_score, score, evalue, seqid)¶
An aligned patch, aka. HSP
- aln¶
The local alignment. Sequence offset of both sequences in the alignment are set to the starting position in the query and target sequence, respectively.
- Type:
- bit_score¶
The bit score of the HSP
- score¶
The score of the HSP
- evalue¶
The E-value of the HSP
- seqid¶
The sequence identity of the HSP
- class BlastHit(identifier, aligned_patches)¶
A positive match found by BLAST.
Each blast hit consists of one or more HSPs, encoded by the
AlignedPatch
class.- identifier¶
The identifier of the matching sequence
- aligned_patches¶
list of
AlignedPatch
instances holding the actual HSPs.
- class BlastError(brief, details)¶