-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpoint_mutation_calc.py
16 lines (11 loc) · 2.12 KB
/
point_mutation_calc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#point mutation calculation
s = 'ACGTGCGCGACGACTCATAACGGGGAACTGGAGTCCTCTCTGAGCGAGCAAGGAATCAGCCACACCACGTCAGCGAGTAAAATGGAGAGTGCAAGGTTGAAATTTGGTTGCTTCGGGATTGATCGGGAATCGATACCCACACTATGTAGGACGGGGCCCATACCGTGGCAAACTGCGTCCTGTTTTAGATACAGTCTTTTAGTCAGTGCAGGAAAGCGGAGCAATCTTGAGGCACGGCTTTGATGTCCATGGGAATAGTCTCTTCGCCCATTAAACTTTATGGCAATGTTTGTGGTCCGTGAGGTGGACAAATTTCGTAGTTCTCCATAGAATCAACATATGCGAGGACTGTGTTCTTGCCACTGCATCAATGATGTAAGGTTACATTAGTCATCACGGTATTGAAATATAGTTGGCTATACAAGGTAAACTGACAGCATCCTTTATGTGCCATCCACGATGGATCCCTTATCCCCCCATCCGGTGAGTATTAGCCTACCAGCTGTCTGGCAACTGTGTCTTCGCCGAGCAGCCGAGCGTTATTCGGGACACGCTCTGCAGACCTCGGGACCGCCGGTGAGTAATCAAACTTCTGGCGGTGCCCGTGGCCCCTTTAGCGAATATTTCCTGACTTTATATTGTCCCTTAGGCTTAAGGAGACTAACCCAGCTAGGCCTCCGGGGCGATTTTTTGATTCATATGGAGGCGAAACAGTGAGATTTCCCATTAAGAGTATATTGAGGCATACACCCCCCAAGGTATTCCCTCTGGGTCGCGCGTGCAGTTTTTTACGGTCGCTTGTTGTCTTAATGCGCGCTGGTTGATCGCGCATGGACCAATCTATATCCTGTGCCTGTACTCTAGTCTAATCAATATGCACGGACTGCCTACCAGTAAAAGCATTGTACGTAGCTCAAATCTCGACGAACACC'
t = 'ACGCACTGTACGTCCTGTAACGGTATAAGGGACATCGCGCTCAGCGAGAGTTTACGGCGCTACCGTACCTTAGCAGGTAATATCGAGCAACCATAGTACAGCTTACCGGGCGCCGAGATTGTGCGGAAACCAGTGTCTATTATAAGGGGGAGGGCGCGCGAAGATAAGCAGTCTGGGTTGTGTGTGAGCGCCAGACTATTAATTCGAAAAAGACTCCAGAACGTGCAGGAGTCCAGGTGGTAAGGTGCTTTGGTATATTCGCCTCTCCTGTTTAGCTTCGTGATAACATTCATGGGCCGCCTGAGAAAGACTGCACGGGACTGTGCTAAAAATCTACTGCGGCCCAAACGGCGTATTTTCCCCTGCGCTCATCGTATAGTGTTAAATCTGAGGACACAACATTTAAATATTGTGGGCAATACGAGGGACCATTACCGCAGGTATTCTGCCACCGTACATACCATTCTCGTCCTTAACGGTCGGGTAAGTATTTGCCTTGCAGCTGACTTGCAACTAGGTGTTCGCAGACTCGCCGTGCAACTATGGCGACTCATCAATCATGCCTCGGGACCTCAAATTCGTGTTTAGCATTTCGTGGAGGTTCCTGCACCCTCAGCCTGTAAGGACCCGCCTATGCATGGAATCAAACAGCTTGAAATGGTGATCCAGAACAGCGTCCTTTACGAATTCGTCACACGAATTCAGTCGACACATTCCGAGTTCCGATCCCAAGCAAGATGCGGTCAACTGCTGTCATGCTGTCCAGTCTATTGTTCGCGCTCACTTTAATACGGGTACGCGCTCTGGTAATTGTCCCCCGTGGAATTAGCATGTTGTAATCTTAATTTTGGAACAACATCCGAGATAACTATATACTCTGGTGAGGGCTATAAGGTTAAGTACTAGCAATCTCCAATCTCTCTAGCGCATAC'
def cnt_mutation(s, t):
l = min(len(s), len(t))
result = abs(len(s) - len(t))
for i in range(0, l):
if s[i] != t[i]:
result += 1
return print("The humming distance (amount of point mutation) is "+ str(result))
cnt_mutation(s,t)