Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. from collections import Counter
  2.  
  3. def count_codons(sequence):
  4.     """ Count the number of codons in a sequence."""
  5.     return Counter(sequence[i:i+3].upper() for i in range(0, len(sequence), 3))
  6.  
  7. sequences = ["ACGTAGGAT", "GTGTAGCTA"]
  8. print(count_codons(sequences[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement