Python基础-生物信息:找出基因,生物学家使用字母A、C、T和G构成的字符串建模一个基因组。,,生物信息:找出基因,


生物信息:找出基因,生物学家使用字母A、C、T和G构成的字符串建模一个基因组。
一个基因是基因组的子串,它从三元组ATG后开始在三元组TAG、TAA或TGA之前结束。
此外,基因字符串的长度是3的倍数,而且基因不包含三元组ATG、TAG、TAA和TGA。
编写程序提示用户输入一个基因组,然后显示基因组里的所有基因。
如果在输入序列中没有找到基因,那么程序显示“no gene is found”

s=input(‘Please input the Gene String:\r\n‘)endsplit=[‘TAG‘,‘TAA‘,‘TGA‘]if ‘ATG‘ in s:    for i in s.split(‘ATG‘):        for j in endsplit:            if j in i:                print(i.split(j)[0], end=‘\t‘)else:    print(‘no gene is found‘)

Python基础-生物信息:找出基因,生物学家使用字母A、C、T和G构成的字符串建模一个基因组。

评论关闭