This document is for OpenStructure version 1.6, the latest version is 2.7 !

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 as a list of BlastHit instances.

  • query (seq.ConstSequenceHandle) – the query sequence
  • database – 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 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)
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


The local alignment. Sequence offset of both sequences in the alignment are set to the starting position in the query and target sequence, respectively.


The bit score of the HSP


The score of the HSP


The E-value of the HSP


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.


The identifier of the matching sequence


list of AlignedPatch instances holding the actual HSPs.

class BlastError(brief, details)


Enter search terms or a module, class or function name.


Documentation is available for the following OpenStructure versions:

dev / 2.7 / 2.6 / 2.5 / 2.4 / 2.3.1 / 2.3 / 2.2 / 2.1 / 2.0 / 1.9 / 1.8 / 1.7.1 / 1.7 / (Currently viewing 1.6) / 1.5 / 1.4 / 1.3 / 1.2 / 1.11 / 1.10 / 1.1

This documentation is still under heavy development!
If something is missing or if you need the C++ API description in doxygen style, check our old documentation for further information.