Guest User

Untitled

a guest
Sep 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. f = open("text.txt", "r")
  2. input = f.read()
  3.  
  4. matrix = [[.22,.22,.22,.33],[.22,.22,.22,.33],[.33,.33,.11,.22],[.22,.33,.11,.33],[.11,.22,.22,.44]]
  5.  
  6. probability = 0
  7. output = ""
  8. for i in range(0, len(input) -4):
  9. temp = 0
  10. for idx,val in enumerate(input[0:5]):
  11. if (val == 'A'):
  12. temp += matrix[idx][0]
  13. elif (val == 'C'):
  14. temp += matrix[idx][1]
  15. elif (val == 'G'):
  16. temp += matrix[idx][2]
  17. elif (val == 'T'):
  18. temp += matrix[idx][3]
  19. if (temp > probability):
  20. output = input[0:5]
  21. probability = temp
  22. input = input[1:]
  23.  
  24. print(output)
Add Comment
Please, Sign In to add comment