codon_table={"GCU":"A","GCC":"A","GCA":"A","GCG":"A","CGU":"R","CGC":"R","CGA":"R","CGG":"R","AGA":"R","AGG":"R","UCU":"S","UCC":"S","UCA":"S","UCG":"S","AGU":"S","AGC":"I","AUU":"I","AUC":"I","AUA":"I","AUU":"I","AUC":"I","AUA":"I","UUA":"L","UUG":"L","CUU":"L","CUC":"L","CUA":"L","CUG":"L","GGU":"G","GGC":"G","GGA":"G","GGG":"G","GUU":"V","GUC":"V","GUA":"V","GUG":"V","ACU":"T","ACC":"T","ACA":"T","ACG":"T","CCU":"P","CCC":"P","CCA":"P","CCG":"P","AAU":"N","AAC":"N","GAU":"D","GAC":"D","UGU":"C","UGC":"C","CAA":"Q","CAG":"Q","GAA":"E","GAG":"E","CAU":"H","CAC":"H","AAA":"K","AAG":"K","UUU":"F","UUC":"F","UAU":"Y","UAC":"Y","AUG":"M","UGG":"W","UAG":"STOP","UGA":"STOP","UAA":"STOP"}
rna=''
for line in open("A06662-RNA.fasta"):
if not line.startswith(">"):
rna=rna+line.strip()
#translate one frame at a time
for frame in range(3):
prot=''
print 'reading frame '+ str(frame + 1)
for i in range(frame, len(rna), 3):
codon=rna[i:i+3]
if codon in codon_table:
if codon_table[codon] == 'stop':
prot = prot + '*'
else:
prot = prot + codon_table[codon]
else:
#handle too short codons
prot = prot + '+'
#format to blocks of 48 columns
i=0
while i < len(prot):
print prot[i:i + 48]
i= i + 48
将RNA序列翻译为蛋白质序列
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 澜妈想问下魅宝们,是否有过这样的疑惑,为什么同样的饭,闰蜜吃了没反应,自己却在疯狂的长肉?为什么!为什么!!为什么...
- 陪你见证孩子的每一步成长 观察是有目的、有计划、比较持久的知觉[1]。儿童期观察力开始形成并迅速发展。由无到有,观...