Agent skill

Bio Reverse Complement

by GPTomics in GPTomics/bioSkills

Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features.

MITAuto-check passedResearch & Science

Install Bio Reverse Complement

skills CLI
$ npx skills add GPTomics/bioSkills --skill bio-reverse-complement -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install GPTomics/bioSkills bio-reverse-complement --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/sequence-manipulation/reverse-complement .claude/skills/bio-reverse-complement && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bio-reverse-complement
GitHub stars
1.2k
Used in
1 other repo
Token cost
~2.8k tokens
SKILL.md length
1,018 words
Files
6
Skills in repo
553
Repo updated
First seen
Licence
MIT

At a glance

Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features.

  • Working with the opposite strand
  • SKILL.md covers Version Compatibility, The Governing Principle, Required Import and Which Method for Which Question, plus 9 more sections
  • Runs Python scripts from its folder; calls pip
  • Building reverse primers

What it does

Bio Reverse Complement is an agent skill from GPTomics/bioSkills. Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features. Use when working with the opposite strand, building reverse primers, normalizing strand orientation before alignment, or extracting a coding sequence from a minus-strand feature.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `examples/basic_operations.py`, `examples/iupac_and_features.py` and `examples/palindrome_check.py`).

It sits in Research & Science, covering Bioinformatics. It works with Biopython. The repository describes itself as: a set of SKILLS.md for doing bioinformatics with agents like claude code. The licence is MIT.

When your agent uses it

  • Working with the opposite strand
  • Building reverse primers
  • Normalizing strand orientation before alignment
  • Extracting a coding sequence from a minus-strand feature

Example prompts

  • “/bio-reverse-complement”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit d91ed3d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bio Reverse Complement loads about 2.8k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 1,018 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 1,018 words, ~2,758 tokens.

Download SKILL.mdSave it as .claude/skills/bio-reverse-complement/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
bio-reverse-complement
description
Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features. Use when working with the opposite strand, building reverse primers, normalizing strand orientation before alignment, or extracting a coding sequence from a minus-strand feature.
tool_type
python
primary_tool
Bio.Seq

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.

Reverse Complement

Generate complementary and reverse complementary sequences using Biopython.

"Get the reverse complement" -> Produce the 5'-to-3' sequence of the opposite strand.

  • Python: seq.reverse_complement() (BioPython Seq)
  • CLI: samtools faidx ref.fa region --reverse-complement (extracts and RCs a region)

The Governing Principle

Never hand-roll the complement table. Biopython's reverse_complement() already encodes the full IUPAC mapping correctly, case-insensitively, and on minus-strand features it is applied for the analyst automatically by SeqFeature.extract(). Every silent corruption in this domain comes from reimplementing what Biopython already does right: swapping ambiguity codes, forgetting that S/W/N are self-complementary, complementing the wrong molecule type, or reverse-complementing a second time after extract() already did it. Reach for the library method; reach for a guard (molecule_type) before it; never reach for a custom dictionary.

Required Import

python
from Bio.Seq import Seq

Which Method for Which Question

QuestionMethodOutput strand/direction
Opposite strand, conventional 5'->3'reverse_complement()5'->3' of the complementary strand (the usual answer)
Base-paired sequence, same directioncomplement()3'->5' of the complementary strand
Opposite strand of RNA, keep Ureverse_complement_rna()5'->3', emits U
Complement of RNA, keep Ucomplement_rna()3'->5', emits U
Coding strand from template (or vice versa)reverse_complement()the other strand, 5'->3'
mRNA sequence from the coding strandtranscribe() (NOT a complement)same strand, T->U
reverse_complement()

Returns the reverse complement (5'->3' of the opposite strand). This is the most commonly used operation.

python
seq = Seq('ATGCGATCG')
rc = seq.reverse_complement()  # Returns Seq('CGATCGCAT')
complement()

Returns the complement without reversing. Less common - gives the opposite strand still written in 3'->5' order.

python
seq = Seq('ATGCGATCG')
comp = seq.complement()  # Returns Seq('TACGCTAGC')
reverse_complement_rna() and complement_rna()

For RNA, the dedicated methods emit U:

python
rna = Seq('AUGCGAUCG')
rna.reverse_complement_rna()  # Returns Seq('CGAUCGCAU')
rna.complement_rna()          # Returns Seq('UACGCUAGC')

Base Pairing and Ambiguity Codes

