Analyze Biological Data with Biopython
Reference skill for Biopython 1.85 - sequences, alignments, NCBI database access, BLAST, protein structures, and phylogenetic trees.
Why it matters
Leverage Biopython to perform complex computational molecular biology tasks, from sequence manipulation and database access to structural bioinformatics and phylogenetics.
Outcomes
What it gets done
Manipulate DNA, RNA, and protein sequences.
Access and process data from NCBI databases.
Perform sequence alignments and BLAST searches.
Analyze protein structures and phylogenetic trees.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-biopython | bash Overview
Biopython: Computational Molecular Biology in Python
Reference skill for Biopython 1.85 covering seven functional areas - sequence handling, alignment analysis, NCBI database access via Entrez, BLAST operations, structural bioinformatics (Bio.PDB), phylogenetics (Bio.Phylo), and advanced features like motifs and population genetics - with working code patterns and troubleshooting guidance for each. Use it for any computational molecular biology task in Python: sequence manipulation, file format conversion, NCBI/BLAST queries, protein structure analysis, or phylogenetic tree building and visualization.
What it does
This skill provides organized reference documentation and working code patterns for Biopython 1.85, the Python toolkit for computational molecular biology. It covers seven functional areas: sequence handling (Bio.Seq/Bio.SeqIO), alignment analysis (Bio.Align/Bio.AlignIO), NCBI database access (Bio.Entrez), BLAST operations (Bio.Blast), structural bioinformatics (Bio.PDB), phylogenetics (Bio.Phylo), and advanced features like sequence motifs and population genetics.
When to use - and when NOT to
Use it for any computational molecular biology task: manipulating DNA/RNA/protein sequences, reading or converting biological file formats (FASTA, GenBank, FASTQ, PDB, mmCIF), searching NCBI databases (GenBank, PubMed, Protein, Gene) via Entrez, running or parsing BLAST searches, performing pairwise or multiple sequence alignments, analyzing protein structures from PDB files, building or visualizing phylogenetic trees, finding sequence motifs, calculating sequence statistics (GC content, molecular weight, melting temperature), or working with population genetics data.
Inputs and outputs
Install with uv pip install biopython (requires Python 3 and NumPy). NCBI database access requires setting Entrez.email (mandatory) and optionally Entrez.api_key for a higher rate limit (10 requests/sec instead of 3). Each functional area has a dedicated reference file (references/sequence_io.md, alignment.md, databases.md, blast.md, structure.md, phylogenetics.md, advanced.md) plus quick code examples - e.g. parsing a FASTA file with SeqIO.parse, running a pairwise alignment with Align.PairwiseAligner, searching PubMed with Entrez.esearch, running a BLAST query with NCBIWWW.qblast, parsing a PDB structure and measuring inter-atom distance with PDBParser, or reading and querying a Newick tree with Phylo.read. Common end-to-end patterns are documented too: fetch a sequence from GenBank, run a full sequence-analysis pipeline, BLAST and fetch top hit sequences, or build a phylogenetic tree directly from an alignment.
Integrations
Biopython wraps access to external bioinformatics resources - NCBI's Entrez databases and BLAST web service - alongside local file-format parsing (PDB/mmCIF structures, Newick/NEXUS/phyloXML trees) and substitution-matrix-based alignment (BLOSUM, PAM). The skill also documents troubleshooting for common failure modes: missing Entrez logger handlers, HTTP 400 errors from NCBI, EOF parsing errors, mismatched-length alignment failures, slow BLAST searches, and PDB parser warnings.
Best practices it documents
Always read the relevant reference documentation before writing code, use grep to search reference files for specific functions or examples, validate file formats before parsing, and handle missing data gracefully since not all records have all fields. It also recommends caching downloaded data instead of repeatedly fetching the same sequences, respecting NCBI rate limits via API keys and proper delays, testing with small datasets before processing large files, keeping Biopython updated, using the appropriate genetic code table for translation, and documenting analysis parameters for reproducibility.
Who it's for
Bioinformaticians and computational biology researchers working in Python who need correct, working code for sequence analysis, database queries, structural analysis, or phylogenetics without re-deriving Biopython's API surface from scratch each time.
Source README
Biopython is a comprehensive set of freely available Python tools for biological computation. It provides functionality for sequence manipulation, file I/O, database access, structural bioinformatics, phylogenetics, and many other bioinformatics tasks. The current version is Biopython 1.85 (released January 2025), which supports Python 3 and requires NumPy.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.