← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-sequence-manipulation-seq-objects / references / usage-guide.md

Seq Objects - Usage Guide

Overview

This skill enables AI agents to help create and manipulate biological sequence objects in Biopython. It covers the core Seq, MutableSeq, and SeqRecord classes, the breaking changes from the 1.78 alphabet removal, and the silent-corruption traps that follow from losing alphabet validation.

Prerequisites

pip install biopython

Quick Start

Tell your AI agent what you want to do:

Example Prompts

Basic Sequence Creation

"Create a Seq object from 'ATGCGATCGATCG', show its length, and count the G bases"

Mutable Sequences

"I need to replace position 5 with a G in this sequence and append three Ts"

SeqRecord Creation

"Create a SeqRecord with id 'gene1' and description 'Example gene' that I can write to a file"

Annotated Records

"Build a SeqRecord with organism 'E. coli' and molecule_type set so it writes to GenBank"

Migration and Debugging

"My script does Seq('ACGT', IUPAC.unambiguous_dna) and crashes on a new Biopython - fix it" "A record from a lazy parser raises UndefinedSequenceError when I print it - how do I handle that?"

Batch Processing

"Create SeqRecords from this list of sequences with sequential ids"

What the Agent Will Do

  1. Import the appropriate classes (Seq, MutableSeq, SeqRecord)
  2. Choose the object type from the task (immutable read, in-place edit, or annotated record)
  3. Create the object and set any required attributes (id, description, molecule_type)
  4. Perform the requested operations, preserving metadata where methods drop it
  5. Return or display the result

When to Use Each Object

Tips