Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. require 'rubygems'
  2. require 'bio'
  3.  
  4. triplets = %w( 1 2 3 1 2 2 4 2 1 3 2 4 3 1 1 3 4 4 2 4 1 1 1 4 2 3 1)
  5. bases = %w(a c t g)
  6. decoded = []
  7.  
  8. bases.each do |i|
  9. bases.each do |j|
  10. bases.each do |k|
  11. bases.each do |l|
  12. test_triplets = triplets.map { |base_index|
  13. [i,j,k,l][base_index.to_i - 1]
  14. }.join
  15. candidate = Bio::Sequence.auto(test_triplets).translate
  16. decoded << candidate if candidate =~ /^M.*\*$/
  17. end
  18. end
  19. end
  20. end
  21.  
  22. puts decoded.uniq.sort
  23.  
  24. # MIIVEE*K*
  25. # MILVEASN*
  26. # MILVEVLN*
  27. # MIVVEG*K*
Add Comment
Please, Sign In to add comment