bio-restriction-sites
Find restriction enzyme cut sites in DNA sequences using Biopython Bio.Restriction. Search with single enzymes, batches of enzymes, or commercially available enzyme sets. Returns cut positions for linear or circular DNA. Use when finding restriction enzyme cut sites in sequences.
What this skill does
## Version Compatibility
Reference examples tested with: BioPython 1.83+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Finding Restriction Sites
**"Find restriction sites in my DNA sequence"** -> Locate cut positions for one or more restriction enzymes in linear or circular DNA.
- Python: `Bio.Restriction.Analysis(rb, seq, linear=True).full()`
## Core Pattern
```python
from Bio import SeqIO
from Bio.Restriction import EcoRI, BamHI, HindIII, RestrictionBatch, Analysis
record = SeqIO.read('sequence.fasta', 'fasta')
seq = record.seq
# Single enzyme
sites = EcoRI.search(seq) # Returns list of cut positions
```
## Search with Single Enzyme
```python
from Bio.Restriction import EcoRI
sites = EcoRI.search(seq)
print(f'EcoRI cuts at positions: {sites}')
print(f'Number of sites: {len(sites)}')
# Check if enzyme cuts
if EcoRI.search(seq):
print('EcoRI cuts this sequence')
else:
print('EcoRI does not cut')
```
## Search with Multiple Enzymes
```python
from Bio.Restriction import RestrictionBatch, EcoRI, BamHI, HindIII, XhoI
batch = RestrictionBatch([EcoRI, BamHI, HindIII, XhoI])
# Method 1: batch.search()
results = batch.search(seq)
for enzyme, sites in results.items():
if sites:
print(f'{enzyme}: {sites}')
# Method 2: Analysis class
analysis = Analysis(batch, seq)
results = analysis.full()
```
## Use Built-in Enzyme Collections
```python
from Bio.Restriction import AllEnzymes, CommOnly
# All known enzymes (800+)
analysis = Analysis(AllEnzymes, seq)
# Commercially available only
analysis = Analysis(CommOnly, seq)
# Get results
results = analysis.full()
for enzyme, sites in results.items():
if sites:
print(f'{enzyme}: {sites}')
```
## Linear vs Circular DNA
```python
from Bio.Restriction import EcoRI, Analysis, RestrictionBatch
# Linear DNA (default)
sites_linear = EcoRI.search(seq, linear=True)
# Circular DNA (plasmid)
sites_circular = EcoRI.search(seq, linear=False)
# With Analysis class
batch = RestrictionBatch([EcoRI, BamHI])
analysis = Analysis(batch, seq, linear=False) # Circular
```
## Filter Results
```python
from Bio.Restriction import Analysis, CommOnly
analysis = Analysis(CommOnly, seq)
# Only enzymes that cut
analysis.print_that_cut()
# Only enzymes that don't cut (non-cutters)
analysis.print_that_dont_cut()
# Enzymes that cut once
analysis.print_once_cutters()
# Enzymes that cut twice
analysis.print_twice_cutters()
# Get as dictionary
cutters = analysis.only_cut()
non_cutters = analysis.only_dont_cut()
once_cutters = analysis.once_cutters()
twice_cutters = analysis.twice_cutters()
```
## Get Enzyme Information
```python
from Bio.Restriction import EcoRI
# Recognition sequence
print(f'Site: {EcoRI.site}') # GAATTC
print(f'Esite: {EcoRI.esite}') # Recognition with cut position
# Cut characteristics
print(f'Overhang: {EcoRI.ovhg}') # 4 (positive = 5' overhang)
print(f'Blunt: {EcoRI.is_blunt()}') # False
print(f'5\' overhang: {EcoRI.is_5overhang()}') # True
print(f'3\' overhang: {EcoRI.is_3overhang()}') # False
# Overhang sequence
print(f'Overhang seq: {EcoRI.ovhgseq}') # AATT
# Isoschizomers (same recognition, different cut)
print(f'Isoschizomers: {EcoRI.isoschizomers()}')
# Compatible enzymes (same overhang)
print(f'Compatible: {EcoRI.compatible_end()}')
```
## Common Cloning Enzymes
```python
from Bio.Restriction import (
EcoRI, BamHI, HindIII, XhoI, SalI, NotI, XbaI, SpeI,
NcoI, NdeI, BglII, PstI, KpnI, SacI, EcoRV, SmaI
)
common_enzymes = RestrictionBatch([
EcoRI, BamHI, HindIII, XhoI, SalI, NotI, XbaI,
NcoI, NdeI, BglII, PstI, KpnI, SacI, EcoRV, SmaI
])
analysis = Analysis(common_enzymes, seq)
results = analysis.full()
```
## Access Enzymes by Name
```python
from Bio.Restriction import AllEnzymes
# Get enzyme by string name
ecori = AllEnzymes.get('EcoRI')
sites = ecori.search(seq)
# Check if enzyme exists
if 'EcoRI' in AllEnzymes:
print('EcoRI is in database')
```
## Search Multiple Sequences
```python
from Bio import SeqIO
from Bio.Restriction import RestrictionBatch, EcoRI, BamHI
batch = RestrictionBatch([EcoRI, BamHI])
for record in SeqIO.parse('sequences.fasta', 'fasta'):
analysis = Analysis(batch, record.seq)
results = analysis.full()
print(f'{record.id}:')
for enzyme, sites in results.items():
if sites:
print(f' {enzyme}: {sites}')
```
## Notes
- **Positions are 1-based** - first base is position 1
- **Cut position** - where enzyme cuts (between bases)
- **Linear default** - set `linear=False` for circular DNA
- **Case insensitive** - recognition matches regardless of case
- **Ambiguous bases** - some enzymes recognize N, R, Y, etc.
## Related Skills
- restriction-mapping - Visualize cut positions on sequence
- enzyme-selection - Choose enzymes by criteria
- fragment-analysis - Analyze resulting fragments
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.