SHARE
TWEET

Untitled

a guest Sep 15th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import argparse
  2. import re
  3.  
  4.  
  5. def Repetition(dna_a, dna_b):
  6.     repetition = {}
  7.     cont1 = 0
  8.     while cont1 < len(dna_a):
  9.         cont2 = 0
  10.         if dna_a[cont1] not in repetition.keys():
  11.             while cont2 < len(dna_b):
  12.                 if (dna_a[cont1] == dna_b[cont2]):
  13.                     if dna_a[cont1] not in repetition.keys():
  14.                         repetition[dna_a[cont1]] = 1
  15.                     else:
  16.                         repetition[dna_a[cont1]] = 1 + repetition[dna_a[cont1]]
  17.                 cont2 += 1
  18.         cont1 += 1
  19.     return repetition
  20.  
  21.  
  22. def to_Match(dna_a, dna_b):
  23.     match = 0
  24.     cont1 = 0
  25.     while cont1 < len(dna_a):
  26.         if (dna_a[cont1] == dna_b[cont1]):
  27.             match += 1
  28.         cont1 += 1
  29.     return (match * 100)/len(dna_a)
  30.  
  31. # print(Repeticoes('ACTGCTG', 'AACGCTG'))
  32. print(to_Match('ACTGCTG', 'AACGCTG'))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top