A comprehensive toolbox for computational molecular biology; use it when you need programmatic sequence/structure parsing, batch bioinformatics pipelines, or automated NCBI/BLAST workflows.
Instrucciones de origen · Vista previa de solo lectura
name
biopython
description
A comprehensive toolbox for computational molecular biology; use it when you need programmatic sequence/structure parsing, batch bioinformatics pipelines, or automated NCBI/BLAST workflows.
Provide an input.fasta in the same directory, e.g.:
>demo
ATCGATCGATCGATCGATCG
Implementation Details
Streaming I/O for large datasets: Prefer iterator-based parsing (SeqIO.parse) to avoid loading entire files into memory. Use SeqIO.read only when exactly one record is expected.
Entrez configuration and rate limits:
Always set Entrez.email (NCBI requirement).
Optionally set Entrez.api_key to increase request limits.
In batch jobs, add delays (e.g., time.sleep(0.34) as a conservative baseline) and implement retries for transient HTTP failures.
BLAST considerations:
NCBIWWW.qblast(...) is convenient but can be slow and is not ideal for high-throughput workloads.
Parse results with NCBIXML.read(...) (single record) or NCBIXML.parse(...) (multiple records).
Filter hits by HSP metrics (e-value, identity) by iterating alignment.hsps.
Sequence statistics and transformations:
Use Bio.SeqUtils.gc_fraction(seq) for GC fraction (returns 0–1).
Use seq.translate(table=...) with the correct genetic code table for reproducibility.
Structure parsing (if used):
Use Bio.PDB.PDBParser(QUIET=True) to suppress warnings when appropriate.
Navigate the SMCRA hierarchy (Structure → Model → Chain → Residue → Atom) for robust traversal and geometry calculations.