Agent skill

Bio Restriction Fragment Analysis

by GPTomics in GPTomics/bioSkills

Predict restriction digest fragment sizes and gel patterns using Biopython Bio.Restriction.

MITAuto-check passedResearch & Science

Install Bio Restriction Fragment Analysis

skills CLI
$ npx skills add GPTomics/bioSkills --skill bio-restriction-fragment-analysis -a claude-code

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

GitHub CLI
$ gh skill install GPTomics/bioSkills bio-restriction-fragment-analysis --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/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/restriction-analysis/fragment-analysis .claude/skills/bio-restriction-fragment-analysis && 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
bio-restriction-fragment-analysis
GitHub stars
1.2k
Used in
1 other repo
Token cost
~2.6k tokens
SKILL.md length
888 words
Files
4
Skills in repo
559
Repo updated
First seen
Licence
MIT

At a glance

Predict restriction digest fragment sizes and gel patterns using Biopython Bio.Restriction.

  • Predicting the fragments from a digest
  • SKILL.md covers Version Compatibility, Fragment Count By Topology, Predict Fragment Sizes and Linear vs Circular Digestion, plus 8 more sections
  • Runs Python scripts from its folder; calls pip
  • Planning a diagnostic digest to verify a clone

What it does

Bio Restriction Fragment Analysis is an agent skill from GPTomics/bioSkills. Predict restriction digest fragment sizes and gel patterns using Biopython Bio.Restriction. Computes fragment lengths and sequences for single and double digests on linear or circular DNA, and interprets them against an agarose gel. Use when predicting the fragments from a digest, planning a diagnostic digest to verify a clone, or matching observed gel bands to an expected pattern.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files (for example `examples/gel_simulation.py`, `examples/predict_fragments.py` and `usage-guide.md`).

It sits in Research & Science, covering Bioinformatics. It works with Biopython. The repository describes itself as: a set of SKILLS.md for doing bioinformatics with agents like claude code. The licence is MIT.

When your agent uses it

  • Predicting the fragments from a digest
  • Planning a diagnostic digest to verify a clone
  • Matching observed gel bands to an expected pattern

Example prompts

  • “/bio-restriction-fragment-analysis”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit d91ed3d. 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 script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

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

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    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

Bio Restriction Fragment Analysis loads about 2.6k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 888 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 888 words, ~2,590 tokens.

Download SKILL.mdSave it as .claude/skills/bio-restriction-fragment-analysis/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
bio-restriction-fragment-analysis
description
Predict restriction digest fragment sizes and gel patterns using Biopython Bio.Restriction. Computes fragment lengths and sequences for single and double digests on linear or circular DNA, and interprets them against an agarose gel. Use when predicting the fragments from a digest, planning a diagnostic digest to verify a clone, or matching observed gel bands to an expected pattern.
tool_type
python
primary_tool
Bio.Restriction

Version Compatibility

Reference examples tested with: BioPython 1.83+ (API verified on 1.86)

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show biopython, then check the return shape with from Bio.Restriction import EcoRI; from Bio.Seq import Seq; EcoRI.catalyze(Seq('GAATTCGAATTC')) (a tuple of fragment Seqs)

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Restriction Fragment Analysis

"What fragments will this digest produce?" -> Simulate the cut and return fragment lengths (and sequences), for one enzyme or a double digest, on linear or circular DNA.

  • Python: enzyme.catalyze(seq, linear=...) returns a tuple of fragment Seq objects directly.

Two facts decide whether the prediction is right. First, catalyze() returns the tuple of fragments itself -- EcoRI.catalyze(seq) is (Seq(...), Seq(...), Seq(...)). Do NOT write catalyze(seq)[0] to "get the fragments": that returns only the first fragment, and iterating it then counts its bases, producing nonsense sizes like [1, 1, 1, ...]. Second, topology sets the fragment count: a linear molecule with n cuts yields n+1 fragments; a circular molecule with n cuts yields n. Passing the default linear=True to a plasmid invents one extra fragment that does not exist on the bench.

Fragment Count By Topology

Moleculen cut sites yieldsWhy
Linear (PCR product, genomic fragment, lambda)n + 1 fragmentsCut once -> two pieces
Circular (plasmid, many viral genomes)n fragmentsCut once -> one linearized piece; the origin-spanning fragment wraps

A plasmid showing three bands on a single-enzyme digest has three sites, not two. Counting plasmid bands as if the molecule were linear is the most common digest-interpretation error.

Predict Fragment Sizes

Goal: Turn a digest into the band sizes a gel would show.

Approach: Call catalyze() with the correct topology, take the lengths of the returned fragments, sort descending. The summed sizes must equal the molecule length -- a built-in correctness check.

python
from Bio import SeqIO
from Bio.Restriction import EcoRI

record = SeqIO.read('sequence.fasta', 'fasta')
seq = record.seq

fragments = EcoRI.catalyze(seq, linear=True)   # tuple of Seq; NO [0]
sizes = sorted((len(f) for f in fragments), reverse=True)
assert sum(sizes) == len(seq)                  # fragments must account for the whole molecule
print(f'{len(sizes)} fragments: {sizes}')

Linear vs Circular Digestion

python
from Bio.Restriction import EcoRI

linear_frags   = EcoRI.catalyze(seq, linear=True)
circular_frags = EcoRI.catalyze(seq, linear=False)   # plasmid: one fewer fragment
print(f'Linear: {len(linear_frags)} fragments; Circular: {len(circular_frags)} fragments')

Double Digest

Goal: Predict fragments when two enzymes cut the same molecule.

Approach: A double digest cuts at the union of both site sets. The robust way is to build a RestrictionBatch and let Analysis collect every position, then compute fragments from the sorted positions (this generalizes to any number of enzymes and to circular DNA). Sequential catalyze calls also work but are easy to get wrong on circular DNA.

python
from Bio.Restriction import EcoRI, BamHI, RestrictionBatch, Analysis

def fragments_from_positions(seq_len, positions, linear=True):
    '''Fragment sizes (bp) from a set of 1-based cut positions.'''
    cuts = sorted(set(positions))
    if not cuts:
        return [seq_len]
    spans = [cuts[i + 1] - cuts[i] for i in range(len(cuts) - 1)]
    if linear:
        return [cuts[0]] + spans + [seq_len - cuts[-1]]
    return spans + [(seq_len - cuts[-1]) + cuts[0]]    # circular: wrap-around fragment

batch = RestrictionBatch([EcoRI, BamHI])
positions = [p for sites in Analysis(batch, seq).with_sites().values() for p in sites]
sizes = sorted(fragments_from_positions(len(seq), positions, linear=True), reverse=True)
print(f'Double digest: {len(sizes)} fragments: {sizes}')
assert sum(sizes) == len(seq)

Interpreting The Gel: Size, Resolution, And Topology

Fragment sizes are not what a gel directly reports; migration distance is. The decisions below come from gel physics, not from BioPython, and they determine whether predicted bands are actually resolvable.

RealityConsequence for interpretation
Migration distance is ~linear in -log10(size) only within a gel's resolving windowSizing is reliable only against a ladder run on the same gel; never reuse a standard curve across gels
Agarose percent sets the window (approximate, buffer- and voltage-dependent: ~0.7% resolves ~0.8-12 kb; ~1% ~0.5-10 kb; ~2% ~0.1-2 kb)Choose the percent for the bands of interest; small fragments run off a low-percent gel, large fragments pile up on a high-percent one
Above ~20-50 kb fragments co-migrate (reptation); resolving them needs pulsed-field (PFGE)Two large predicted bands may appear as one on a conventional gel
Two fragments of similar size co-migrate as one band of doubled intensity (intensity ~ mass)A "missing" predicted band is often a co-migrating doublet, not an error -- check the sum
Uncut plasmid runs as supercoiled (fast, anomalous) + nicked (slow), same moleculeDo not size a supercoiled band off a linear ladder; only a linearized (single-cut) plasmid sizes correctly
Show full SKILL.md (307 more words)Show less

Simulate A Gel Pattern (Text)

Goal: Lay predicted digests next to a ladder to see which bands resolve and which co-migrate.

Approach: Pool all band sizes and the ladder, sort descending, and mark each lane. Co-migration shows up as multiple marks at one size.

python
def simulate_gel(digests, ladder=None):
    '''digests: {lane_name: [sizes]} -> print a text gel against a ladder.'''
    ladder = ladder or [10000, 8000, 6000, 5000, 4000, 3000, 2000, 1500, 1000, 750, 500, 250]
    bands = sorted(set(ladder).union(*[set(s) for s in digests.values()]), reverse=True)
    header = f'{"size":>6} | {"ladder":^6} | ' + ' | '.join(f'{n:^8}' for n in digests)
    print(header); print('-' * len(header))
    for b in bands:
        row = f'{b:>6} | {"---" if b in ladder else "":^6} | '
        row += ' | '.join(f'{"=" * 4 * lane.count(b):^8}' for lane in digests.values())
        print(row)

simulate_gel({'EcoRI': sizes})

Diagnostic Digest Report

Goal: Document an expected digest to plan a clone-verification gel.

