Agent skill

Biopython Alignment

by aipoch in aipoch/medical-research-skills

Sequence alignment and alignment file processing with Biopython (Bio.Align/Bio.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment…

MITAuto-check passedResearch & Science

Install Biopython Alignment

skills CLI
$ npx skills add aipoch/medical-research-skills --skill biopython-alignment -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills biopython-alignment --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Data Analysis/biopython-alignment' .claude/skills/biopython-alignment && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
biopython-alignment
GitHub stars
2k
Token cost
~1.6k tokens
SKILL.md length
307 words
Files
6 (incl. scripts, references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

Sequence alignment and alignment file processing with Biopython (Bio.Align/Bio.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment…

  • Tasks that involve Bioinformatics
  • SKILL.md covers When to Use, Key Features, Dependencies and Example Usage, plus 1 more section
  • Runs Python scripts from its folder; calls python
  • Tasks that involve Statistics

What it does

Biopython Alignment is an agent skill from aipoch/medical-research-skills. Sequence alignment and alignment file processing with Biopython (Bio.Align/Bio.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment statistics/filtering.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `biopython-alignment_audit_result_v1.json`, `config/msa_conservation.json` and `config/task_config.json`).

It sits in Research & Science, covering Bioinformatics and Statistics. It works with Biopython. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Tasks that involve Bioinformatics
  • Tasks that involve Statistics

Example prompts

  • “/biopython-alignment”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Biopython Alignment loads about 1.6k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 59 tokens; SKILL.md has 307 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 307 words, ~1,584 tokens.

Download SKILL.mdSave it as .claude/skills/biopython-alignment/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
biopython-alignment
description
Sequence alignment and alignment file processing with Biopython (Bio.Align/Bio.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment statistics/filtering.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

biopython-alignment

When to Use

  • You need global alignment between two protein (or nucleotide) sequences and want a reproducible score and aligned strings.
  • You need local alignment to find the best matching fragment/subsequence between two DNA/RNA/protein sequences.
  • You need to read, write, or convert multiple sequence alignment (MSA) files (e.g., FASTA/Clustal/Stockholm) using Biopython I/O.
  • You want to compute alignment statistics (e.g., identity, coverage, conservation per column) and filter alignments by thresholds.
  • You need to apply substitution matrices (e.g., BLOSUM62) and tune gap penalties for biologically meaningful scoring.

Key Features

  • Pairwise alignment via Bio.Align.PairwiseAligner (global and local modes).
  • Alignment scoring with configurable match/mismatch and gap penalties.
  • Protein substitution matrices via Bio.Align.substitution_matrices (e.g., BLOSUM/PAM).
  • MSA parsing and serialization via Bio.AlignIO (read/write/format conversion).
  • Basic alignment statistics: identity, aligned length, coverage, and MSA column conservation.

Dependencies

  • biopython>=1.81
  • numpy>=1.21

Example Usage

python
# -*- coding: utf-8 -*-
"""
Runnable examples for:
1) Global protein alignment
2) Local DNA alignment (best fragment)
3) MSA parsing + column conservation

Requires: biopython, numpy
"""

from __future__ import annotations

from io import StringIO
import numpy as np

from Bio.Align import PairwiseAligner
from Bio.Align import substitution_matrices
from Bio import AlignIO


def global_protein_alignment(seq_a: str, seq_b: str) -> None:
    matrix = substitution_matrices.load("BLOSUM62")

    aligner = PairwiseAligner()
    aligner.mode = "global"
    aligner.substitution_matrix = matrix
    aligner.open_gap_score = -10.0
    aligner.extend_gap_score = -0.5

    alignments = aligner.align(seq_a, seq_b)
    best = alignments[0]

    print("=== Global protein alignment (best) ===")
    print("Score:", best.score)
    print(best)


def local_dna_alignment_best_fragment(seq_a: str, seq_b: str) -> None:
    aligner = PairwiseAligner()
    aligner.mode = "local"
    aligner.match_score = 2.0
    aligner.mismatch_score = -1.0
    aligner.open_gap_score = -2.0
    aligner.extend_gap_score = -0.5

    best = aligner.align(seq_a, seq_b)[0]

    # Extract the aligned fragment coordinates from the first aligned block.
    # aligned is a tuple: (aligned_coords_in_seq_a, aligned_coords_in_seq_b)
    a_blocks, b_blocks = best.aligned
    a_start, a_end = a_blocks[0]
    b_start, b_end = b_blocks[0]

    print("=== Local DNA alignment (best) ===")
    print("Score:", best.score)
    print(best)
    print("Best fragment in seq_a:", seq_a[a_start:a_end], f"(coords {a_start}:{a_end})")
    print("Best fragment in seq_b:", seq_b[b_start:b_end], f"(coords {b_start}:{b_end})")


def msa_column_conservation(fasta_text: str) -> None:
    handle = StringIO(fasta_text)
    msa = AlignIO.read(handle, "fasta")  # MultipleSeqAlignment

    # Convert to a 2D array of characters: shape (n_seqs, aln_len)
    arr = np.array([list(str(rec.seq)) for rec in msa], dtype="U1")
    n_seqs, aln_len = arr.shape

    # Conservation per column: fraction of the most common non-gap character.
    # Treat '-' as gap; ignore gaps when computing the most common residue.
    conservation = []
    for j in range(aln_len):
        col = arr[:, j]
        col = col[col != "-"]
        if col.size == 0:
            conservation.append(0.0)
            continue
        values, counts = np.unique(col, return_counts=True)
        conservation.append(float(counts.max() / counts.sum()))

    print("=== MSA column conservation ===")
    print("n_seqs:", n_seqs, "aln_len:", aln_len)
    print("conservation:", [round(x, 3) for x in conservation])


def main() -> None:
    # 1) Global alignment (protein)
    seq_a = "MKTAYIAKQRQISFVKSHFSRQDILD"
    seq_b = "MKLAYIAKQRQISFVKSHFTRQDILN"
    global_protein_alignment(seq_a, seq_b)

    # 2) Local alignment (DNA)
    seq_a = "ATGCGTACGTTAGC"
    seq_b = "GGGATGCGTACGAAAC"
    local_dna_alignment_best_fragment(seq_a, seq_b)

    # 3) MSA conservation (FASTA)
    fasta_text = ">s1\nACGTACGT\n>s2\nACGTTCGT\n>s3\nACGTACGA\n"
    msa_column_conservation(fasta_text)


if __name__ == "__main__":
    main()

Implementation Details

  • Pairwise alignment engine: uses Bio.Align.PairwiseAligner, which performs dynamic programming alignment under the selected mode:
    • mode="global": aligns full-length sequences end-to-end.
    • mode="local": finds the highest-scoring matching region (best subsequence pair).
  • Scoring configuration:
    • For proteins, prefer substitution_matrix (e.g., BLOSUM62) plus gap penalties (open_gap_score, extend_gap_score).
    • For nucleotides, a simple scheme is common: match_score, mismatch_score, and gap penalties.
  • Selecting the best alignment: aligner.align(a, b) returns an iterable of alignments sorted by score; use [0] for the top-scoring result.
  • Local “best fragment” extraction:
    • alignment.aligned returns aligned coordinate blocks for each sequence.
    • The first block (start, end) typically corresponds to the highest-scoring contiguous aligned region; slice the original sequences with these coordinates to obtain the fragment.
  • MSA I/O and statistics:
    • Bio.AlignIO.read(handle, fmt) parses an alignment into a MultipleSeqAlignment.
    • Column conservation can be computed as:
      max_count(non-gap residues in column) / total_non_gap_count(column).
  • Operational conventions (recommended):
    • Store runtime configuration in config/task_config.json and invoke scripts as python scripts/<task_name>.py.
    • Avoid stacking many CLI -- parameters; keep parameters in the config file.
    • Always specify encoding="utf-8" for file I/O; for JSON output use ensure_ascii=False.

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in scientific-skills/Data Analysis/biopython-alignment of aipoch/medical-research-skills.

  • SKILL.md
  • biopython-alignment_audit_result_v1.json
  • config/msa_conservation.json
  • config/task_config.json
  • references/alignment.md
  • scripts/msa_conservation.py

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Biopython Alignment next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Biopython Alignment compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Biopython Alignment this skillaipoch/medical-research-skills2k—~1.6kAutomated safety check: PassMIT
Bio Sequence StatisticsGPTomics/bioSkills1.2k1 repos~3.2kAutomated safety check: PassMIT
PyDESeq2 Differential Expressiondavila7/claude-code-templates32k12 repos~4kAutomated safety check: PassMIT
Ukb Ppp Region FetchClawBio/ClawBio1.2k—~4.6kAutomated safety check: PassMIT
Tooluniverse Epigenomicswu-yc/LabClaw1.1k2 repos~14kAutomated safety check: PassNone
Tooluniverse Metabolomics Analysiswu-yc/LabClaw1.1k2 repos~5.9kAutomated safety check: PassNone

Similar skills

  • Bio Sequence Statistics

    GPTomics/bioSkills

    Calculate assembly and sequence statistics (N50/L50, auN, NG50/NGA50, length distribution, GC content with ambiguity handling, summary reports) using Biopython.

    1.2k GitHub starsUsed in 1 repo~3.2k tokens
    Data & AnalyticsAuto-check passed
  • PyDESeq2 Differential Expression

    davila7/claude-code-templates

    Runs differential gene expression analysis on bulk RNA-seq counts with PyDESeq2: design formulas, Wald tests, FDR correction and volcano or MA plots.

    32k GitHub starsUsed in 12 repos~4k tokens
    Research & ScienceAuto-check passed
  • Ukb Ppp Region Fetch

    ClawBio/ClawBio

    Fetch a regional slice of plasma pQTL summary statistics from the UK Biobank Pharma Proteomics Project (UKB-PPP; Sun 2023 Nature) for a specific (protein, ancestry) measurement.

    1.2k GitHub stars~4.6k tokensUpdated today
    Research & ScienceAuto-check passed
  • Production-ready genomics and epigenomics data processing for BixBench questions.

    1.1k GitHub starsUsed in 2 repos~14k tokens
    Research & ScienceAuto-check passed
  • Analyze metabolomics data including metabolite identification, quantification, pathway analysis, and metabolic flux.

    1.1k GitHub starsUsed in 2 repos~5.9k tokens
    Research & ScienceAuto-check passed
  • Computes linkage disequilibrium (r2, D', composite Rogers-Huff r2), prunes correlated variants, clumps GWAS summary statistics to lead SNPs, and defines haplotype blocks with PLINK 1.9/2.0 and…

    1.2k GitHub starsUsed in 1 repo~4.7k tokens
    Research & ScienceAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 21 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 21 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Works with

Questions about Biopython Alignment

What does Biopython Alignment do?

Sequence alignment and alignment file processing with Biopython (Bio.Align/Bio.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment…. Biopython Alignment is an agent skill from aipoch/medical-research-skills.AlignIO), triggered when you need global/local pairwise alignment, MSA read/write/format conversion, or alignment statistics/filtering.

When should I use Biopython Alignment?

Biopython Alignment fits situations like: tasks that involve Bioinformatics; tasks that involve Statistics.

How do I install Biopython Alignment in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill biopython-alignment -a claude-code`. Or copy the skill folder (scientific-skills/Data Analysis/biopython-alignment in aipoch/medical-research-skills) into .claude/skills/biopython-alignment in your project. Claude Code loads it when a task matches its description.

How do I install Biopython Alignment in Codex?

Run `npx skills add aipoch/medical-research-skills --skill biopython-alignment -a codex`. Or copy the skill folder (scientific-skills/Data Analysis/biopython-alignment in aipoch/medical-research-skills) into .agents/skills/biopython-alignment in your project. Codex loads it when a task matches its description.

Can I use Biopython Alignment in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill biopython-alignment -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/biopython-alignment, .gemini/skills/biopython-alignment, .github/skills/biopython-alignment and .opencode/skills/biopython-alignment in your project.

What does Biopython Alignment need to run?

Going by SKILL.md and its folder, Biopython Alignment needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Biopython Alignment access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Biopython Alignment safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Biopython Alignment use?

Biopython Alignment is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Biopython Alignment use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Biopython Alignment?

Skills that share tags, products or a category with Biopython Alignment: Bio Sequence Statistics (GPTomics/bioSkills, 1.2k stars), PyDESeq2 Differential Expression (davila7/claude-code-templates, 32k stars), Ukb Ppp Region Fetch (ClawBio/ClawBio, 1.2k stars) and Tooluniverse Epigenomics (wu-yc/LabClaw, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Biopython Alignment?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.