Bio.Data.CodonTable 模組
基於 NCBI 的密碼子表。
這些表是基於解析 NCBI 檔案 ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt,並使用 Scripts/update_ncbi_codon_table.py。
上次更新於版本 4.4 (2019 年 5 月)
- exception Bio.Data.CodonTable.TranslationError
基底:
Exception
用於存放特定轉譯例外狀況的容器。
- class Bio.Data.CodonTable.CodonTable(nucleotide_alphabet: str | None = None, protein_alphabet: str | None = None, forward_table: dict[str, str] = forward_table, back_table: dict[str, str] = back_table, start_codons: list[str] = start_codons, stop_codons: list[str] = stop_codons)
基底:
object
一個密碼子表,或遺傳密碼。
- __init__(nucleotide_alphabet: str | None = None, protein_alphabet: str | None = None, forward_table: dict[str, str] = forward_table, back_table: dict[str, str] = back_table, start_codons: list[str] = start_codons, stop_codons: list[str] = stop_codons) None
初始化類別。
- forward_table: dict[str, str] = {}
- back_table: dict[str, str] = {}
- start_codons: list[str] = []
- stop_codons: list[str] = []
- __str__()
回傳密碼子表的簡單文字表示。
例如
>>> import Bio.Data.CodonTable >>> print(Bio.Data.CodonTable.standard_dna_table) Table 1 Standard, SGC0 | T | C | A | G | --+---------+---------+---------+---------+-- T | TTT F | TCT S | TAT Y | TGT C | T T | TTC F | TCC S | TAC Y | TGC C | C ... G | GTA V | GCA A | GAA E | GGA G | A G | GTG V | GCG A | GAG E | GGG G | G --+---------+---------+---------+---------+-- >>> print(Bio.Data.CodonTable.generic_by_id[1]) Table 1 Standard, SGC0 | U | C | A | G | --+---------+---------+---------+---------+-- U | UUU F | UCU S | UAU Y | UGU C | U U | UUC F | UCC S | UAC Y | UGC C | C ... G | GUA V | GCA A | GAA E | GGA G | A G | GUG V | GCG A | GAG E | GGG G | G --+---------+---------+---------+---------+--
- __annotations__ = {'back_table': dict[str, str], 'forward_table': dict[str, str], 'start_codons': list[str], 'stop_codons': list[str]}
- Bio.Data.CodonTable.make_back_table(table, default_stop_codon)
建立一個反向表(簡單的單一密碼子映射)。
只回傳一個單一密碼子,從可能的選項中根據其排序順序選擇。
- class Bio.Data.CodonTable.NCBICodonTable(id, names, table, start_codons, stop_codons)
基底:
CodonTable
用於一般核苷酸序列的密碼子表。
- nucleotide_alphabet: str | None = None
- protein_alphabet = 'ACDEFGHIKLMNPQRSTVWY'
- __init__(id, names, table, start_codons, stop_codons)
初始化類別。
- __repr__()
將 NCBI 密碼子表類別表示為字串,以便進行除錯。
- __annotations__ = {'back_table': 'dict[str, str]', 'forward_table': 'dict[str, str]', 'nucleotide_alphabet': typing.Optional[str], 'start_codons': 'list[str]', 'stop_codons': 'list[str]'}
- class Bio.Data.CodonTable.NCBICodonTableDNA(id, names, table, start_codons, stop_codons)
基底類別:
NCBICodonTable
適用於明確 DNA 序列的密碼子表。
- nucleotide_alphabet: str | None = 'GATC'
- class Bio.Data.CodonTable.NCBICodonTableRNA(id, names, table, start_codons, stop_codons)
基底類別:
NCBICodonTable
適用於明確 RNA 序列的密碼子表。
- nucleotide_alphabet: str | None = 'GAUC'
- class Bio.Data.CodonTable.AmbiguousCodonTable(codon_table, ambiguous_nucleotide_alphabet, ambiguous_nucleotide_values, ambiguous_protein_alphabet, ambiguous_protein_values)
基底:
CodonTable
用於不明確序列的基礎密碼子表。
- __init__(codon_table, ambiguous_nucleotide_alphabet, ambiguous_nucleotide_values, ambiguous_protein_alphabet, ambiguous_protein_values)
初始化類別。
- __getattr__(name)
將屬性查找轉發到原始表格。
- Bio.Data.CodonTable.list_possible_proteins(codon, forward_table, ambiguous_nucleotide_values)
傳回不明確密碼子的所有可能編碼胺基酸。
- Bio.Data.CodonTable.list_ambiguous_codons(codons, ambiguous_nucleotide_values)
擴展密碼子列表以包含所有可能的不明確密碼子。
例如
['TAG', 'TAA'] -> ['TAG', 'TAA', 'TAR'] ['UAG', 'UGA'] -> ['UAG', 'UGA', 'URA']
請注意,['TAG','TGA'] -> ['TAG','TGA'],這不會添加 'TRR'(也可能表示 'TAA' 或 'TGG')。因此,在以下情況下只會添加兩個密碼子
例如
['TGA', 'TAA', 'TAG'] -> ['TGA', 'TAA', 'TAG', 'TRA', 'TAR']
傳回新的(更長的)密碼子字串列表。
- class Bio.Data.CodonTable.AmbiguousForwardTable(forward_table, ambiguous_nucleotide, ambiguous_protein)
基底:
object
用於翻譯不明確核苷酸序列的前向表格。
- __init__(forward_table, ambiguous_nucleotide, ambiguous_protein)
初始化類別。
- __contains__(codon)
檢查密碼子是否可用作不明確前向表格的索引鍵。
只有在 forward_table[codon] 傳回值時,才會傳回 'True'。
- get(codon, failobj=None)
為類似字典的行為實作 get。
- __getitem__(codon)
為 AmbiguousForwardTable 實作類似字典的行為。
forward_table[codon] 會傳回一個胺基酸字母,或拋出 KeyError(如果密碼子沒有編碼胺基酸)或 TranslationError(如果密碼子確實編碼胺基酸,但也是終止密碼子,或編碼多個胺基酸,且在給定的字母表中沒有唯一的字母可使用)。
- Bio.Data.CodonTable.register_ncbi_table(name, alt_name, id, table, start_codons, stop_codons)
將密碼子表資料轉換為物件 (PRIVATE)。
資料儲存在字典中。