-
Notifications
You must be signed in to change notification settings - Fork 2
/
InferringmRNAFromProtein.py
25 lines (22 loc) · 2.57 KB
/
InferringmRNAFromProtein.py
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
amino_codon = {'A':4,'R':6,'N':2,'D':2,'C':2,'Q':2,'E':2,'G':4,'H':2,'I':3,'L':6,'K':2,'M':1,'F':2,'P':4,'S':6,'T':4,'W':1,'Y':2,'V':4}
def codon_freq(proteinString):
numberofRNAs = 1;
length = len(proteinString)
i=0
while(length !=0):
numberofRNAs *= amino_codon[proteinString[i]]
i+=1
length-=1
return (numberofRNAs*3)%1000000
inputString1 = 'MDCLDWSAFIDVCMYVDCAVSVLLIRYIEAYIFHGADASTNIHEKYGRQIQCEECIQCDTFECVWQHWKECEVVCIDRMPAMPQASFSALPAASFRED' \
'GYCNVIVHVPQSPDGSIFADCSKRHFQDMYDQFNTFDMDQRTIQRITSGHFMSQHFFFYFLYAWRWCVPSFIDVSKSKYDVNIAVDSCIMFKNVMFSWQVF' \
'TQSFWTTGMACCRVRRFSLVGDMEAQGIDFHWCHMHFMGWVRLMFGAINEHWPAAGSFQTHVMQAWINSEKAKMRLQALLDCASMSYPMMCNDRTTYFMMQALD' \
'EMDLGEFETHPVIEHMKMLAPEIHMWDILIGWCPIGVGLNSSYGKSATIDSQLQYEDGNQKWSVVPAFNRLLKCACSAMQPTNGQPDGLTFLCNHHTQPTNHD' \
'DWFPSMYSKIHRIERLALINKPGWWWATCCHADEKIFFAKLYYHWTFPNVAKVNKPKRMLIKSGWMRWLPFRCHSVAYCECQKMCQSSYTIDYAGTNMPYGMAEGC' \
'QSYDMEHAKLVTDSFWFFWWWFQKQNSNFTMMNQRRMGKSYSIQYTNFNLDACGNYTTCDAHGDCALVGSKNWDDVTIGSRQWQKAINYYEFAMNLDAKIMMPVY' \
'RSKHQCSPKCEMHWCSHTTKRAHSMIKSMQDWCNRWNIPIISMLCACSFLLTGTCRKKCYDFNLEIQRLK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