biopython
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Author
Category
Development ToolsInstall
Hot:6
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-biopython&locale=en&source=copy
Biopython: Python Bioinformatics Computational Toolkit
Overview of Capabilities
Biopython is a powerful Python toolkit for bioinformatics used to handle DNA, RNA, and protein sequences, parse biological file formats such as FASTA and GenBank, access NCBI databases, perform BLAST searches and sequence alignments, and carry out other computational molecular biology tasks.
Use Cases
1. Sequence Data Processing and Format Conversion
When you need to process biological sequence files in bulk, Biopython is an ideal choice. It can read and write dozens of biological file formats including FASTA, GenBank, FASTQ, PDB, and mmCIF, making format conversion easy. For example, you can batch-convert GenBank files to FASTA, extract specific records from large sequence files, or calculate sequence statistics such as GC content, molecular weight, and melting temperature.
2. NCBI Database Access and BLAST Automation
When programmatic access to NCBI databases (such as GenBank, PubMed, Protein) is required, the Bio.Entrez module provides full API support. You can automate BLAST searches, bulk-download sequence data, parse BLAST results, and filter by E-value or similarity. This is especially useful for building custom bioinformatics analysis pipelines and avoiding the tedium of manual data downloads.
3. Sequence Alignment and Phylogenetic Analysis
Biopython supports pairwise and multiple sequence alignments and can compute alignment scores using substitution matrices like BLOSUM and PAM. With the Bio.Phylo module you can read, manipulate, and visualize phylogenetic trees (Newick, NEXUS formats), build distance matrices from sequence alignments, and construct evolutionary trees using methods like neighbor joining (NJ). This is helpful for understanding relationships between species or the evolution of protein families.
Core Features
1. Sequence Operations and File I/O
Bio.Seq and Bio.SeqIO provide comprehensive sequence-processing capabilities, including transcription, translation, reverse complement, and codon table lookup. They support iterative processing of large files to avoid memory overflow. You can easily create SeqRecord objects to manage sequence annotations and use Bio.SeqUtils to compute various sequence statistics.
2. Structural Bioinformatics Analysis
The Bio.PDB module parses protein 3D structure files (PDB and mmCIF) and allows navigation of structures according to the SMCRA hierarchy (Structure-Model-Chain-Residue-Atom). You can compute interatomic distances, angles, and dihedral angles, perform structural superposition and RMSD calculations, assign secondary structure using DSSP, or extract sequence information from PDB files.
3. Database Querying and Bulk Analysis
Access the NCBI Entrez system via Bio.Entrez to search PubMed literature, download GenBank records, retrieve gene information, and more. Combined with Bio.Blast, you can run BLAST online or locally and parse XML-formatted results. For workflows that need to process large volumes of data, Biopython offers efficient bulk-processing capabilities, making it well suited for building automated analysis pipelines.
Frequently Asked Questions
What is Biopython? Who is it suitable for?
Biopython is an open-source Python toolkit for bioinformatics. Version 1.85 (released January 2025) supports Python 3. It is suitable for biologists, bioinformatics researchers, data scientists, and anyone who needs to work with biological sequence data in Python. If you need to analyze sequences in bulk, automate NCBI queries, or build bioinformatics pipelines, Biopython is one of the most mature Python solutions available.
How to choose between Biopython, gget, and bioservices?
Biopython is suited for bulk processing, custom pipelines, and deep analysis, offering the most comprehensive module coverage. gget is better for quick queries and simple tasks and is command-line friendly. bioservices excels at integrating multiple biological database services (e.g., UniProt, KEGG) and is suitable when cross-platform data integration is required. If you only need simple sequence lookups, gget is faster; for complex analysis workflows, choose Biopython; for accessing multiple bioservice APIs, choose bioservices.
Which file formats does Biopython support? Can it handle PDB structures?
Biopython supports more than 30 biological file formats, including FASTA, GenBank, FASTQ, EMBL, PDB, mmCIF, Clustal, Phylip, NEXUS, and Newick. The Bio.PDB module can fully parse protein 3D structures, compute structural parameters, extract atomic coordinates, and analyze secondary structure. Structural biologists can use it for structure comparison, distance calculations, and superposition analyses.