biopython-sequence-analysis
Biopython sequence analysis: parse FASTA/FASTQ/GenBank/GFF (SeqIO), NCBI Entrez (esearch/efetch/elink), remote/local BLAST, pairwise/MSA alignment (PairwiseAligner, MUSCLE/ClustalW), phylogenetic trees (Phylo). Use for gene family studies, phylogenomics, comparative genomics, NCBI pipelines. For PCR/restriction/cloning use biopython-molecular-biology; for SAM/BAM use pysam.
npx skills add BioTender-max/awesome-bio-agent-skills --skill biopython-sequence-analysis --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Parses and converts biological sequence formats, retrieves data from NCBI, performs BLAST (remote or local), runs pairwise or multiple sequence alignment, and handles phylogenetic trees. It also covers random-access indexing and basic phylogenetic tree traversal and visualization workflows.
How it works
- Uses SeqIO for reading, writing, and converting formats (FASTA, FASTQ, GenBank, GFF) and SeqIO.index() for random access; demonstrates converting GenBank to FASTA and indexing large FASTA files.
- Employs Entrez for programmatic NCBI access: esearch to find records, efetch to download full records, elink to find related records, and esummary for metadata; enforces Entrez.email and rate limits.
- Accesses BLAST remotely via NCBIWWW.qblast() and parses results with NCBIXML; includes example thresholds and data extraction from alignments and HSPs. Also shows local BLAST+ usage with subprocess: makeblastdb, blastp, and parsing with NCBIXML.
- Handles phylogenetic trees with Bio.Phylo: parsing Newick strings, counting terminals, rooting with outgroups, computing distances, pruning, and traversing clades; supports visualization via matplotlib.
- Demonstrates PairwiseAligner for pairwise sequence alignment with configurable modes (global/local), gap penalties, and substitution matrices; includes examples for identity calculation and batch identity matrices.
When to use it
- When you need to download a gene family from NCBI, align sequences, and build a phylogenetic tree.
- When parsing GenBank or GFF3 annotation to extract CDS sequences.
- When performing a BLAST search against nt/nr, filtering hits, and fetching sequences.
- When computing pairwise identities or scoring alignments with standard matrices.
- When indexing large multi-FASTA/FASTQ files for random access.
- When converting between formats in a single call.
- When traversing, rooting, pruning, or annotating a Newick/Nexus tree programmatically.
- When working with SAM/BAM files use pysam; for ecological metrics use scikit-bio; for quick NCBI queries use gget.
What it can touch
- Uses Biopython packages: Bio.SeqIO, Bio.Entrez, Bio.Blast, Bio.Phylo, Bio.SeqUtils, Bio.Align, and associated modules.
- Optional tool dependencies shown: MUSCLE/ClustalW for alignment wrappers, local BLAST+ tools (makeblastdb, blastp) for offline searches.
Caveats
- Requires Python packages: biopython, numpy, matplotlib; optional local BLAST+ tools may require separate installation.
- Entrez usage requires setting Entrez.email and respects 3 req/s rate limit (10 req/s with an API key).
- Local BLAST workflows depend on external executables being installed and accessible in PATH.
- License noted as Biopython License (BSD-like); no explicit license text in these excerpts beyond that.
# Biopython: Sequence Analysis Toolkit ## Overview Biopython provides a comprehensive suite of modules for sequence-centric bioinformatics: reading and writing every major biological file format (FASTA, FASTQ, GenBank, GFF), querying NCBI databases programmatically, running BLAST searches and parsing results, aligning sequences pairwise or in multiple-sequence alignments, and building and visualizing phylogenetic trees. This skill focuses on analysis workflows — from NCBI data retrieval through alignment to phylogenetic inference. For PCR primer design, restriction enzyme digestion, cloning simulation, protein structure analysis (Bio.PDB), and molecular weight/Tm calculations, see **biopython-molecular-biology**. ## When to Use - Download a gene family from NCBI Nucleotide/Protein, align sequences, and construct a phylogenetic tree - Parse GenBank or GFF3 annotation files and extract CDS sequences for a set of features - Run a BLAST search against NCBI `nt` or `nr`, filter significant hits, and fetch their full sequences - Compute pairwise sequence identities or score alignments with BLOSUM62/PAM250 matrices - Index a large multi-FASTA or FASTQ file with `SeqIO.index()` for random-
- Overview
- When to Use
- Prerequisites
- Quick Start
- Core API
- Module 1: SeqIO — File Parsing and Format Conversion
- Module 2: Seq and SeqRecord — Sequence Objects and Feature Annotations
- Module 3: Entrez — Programmatic NCBI Database Access
- Module 4: BLAST — Remote and Local Sequence Similarity Search
- Module 5: Phylo — Tree Parsing, Manipulation, and Visualization
- Module 6: PairwiseAligner — Pairwise Sequence Alignment
- Key Concepts
- SeqRecord and Feature Coordinates
- Phylo Clade Objects
pip install biopython numpy matplotlib conda install -c bioconda blast # optional, for local BLAST
What does the biopython-sequence-analysis skill do?
Biopython sequence analysis: parse FASTA/FASTQ/GenBank/GFF (SeqIO), NCBI Entrez (esearch/efetch/elink), remote/local BLAST, pairwise/MSA alignment (PairwiseAligner, MUSCLE/ClustalW), phylogenetic trees (Phylo). Use for gene family studies, phylogenomics, comparative genomics, NCBI pipelines. For PCR/restriction/cloning use biopython-molecular-biology; for SAM/BAM use pysam.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill biopython-sequence-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
