rosalind练习题二十二

# 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)

你可能感兴趣的:(python)