[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EG661X0VC6BJT4W1SYJQXK":3,"skill-same:01M7EG661X0VC6BJT4W1SYJQXK":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EG661X0VC6BJT4W1SYJQXK","bio-transcription-translation",null,"Transcribe DNA to RNA and translate to protein using Biopython, with NCBI codon-table selection, CDS validation, and six-frame ORF finding. Use when converting a CDS or ORF to its amino-acid sequence, selecting a non-standard (mitochondrial, bacterial, ciliate) genetic code, validating a coding sequence, or scanning all reading frames.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-transcription-translation\ndescription: Transcribe DNA to RNA and translate to protein using Biopython, with NCBI codon-table selection, CDS validation, and six-frame ORF finding. Use when converting a CDS or ORF to its amino-acid sequence, selecting a non-standard (mitochondrial, bacterial, ciliate) genetic code, validating a coding sequence, or scanning all reading frames.\ntool_type: python\nprimary_tool: Bio.Seq\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"sequence-manipulation\u002Ftranscription-translation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: BioPython 1.83+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Transcription and Translation\n\n**\"Translate my DNA sequence to protein\"** -> Transcribe DNA to RNA and translate to protein, choosing the right genetic code and validating the reading frame.\n- Python: `Seq.translate()`, `Seq.transcribe()`, `Bio.Data.CodonTable` (BioPython)\n\n## The Governing Principle\n\nThe single most dangerous bug in translation is **silent**: a valid-but-wrong `table=` argument produces a plausible wrong protein with no error. Translating human mitochondrial DNA with the default Standard code (table 1) inserts `*` where UGA actually codes Trp and truncates at AGA\u002FAGG (which are stops in vertebrate mito). The protein looks real and nothing complains. By contrast, an *unknown* table id or name raises `KeyError` (loud). Only valid-but-wrong tables corrupt silently.\n\nThe defense: when the input is a complete coding sequence, pass `cds=True`. It converts silent traps into loud `TranslationError` exceptions by validating start, length, and stop. Use it for ORF validation rather than trusting a clean-looking output.\n\nSince the Biopython 1.78 alphabet removal, `transcribe()`, `back_transcribe()`, and `translate()` perform NO type checking. Transcribing a protein or translating the wrong strand returns silent garbage. Confirm the molecule and strand before converting.\n\n## Required Import\n\n```python\nfrom Bio.Seq import Seq\nfrom Bio.Data import CodonTable\n```\n\n## Transcription Is a String Operation, Not Biology\n\n`transcribe()` is a pure T->U replacement on the coding (sense) strand; `back_transcribe()` is U->T. Neither performs splicing, intron removal, 5' capping, or poly-A addition. The Biopython tutorial states plainly that all transcribe does is replace T with U.\n\n```python\ncoding_dna = Seq('ATGCGATCGATCG')\nrna = coding_dna.transcribe()        # Seq('AUGCGAUCGAUCG'), T->U only\nback = rna.back_transcribe()         # Seq('ATGCGATCGATCG'), U->T only\n```\n\nTrue biological transcription starts from the template strand, so reverse-complement first:\n\n```python\ntemplate = Seq('CGATCGATCGCAT')\nmrna = template.reverse_complement().transcribe()\n```\n\nTranslation accepts DNA or RNA directly, so explicit transcription is rarely needed before `translate()`.\n\n## Translation Basics\n\n```python\ncoding_dna = Seq('ATGTTTGGT')\ncoding_dna.translate()               # Seq('MFG'), from DNA\nSeq('AUGUUUGGU').translate()         # Seq('MFG'), from RNA\n```\n\n### Stop-Codon Behavior\n\n`translate()` substitutes `stop_symbol` (default `'*'`) for EVERY in-frame stop, so internal stops appear as `*` mid-protein. `to_stop=True` instead halts at the first in-frame stop and does NOT append the symbol.\n\n```python\nseq = Seq('ATGTTTGGTTAAGGG')\nseq.translate()                      # Seq('MFG*G'), stop shown, translation continues\nseq.translate(to_stop=True)          # Seq('MFG'), halts at first stop\n```\n\n## NCBI Codon Tables: Which Code, and the Consequence of the Wrong One\n\nBiopython exposes every NCBI genetic code by integer id or registered name. Selecting the wrong one is the #1 silent bug (see governing principle).\n\n| ID | Name | Key reassignments vs Standard | When it matters |\n|----|------|-------------------------------|-----------------|\n| 1 | Standard | none (baseline) | Most nuclear genes |\n| 2 | Vertebrate Mitochondrial | AGA\u002FAGG -> STOP; AUA -> Met; UGA -> Trp | Human\u002Fvertebrate mtDNA (4 stops: UAA, UAG, AGA, AGG) |\n| 3 | Yeast Mitochondrial | CUN (all four CU*) -> Thr; AUA -> Met; UGA -> Trp | **CTG -> Thr lives HERE, not table 12** |\n| 4 | Mold\u002FProtozoan Mito + Mycoplasma\u002FSpiroplasma | UGA -> Trp (only change) | Fungal\u002Fprotozoan mito; Mycoplasma |\n| 5 | Invertebrate Mitochondrial | AGA\u002FAGG -> Ser; AUA -> Met; UGA -> Trp | Insect\u002Fworm mito (AGA\u002FAGG=Ser, not STOP as in table 2) |\n| 6 | Ciliate Nuclear | UAA\u002FUAG -> Gln; only UGA stays stop | Tetrahymena, Paramecium (single stop) |\n| 11 | Bacterial\u002FArchaeal\u002FPlastid | same coding as Standard; expanded starts | Prokaryotes, plastids (differs from 1 mainly in initiation) |\n| 12 | Alternative Yeast Nuclear | CUG -> Ser (from Leu) | *Candida* CUG-Ser clade |\n\n**Explicit correction:** CTG -> Thr is table **3** (Yeast Mitochondrial). Table **12** is CUG -> **Ser**. Do not conflate them.\n\n```python\nseq = Seq('ATGGCCTGA')\nseq.translate(table=2)                            # by NCBI integer id\nseq.translate(table='Vertebrate Mitochondrial')   # by registered name\n\nCodonTable.unambiguous_dna_by_id[2]\nCodonTable.unambiguous_dna_by_name['Vertebrate Mitochondrial']\n```\n\n## Validating a Coding Sequence with cds=True\n\n**Goal:** Translate a complete ORF and have any structural defect raise a loud error instead of producing a silent wrong protein.\n\n**Approach:** Pass `cds=True`. It enforces four conditions, each raising `Bio.Data.CodonTable.TranslationError` on failure: (1) first codon is a start codon for the chosen table; (2) length is a multiple of 3; (3) sequence ends in a stop; (4) no internal in-frame stop. A valid alternative start (GTG\u002FTTG\u002FATT) is translated as M, biologically correct for fMet initiation. The terminal stop is stripped from the output.\n\n**Reference (BioPython 1.83+):**\n\n```python\ncds = Seq('ATGTTTGGTTAA')\ncds.translate(cds=True)              # Seq('MFG'), validated, terminal stop removed\n\nalt_start = Seq('GTGTTTGGTTAA')\nalt_start.translate(table=11, cds=True)   # Seq('MFG'), GTG start -> M under bacterial code\n```\n\nStart-codon lists differ by table: table 1 = TTG\u002FCTG\u002FATG; table 2 = ATT\u002FATC\u002FATA\u002FATG\u002FGTG; table 11 = TTG\u002FCTG\u002FATT\u002FATC\u002FATA\u002FATG\u002FGTG. A start valid under one table fails under another, which is exactly the loud signal `cds=True` provides.\n\n## translate() Parameters and Edge Cases\n\nSignature (the `Seq.translate` METHOD): `translate(table='Standard', stop_symbol='*', to_stop=False, cds=False, gap='-')`. The `Seq` method defaults to `gap='-'`, while both the module-level `Bio.Seq.translate(sequence, ...)` function and `SeqRecord.translate()` default to `gap=None`.\n\n- **Partial codon** (length not a multiple of 3): emits a `BiopythonWarning` and SILENTLY drops the trailing 1-2 bases. Easy to miss in a pipeline. Under `cds=True` the same condition becomes a loud `TranslationError`.\n- **Gaps:** because the `Seq` method defaults to `gap='-'`, a full gap codon `'---'` already translates to `'-'` (e.g. `Seq('GTG---GCCATT').translate()` -> `'V-AI'`, no error). A codon mixing gaps and bases (`'TT-'`) raises `TranslationError`. `SeqRecord.translate()` instead defaults to `gap=None`, so even a full `'---'` codon raises unless `gap='-'` is passed; mixed gap\u002Fbase codons still raise. For alignment-derived CDS, preserve codon and alignment semantics with `alignment\u002Fmultiple-alignment` or the project's established translation wrapper rather than assuming one gap-normalization policy.\n- **Dual-coding stop tables (27 Karyorelict, 28 Condylostoma, 31 Blastocrithidia Nuclear):** these reassign a stop codon so it codes both an amino acid and stop, so `to_stop=True` raises a `ValueError` (no single truncation point).\n\n```python\nSeq('ATGTTTGG').translate()          # BiopythonWarning, trailing 'GG' dropped -> Seq('MF')\nSeq('ATGTTTGG').translate(cds=True)  # TranslationError: length not a multiple of three\n```\n\n## Selenocysteine and Pyrrolysine Are Silently Lost\n\nSelenocysteine (Sec, one-letter U) is encoded by UGA and pyrrolysine (Pyl, one-letter O) by UAG, both normally stop codons. Recoding requires a SECIS (Sec) or PYLIS (Pyl) element that Biopython does NOT detect. No NCBI table maps UGA->U or UAG->O. Naive translation therefore yields `*` mid-protein, and `to_stop=True` SILENTLY truncates the protein at that position. Real selenoproteins (GPX, TXNRD, SELENOP) come out truncated or peppered with `*`. There is no clean Biopython workaround; flag these genes and handle the recoding event manually.\n\n## Six-Frame Translation\n\n**Goal:** Translate a DNA sequence in all six frames (three forward, three reverse) to expose every possible protein product.\n\n**Approach:** For each strand, offset by 0, 1, 2 bases, trim to a multiple of 3, and translate.\n\n**Reference (BioPython 1.83+):**\n\n```python\ndef six_frame_translation(seq):\n    frames = []\n    for strand, s in [('+', seq), ('-', seq.reverse_complement())]:\n        for frame in range(3):\n            length = 3 * ((len(s) - frame) \u002F\u002F 3)\n            fragment = s[frame:frame + length]\n            frames.append((strand, frame, fragment.translate()))\n    return frames\n\nseq = Seq('ATGCGATCGATCGATCGATCG')\nfor strand, frame, protein in six_frame_translation(seq):\n    print(f'{strand}{frame}: {protein}')\n```\n\n## Find All ORFs (Start to Stop)\n\n**Goal:** Identify all open reading frames (Met to stop) across both strands and all three frames, keeping only those above a minimum length.\n\n**Approach:** Translate each of the six frames, then scan each translation for Met-to-stop segments meeting the threshold.\n\n**Reference (BioPython 1.83+):**\n\n```python\ndef find_orfs(seq, min_protein_length=30):\n    orfs = []\n    for strand, s in [('+', seq), ('-', seq.reverse_complement())]:\n        for frame in range(3):\n            end = frame + 3 * ((len(s) - frame) \u002F\u002F 3)\n            trans = str(s[frame:end].translate())\n            aa_start = 0\n            while True:\n                start = trans.find('M', aa_start)\n                if start == -1:\n                    break\n                stop = trans.find('*', start)\n                if stop == -1:\n                    stop = len(trans)\n                orf = trans[start:stop]\n                if len(orf) >= min_protein_length:\n                    orfs.append((strand, frame, start * 3 + frame, orf))\n                aa_start = start + 1\n    return orfs\n\nseq = Seq('ATGCGATCGATCGATCGATCGTAA')\nfor strand, frame, pos, orf in find_orfs(seq, min_protein_length=3):\n    print(f'{strand} frame {frame} pos {pos}: {orf}')\n```\n\n## Inspect a Codon Table\n\n```python\ntable = CodonTable.unambiguous_dna_by_id[2]\ntable.start_codons                   # ['ATT', 'ATC', 'ATA', 'ATG', 'GTG']\ntable.stop_codons                    # ['TAA', 'TAG', 'AGA', 'AGG']\ntable.forward_table['TGA']           # 'W' under vertebrate mito code\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Plausible protein, wrong residues, no error | Valid-but-wrong `table=` (e.g. mito DNA on table 1) | Select the organism's NCBI table; use `cds=True` to validate |\n| `*` mid-protein or premature truncation | Selenoprotein\u002Fpyrrolysine UGA\u002FUAG, or wrong table where UGA=Trp | Use correct mito table for UGA=Trp; Sec\u002FPyl recoding is not automatic |\n| `TranslationError: First codon ... is not a start codon` | `cds=True` on a sequence not starting at a valid start for that table | Trim to the true start, or pick the table whose starts include it |\n| `TranslationError: ... is not a multiple of three` | `cds=True` on a partial CDS | Trim to a full ORF; without `cds=True` this only warns and drops trailing bases |\n| `TranslationError: Extra in frame stop codon found` | Internal stop under `cds=True` | Wrong frame, wrong table, or genuine internal stop; re-check frame\u002Ftable |\n| Garbage protein from a protein input | `transcribe()`\u002F`translate()` on a non-nucleotide Seq (no type checks since 1.78) | Verify molecule type before converting |\n| `KeyError` | Unknown table id or name | Use a valid NCBI id (1-6, 9-16, 21-31) or registered name |\n\n## Decision Tree\n\n```\nNeed to convert a sequence?\n├── DNA \u003C-> RNA (string-level T\u003C->U)?\n│   ├── coding strand to RNA -> seq.transcribe()\n│   ├── RNA back to DNA      -> seq.back_transcribe()\n│   └── template strand to mRNA -> seq.reverse_complement().transcribe()\n├── DNA\u002FRNA to protein?\n│   ├── alignment-derived CDS    -> alignment\u002Fmultiple-alignment (codon-aware), or project wrapper\n│   ├── complete CDS to validate -> translate(cds=True) [loud on defects]\n│   ├── stop at first stop only  -> translate(to_stop=True)\n│   ├── non-standard organism    -> translate(table=N)  [pick from the table above]\n│   └── show internal stops      -> translate()  [* per stop]\n└── Unknown coding regions? -> six-frame translation, then scan M...* for ORFs\n```\n\n## Related Skills\n\n- seq-objects - Create and inspect Seq objects before translation\n- reverse-complement - Strand handling for six-frame translation and template-strand transcription\n- codon-usage - Analyze codon bias and adaptation in coding sequences\n- sequence-io\u002Fread-sequences - Parse GenBank\u002FFASTA records and CDS features for translation\n\n## References\n\nThe genetic-code tables and their organism assignments follow the NCBI Taxonomy \"The Genetic Codes\" page, compiled by Andrzej (Anjay) Elzanowski and Jim Ostell at NCBI (https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002FTaxonomy\u002FUtils\u002Fwprintgc.cgi). This is a maintained web resource; cite it as the NCBI page rather than as a journal article.\n","## Version Compatibility\n\nReference examples tested with: BioPython 1.83+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Transcription and Translation\n\n**\"Translate my DNA sequence to protein\"** -> Transcribe DNA to RNA and translate to protein, choosing the right genetic code and validating the reading frame.\n- Python: `Seq.translate()`, `Seq.transcribe()`, `Bio.Data.CodonTable` (BioPython)\n\n## The Governing Principle\n\nThe single most dangerous bug in translation is **silent**: a valid-but-wrong `table=` argument produces a plausible wrong protein with no error. Translating human mitochondrial DNA with the default Standard code (table 1) inserts `*` where UGA actually codes Trp and truncates at AGA\u002FAGG (which are stops in vertebrate mito). The protein looks real and nothing complains. By contrast, an *unknown* table id or name raises `KeyError` (loud). Only valid-but-wrong tables corrupt silently.\n\nThe defense: when the input is a complete coding sequence, pass `cds=True`. It converts silent traps into loud `TranslationError` exceptions by validating start, length, and stop. Use it for ORF validation rather than trusting a clean-looking output.\n\nSince the Biopython 1.78 alphabet removal, `transcribe()`, `back_transcribe()`, and `translate()` perform NO type checking. Transcribing a protein or translating the wrong strand returns silent garbage. Confirm the molecule and strand before converting.\n\n## Required Import\n\n```python\nfrom Bio.Seq import Seq\nfrom Bio.Data import CodonTable\n```\n\n## Transcription Is a String Operation, Not Biology\n\n`transcribe()` is a pure T->U replacement on the coding (sense) strand; `back_transcribe()` is U->T. Neither performs splicing, intron removal, 5' capping, or poly-A addition. The Biopython tutorial states plainly that all transcribe does is replace T with U.\n\n```python\ncoding_dna = Seq('ATGCGATCGATCG')\nrna = coding_dna.transcribe()        # Seq('AUGCGAUCGAUCG'), T->U only\nback = rna.back_transcribe()         # Seq('ATGCGATCGATCG'), U->T only\n```\n\nTrue biological transcription starts from the template strand, so reverse-complement first:\n\n```python\ntemplate = Seq('CGATCGATCGCAT')\nmrna = template.reverse_complement().transcribe()\n```\n\nTranslation accepts DNA or RNA directly, so explicit transcription is rarely needed before `translate()`.\n\n## Translation Basics\n\n```python\ncoding_dna = Seq('ATGTTTGGT')\ncoding_dna.translate()               # Seq('MFG'), from DNA\nSeq('AUGUUUGGU').translate()         # Seq('MFG'), from RNA\n```\n\n### Stop-Codon Behavior\n\n`translate()` substitutes `stop_symbol` (default `'*'`) for EVERY in-frame stop, so internal stops appear as `*` mid-protein. `to_stop=True` instead halts at the first in-frame stop and does NOT append the symbol.\n\n```python\nseq = Seq('ATGTTTGGTTAAGGG')\nseq.translate()                      # Seq('MFG*G'), stop shown, translation continues\nseq.translate(to_stop=True)          # Seq('MFG'), halts at first stop\n```\n\n## NCBI Codon Tables: Which Code, and the Consequence of the Wrong One\n\nBiopython exposes every NCBI genetic code by integer id or registered name. Selecting the wrong one is the #1 silent bug (see governing principle).\n\n| ID | Name | Key reassignments vs Standard | When it matters |\n|----|------|-------------------------------|-----------------|\n| 1 | Standard | none (baseline) | Most nuclear genes |\n| 2 | Vertebrate Mitochondrial | AGA\u002FAGG -> STOP; AUA -> Met; UGA -> Trp | Human\u002Fvertebrate mtDNA (4 stops: UAA, UAG, AGA, AGG) |\n| 3 | Yeast Mitochondrial | CUN (all four CU*) -> Thr; AUA -> Met; UGA -> Trp | **CTG -> Thr lives HERE, not table 12** |\n| 4 | Mold\u002FProtozoan Mito + Mycoplasma\u002FSpiroplasma | UGA -> Trp (only change) | Fungal\u002Fprotozoan mito; Mycoplasma |\n| 5 | Invertebrate Mitochondrial | AGA\u002FAGG -> Ser; AUA -> Met; UGA -> Trp | Insect\u002Fworm mito (AGA\u002FAGG=Ser, not STOP as in table 2) |\n| 6 | Ciliate Nuclear | UAA\u002FUAG -> Gln; only UGA stays stop | Tetrahymena, Paramecium (single stop) |\n| 11 | Bacterial\u002FArchaeal\u002FPlastid | same coding as Standard; expanded starts | Prokaryotes, plastids (differs from 1 mainly in initiation) |\n| 12 | Alternative Yeast Nuclear | CUG -> Ser (from Leu) | *Candida* CUG-Ser clade |\n\n**Explicit correction:** CTG -> Thr is table **3** (Yeast Mitochondrial). Table **12** is CUG -> **Ser**. Do not conflate them.\n\n```python\nseq = Seq('ATGGCCTGA')\nseq.translate(table=2)                            # by NCBI integer id\nseq.translate(table='Vertebrate Mitochondrial')   # by registered name\n\nCodonTable.unambiguous_dna_by_id[2]\nCodonTable.unambiguous_dna_by_name['Vertebrate Mitochondrial']\n```\n\n## Validating a Coding Sequence with cds=True\n\n**Goal:** Translate a complete ORF and have any structural defect raise a loud error instead of producing a silent wrong protein.\n\n**Approach:** Pass `cds=True`. It enforces four conditions, each raising `Bio.Data.CodonTable.TranslationError` on failure: (1) first codon is a start codon for the chosen table; (2) length is a multiple of 3; (3) sequence ends in a stop; (4) no internal in-frame stop. A valid alternative start (GTG\u002FTTG\u002FATT) is translated as M, biologically correct for fMet initiation. The terminal stop is stripped from the output.\n\n**Reference (BioPython 1.83+):**\n\n```python\ncds = Seq('ATGTTTGGTTAA')\ncds.translate(cds=True)              # Seq('MFG'), validated, terminal stop removed\n\nalt_start = Seq('GTGTTTGGTTAA')\nalt_start.translate(table=11, cds=True)   # Seq('MFG'), GTG start -> M under bacterial code\n```\n\nStart-codon lists differ by table: table 1 = TTG\u002FCTG\u002FATG; table 2 = ATT\u002FATC\u002FATA\u002FATG\u002FGTG; table 11 = TTG\u002FCTG\u002FATT\u002FATC\u002FATA\u002FATG\u002FGTG. A start valid under one table fails under another, which is exactly the loud signal `cds=True` provides.\n\n## translate() Parameters and Edge Cases\n\nSignature (the `Seq.translate` METHOD): `translate(table='Standard', stop_symbol='*', to_stop=False, cds=False, gap='-')`. The `Seq` method defaults to `gap='-'`, while both the module-level `Bio.Seq.translate(sequence, ...)` function and `SeqRecord.translate()` default to `gap=None`.\n\n- **Partial codon** (length not a multiple of 3): emits a `BiopythonWarning` and SILENTLY drops the trailing 1-2 bases. Easy to miss in a pipeline. Under `cds=True` the same condition becomes a loud `TranslationError`.\n- **Gaps:** because the `Seq` method defaults to `gap='-'`, a full gap codon `'---'` already translates to `'-'` (e.g. `Seq('GTG---GCCATT').translate()` -> `'V-AI'`, no error). A codon mixing gaps and bases (`'TT-'`) raises `TranslationError`. `SeqRecord.translate()` instead defaults to `gap=None`, so even a full `'---'` codon raises unless `gap='-'` is passed; mixed gap\u002Fbase codons still raise. For alignment-derived CDS, preserve codon and alignment semantics with `alignment\u002Fmultiple-alignment` or the project's established translation wrapper rather than assuming one gap-normalization policy.\n- **Dual-coding stop tables (27 Karyorelict, 28 Condylostoma, 31 Blastocrithidia Nuclear):** these reassign a stop codon so it codes both an amino acid and stop, so `to_stop=True` raises a `ValueError` (no single truncation point).\n\n```python\nSeq('ATGTTTGG').translate()          # BiopythonWarning, trailing 'GG' dropped -> Seq('MF')\nSeq('ATGTTTGG').translate(cds=True)  # TranslationError: length not a multiple of three\n```\n\n## Selenocysteine and Pyrrolysine Are Silently Lost\n\nSelenocysteine (Sec, one-letter U) is encoded by UGA and pyrrolysine (Pyl, one-letter O) by UAG, both normally stop codons. Recoding requires a SECIS (Sec) or PYLIS (Pyl) element that Biopython does NOT detect. No NCBI table maps UGA->U or UAG->O. Naive translation therefore yields `*` mid-protein, and `to_stop=True` SILENTLY truncates the protein at that position. Real selenoproteins (GPX, TXNRD, SELENOP) come out truncated or peppered with `*`. There is no clean Biopython workaround; flag these genes and handle the recoding event manually.\n\n## Six-Frame Translation\n\n**Goal:** Translate a DNA sequence in all six frames (three forward, three reverse) to expose every possible protein product.\n\n**Approach:** For each strand, offset by 0, 1, 2 bases, trim to a multiple of 3, and translate.\n\n**Reference (BioPython 1.83+):**\n\n```python\ndef six_frame_translation(seq):\n    frames = []\n    for strand, s in [('+', seq), ('-', seq.reverse_complement())]:\n        for frame in range(3):\n            length = 3 * ((len(s) - frame) \u002F\u002F 3)\n            fragment = s[frame:frame + length]\n            frames.append((strand, frame, fragment.translate()))\n    return frames\n\nseq = Seq('ATGCGATCGATCGATCGATCG')\nfor strand, frame, protein in six_frame_translation(seq):\n    print(f'{strand}{frame}: {protein}')\n```\n\n## Find All ORFs (Start to Stop)\n\n**Goal:** Identify all open reading frames (Met to stop) across both strands and all three frames, keeping only those above a minimum length.\n\n**Approach:** Translate each of the six frames, then scan each translation for Met-to-stop segments meeting the threshold.\n\n**Reference (BioPython 1.83+):**\n\n```python\ndef find_orfs(seq, min_protein_length=30):\n    orfs = []\n    for strand, s in [('+', seq), ('-', seq.reverse_complement())]:\n        for frame in range(3):\n            end = frame + 3 * ((len(s) - frame) \u002F\u002F 3)\n            trans = str(s[frame:end].translate())\n            aa_start = 0\n            while True:\n                start = trans.find('M', aa_start)\n                if start == -1:\n                    break\n                stop = trans.find('*', start)\n                if stop == -1:\n                    stop = len(trans)\n                orf = trans[start:stop]\n                if len(orf) >= min_protein_length:\n                    orfs.append((strand, frame, start * 3 + frame, orf))\n                aa_start = start + 1\n    return orfs\n\nseq = Seq('ATGCGATCGATCGATCGATCGTAA')\nfor strand, frame, pos, orf in find_orfs(seq, min_protein_length=3):\n    print(f'{strand} frame {frame} pos {pos}: {orf}')\n```\n\n## Inspect a Codon Table\n\n```python\ntable = CodonTable.unambiguous_dna_by_id[2]\ntable.start_codons                   # ['ATT', 'ATC', 'ATA', 'ATG', 'GTG']\ntable.stop_codons                    # ['TAA', 'TAG', 'AGA', 'AGG']\ntable.forward_table['TGA']           # 'W' under vertebrate mito code\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Plausible protein, wrong residues, no error | Valid-but-wrong `table=` (e.g. mito DNA on table 1) | Select the organism's NCBI table; use `cds=True` to validate |\n| `*` mid-protein or premature truncation | Selenoprotein\u002Fpyrrolysine UGA\u002FUAG, or wrong table where UGA=Trp | Use correct mito table for UGA=Trp; Sec\u002FPyl recoding is not automatic |\n| `TranslationError: First codon ... is not a start codon` | `cds=True` on a sequence not starting at a valid start for that table | Trim to the true start, or pick the table whose starts include it |\n| `TranslationError: ... is not a multiple of three` | `cds=True` on a partial CDS | Trim to a full ORF; without `cds=True` this only warns and drops trailing bases |\n| `TranslationError: Extra in frame stop codon found` | Internal stop under `cds=True` | Wrong frame, wrong table, or genuine internal stop; re-check frame\u002Ftable |\n| Garbage protein from a protein input | `transcribe()`\u002F`translate()` on a non-nucleotide Seq (no type checks since 1.78) | Verify molecule type before converting |\n| `KeyError` | Unknown table id or name | Use a valid NCBI id (1-6, 9-16, 21-31) or registered name |\n\n## Decision Tree\n\n```\nNeed to convert a sequence?\n├── DNA \u003C-> RNA (string-level T\u003C->U)?\n│   ├── coding strand to RNA -> seq.transcribe()\n│   ├── RNA back to DNA      -> seq.back_transcribe()\n│   └── template strand to mRNA -> seq.reverse_complement().transcribe()\n├── DNA\u002FRNA to protein?\n│   ├── alignment-derived CDS    -> alignment\u002Fmultiple-alignment (codon-aware), or project wrapper\n│   ├── complete CDS to validate -> translate(cds=True) [loud on defects]\n│   ├── stop at first stop only  -> translate(to_stop=True)\n│   ├── non-standard organism    -> translate(table=N)  [pick from the table above]\n│   └── show internal stops      -> translate()  [* per stop]\n└── Unknown coding regions? -> six-frame translation, then scan M...* for ORFs\n```\n\n## Related Skills\n\n- seq-objects - Create and inspect Seq objects before translation\n- reverse-complement - Strand handling for six-frame translation and template-strand transcription\n- codon-usage - Analyze codon bias and adaptation in coding sequences\n- sequence-io\u002Fread-sequences - Parse GenBank\u002FFASTA records and CDS features for translation\n\n## References\n\nThe genetic-code tables and their organism assignments follow the NCBI Taxonomy \"The Genetic Codes\" page, compiled by Andrzej (Anjay) Elzanowski and Jim Ostell at NCBI (https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002FTaxonomy\u002FUtils\u002Fwprintgc.cgi). This is a maintained web resource; cite it as the NCBI page rather than as a journal article.\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","sequence-manipulation\u002Ftranscription-translation\u002FSKILL.md","Bio.Seq","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-transcription-translation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-transcription-translation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-transcription-translation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-transcription-translation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002FSKILL.md",true,[50,56,60,64],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fbasic_conversion.py","SCRIPT","脚本",1031,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002Fexamples\u002Fbasic_conversion.py",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fcodon_tables.py",2048,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002Fexamples\u002Fcodon_tables.py",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"examples\u002Forf_finding.py",1907,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002Fexamples\u002Forf_finding.py",{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"usage-guide.md","REFERENCE","参考文档",3894,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-transcription-translation\u002Fusage-guide.md",[71,79,86,93,100,107],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":78},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":78},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":78},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":78},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":78},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":78},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]