BLAST Support - ajmoore143/KEGGBLAST GitHub Wiki
BLAST Support
KEGGBLAST provides two ways to BLAST your newly exported FASTA files against NCBI’s “nr” database (or any other you choose):
Tool | Interface | Output Format | Taxonomic Filter | Notes |
---|---|---|---|---|
gget | Python API | JSON | ❌ No | Fast setup, minimal dependencies |
NCBI API | HTTP POST | JSON | ✅ Yes (txid… ) |
Full taxonomy support, needs API key |
1. gget BLAST (no tax filter)
from keggblast.blast_gget import run_gget_blast_all
run_gget_blast_all(
program="blastp",
database="nr",
query_folder="fasta_output/hsa",
output_folder="blast_results_gget"
)
Produces one JSON file per FASTA (e.g., GENE1_blastp_blast.json).
-
Pros:
-
No need for NCBI_API_KEY
-
Instant JSON response
-
-
Cons:
- Cannot specify txid####[ORGN] to limit hits by taxonomy
2. NCBI API BLAST (with optional tax filter)
from keggblast.blast_ncbi import run_ncbi_blast_all
run_ncbi_blast_all(
program="blastp",
database="nr",
query_folder="fasta_output/hsa",
output_folder="blast_results_ncbi",
tax_query="txid4751[ORGN]" # restrict to Fungi
)
-
Produces one JSON per FASTA.
-
Pros:
-
Can do txid4751[ORGN], txid9606[ORGN], etc.
-
Official NCBI endpoints (more stable)
-
-
Cons:
-
Requires export NCBI_API_KEY=… for high throughput
-
Slightly more setup (XML parsing vs. JSON)
-