Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import argparse
- import re
- def Repetition(dna_a, dna_b):
- repetition = {}
- cont1 = 0
- while cont1 < len(dna_a):
- cont2 = 0
- if dna_a[cont1] not in repetition.keys():
- while cont2 < len(dna_b):
- if (dna_a[cont1] == dna_b[cont2]):
- if dna_a[cont1] not in repetition.keys():
- repetition[dna_a[cont1]] = 1
- else:
- repetition[dna_a[cont1]] = 1 + repetition[dna_a[cont1]]
- cont2 += 1
- cont1 += 1
- return repetition
- def to_Match(dna_a, dna_b):
- match = 0
- cont1 = 0
- while cont1 < len(dna_a):
- if (dna_a[cont1] == dna_b[cont1]):
- match += 1
- cont1 += 1
- return (match * 100)/len(dna_a)
- # print(Repeticoes('ACTGCTG', 'AACGCTG'))
- print(to_Match('ACTGCTG', 'AACGCTG'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement