-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSPLC 2
36 lines (31 loc) · 885 Bytes
/
SPLC 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from Transcribing_DNA_into_RNA import transcription
from Translating_RNA_into_Protein import translation
def splicing_rna(s,lst):
for intron in lst:
while s.find(intron) != -1:
edited = ''
start = s.find(intron)
stop = start + len(intron)
edited+= s[:start]+s[stop:]
s = edited
RNA = transcription(s)
protein = translation(RNA)
return protein
with open('rosalind_splc6.txt', 'r') as file:
content = file.read()
lst, List= [], []
splited = content.splitlines()
for i in range(len(splited)):
if splited[i][0] == '>':
lst.append(i)
for j in range(len(lst)-1):
i, l = lst[j], ''
i += 1
if len(lst) > j:
while i != lst[j+1]:
l += splited[i]
i += 1
List.append(l)
List.append(splited[-1])
s = List.pop(0)
print(splicing_rna(s, List))