Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-restriction-sites

БесплатноЗапускает вложенные скриптыНе проверен

Find restriction enzyme cut sites in DNA sequences using Biopython Bio.Restriction. Searches single enzymes, batches, or commercial enzyme sets and returns…

lilinjiот lilinji★ 18 звёзд на GitHub

Об этом скилле

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 help(Bio.Restriction.Analysis) to check method names

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying. The Analysis "cutters" methods in particular were renamed across versions (see Common Errors).

Finding Restriction Sites

"Find where this enzyme cuts my DNA" -> Return the cut positions for one or more restriction enzymes along a linear or circular sequence.

  • Python: enzyme.search(seq, linear=...) for one enzyme; Bio.Restriction.Analysis(batch, seq, linear=...).full() for many.

The one fact that governs every result: search() returns a 1-based position equal to the first base of the downstream fragment (the base immediately 3' of the cut on the top strand), not the start of the recognition site. For EcoRI G^AATTC whose site starts at position 4, search reports 5 (the base after the cut). Confusing the cut position with the recognition-site start is the single most common bug in restriction code, and it propagates silently into fragment sizes and map coordinates.

The Decisions That Shape A Site Search

Decision Options When to pick which
Enzyme scope one enzyme / a curated RestrictionBatch / CommOnly / AllEnzymes A named enzyme when the assay dictates it; a small batch for a cloning panel; CommOnly (623 buyable enzymes) when the answer must be an enzyme one can purchase; AllEnzymes (1088, includes non-commercial) only for exhaustive in-silico surveys
Topology linear=True (default) / linear=False linear=False for any plasmid, viral circle, or BAC. A circular molecule lets a site span the origin and changes fragment counts (see fragment-analysis)
Question does it cut? / how often? / where? search() for positions; Analysis.with_N_sites(n) for exact cut counts; bool(search()) for a yes/no screen

Use CommOnly not AllEnzymes by default: proposing an enzyme nobody sells wastes a wet-lab cycle. The README's legacy "800+" figure is stale; the installed database holds 1088 enzymes total, 623 commercially available.

Search With One Enzyme

from Bio import SeqIO
from Bio.Restriction import EcoRI

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

sites = EcoRI.search(seq)              # list of 1-based cut positions, e.g. [5, 14]
print(f'EcoRI cuts {len(sites)} time(s) at {sites}')
if not sites:
    print('EcoRI does not cut this sequence')

Search With A Batch Of Enzymes

Goal: Screen a sequence against several enzymes at once and keep only those that cut.

Approach: Build a RestrictionBatch, run Analysis.full() to get every enzyme's positions, then filter to cutters with with_sites().

from Bio.Restriction import RestrictionBatch, Analysis, EcoRI, BamHI, HindIII, XhoI

batch = RestrictionBatch([EcoRI, BamHI, HindIII, XhoI])
analysis = Analysis(batch, seq, linear=True)

cutters = analysis.with_sites()        # {enzyme: [positions]} only enzymes that cut
for enzyme, positions in cutters.items():
    print(f'{enzyme}: {positions}')

Filter By Cut Count

Goal: Separate single-cutters (linearize a plasmid), double-cutters (excise an insert), and non-cutters (safe to carry through a digest).

Approach: Analysis exposes with_N_sites(n) for an exact count and without_site() for enzymes with no site. (The older once_cutters()/twice_cutters()/only_dont_cut() names do not exist in current BioPython.)

from Bio.Restriction import Analysis, CommOnly

analysis = Analysis(CommOnly, seq, linear=False)   # circular plasmid

single_cutters = analysis.with_N_sites(1)          # {enzyme: [pos]} good for linearization
double_cutters = analysis.with_N_sites(2)          # {enzyme: [pos, pos]} good for excision
non_cutters    = analysis.without_site()           # {enzyme: []} safe in a multi-step digest
all_cutters    = analysis.with_sites()             # any number of sites

print(f'{len(single_cutters)} single-cutters, {len(non_cutters)} non-cutters')

# Pretty-print a chosen subset
analysis.print_as('map')
analysis.print_that(single_cutters)                # formats the dict you pass it

Built-In Enzyme Collections

from Bio.Restriction import AllEnzymes, CommOnly, Analysis

print(f'{len(AllEnzymes)} known enzymes, {len(CommOnly)} commercially available')

analysis = Analysis(CommOnly, seq)                 # default: only buyable enzymes
for enzyme, positions in analysis.with_sites().items():
    print(f'{enzyme}: {positions}')

Linear vs Circular DNA

from Bio.Restriction import EcoRI

sites_linear   = EcoRI.search(seq, linear=True)    # ends are free; no
Полный SKILL.md на GitHub

Установить bio-restriction-sites в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/circular_plasmid.pyexamples/find_sites.pyusage-guide.md

FAQ

Что делает скилл bio-restriction-sites?

Find restriction enzyme cut sites in DNA sequences using Biopython Bio.Restriction. Searches single enzymes, batches, or commercial enzyme sets and returns cut positions for linear or circular DNA. Use when locating where one or more restriction enzymes cut a sequence, screening a sequence for the presence or absence of a site, or counting how often an enzyme cuts.

Как установить скилл bio-restriction-sites?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-restriction-sites запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-restriction-sites с