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

Reverse Complement - Usage Guide

Overview

This skill enables AI agents to help you generate complementary and reverse complementary sequences using Biopython. It covers the everyday operation (opposite strand, 5'->3'), the RNA-specific methods, IUPAC ambiguity codes, gapped alignment columns, in-place mutation, and the silent-corruption traps (protein sequences, double reverse-complementing minus-strand features, confusing complement with transcription).

Prerequisites

pip install biopython

Quick Start

Tell your AI agent what you want to do:

Example Prompts

Basic Reverse Complement

"What is the reverse complement of ATGCGATCGATCG?"

Visualize Double-Stranded DNA

"Show me this sequence as double-stranded DNA with both strands"

Palindrome Check

"Is GAATTC a palindromic sequence? What about ATGCAT?"

RNA Strand

"Give me the reverse complement of this RNA but keep it as U, not T"

Primer Design

"I need to amplify positions 100-500 of this sequence. What would the reverse primer look like?"

Minus-Strand Feature

"This CDS is annotated on the minus strand. Extract its coding sequence in the right orientation."

Strand Conversion

"Convert this template strand sequence to the coding strand"

What the Agent Will Do

  1. Wrap your input in a Bio.Seq.Seq object (or read records with SeqIO)
  2. Confirm the molecule type so it does not silently reverse-complement a protein
  3. Pick the method: reverse_complement() for DNA, reverse_complement_rna() to keep U, complement() for same-direction base pairs
  4. For an annotated feature, use feature.extract() which already handles minus-strand orientation
  5. Return the result in the conventional 5'->3' orientation

Understanding the Methods

Strand Terminology

Coding strand:     5'-ATGCGATCG-3'  (matches mRNA, except T instead of U)
Template strand:   3'-TACGCTAGC-5'  (used for transcription)
                      |||||||||

reverse_complement() of the coding strand = the template strand (written 5'->3').

Tips