-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRosalind Problem 1 DNA.py
executable file
·26 lines (22 loc) · 1.31 KB
/
Rosalind Problem 1 DNA.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
def count(string):
A=0
G=0
C=0
T=0
for letter in string:
if letter == 'A':
A = A + 1
elif letter == 'G':
G = G + 1
elif letter == 'C':
C = C + 1
elif letter == 'T':
T = T + 1
print A, C, G, T
def count2(string):
A = string.count('A')
C = string.count('C')
T = string.count('T')
G = string.count('G')
print A, C, G, T
count2('CTCATCAGTACACTTCCAGGACTCACGGAGTAACTACAATGACTTCTAGCCGAACTCGCGGTTATCGCTGATTCAAGCTTCAGGCACCCTTGCCGGTCAGATTTCAGTGCTAGAACGTTTGTAAAGGTGGATAAGTCTCGAATCAACAGCGGCACCGTTCAGTCAATCAATCACAGCCTTCGCCCTTGCCACTCTGAGGCGTTGGCGTGTGGCCGAGAACTCCATAAACGCGGCAGCCAAGTTTGCCGCGTGAAGCCTAATTCACCTTGTCGTATTTCATTAAGCTTCCTGAAAGCCCACTGACGTCTGACATACTAGTCTAAGCATGACCAATCGAGGCCCAATCTAGAAGCATGCTGGGTAGACTAATCATGAGGGTCCTCGGCGTAATGATCACTGTAACCACACTGTCCAACCGGAACAACAGTTAACCGCCCCACCCGTTACAAGAGTGCAATGGTCCATTCTGCTTTTTCCGATGTCTTGAAAATCGAGGAGGCCCTGGGAGGACTGGATTTATTGCAGCTCTTATTCGCTCCACGCGTGTCAACCTCAGGTAGCTGTAATTTCACTTTGTCTCATGGATCAAAATTGCGGTCATAATCATGGGTTCGTGGGATACGCGACGTGCCGAATCGACTCTTTATGCGCTGAAAGCCTCCCGTTAATCAACCGCGTGTAGATCCAGTAGCTATCATGACAGCGGGGCGGCCATCACGGAGTGGATTTGGCAGAGAGACATAGGTACTTTAGCTAATTCCAAAGATCATAGGGCCGCTTCGACTTCTTTTGTCGGAACGTACAGTCGGCTCGACTCTTGCCTGATAGATGCCTCTAGGAGTTAGAACCTGCGCTTACCATTACTGAATACTTCGATTGGGCA')