Created
July 27, 2008 18:13
-
-
Save jasonm/2793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bio' | |
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) | |
bases = %w(a c t g) | |
decoded = [] | |
bases.each do |i| | |
bases.each do |j| | |
bases.each do |k| | |
bases.each do |l| | |
test_triplets = triplets.map { |base_index| | |
[i,j,k,l][base_index.to_i - 1] | |
}.join | |
candidate = Bio::Sequence.auto(test_triplets).translate | |
decoded << candidate if candidate =~ /^M.*\*$/ | |
end | |
end | |
end | |
end | |
puts decoded.uniq.sort | |
# MIIVEE*K* | |
# MILVEASN* | |
# MILVEVLN* | |
# MIVVEG*K* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment