Guest User

Untitled

a guest
May 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. def pairwiseScore(seqA, seqB):
  2.     x = 1
  3.     i = 0
  4.     score = 0
  5.     rtnStr = seqA + "\n"
  6.     while i < len(seqA) :
  7.         if seqA[i] == seqB[i]:
  8.              x += 1
  9.              if x > 3:
  10.                  x -= 1
  11.         else:
  12.              x = 1
  13.         if x == 1:
  14.              score -= 1
  15.              rtnStr += " "
  16.         if x == 2:
  17.              score += 1
  18.              rtnStr += "|"
  19.         if x == 3:
  20.             score += 3
  21.             rtnStr += "|"
  22.         i += 1
  23.     rtnStr += "\n" + seqB + " Score: " + str(score)
  24.     return rtnStr
Add Comment
Please, Sign In to add comment