bio-transcription-translation
SkillDev toolsConvert between DNA, RNA, and protein sequences using Biopython.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the bio-transcription-translation skill
About this skill
The largest open-source medical AI skills library for OpenClawπ¦.
What this skill tells your AI
The instructions your AI receives, as published by freedomintelligence/openclaw-medical-skills in skills/bio-transcription-translation/SKILL.md and read by ahelβs review.
name: bio-transcription-translation description: Transcribe DNA to RNA and translate to protein using Biopython. Use when converting between DNA, RNA, and protein sequences, finding ORFs, or using alternative codon tables. tool_type: python primary_tool: Bio.Seq measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools:
- read_file
- run_shell_command
Transcription and Translation
Convert between DNA, RNA, and protein sequences using Biopython.
Required Import
from Bio.Seq import Seq
Core Methods
Transcription (DNA to RNA)
dna = Seq('ATGCGATCGATCG')
rna = dna.transcribe() # Returns Seq('AUGCGAUCGAUCG')
Transcription replaces T with U. Works on coding strand (5' to 3').
Back Transcription (RNA to DNA)
rna = Seq('AUGCGAUCGAUCG')
dna = rna.back_transcribe() # Returns Seq('ATGCGATCGATCG')
Translation (RNA/DNA to Protein)
# From coding DNA (includes ATG start)
coding_dna = Seq('ATGTTTGGT')
protein = coding_dna.translate() # Returns Seq('MFG')
# From RNA
rna = Seq('AUGUUUGGU')
protein = rna.translate() # Returns Seq('MFG')
Translation Options
Stop at First Stop Codon
seq = Seq('ATGTTTGGTTAAGGG')
protein = seq.translate(to_stop=True) # Stops at TAA, excludes stop
Include Stop Codon Symbol
seq = Seq('ATGTTTGGTTAA')
protein = seq.translate() # Returns Seq('MFG*')
Alternative Codon Tables
Biopython supports NCBI codon tables. Common tables:
| ID | Name | Use Case |
|---|---|---|
| 1 | Standard | Default, most organisms |
| 2 | Vertebrate Mitochondrial | Human/vertebrate mitochondria |
| 4 | Mold Mitochondrial | Fungi, protozoa mitochondria |
| 5 | Invertebrate Mitochondrial | Insects, worms mitochondria |
| 6 | Ciliate Nuclear | Tetrahymena, Paramecium |
| 11 | Bacterial/Archaeal | Prokaryotes, plastids |
# Bacterial translation
seq = Seq('ATGTTTGGT')
protein = seq.translate(table=11)
# Mitochondrial translation
protein = seq.translate(table=2)
# By name
protein = seq.translate(table='Vertebrate Mitochondrial')
CDS Translation (Complete Coding Sequence)
For validated coding sequences with proper start/stop:
cds = Seq('ATGTTTGGTTAA') # Must start with start codon, end with stop
protein = cds.translate(cds=True) # Validates and removes stop
The cds=True option:
- Validates start codon (ATG or alternative)
- Validates stop codon at end
- Removes stop codon from result
- Raises error if invalid CDS
Code Patterns
Basic Transcription and Translation Pipeline
dna = Seq('ATGTTTGGTCATTAA')
rna = dna.transcribe()
protein = rna.translate()
print(f'DNA: {dna}')
print(f'RNA: {rna}')
print(f'Protein: {protein}')
Translate All Six Reading Frames
def six_frame_translation(seq):
frames = []
for strand, s in [('+', seq), ('-', seq.reverse_complement())]:
for frame in range(3):
length = 3 * ((len(s) - frame) // 3)
fragment = s[frame:frame + length]
frames.append((strand, frame, fragment.translate()))
return frames
seq = Seq('ATGCGATCGATCGATCGATCG')
for strand, frame, protein in six_frame_translation(seq):
print(f'{strand}{frame}: {protein}')
Find All ORFs (Start to Stop)
def find_orfs(seq, min_length=30):
orfs = []
for strand, s in [('+', seq), ('-', seq.reverse_complement())]:
for frame in range(3):
trans = s[frame:].translate()
aa_start = 0
while True:
start = trans.find('M', aa_start)
if start == -1:
break
stop = trans.find('*', start)
if stop == -1:
stop = len(trans)
orf = trans[start:stop]
if len(orf) * 3 >= min_length:
orfs.append((strand, frame, start * 3 + frame, str(orf)))
aa_start = start + 1
return orfs
seq = Seq('ATGCGATCGATCGATCGATCGTAA')
for strand, frame, pos, orf in find_orfs(seq, min_length=3):
print(f'{strand} frame {frame} pos {pos}: {orf}')
Translate with Quality Check
def translate_cds_safe(seq):
try:
return seq.translate(cds=True)
except Exception as e:
return seq.translate(to_stop=True) # Fallback
Get Codon Table Info
from Bio.Data import CodonTable
table = CodonTable.unambiguous_dna_by_id[1]
print(f'Start codons: {table.start_codons}')
print(f'Stop codons: {table.stop_codons}')
Common Errors
| Error | Cause | Solution |
|---|---|---|
TranslationError: First codon is not a start codon | Used cds=True without valid start | Remove cds=True or fix sequence |
TranslationError: Final codon is not a stop codon | Used cds=True without stop codon | Remove cds=True or add stop codon |
TranslationError: Sequence length not multiple of 3 | Partial codons at end | Trim sequence to multiple of 3 |
| Unexpected amino acids | Wrong codon table | Specify correct table for organism |
Decision Tree
Need to convert sequence?
βββ DNA to RNA?
β βββ Use seq.transcribe()
βββ RNA to DNA?
β βββ Use seq.back_transcribe()
βββ DNA/RNA to protein?
β βββ Complete CDS with start/stop?
β β βββ Use translate(cds=True)
β βββ Stop at first stop codon?
β β βββ Use translate(to_stop=True)
β βββ Non-standard organism?
β β βββ Use translate(table=N)
β βββ Get all including stop symbol?
β βββ Use translate()
βββ Find all ORFs?
βββ Translate all six frames, search for M...*
Related Skills
- seq-objects - Create Seq objects for translation
- reverse-complement - Translate both strands (six-frame translation)
- codon-usage - Analyze codon bias in coding sequences
- sequence-io/read-sequences - Parse GenBank files with CDS features
- database-access/entrez-fetch - Fetch CDS sequences from NCBI for translation
Signals
- GitHub stars
- 3k
- Forks
- 412
- Last commit
- Jul 2026
ahel review
K1binfo
installs-packages (in usage-guide.md)
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Item type
- skill
- Key
bio-transcription-translation- Source
- github.com/freedomintelligence/openclaw-medical-skills
github.com/freedomintelligence/openclaw-medical-skills
Related picks
Skill Β· wshobson
The pick for Pythonpython-pro
Skill Β· jeffallan
The pick for Pythonbmad-technical-research
Skill Β· tronghieu
The pick for Technicalusenix-annual-technical-conference
Skill Β· brycewang-stanford
The pick for Technicalteach
Skill Β· mattpocock
More in Dev toolsimplement
Skill Β· mattpocock
More in Dev tools