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.
Reference examples tested with: BioPython 1.83+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signaturesIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Find restriction sites in my DNA sequence" → Locate cut positions for one or more restriction enzymes in linear or circular DNA.
Bio.Restriction.Analysis(rb, seq, linear=True).full()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
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')