← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-database-access-blast-searches / references / usage-guide.md

BLAST Searches Usage Guide

Overview

Run remote BLAST searches against NCBI's servers using Bio.Blast.NCBIWWW. Encodes the program-vs-database decision matrix, Karlin-Altschul E-value math and why bit-scores beat E-values across databases, the max_target_seqs misinterpretation that has biased many published workflows (Shah 2019), composition-based-statistics modes, word-size choice for cross-species vs intra-species DNA, and reproducibility traps with nt/nr.

Prerequisites

pip install biopython

No API key required for remote BLAST; one search at a time is the polite cap.

Quick Start

Example Prompts

Picking the right program

"I have an unknown DNA sequence from an environmental sample. Run blastn against refseq_select_rna with word_size=11 and E-value cutoff 1e-10. Don't use megablast -- it requires 28-nt exact match seeds and will miss divergent homologs."

Reproducibility-safe database choice

"I'm BLASTing for a publication. Use refseq_select instead of nr/nt because those change daily and aren't reproducible. If I need the broader search, record today's date and archive a frozen copy of the database snapshot."

Avoiding the max_target_seqs trap

"Set hitlist_size=500 not 10. The Bio.Blast hitlist_size parameter maps to BLAST+'s max_target_seqs, which is an early-termination heuristic, not 'top N by E-value' (Shah et al. 2019). Then post-filter to the top 10 by bit-score in Python."

"BLAST this 12-aa proteomics peptide against swissprot. Use matrix='PAM30', word_size=2, expect=1000, composition_based_statistics=3. Default BLOSUM62/word=3 will miss everything for queries this short."

Cross-database analysis caveat

"I have results from a blastp vs nr and a blastp vs swissprot for the same query. Don't compare E-values across databases -- they scale with database size. Sort by bit-score for cross-DB comparison."

What the Agent Will Do

  1. Choose program from the (query molecule, target molecule) pair and the species-distance question.
  2. Choose database from the reproducibility-vs-coverage tradeoff (refseq_select for stability; nt/nr only with snapshot date).
  3. Set word_size, matrix, and composition-based-statistics appropriate for query length and protein composition.
  4. Set hitlist_size large (500+) to dodge the max_target_seqs trap; post-filter top N.
  5. Use entrez_query for pre-filtering by organism (faster and more meaningful E-values than post-filter).
  6. Parse XML with NCBIXML.read(); compute identity and coverage from HSP attributes.
  7. Sort by bit-score, not E-value, when comparing across databases.
  8. Recommend defection to local-blast / DIAMOND / MMseqs2 for >50 sequences.

Tips