rosalind练习题二十二

给定一个DNA字符串和内含子序列,程序通过移除内含子并将DNA序列转录为RNA,然后翻译成蛋白质序列。使用Bio.Seq模块进行操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

# Problem
# After identifying the exons and introns of an RNA string, we only need to delete the introns and concatenate the exons to form a new string ready for translation.

# Given: A DNA string s (of length at most 1 kbp) and a collection of substrings of s acting as introns. All strings are given in FASTA format.
# Return: A protein string resulting from transcribing and translating the exons of s. (Note: Only one solution will exist for the dataset provided.)

# Sample Dataset
# >Rosalind_10
# ATGGTCTACATAGCTGACAAACAGCACGTAGCAATCGGTCGAATCTCGAGAGGCATATGGTCACATGATCGGTCGAGCGTGTTTCAAAGTTTGCGCCTAG
# >Rosalind_12
# ATCGGTCGAA
# >Rosalind_15
# ATCGGTCGAGCGTGT
# Sample Output
# MVYIADKQHVASREAYGHMFKVCA

# 给出一段序列,给了2个内含子序列,需要将2个内含子去掉,将剩余的序列转录为RNA,翻译成蛋白质。

from Bio.Seq import Seq

seq = Seq("ATGGTCTACATAGCTGACAAACAGCACGTAGCAATCGGTCGAATCTCGAGAGGCATATGGTCACATGATCGGTCGAGCGTGTTTCAAAGTTTGCGCCTAG")
intron_list = ["ATCGGTCGAA", "ATCGGTCGAGCGTGT"]
seq2 = seq.replace(intron_list[0], "")
seq3 = seq2.replace(intron_list[1], "")

# 转录DNA序列
rna_seq = seq3.transcribe()

# 翻译RNA序列
protein_seq = rna_seq.translate()

print(protein_seq)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值