Skip to content
Skillpedia
Misc51k · #1840

biopython

Lets your agent manipulate biological sequence data and access genetic information. It's useful for molecular analysis and automating biology tasks.

What it does

This tool helps you work with molecular biology information, like DNA or protein sequences. It allows you to read, write, and manipulate this data, as well as access scientific databases.

When to use it

  • ✓When you have DNA or protein sequences to analyze.
  • ✓When you need to read or save files with biological data (like FASTA or GenBank).
  • ✓To search for information in scientific databases like PubMed.

Example of what to ask your AI

“Analyze this DNA sequence and tell me its GC content.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/biopython/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/biopython/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses a library called Biopython, which contains various ready-to-use functions for common computational biology tasks. It can read different file formats and interact with online databases.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add K-Dense-AI/scientific-agent-skills --skill biopython

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/biopython/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Biopython: Computational Molecular Biology in Python

Overview

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. These examples target Biopython 1.88 (released 6 August 2026), tested here on Python 3.13. It requires Python 3.10+ and NumPy; Python 3.10 support is deprecated. Upgrade to 1.88 for its Bio.Nexus parser security fix, in addition to the Entrez XML fix in 1.87. See the release notes. Local example checks and external-service limits are recorded in references/review.md; examples requiring user files or external programs are illustrative unless listed there as exercised.

When to Use This Skill

Use this skill when:

  • Working with biological sequences (DNA, RNA, or protein)
  • Reading, writing, or converting biological file formats (FASTA, GenBank, FASTQ, PDB, mmCIF, etc.)
  • Accessing NCBI databases (GenBank, PubMed, Protein, Gene, etc.) via Entrez
  • Running BLAST searches or parsing BLAST results
  • Performing sequence alignments (pairwise or multiple sequence alignments)
  • Analyzing protein structures from PDB files
  • Creating, manipulating, or visualizing phylogenetic trees
  • Finding sequence motifs or analyzing motif patterns
  • Calculating sequence statistics (GC content, molecular weight, melting temperature, etc.)
  • Performing structural bioinformatics tasks
  • Working with population genetics data
  • Any other computational molecular biology task

Core Capabilities

Biopython is organized into modular sub-packages, each addressing specific bioinformatics domains:

  1. Sequence Handling - Bio.Seq and Bio.SeqIO for sequence manipulation and file I/O
  2. Alignment Analysis - Bio.Align and Bio.AlignIO for pairwise and multiple sequence alignments
  3. Database Access - Bio.Entrez for programmatic access to NCBI databases
  4. BLAST Operations - Bio.Blast for running and parsing BLAST searches
  5. Structural Bioinformatics - Bio.PDB for working with 3D protein structures
  6. Phylogenetics - Bio.Phylo for phylogenetic tree manipulation and visualization
  7. Advanced Features - Motifs, population genetics, sequence utilities, and more

Installation and Setup

Install the current stable Biopython release with an explicit version pin for reproducibility:

uv pip install "biopython==1.88"

For NCBI database access, always set your email address (required by NCBI). For reusable software, set a stable Entrez.tool value and register the tool/email with NCBI. For higher rate limits (10 req/s instead of 3 req/s), read only NCBI_API_KEY from the environment — do not hardcode keys or load unrelated environment variables:

import os
from Bio import Entrez

Entrez.email = "your.email@example.com"  # required — use your real email
Entrez.tool = "your_tool_name"  # optional but recommended for reusable software

# Optional: register at https://www.ncbi.nlm.nih.gov/account/settings/
if api_key := os.environ.get("NCBI_API_KEY"):
    Entrez.api_key = api_key

Using This Skill

This skill provides comprehensive documentation organized by functionality area. When working on a task, consult the relevant reference documentation:

1. Sequence Handling (Bio.Seq & Bio.SeqIO)

Reference: references/sequence_io.md

Use for:

  • Creating and manipulating biological sequences
  • Reading and writing sequence files (FASTA, GenBank, FASTQ, etc.)
  • Converting between file formats
  • Extracting sequences from large files
  • Sequence translation, transcription, and reverse complement
  • Working with SeqRecord objects

Quick example:

from Bio import SeqIO

# Read sequences from FASTA file
for record in SeqIO.parse("sequences.fasta", "fasta"):
    print(f"{record.id}: {len(record.seq)} bp")

# Convert GenBank to FASTA
SeqIO.convert("input.gb", "genbank", "output.fasta", "fasta")

2. Alignment Analysis (Bio.Align & Bio.AlignIO)

Reference: references/alignment.md

Use for:

  • Pairwise sequence alignment (global and local)
  • Reading and writing multiple sequence alignments
  • Using substitution matrices (BLOSUM, PAM)
  • Calculating alignment statistics
  • Customizing alignment parameters

Quick example:

from Bio import Align

# Pairwise alignment

…
FAQ

Do I need to know how to program to use this?

You don't need to be an experienced programmer. The tool simplifies the use of functions, but understanding the basics of what you want to do with the biological data is helpful.

How does the tool access databases?

It uses a system called Entrez to connect to NCBI databases, such as PubMed and GenBank, allowing you to search and download information directly.

What types of files does it understand?

It understands several common biology formats, like FASTA, GenBank, PDB, among others, making it easier to exchange data between different programs.

Details

Original description by the author

Provides Biopython workflows for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Supports batch processing, custom molecular-biology pipelines, BLAST automation, structure analysis, and motif analysis.

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1840
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills