2 回答

TA貢獻1995條經驗 獲得超2個贊
這是做我在問題中描述的最基本的方法,但是,請注意,如果有人試圖找到 ORFS 和轉錄基因,在使用 python 的程序中,有一些生物學規則需要考慮,閱讀和停止應該考慮密碼子,但是,這只是一個關于如何開始構建代碼的示例:另外,請注意此代碼使用 biopython
從 Bio.Seq 導入 Seq 從 Bio.Seq 導入轉錄
genelist=[]
gene_1= 'A','C','G','G','A','C','T','A','T','T','C'
gene_2= 'G','G','C','C','A','T','G','A','G','T','A','A','C','G','C','A','T','A','G','G','G','C','C','C'
gene_3='G','G','G','C','C','C','A','T','G','A','C','G','T','A','C','T','A','G','G','G','G','C','C','C','A','T','G','C','A','T','T','C','A','T','A','G'
genelist.append(gene_1)
genelist.append(gene_2)
genelist.append(gene_3)
def transcription(ORF):
? ? mRNA= ''
? ? foundStart = False
? ? foundEnd = False
? ? for i in range(0, len(ORF), 3):
? ? ? ? codon= "".join(ORF[i:i+3])
? ? ? ? if codon == 'ATG' and not foundStart:
? ? ? ? ? ? foundStart = True
? ? ? ? if foundStart and not foundEnd:
? ? ? ? ? ? cc=transcribe(codon)
? ? ? ? ? ? mRNA = mRNA + transcribe(codon)
? ? ? ? if codon == 'TAG':
? ? ? ? ? ? foundEnd = True
? ? ? ?
? ? return(mRNA)
mRNAs=[]
for gene in genelist:
? ? mRNA = transcription(gene)
? ? mRNAs.append(mRNA)
print(mRNAs)

TA貢獻1802條經驗 獲得超6個贊
與其列出每個氨基酸,不如嘗試將基因轉換為字符串并使用正則表達式查找起始和結束位點?基因 3 會不會是一個多順反子基因而不是一個帶有外顯子的基因?
是這樣的:
import re
gene = 'GGGCCCATGACGTACTAGGGGCCCATGCATTCATAG'
rna = re.findall('ATG(.+?(?=TAG))', gene)
添加回答
舉報