Skip to content

Instantly share code, notes, and snippets.

@blkperl
Created June 27, 2014 22:17
Show Gist options
  • Save blkperl/17a2f0e12168115ea4f8 to your computer and use it in GitHub Desktop.
Save blkperl/17a2f0e12168115ea4f8 to your computer and use it in GitHub Desktop.
permutation of codons into SQL
#!/usr/bin/env ruby
codons = []
a = ['A', 'C', 'T', 'G'] * 3
a.permutation(3).to_a.uniq.each do |codon|
codons.push(codon.join().to_s)
end
puts "create table refseq (id varchar(20) not null, name varchar(20), description text, #{codons.sort.join(" varchar(3) default 0, ").to_s} varchar(3) default 0);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment