bio-restriction-fragment-analysis

Installation
SKILL.md

Fragment Analysis

Get Fragment Sizes

from Bio import SeqIO
from Bio.Restriction import EcoRI

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

# catalyze() returns tuple: (fragments_5prime, fragments_3prime)
# For standard use, take the first element
fragments = EcoRI.catalyze(seq)[0]

# fragments is tuple of Seq objects
sizes = [len(f) for f in fragments]
print(f'Fragment sizes: {sorted(sizes, reverse=True)}')
Installs
3
GitHub Stars
1.1K
First Seen
Jan 24, 2026
bio-restriction-fragment-analysis — gptomics/bioskills