Bio.Blast.NCBIWWW module

Code to invoke the NCBI BLAST server over the internet.

This module provides code to work with the WWW version of BLAST provided by the NCBI.

Bio.Blast.NCBIWWW.qblast(program, database, sequence, url_base='', auto_format=None, composition_based_statistics=None, db_genetic_code=None, endpoints=None, entrez_query='(none)', expect=10.0, filter=None, gapcosts=None, genetic_code=None, hitlist_size=50, i_thresh=None, layout=None, lcase_mask=None, matrix_name=None, nucl_penalty=None, nucl_reward=None, other_advanced=None, perc_ident=None, phi_pattern=None, query_file=None, query_believe_defline=None, query_from=None, query_to=None, searchsp_eff=None, service=None, threshold=None, ungapped_alignment=None, word_size=None, short_query=None, alignments=500, alignment_view=None, descriptions=500, entrez_links_new_window=None, expect_low=None, expect_high=None, format_entrez_query=None, format_object=None, format_type='XML', ncbi_gi=None, results_file=None, show_overview=None, megablast=None, template_type=None, template_length=None)

BLAST search using NCBI’s QBLAST server or a cloud service provider.

Supports all parameters of the old qblast API for Put and Get.

Please note that NCBI uses the new Common URL API for BLAST searches on the internet ( Thus, some of the parameters used by this function are not (or are no longer) officially supported by NCBI. Although they are still functioning, this may change in the future.

The Common URL API ( allows doing BLAST searches on cloud servers. To use this feature, please set url_base='' and format_object='Alignment'. For more details, please see

Some useful parameters:

  • program blastn, blastp, blastx, tblastn, or tblastx (lower case)

  • database Which database to search against (e.g. “nr”).

  • sequence The sequence to search.

  • ncbi_gi TRUE/FALSE whether to give ‘gi’ identifier.

  • descriptions Number of descriptions to show. Def 500.

  • alignments Number of alignments to show. Def 500.

  • expect An expect value cutoff. Def 10.0.

  • matrix_name Specify an alt. matrix (PAM30, PAM70, BLOSUM80, BLOSUM45).

  • filter “none” turns off filtering. Default no filtering

  • format_type “HTML”, “Text”, “ASN.1”, or “XML”. Def. “XML”.

  • entrez_query Entrez query to limit Blast search

  • hitlist_size Number of hits to return. Default 50

  • megablast TRUE/FALSE whether to use MEga BLAST algorithm (blastn only)

  • short_query TRUE/FALSE whether to adjust the search parameters for a

    short query sequence. Note that this will override manually set parameters like word size and e value. Turns off when sequence length is > 30 residues. Default: None.

  • service plain, psi, phi, rpsblast, megablast (lower case)

This function does no checking of the validity of the parameters and passes the values to the server as is. More help is available at: