-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_database.sh
More file actions
executable file
·47 lines (42 loc) · 927 Bytes
/
create_database.sh
File metadata and controls
executable file
·47 lines (42 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Generate input files chrY_stats and autosomal_stats
# Construct SQL database
SQL="
CREATE TABLE haploid_calls (
id integer primary key,
chrom TEXT,
start NUMERIC,
end NUMERIC,
total_one NUMERIC,
total_two NUMERIC,
g1_1 NUMERIC,
g1_2 NUMERIC,
g2_1 NUMERIC,
g2_2 NUMERIC,
sample_1 TEXT,
sample_2 TEXT
);
CREATE TABLE diploid_calls (
id integer primary key,
chrom TEXT,
start NUMERIC,
end NUMERIC,
total_one NUMERIC,
total_two NUMERIC,
g1_1 NUMERIC,
g1_2 NUERMIC,
g2_1 NUMERIC,
g2_2 NUMERIC,
sample_1 TEXT,
sample_2 TEXT
);
.separator \" \"
.import chrY_stats haploid_calls
CREATE INDEX hap_index1 ON haploid_calls(total_one, total_two);
CREATE INDEX hap_index2 ON haploid_calls(chrom ASC);
.import autosomal_stats diploid_calls
CREATE INDEX dip_index1 ON diploid_calls(total_one, total_two);
CREATE INDEX dip_index2 ON diploid_calls(chrom ASC);
"
rm -f call_data.sqlite
echo "$SQL" | sqlite3 call_data.sqlite