reverse_complement() complements all 15 IUPAC codes plus X correctly. The mapping is non-obvious for ambiguity codes - this is exactly why hand-rolling corrupts silently.

CodeBasesComplementCodeBasesComplement
AATMA/CK
TTABC/G/TV
GGCVA/C/GB
CCGDA/G/TH
RA/GYHA/C/TD
YC/TRSG/CS (self)
KG/TMWA/TW (self)
NanyN (self)

S, W, N, and X are SELF-complementary. The pairs that get swapped wrong by hand are B<->V and D<->H. The table is built for upper and lower case, so complementation is case-insensitive (Seq('atRY').reverse_complement() works).

DNA vs RNA: the U handling rule

reverse_complement() runs in DNA mode: it treats any U as a T and EMITS T (docstring: "Any U in the sequence is treated as a T"). It does not raise and does not leave U.

python
Seq('ACGU').reverse_complement()      # Returns Seq('ACGT')  -- U mapped to A, emitted as T
Seq('ACGU').reverse_complement_rna()  # Returns Seq('ACGU')  -- stays RNA

transcribe() does NOT complement. It swaps T->U on the SAME strand. Confusing "complement the template" with "transcribe the coding strand" is silent corruption. True biological transcription from the template strand is template_dna.reverse_complement().transcribe().

Gaps and Non-Table Characters

complement and reverse_complement do NOT validate the alphabet (unlike translate()). A gap - is not a table key, so it passes through unchanged and reversal preserves gap columns - the desired behavior for aligned sequences. Any other non-table character (?, *) also passes through silently.

python
Seq('ATG-CGA--TY').reverse_complement()  # Returns Seq('RA--TCG-CAT') -- gaps preserved, Y->R

Because there is no alphabet check, garbage in produces garbage out without a warning (see the protein trap below).

Code Patterns

Visualize Double-Stranded DNA
python
def show_dsdna(seq):
    print(f"5'-{seq}-3'")
    print(f"   {'|' * len(seq)}")
    print(f"3'-{seq.complement()}-5'")

show_dsdna(Seq('ATGCGATCG'))
Check if a Sequence is Palindromic (Self-Complementary)
python
def is_palindrome(seq):
    return seq == seq.reverse_complement()

is_palindrome(Seq('GAATTC'))  # True  -- EcoRI site
is_palindrome(Seq('ATGCGA'))  # False
Reverse Complement a FASTA File

Goal: Produce a new FASTA file with all sequences reverse-complemented.

Approach: Parse records as a stream, build new SeqRecords from .reverse_complement(), write to output.

Reference (BioPython 1.83+):

python
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord

def reverse_complement_records(records):
    for record in records:
        yield SeqRecord(record.seq.reverse_complement(), id=record.id + '_rc', description=record.description + ' reverse complement')

records = SeqIO.parse('sequences.fasta', 'fasta')
SeqIO.write(reverse_complement_records(records), 'sequences_rc.fasta', 'fasta')
Show full SKILL.md (424 more words)Show less
Extract a Coding Sequence from a Minus-Strand Feature

Goal: Get the correct 5'->3' coding sequence for a gene annotated on the minus strand.

Approach: Call feature.extract(parent.seq). For strand == -1, extract() ALREADY reverse-complements the slice and returns the coding sequence. Do NOT reverse-complement again.

Reference (BioPython 1.83+):

python
from Bio.Seq import Seq
from Bio.SeqFeature import SeqFeature, SimpleLocation

parent = Seq('AAATGGGCCCTTTAAA')
feature = SeqFeature(SimpleLocation(3, 12, strand=-1), type='CDS')
cds = feature.extract(parent)  # Already reverse-complemented; this is the coding sequence
# cds.reverse_complement()     # WRONG -- double-RC bug, valid-looking but wrong strand
Search Both Strands for a Motif

Goal: Find a motif on both strands and report forward-strand coordinates.

Approach: Search the forward sequence, then search its reverse complement, mapping minus-strand hits back to forward coordinates.

Reference (BioPython 1.83+):

python
def search_both_strands(seq, motif):
    motif = Seq(motif)
    results = []
    pos = seq.find(motif)
    while pos != -1:
        results.append(('+', pos))
        pos = seq.find(motif, pos + 1)
    rc = seq.reverse_complement()
    pos = rc.find(motif)
    while pos != -1:
        results.append(('-', len(seq) - pos - len(motif)))
        pos = rc.find(motif, pos + 1)
    return results

search_both_strands(Seq('ATGCGAATTCGATGAATTCGATC'), 'GAATTC')

In-Place Complementation

inplace defaults to False (standardized in 1.79). On an immutable Seq, inplace=True raises TypeError: Sequence is immutable (a loud, useful error). In-place mutation works only on MutableSeq.

python
from Bio.Seq import MutableSeq
m = MutableSeq('ATGC')
m.reverse_complement(inplace=True)  # m is now MutableSeq('GCAT')

The Protein Trap

Since the 1.78 alphabet removal there is no molecule-type checking. Reverse-complementing a protein produces SILENT GARBAGE with no warning: residues that are also nucleotide codes get complemented (Seq('MAIVMGR').reverse_complement() -> Seq('YCKBITK'); M->K, V->B), while protein-only letters E, F, I, L, P, Q, Z and * pass through unchanged. The old IUPAC.protein ValueError guard is gone. Guard on the molecule type, not the Seq:

python
if record.annotations.get('molecule_type') not in ('DNA', 'RNA'):
    raise ValueError('reverse_complement is only valid for nucleotide sequences')

Common Errors

SymptomCauseFix
U replaced by T in resultreverse_complement() runs in DNA mode (U treated as T)Use reverse_complement_rna() to keep RNA
Result is meaningless letters, no errorReverse-complemented a protein (silent since 1.78)Guard on molecule_type, not the Seq
Coding sequence is the wrong strandCalled .reverse_complement() after extract() on a minus-strand featureextract() already RC'd it; do not RC again
TypeError: Sequence is immutableinplace=True on a SeqUse a MutableSeq, or take the returned value
Ambiguity codes complement wronglyHand-rolled complement table (B/V, D/H swapped; S/W/N not self-complementary)Use Biopython's reverse_complement(); never reinvent the table
Same strand returned instead of complementUsed transcribe() thinking it complementstranscribe() only swaps T->U; use reverse_complement() for the other strand
TypeError on a plain stringPassed a str instead of a SeqWrap input in Seq() first

References

Cornish-Bowden A (1985) "Nomenclature for incompletely specified bases in nucleic acid sequences: recommendations 1984." Nucleic Acids Res 13(9):3021-3030 (PMID 2582368). Defines the IUPAC ambiguity codes (R, Y, S, W, K, M, B, D, H, V, N) that Biopython's complement table implements.

  • seq-objects - Create and mutate Seq/MutableSeq objects to complement
  • transcription-translation - transcribe() vs complement(); six-frame translation uses the reverse complement
  • motif-search - Search both strands by reverse-complementing the query or sequence
  • sequence-io/read-sequences - Parse FASTA/GenBank records before reverse-complementing
  • primer-design/primer-basics - Reverse primers are the reverse complement of the target 3' end
  • restriction-analysis/restriction-sites - Restriction sites are often palindromic (self-complementary)
  • alignment-files/sam-bam-basics - BAM FLAG indicates read strand; samtools view -f 16 selects reverse reads

© GPTomics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in sequence-manipulation/reverse-complement of GPTomics/bioSkills.

  • SKILL.md
  • examples/basic_operations.py
  • examples/iupac_and_features.py
  • examples/palindrome_check.py
  • examples/primer_design.py
  • usage-guide.md

Open the folder on GitHubat commit d91ed3d

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bio Reverse Complement next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bio Reverse Complement compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bio Reverse Complement this skillGPTomics/bioSkills1.2k1 repos~2.8kAutomated safety check: PassMIT
Biopython Bioinformaticsaiming-lab/AutoResearchClaw15k—~810Automated safety check: PassMIT
Biopythondavila7/claude-code-templates32k13 repos~3.4kAutomated safety check: PassMIT
Ggetdavila7/claude-code-templates32k11 repos~6.3kAutomated safety check: PassMIT
Bio Alignment Pairwisemajiayu000/claude-skill-registry6664 repos~1.7kAutomated safety check: PassMIT
GgetK-Dense-AI/scientific-agent-skills48k1 repos~2.8kAutomated safety check: NotesBSD-2-Clause

Similar skills

  • Biopython Bioinformatics

    aiming-lab/AutoResearchClaw

    Quick reference for Biopython work: sequence operations, SeqIO file parsing, BLAST searches, Entrez queries, phylogenetic trees and PDB structure analysis.

    15k GitHub stars~810 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Biopython

    davila7/claude-code-templates

    Primary Python toolkit for molecular biology. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 13 repos~3.4k tokens
    Research & ScienceAuto-check passed
  • Gget

    davila7/claude-code-templates

    CLI/Python toolkit for rapid bioinformatics queries. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 11 repos~6.3k tokens
    Research & ScienceAuto-check passed
  • Bio Alignment Pairwise

    majiayu000/claude-skill-registry

    Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.

    666 GitHub starsUsed in 4 repos~1.7k tokens
    Research & ScienceAuto-check passed
  • Gget

    K-Dense-AI/scientific-agent-skills

    Queries 20+ bioinformatics resources through CLI/Python. An agent skill from K-Dense-AI/scientific-agent-skills.

    48k GitHub starsUsed in 1 repo~2.8k tokens
    Research & ScienceAuto-check: notes
  • Biopython

    K-Dense-AI/scientific-agent-skills

    Provides Biopython workflows for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez).

    48k GitHub starsUsed in 1 repo~4.3k tokens
    Research & ScienceAuto-check: notes

More from GPTomics/bioSkills

All 553 skills in this repo
  • Bio Alignment Io

    GPTomics/bioSkills

    Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.

    1.2k GitHub starsUsed in 3 repos~4.9k tokens
    Auto-check passed
  • bioSkills Installer

    GPTomics/bioSkills

    Installs the bioSkills collection of 425 bioinformatics skills in one step, or only chosen categories, so sequencing, RNA-seq, single-cell and variant tasks get specialized help.

    1.2k GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Bio Write Sequences

    GPTomics/bioSkills

    Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.

    1.2k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Amplicon Primer Clipping

    GPTomics/bioSkills

    Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.

    1.2k GitHub starsUsed in 2 repos~2.2k tokens
    Auto-check passed
  • Bio Alignment Indexing

    GPTomics/bioSkills

    Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed
  • Bio Alignment Sorting

    GPTomics/bioSkills

    Sort alignment files by coordinate or read name using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.6k tokens
    Auto-check passed

Works with

Questions about Bio Reverse Complement

What does Bio Reverse Complement do?

Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features. Bio Reverse Complement is an agent skill from GPTomics/bioSkills. Generate reverse complements and complements of DNA/RNA sequences using Biopython, including IUPAC ambiguity codes, gapped alignments, and minus-strand features.

When should I use Bio Reverse Complement?

Bio Reverse Complement fits situations like: working with the opposite strand; building reverse primers; normalizing strand orientation before alignment; extracting a coding sequence from a minus-strand feature.

How do I install Bio Reverse Complement in Claude Code?

Run `npx skills add GPTomics/bioSkills --skill bio-reverse-complement -a claude-code`. Or copy the skill folder (sequence-manipulation/reverse-complement in GPTomics/bioSkills) into .claude/skills/bio-reverse-complement in your project. Claude Code loads it when a task matches its description.

How do I install Bio Reverse Complement in Codex?

Run `npx skills add GPTomics/bioSkills --skill bio-reverse-complement -a codex`. Or copy the skill folder (sequence-manipulation/reverse-complement in GPTomics/bioSkills) into .agents/skills/bio-reverse-complement in your project. Codex loads it when a task matches its description.

Can I use Bio Reverse Complement in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GPTomics/bioSkills --skill bio-reverse-complement -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bio-reverse-complement, .gemini/skills/bio-reverse-complement, .github/skills/bio-reverse-complement and .opencode/skills/bio-reverse-complement in your project.

What does Bio Reverse Complement need to run?

Going by SKILL.md and its folder, Bio Reverse Complement needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Bio Reverse Complement access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Bio Reverse Complement safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bio Reverse Complement use?

Bio Reverse Complement is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bio Reverse Complement use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bio Reverse Complement?

Skills that share tags, products or a category with Bio Reverse Complement: Biopython Bioinformatics (aiming-lab/AutoResearchClaw, 15k stars), Biopython (davila7/claude-code-templates, 32k stars), Gget (davila7/claude-code-templates, 32k stars) and Bio Alignment Pairwise (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bio Reverse Complement?

GPTomics (a GitHub organization) maintains it in GPTomics/bioSkills, which has 1,215 GitHub stars. The repository holds 553 skills in this directory. The repository was last updated on August 15, 2026.

Source: GPTomics/bioSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.