Approach: Report site count, positions, fragment sizes, and the total; flag any pair of fragments too close to resolve.

python
def fragment_report(seq, enzyme, linear=True, resolution=0.10):
    sites = enzyme.search(seq, linear=linear)
    sizes = sorted((len(f) for f in enzyme.catalyze(seq, linear=linear)), reverse=True)
    print(f'{enzyme} ({enzyme.site}): {len(sites)} site(s) at {sites}')
    print(f'  {len(sizes)} fragments, total {sum(sizes)} bp: {sizes}')
    close = [(a, b) for a, b in zip(sizes, sizes[1:]) if a and (a - b) / a < resolution]
    if close:
        print(f'  WARNING likely co-migrating (<{resolution:.0%} apart): {close}')
    return sizes

fragment_report(seq, EcoRI)

Compare Expected vs Observed Bands

python
def compare_fragments(expected, observed, tolerance=50):
    '''Match predicted sizes to gel-measured sizes within a tolerance (bp).'''
    obs = list(observed)
    matched, missing = [], []
    for exp in expected:
        hit = next((o for o in obs if abs(exp - o) <= tolerance), None)
        if hit is None:
            missing.append(exp)
        else:
            matched.append((exp, hit)); obs.remove(hit)
    print('matched:', matched)
    if missing: print('missing (predicted, not seen -- co-migration or partial digest?):', missing)
    if obs:     print('extra (seen, not predicted -- star activity, contaminant, or wrong map?):', obs)

compare_fragments(expected=[3000, 2000, 1500, 500], observed=[3050, 2000, 1480, 510, 200])

Extra bands and a smeary ladder of intermediate sizes often signal a partial digest (not every site cut), which produces sums of adjacent complete-digest fragments. Drive the reaction to completion (more enzyme or time) before concluding the map is wrong.

Common Errors

SymptomCauseFix
Fragment sizes are all 1 (or wildly wrong)catalyze(seq)[0] returns the first fragment, then len(f) for f in it counts basesUse fragments = enzyme.catalyze(seq, linear=...) with no [0]
Predicted one fragment too many for a plasmidDigested a circular molecule with linear=TruePass linear=False; circular gives n fragments from n cuts
Fragment sizes do not sum to the molecule lengthA band was missed or two co-migrateThe sum(sizes) == len(seq) check is mandatory; a shortfall means a hidden doublet or run-off fragment
Two predicted bands never separate on the gelSizes within the gel's resolving limit, or both >20-50 kbAdjust agarose percent, or use PFGE for very large fragments
  • restriction-sites - Find the cut positions that drive fragment calculation
  • restriction-mapping - Order sites and compute inter-site distances
  • enzyme-selection - Choose enzymes that give a resolvable, diagnostic band pattern
  • sequence-manipulation/seq-objects - Work with the fragment Seq objects

References

  • Smith HO, Birnstiel ML. A simple method for DNA restriction site mapping. Nucleic Acids Res. 1976;3(9):2387-2398. doi:10.1093/nar/3.9.2387
  • Schwartz DC, Cantor CR. Separation of yeast chromosome-sized DNAs by pulsed field gradient gel electrophoresis. Cell. 1984;37(1):67-75. doi:10.1016/0092-8674(84)90301-5

© GPTomics, 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 3 other files in restriction-analysis/fragment-analysis of GPTomics/bioSkills.

  • SKILL.md
  • examples/gel_simulation.py
  • examples/predict_fragments.py
  • usage-guide.md

Open the folder on GitHubat commit d91ed3d

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bio Restriction Fragment Analysis 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.

Bio Restriction Fragment Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bio Restriction Fragment Analysis this skillGPTomics/bioSkills1.2k1 repos~2.6kAutomated safety check: PassMIT
Biopython Bioinformaticsaiming-lab/AutoResearchClaw15k—~810Automated safety check: PassMIT
Biopythondavila7/claude-code-templates33k12 repos~3.4kAutomated safety check: PassMIT
Ggetdavila7/claude-code-templates33k10 repos~6.3kAutomated safety check: PassMIT
GgetK-Dense-AI/scientific-agent-skills48k1 repos~2.8kAutomated safety check: NotesBSD-2-Clause
BiopythonK-Dense-AI/scientific-agent-skills48k1 repos~4.3kAutomated safety check: NotesMIT

