6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/vardb/snp_db_build.rb', line 6
def format_matrix
host = ConfigData.get_connection
conn = PGconn.connect(:host => host[:host], :port => host[:port], :dbname => host[:dbname], :user => host[:user], :password => host[:password])
puts "formatting annotations table..."
conn.exec("CREATE TABLE annotations (id numeric(11) PRIMARY KEY, cds varchar(128), transcript varchar(128), transcript_id varchar(128), info text, orientation varchar(128), cds_locus varchar(128), codon_pos varchar(128), codon varchar(128), peptide varchar(128), amino_a varchar(128), syn varchar(128))")
puts "formatting snps table..."
conn.exec("CREATE TABLE snps (id numeric(11) PRIMARY KEY, locus numeric(11), annotation_id numeric(11))")
puts "formatting samples table..."
conn.exec("CREATE TABLE samples (id numeric(11) PRIMARY KEY, name varchar(128))")
puts "formatting samples_snps join table..."
conn.exec("CREATE TABLE samples_snps (sample_id numeric(11), snp_id numeric(11))")
end
|