Created
June 27, 2014 22:17
-
-
Save blkperl/17a2f0e12168115ea4f8 to your computer and use it in GitHub Desktop.
permutation of codons into SQL
This file contains hidden or 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
#!/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