-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrosalind_execute.py
97 lines (59 loc) · 5.98 KB
/
rosalind_execute.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from rosalind_dna import *
if __name__ == "__main__":
#f = open("rosalind_subs.txt")
#for i in counting_dna_nucleotides(f.read()):
# print(i, end=" ")
#print()
#print(complementing_a_string_of_dna(f.read()))
#for p in finding_a_motif_in_dna("ACGGAGCAC","TCAACGGAGCACGGAGCGTCTGGACGGAGCACGGAGCACGGAGCAATACGGAGCTACGGAGCCTTACGGAGCACCACACGGAGCTGTTAACGGAGCGGGGCAACTGTCACGGAGCGGTTCCACGGAGCTAACGGAGCTCTTGACGGAGCCGAAACGGAGCAACGGAGCACGGAGCACGGAGCGCGATGACGGAGCACGGAGCTATACGGAGCACGGAGCTACACGGAGCACGGAGCTACGGAGCACGGAGCACGAACGGAGCGTGCGGCACGGAGCAACGGAGCATGTACGGAGCGACGGAGCATTTGACGGAGCATAATACGATGAACGGAGCACGGAGCACGGAGCGTGACGCCACGGAGCACACGGAGCTTACGGAGCGCGCAGAACGGAGCTGAACGGAGCTTACGGAGCGCCACGGAGCTCGAGACGGAGCAGCTCACGGAGCCGGACGGAGCACGGAGCACGGAGCATAACGGAGCACGGAGCGGACGGAGCACGGAGCCGGGACGGAGCTTACGGAGCGAGGACGGAGCACGGAGCGACGGAGCGACGGAGCAACGGAGCTCACGGAGCCCCCACGGAGCAACGGAGCAACGGAGCCACACGGAGCACGGAGCAGGACCATACGGAGCGCGTCACGGAGCTACGGAGCTGACGGAGCCACGGAGCACACCACGGAGCTACAATACGGAGCCTCCGACGGAGCCACCTACGGAGCACGGAGCATACGGAGCAACGACGGAGCTGCGACGGAGCACGGAGCCGACGGAGCGGACGGAGCACGGAGCACGGAGCGACGGAGCCCAACGGAGCGGAACACGGAGCCTCGACGGAGCAACGGAGCGACGGAGCTAAACGGAGC"):
# print(str(p), end=" ")
#print()
#print(counting_point_mutations("CCTTTAAACAGATTCTACTTGTCTTCACTATTGAATGAATCATATATGCCTCTCAAAGCTGAGAGTGTTTAACGTATAAGAGAGGGTGATGACCCATTCATGGATCTATTAGGCGTAGGGAAGAGATAGCGCTCCCTAGAAGACAACCGCTCCTGAGTGTAGCCTACCTGTCAGAGACGGCTTGACTCAATGCGATAGATAGAAGTTATGGTCCTTTGTGTCATTCACGCCAGGGAATTTCTATTAGGCCATCAATCTTCCCCCAGCCGTTGATCTTTCAACCATCAAAGGGAGCAAACCGCGTCTGAGAATAACCGCGGGGGTCCACGACTCGTGACCGAGACAAGACTTCAATATCGTGACGTTGAATTTCCATGTGAACCTCAGCGCTACGCACAGGTATTTGTCAGCGGGATTAGCATGCCTAATTGCCACTTGTCCCGGGCATGGCTCCCGTCAGGGGCGCTGCCTATTCAGGTACCCGTTATAAAACGCTGTTTGGACGACCAAGAACAGAAAACCGAGGATGTGACAGGTTGCTTCTGCCCGTGTGGGAATGGCACTTGAACTACTTGCATTTAATTGGGGATTGGCTGCGATATCCGCTGCCAATACGATGAATATCGGCCGTTGAGGTTGTCAGAATATTGATCAGTCTTTGCACATATTCAGCAGCAGGGACTACCGAGGCCCCTGATTAGTTGCCGTTAGCGTCAAAGGATTGCACACACGGACAGCGAGTCATGGATATGCCGGACTTGTCAGGCGCGCTCTGATCCGTAATATAGCTCGTGTCTTGCAGTACCCTCTATATAATGATAAGAATTTTTCAGGACTACCCTTAGTAGAATGAGGAGTCTGAAACAACTAGTATGGTCGATCTCAACGCTAAGAGAGTGTTTCCTTAACCGAAACCTCTTAGAATATCTAATCCTACAA",
# "CTGATGACTGCTTTCGAGACTTCATATCTTTTACTTGTATCATGTAATCCTCCGCACGCTGTAAGTGCTATTCACTTAAACGAGGGTGCTTTCCAAATGATTGAAGAATGACGAGTATGGAGCAGAACGTCGGGCATATGAAAAAAGCAGTTGTTCGCCCCTTTAAACCGTCTTACAGGGCTACAGTGAATCAGCTCCATATAAATTAAGATGCCCGGGAGGGGTCACGACTGGAAATGCATGATGTGCAATCAATCCTTTGCGAGCTTTCCCTCTTGCAACCATCAAATGGTTCTAGAGCCGGTTGCGGATGTGCGGGAGAGACCAAGAGCGTTCGCGAACATACGACTGCCATCTCTTGCGTTTTGACGAAGGGTTCAGTGTCCGCGCTACGTACTGGTAAAACCGGGCCACATAGGGATGGCAAGTTCCCTCTTGTCCGGGCACTGACCACGGAAGGCACCTCGGGCTTTACAGGGACTTCTTTTATCGTAATGTTAGGTCTTCCAAGAGTTAATAAGCAATGAAGGGGACGCGTAATTATGTCAACCCGGGGTTTGTACGAGTCACACTCTTTGCGGATCTTGGCTTTAGAGCGTACGCCGCTATCTAGGTAACAAGACGCGACAGTGCAGCCAATAGGAAAGTGTAAGTATACAATAAGATAATCAGAATGTAGTGATCCATAGGCGATGGGGTAGCTCCCTTCTCCGTCAGGGCGCCGCACTGGTGTTCATCGGGCTAGGGATACGCCGGAGCCCTCGTAGGCGACTAGATGTCTGATTTTGCTTTTGTCTTGCTCTAGCCTTTACTTGTCATGATCAGCATCGCATGCGTACCCTCCGCAGAATCACCTGTGAAAATTCACGCGTTGTATGTTTCGTCAGGTTTCGTGTGTGTACACTGCACTAAAACCCACGGGAATATGAAGCCCCACAC"))
#for edge in overlap_graphs(read_fasta("rosalind_grph.txt"), 3):
# print(" ".join(edge))
#for k, v in read_fasta().items():
# print("label: " + k)
# print("dna: " + v)
# print("------------------")
#fl = open("rosalind_mprt.txt")
#proteins = [ p.strip() for p in fl.readlines()]
#show_a_protein_motif_position(proteins)
#dnas = read_fasta(open("rosalind_cons.txt").read())
#d = []
#for dna in dnas.values():
# d.append(dna)
#profile, consensus = consensus_and_profile(d)
#print(consensus)
#print("A: " + " ".join([str(n) for n in profile["A"] ]))
#print("C: " + " ".join([str(n) for n in profile["C"] ]))
#print("G: " + " ".join([str(n) for n in profile["G"] ]))
#print("T: " + " ".join([str(n) for n in profile["T"] ]))
#sub = ["ATCGGTCGAA","ATCGGTCGAGCGTGT"]
#dna = "ATGGTCTACATAGCTGACAAACAGCACGTAGCAATCGGTCGAATCTCGAGAGGCATATGGTCACATGATCGGTCGAGCGTGTTTCAAAGTTTGCGCCTAG"
#dnas = read_fasta_list(open("rosalind_splc.txt","r").read())
#dna_res = delete_instrons(dnas[0], dnas[1:])
#rna = transcribing_dna_into_rna(dna_res)
#protein = translatin_rna_into_protein(rna)
#print(protein)
#print(mortal_fibonacci_rabbits(87,16))
#print(finding_a_shared_motif(read_fasta_list(open("rosalind_lcsm.txt","r").read())))
#fasta = read_fasta_list(open("rosalind_sseq.txt","r").read())
#for x in subsequence_indexes(fasta[0],fasta[1]):
# print(x, end=" ")
#print("")
#fasta = read_fasta_list(open("rosalind_lcsq.txt","r").read())
#print(finding_a_shared_spliced_motif(fasta[0],fasta[1]))
#dna = read_fasta_list(open("rosalind_orf.txt","r").read())[0]
#for i in distinct_protein_candidates(dna):
# print(i)
#perms = permutations(5)
#print(len(perms))
#for p in perms:
# for n in p:
# print(n,end=" ")
# print("")
#dna = read_fasta_list(open("rosalind_revp.txt","r").read())[0]
#for p in reverse_palindrome(dna):
# print(str(p[0]) + " " + str(p[1]))
print(calculating_protein_mass('RQERGWRRITSVPGYMAAAYKDKTNTYENCVPMRRYMHDTVYTMVNMIYNGQYFGHMIDMGLKCTTSGECDCAGFPKSNLDWWMDGGCYLHLWKKHAPNMDGRSVFVMGHKKNEWHGDVRWYMGLGALVSWLEVNQKGRMWAGGKRINQFLEMMGTTIPTQGKNQVCTCIFENTYFIFSPNQMMRLNSAVCMMEVTHARRSCFTHHHKGYKWICCTHEMYHDGPCRSCAMLKDVGRISCDCHDDSVFAVNDMRKMPIHPNTVYYEHWFFNDIAEFNLVRLETWMNAATGTDEHNVLIKPHHGVPPCVLISVFYKRGNMFSSFHVQGKGIAGMMADAGINCTTRKCHDFEGNQADFISMFQLYHRVCVIASIAPTPPNLWVRPAPDGYQMCSTCRRQMWWPEQNDIYINIMNAWPCNCNIMRALWCAINEAEHLTYTAECSWVGFEMCLGLYEVAPNALVNIGFMWITNVMEHSTRGQYYWEPDFRSDNQWYPCGILPFFLIRCENGYDWMPYYFFIAHNSWHMFTDIGEHHAYIQPELCLMWTCAWRIWPSRNYGHAQGLMTFYQTWQAIYYNVCEFWFWQCFHWCDVPGISPAKNAYTGTREVNKPKCAYQIRSIGDKEKCRTQSYHRWKSGIYDAFKRHRAVTVCNAYASVDCCCNSVLNHMIGIPCSGCYTSTDWQPMRNKNGIKTCHVLRQETGMEVDFNQTDKNFLLCIPMNECFTHMDHWSWAKTEGSYNMDINGGACRICDDGNDLHHQLFITDFEGPLWYMTWRNFSEICTWPQHWVHPCILFGVVVRGTDMGVVHHWRGCQAPFMQVSRSQWYWCCALSEIFQACPNGKAEFLAPNHKTGCVCTQ'))