Similar skills

  • Biopython Bioinformatics

    aiming-lab/AutoResearchClaw

    Quick reference for Biopython work: sequence operations, SeqIO file parsing, BLAST searches, Entrez queries, phylogenetic trees and PDB structure analysis.

    15k GitHub stars~810 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Biopython

    davila7/claude-code-templates

    Primary Python toolkit for molecular biology. An agent skill from davila7/claude-code-templates.

    33k GitHub starsUsed in 12 repos~3.4k tokens
    Research & ScienceAuto-check passed
  • Gget

    davila7/claude-code-templates

    CLI/Python toolkit for rapid bioinformatics queries. An agent skill from davila7/claude-code-templates.

    33k GitHub starsUsed in 10 repos~6.3k tokens
    Research & ScienceAuto-check passed
  • Gget

    K-Dense-AI/scientific-agent-skills

    Queries 20+ bioinformatics resources through CLI/Python. An agent skill from K-Dense-AI/scientific-agent-skills.

    48k GitHub starsUsed in 1 repo~2.8k tokens
    Research & ScienceAuto-check: notes
  • Biopython

    K-Dense-AI/scientific-agent-skills

    Provides Biopython workflows for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez).

    48k GitHub starsUsed in 1 repo~4.3k tokens
    Research & ScienceAuto-check: notes
  • Biopython

    lamm-mit/scienceclaw

    Computational molecular biology library (sequence I/O, alignment, phylogenetics).

    246 GitHub stars~3.9k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed

More from GPTomics/bioSkills

All 559 skills in this repo
  • Bio Alignment Io

    GPTomics/bioSkills

    Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.

    1.2k GitHub starsUsed in 3 repos~4.9k tokens
    Auto-check passed
  • bioSkills Installer

    GPTomics/bioSkills

    Installs the bioSkills collection of 425 bioinformatics skills in one step, or only chosen categories, so sequencing, RNA-seq, single-cell and variant tasks get specialized help.

    1.2k GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Bio Write Sequences

    GPTomics/bioSkills

    Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.

    1.2k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Amplicon Primer Clipping

    GPTomics/bioSkills

    Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.

    1.2k GitHub starsUsed in 2 repos~2.2k tokens
    Auto-check passed
  • Filters BAM alignments by FLAG bits, mapping quality and regions with samtools view or pysam, with recipes for common keep and drop cases.

    1.2k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Bio Alignment Indexing

    GPTomics/bioSkills

    Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed

Works with

Questions about Bio Restriction Fragment Analysis

What does Bio Restriction Fragment Analysis do?

Predict restriction digest fragment sizes and gel patterns using Biopython Bio.Restriction. Bio Restriction Fragment Analysis is an agent skill from GPTomics/bioSkills.Restriction.

When should I use Bio Restriction Fragment Analysis?

Bio Restriction Fragment Analysis fits situations like: predicting the fragments from a digest; planning a diagnostic digest to verify a clone; matching observed gel bands to an expected pattern.

How do I install Bio Restriction Fragment Analysis in Claude Code?

Run `npx skills add GPTomics/bioSkills --skill bio-restriction-fragment-analysis -a claude-code`. Or copy the skill folder (restriction-analysis/fragment-analysis in GPTomics/bioSkills) into .claude/skills/bio-restriction-fragment-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Bio Restriction Fragment Analysis in Codex?

Run `npx skills add GPTomics/bioSkills --skill bio-restriction-fragment-analysis -a codex`. Or copy the skill folder (restriction-analysis/fragment-analysis in GPTomics/bioSkills) into .agents/skills/bio-restriction-fragment-analysis in your project. Codex loads it when a task matches its description.

Can I use Bio Restriction Fragment Analysis 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 GPTomics/bioSkills --skill bio-restriction-fragment-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bio-restriction-fragment-analysis, .gemini/skills/bio-restriction-fragment-analysis, .github/skills/bio-restriction-fragment-analysis and .opencode/skills/bio-restriction-fragment-analysis in your project.

What does Bio Restriction Fragment Analysis need to run?

Going by SKILL.md and its folder, Bio Restriction Fragment Analysis needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Bio Restriction Fragment Analysis access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bio Restriction Fragment Analysis 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. Review the folder before installing.

What licence does Bio Restriction Fragment Analysis use?

Bio Restriction Fragment Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bio Restriction Fragment Analysis use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bio Restriction Fragment Analysis?

Skills that share tags, products or a category with Bio Restriction Fragment Analysis: Biopython Bioinformatics (aiming-lab/AutoResearchClaw, 15k stars), Biopython (davila7/claude-code-templates, 33k stars), Gget (davila7/claude-code-templates, 33k stars) and Gget (K-Dense-AI/scientific-agent-skills, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bio Restriction Fragment Analysis?

GPTomics (a GitHub organization) maintains it in GPTomics/bioSkills, which has 1,218 GitHub stars. The repository holds 559 skills in this directory. The repository was last updated on August 15, 2026.

Source: GPTomics/bioSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.