-
Notifications
You must be signed in to change notification settings - Fork 3
/
EvoNAPS_import_statements.sql
333 lines (324 loc) · 15.3 KB
/
EvoNAPS_import_statements.sql
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
/*
Example import commands to inport files into the EvoNAPS database.
Created by: Franziska Reden
Create date: 08.03.2023
This script includes example import commands for the files generated by the EvoNAPS workflow.
Exchange the phrase '/PATH/TO/FILE_NAME' to the actual path to and name of the file to be imported.
Note, that teh import statements need to be exectued in the order as they appear in this script.
Otherwise, there might be errors due to the constraints as introduced to some tables in the EvoNAPS database.
Also note, that there are different import commands for importing data intpo the DNA or protein tables!
*/
/*
The following comments import the parameters stored in the target files of the EvoNAPS Snakemake workflow
into the DNA tables of the EvoNAPS database.
*/
/*Loading data into the dna_alignemnts table from the corresponding ali_parameters-file.
Set FROM_DATABASE to the source database. Note that if */
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_ali_parameters.tsv'
IGNORE INTO TABLE dna_alignments FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, @IQTREE_VERSION, @RANDOM_SEED, @TIME_STAMP, @SEQ_TYPE, SEQUENCES, COLUMNS, DISTINCT_PATTERNS, PARSIMONY_INFORMATIVE_SITES,
SINGELTON_SITES, CONSTANT_SITES, FRAC_WILDCARDS_GAPS, FAILED_CHI2, IDENTICAL_SEQ, EXCLUDED_SEQ, DESCRIPTION)
SET
FROM_DATABASE = 'SOURCE'
;
/*Loading data into the dna_sequences table from the corresponding seq_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_seq_parameters.tsv'
IGNORE INTO TABLE dna_sequences FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, SEQ_INDEX, SEQ_NAME, FRAC_WILDCARDS_GAPS, CHI2_P_VALUE, CHI2_PASSED, EXCLUDED, @IDENTICAL_TO, FREQ_A, FREQ_C, FREQ_G, FREQ_T, SEQ)
SET
IDENTICAL_TO = NULLIF(@IDENTICAL_TO, '')
;
/*Loading data into the dna_modelparameters table from the corresponding model_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_model_parameters.tsv'
IGNORE INTO TABLE dna_modelparameters FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, IQTREE_VERSION, RANDOM_SEED, TIME_STAMP, KEEP_IDENT, MODEL, BASE_MODEL, @FREQ_TYPE, MODEL_RATE_HETEROGENEITY, NUM_RATE_CAT,
LOGL, AIC, WEIGHTED_AIC, CONFIDENCE_AIC, AICC, WEIGHTED_AICC, CONFIDENCE_AICC, BIC, WEIGHTED_BIC, CONFIDENCE_BIC,
CAIC, WEIGHTED_CAIC, CONFIDENCE_CAIC, ABIC, WEIGHTED_ABIC, CONFIDENCE_ABIC,
NUM_FREE_PARAMETERS, NUM_MODEL_PARAMETERS, NUM_BRANCHES, TREE_LENGTH ,@vpropInvar, @valpha,
STAT_FREQ_A, STAT_FREQ_C, STAT_FREQ_G, STAT_FREQ_T,
@vrateAC, @vrateAG, @vrateAT, @vrateCG, @vrateCT, @vrateGT,
@vpropCat_1, @vrelRateCat_1, @vpropCat_2, @vrelRateCat_2, @vpropCat_3, @vrelRateCat_3, @vpropCat_4, @vrelRateCat_4,
@vpropCat_5, @vrelRateCat_5, @vpropCat_6, @vrelRateCat_6, @vpropCat_7, @vrelRateCat_7, @vpropCat_8, @vrelRateCat_8,
@vpropCat_9, @vrelRateCat_9, @vpropCat_10, @vrelRateCat_10)
set
PROP_INVAR = NULLIF(@vpropInvar, ''),
ALPHA = NULLIF(@valpha, ''),
STAT_FREQ_TYPE = IF(@FREQ_TYPE = 'equal', 'uniform', @FREQ_TYPE),
MODEL_TYPE='Markov',
RATE_AC = @vrateAC,
RATE_AG = @vrateAG,
RATE_AT = @vrateAT,
RATE_CG = @vrateCG,
RATE_CT = @vrateCT,
RATE_GT = @vrateGT,
RATE_CA = @vrateAC,
RATE_GA = @vrateAG,
RATE_TA = @vrateAT,
RATE_GC = @vrateCG,
RATE_TC = @vrateCT,
RATE_TG = @vrateGT,
REL_RATE_CAT_1 = NULLIF(@vrelRateCat_1, ''),
PROP_CAT_1 = NULLIF(@vpropCat_1, ''),
REL_RATE_CAT_2 = NULLIF(@vrelRateCat_2, ''),
PROP_CAT_2 = NULLIF(@vpropCat_2, ''),
REL_RATE_CAT_3 = NULLIF(@vrelRateCat_3, ''),
PROP_CAT_3 = NULLIF(@vpropCat_3, ''),
REL_RATE_CAT_4 = NULLIF(@vrelRateCat_4, ''),
PROP_CAT_4 = NULLIF(@vpropCat_4, ''),
REL_RATE_CAT_5 = NULLIF(@vrelRateCat_5, ''),
PROP_CAT_5 = NULLIF(@vpropCat_5, ''),
REL_RATE_CAT_6 = NULLIF(@vrelRateCat_6, ''),
PROP_CAT_6 = NULLIF(@vpropCat_6, ''),
REL_RATE_CAT_7 = NULLIF(@vrelRateCat_7, ''),
PROP_CAT_7 = NULLIF(@vpropCat_7, ''),
REL_RATE_CAT_8 = NULLIF(@vrelRateCat_8, ''),
PROP_CAT_8 = NULLIF(@vpropCat_8, ''),
REL_RATE_CAT_9 = NULLIF(@vrelRateCat_9, ''),
PROP_CAT_9 = NULLIF(@vpropCat_9, ''),
REL_RATE_CAT_10 = NULLIF(@vrelRateCat_10, ''),
PROP_CAT_10 = NULLIF(@vpropCat_10, '')
;
/*Loading data into the dna_trees table from the corresponding tree_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_tree_parameters.tsv'
IGNORE INTO TABLE dna_trees FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, IQTREE_VERSION, RANDOM_SEED, TIME_STAMP, TREE_TYPE, @CHOICE_CRITERIUM, KEEP_IDENT,
MODEL, BASE_MODEL, @FREQ_TYPE, MODEL_RATE_HETEROGENEITY, NUM_RATE_CAT,
LOGL, @UNCONSTRAINED_LOGL, AIC, AICC, BIC, CAIC, ABIC, NUM_FREE_PARAMETERS, NUM_MODEL_PARAMETERS, NUM_BRANCHES,
@vpropInvar, @valpha, STAT_FREQ_A, STAT_FREQ_C, STAT_FREQ_G, STAT_FREQ_T,
@vrateAC, @vrateAG, @vrateAT, @vrateCG, @vrateCT, @vrateGT,
@vpropCat_1, @vrelRateCat_1, @vpropCat_2, @vrelRateCat_2, @vpropCat_3, @vrelRateCat_3, @vpropCat_4, @vrelRateCat_4,
@vpropCat_5, @vrelRateCat_5, @vpropCat_6, @vrelRateCat_6, @vpropCat_7, @vrelRateCat_7, @vpropCat_8, @vrelRateCat_8,
@vpropCat_9, @vrelRateCat_9, @vpropCat_10, @vrelRateCat_10,
TREE_LENGTH, SUM_IBL, TREE_DIAMETER, @DIST_MIN, @DIST_MAX, @DIST_MEAN, @DIST_MEDIAN, @DIST_VAR,
BL_MIN, BL_MAX, BL_MEAN, BL_MEDIAN, BL_VAR,
@IBL_MIN, @IBL_MAX, @IBL_MEAN, @IBL_MEDIAN, @IBL_VAR,
@EBL_MIN, @EBL_MAX, @EBL_MEAN, @EBL_MEDIAN, @EBL_VAR,
POT_LBA_7, POT_LBA_8, POT_LBA_9, POT_LBA_10,
NEWICK_STRING)
set
PROP_INVAR = NULLIF(@vpropInvar, ''),
CHOICE_CRITERIUM = NULLIF(@CHOICE_CRITERIUM, ''),
UNCONSTRAINED_LOGL = NULLIF(@UNCONSTRAINED_LOGL, ''),
ALPHA = NULLIF(@valpha, ''),
STAT_FREQ_TYPE = IF(@FREQ_TYPE = 'equal', 'uniform', @FREQ_TYPE),
MODEL_TYPE='Markov',
RATE_AC = @vrateAC,
RATE_AG = @vrateAG,
RATE_AT = @vrateAT,
RATE_CG = @vrateCG,
RATE_CT = @vrateCT,
RATE_GT = @vrateGT,
RATE_CA = @vrateAC,
RATE_GA = @vrateAG,
RATE_TA = @vrateAT,
RATE_GC = @vrateCG,
RATE_TC = @vrateCT,
RATE_TG = @vrateGT,
REL_RATE_CAT_1 = NULLIF(@vrelRateCat_1, ''),
PROP_CAT_1 = NULLIF(@vpropCat_1, ''),
REL_RATE_CAT_2 = NULLIF(@vrelRateCat_2, ''),
PROP_CAT_2 = NULLIF(@vpropCat_2, ''),
REL_RATE_CAT_3 = NULLIF(@vrelRateCat_3, ''),
PROP_CAT_3 = NULLIF(@vpropCat_3, ''),
REL_RATE_CAT_4 = NULLIF(@vrelRateCat_4, ''),
PROP_CAT_4 = NULLIF(@vpropCat_4, ''),
REL_RATE_CAT_5 = NULLIF(@vrelRateCat_5, ''),
PROP_CAT_5 = NULLIF(@vpropCat_5, ''),
REL_RATE_CAT_6 = NULLIF(@vrelRateCat_6, ''),
PROP_CAT_6 = NULLIF(@vpropCat_6, ''),
REL_RATE_CAT_7 = NULLIF(@vrelRateCat_7, ''),
PROP_CAT_7 = NULLIF(@vpropCat_7, ''),
REL_RATE_CAT_8 = NULLIF(@vrelRateCat_8, ''),
PROP_CAT_8 = NULLIF(@vpropCat_8, ''),
REL_RATE_CAT_9 = NULLIF(@vrelRateCat_9, ''),
PROP_CAT_9 = NULLIF(@vpropCat_9, ''),
REL_RATE_CAT_10 = NULLIF(@vrelRateCat_10, ''),
PROP_CAT_10 = NULLIF(@vpropCat_10, ''),
DIST_MIN = NULLIF(@DIST_MIN, ''),
DIST_MAX = NULLIF(@DIST_MAX, ''),
DIST_MEAN = NULLIF(@DIST_MEAN, ''),
DIST_MEDIAN = NULLIF(@DIST_MEDIAN, ''),
DIST_VAR = NULLIF(@DIST_VAR, ''),
IBL_MIN = NULLIF(@IBL_MIN, ''),
IBL_MAX = NULLIF(@IBL_MAX, ''),
IBL_MEAN = NULLIF(@IBL_MEAN, ''),
IBL_MEDIAN = NULLIF(@IBL_MEDIAN, ''),
IBL_VAR = NULLIF(@IBL_VAR, ''),
EBL_MIN = NULLIF(@EBL_MIN, ''),
EBL_MAX = NULLIF(@EBL_MAX, ''),
EBL_MEAN = NULLIF(@EBL_MEAN, ''),
EBL_MEDIAN = NULLIF(@EBL_MEDIAN, ''),
EBL_VAR = NULLIF(@EBL_VAR, '')
;
/*Loading data into the dna_branches table from the corresponding branch_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_branch_parameters.tsv'
IGNORE INTO TABLE dna_branches FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, @IQTREE_VERSION, @RANDOM_SEED, TIME_STAMP,
TREE_TYPE, BRANCH_INDEX, BRANCH_TYPE, BL, SPLIT_SIZE,
MIN_PATH_1, MAX_PATH_1, MEAN_PATH_1, MEDIAN_PATH_1,
MIN_PATH_2, MAX_PATH_2, MEAN_PATH_2, MEDIAN_PATH_2)
;
/*
The following comments import the parameters stored in the target files of the EvoNAPS Snakemake workflow
into the protein tables of the EvoNAPS database
*/
/*Loading data into the aa_alignments table from the corresponding ali_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_ali_parameters.tsv'
IGNORE INTO TABLE aa_alignments FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, @IQTREE_VERSION, @SEQ_TYPE, @RANDOM_SEED_NUM, @TIME_STAMP, SEQUENCES, COLUMNS, DISTINCT_PATTERNS,PARSIMONY_INFORMATIVE_SITES,SINGELTON_SITES,
CONSTANT_SITES,FRAC_WILDCARDS_GAPS,FAILED_CHI2, IDENTICAL_SEQ, EXCLUDED_SEQ, DESCRIPTION)
SET
FROM_DATABASE = 'PANDIT'
;
/*Loading data into the aa_sequences table from the corresponding seq_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_seq_parameters.tsv'
IGNORE INTO TABLE aa_sequences FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, SEQ_INDEX, SEQ_NAME, FRAC_WILDCARDS_GAPS, CHI2_P_VALUE, CHI2_PASSED, EXCLUDED, @IDENTICAL_TO,
FREQ_A, FREQ_R,FREQ_N,FREQ_D,FREQ_C,FREQ_Q,FREQ_E,FREQ_G,FREQ_H,FREQ_I,FREQ_L,FREQ_K,FREQ_M,FREQ_F, FREQ_P,FREQ_S,FREQ_T,FREQ_W, FREQ_Y, FREQ_V,
SEQ)
SET
IDENTICAL_TO = NULLIF(@IDENTICAL_TO, '')
;
/*Loading data into the aa_modelparameters table from the corresponding model_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_model_parameters.tsv'
IGNORE INTO TABLE aa_modelparameters FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, IQTREE_VERSION, RANDOM_SEED, TIME_STAMP, KEEP_IDENT, MODEL, BASE_MODEL, @FREQ_TYPE, MODEL_RATE_HETEROGENEITY, NUM_RATE_CAT,
LOGL, AIC, WEIGHTED_AIC, CONFIDENCE_AIC, AICC, WEIGHTED_AICC, CONFIDENCE_AICC, BIC, WEIGHTED_BIC, CONFIDENCE_BIC,
CAIC, WEIGHTED_CAIC, CONFIDENCE_CAIC, ABIC, WEIGHTED_ABIC, CONFIDENCE_ABIC,
NUM_FREE_PARAMETERS, NUM_MODEL_PARAMETERS, NUM_BRANCHES, TREE_LENGTH, @vpropInvar, @valpha,
@FREQ_A, @FREQ_R,@FREQ_N,@FREQ_D,@FREQ_C,@FREQ_Q,@FREQ_E,@FREQ_G,@FREQ_H,@FREQ_I,@FREQ_L,@FREQ_K,@FREQ_M,@FREQ_F, @FREQ_P,@FREQ_S,@FREQ_T,@FREQ_W, @FREQ_Y, @FREQ_V,
@vpropCat_1, @vrelRateCat_1, @vpropCat_2, @vrelRateCat_2, @vpropCat_3, @vrelRateCat_3, @vpropCat_4, @vrelRateCat_4,
@vpropCat_5, @vrelRateCat_5, @vpropCat_6, @vrelRateCat_6, @vpropCat_7, @vrelRateCat_7, @vpropCat_8, @vrelRateCat_8,
@vpropCat_9, @vrelRateCat_9, @vpropCat_10, @vrelRateCat_10)
set
PROP_INVAR = NULLIF(@vpropInvar, ''),
ALPHA = NULLIF(@valpha, ''),
STAT_FREQ_TYPE = IF(@FREQ_TYPE = 'equal', 'uniform', @FREQ_TYPE),
MODEL_TYPE='Markov',
STAT_FREQ_A=@FREQ_A,
STAT_FREQ_R=@FREQ_R,
STAT_FREQ_N=@FREQ_N,
STAT_FREQ_D=@FREQ_D,
STAT_FREQ_C=@FREQ_C,
STAT_FREQ_Q=@FREQ_Q,
STAT_FREQ_E=@FREQ_E,
STAT_FREQ_G=@FREQ_G,
STAT_FREQ_H=@FREQ_H,
STAT_FREQ_I=@FREQ_I,
STAT_FREQ_L=@FREQ_L,
STAT_FREQ_K=@FREQ_K,
STAT_FREQ_M=@FREQ_M,
STAT_FREQ_F=@FREQ_F,
STAT_FREQ_P=@FREQ_P,
STAT_FREQ_S=@FREQ_S,
STAT_FREQ_T=@FREQ_T,
STAT_FREQ_W=@FREQ_W,
STAT_FREQ_Y=@FREQ_Y,
STAT_FREQ_V=@FREQ_V,
REL_RATE_CAT_1 = NULLIF(@vrelRateCat_1, ''),
PROP_CAT_1 = NULLIF(@vpropCat_1, ''),
REL_RATE_CAT_2 = NULLIF(@vrelRateCat_2, ''),
PROP_CAT_2 = NULLIF(@vpropCat_2, ''),
REL_RATE_CAT_3 = NULLIF(@vrelRateCat_3, ''),
PROP_CAT_3 = NULLIF(@vpropCat_3, ''),
REL_RATE_CAT_4 = NULLIF(@vrelRateCat_4, ''),
PROP_CAT_4 = NULLIF(@vpropCat_4, ''),
REL_RATE_CAT_5 = NULLIF(@vrelRateCat_5, ''),
PROP_CAT_5 = NULLIF(@vpropCat_5, ''),
REL_RATE_CAT_6 = NULLIF(@vrelRateCat_6, ''),
PROP_CAT_6 = NULLIF(@vpropCat_6, ''),
REL_RATE_CAT_7 = NULLIF(@vrelRateCat_7, ''),
PROP_CAT_7 = NULLIF(@vpropCat_7, ''),
REL_RATE_CAT_8 = NULLIF(@vrelRateCat_8, ''),
PROP_CAT_8 = NULLIF(@vpropCat_8, ''),
REL_RATE_CAT_9 = NULLIF(@vrelRateCat_9, ''),
PROP_CAT_9 = NULLIF(@vpropCat_9, ''),
REL_RATE_CAT_10 = NULLIF(@vrelRateCat_10, ''),
PROP_CAT_10 = NULLIF(@vpropCat_10, '')
;
/*Loading data into the aa_trees table from the corresponding tree_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_tree_parameters.tsv'
IGNORE INTO TABLE aa_trees FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, IQTREE_VERSION, RANDOM_SEED, TIME_STAMP, TREE_TYPE, @CHOICE_CRITERIUM, KEEP_IDENT,
MODEL, BASE_MODEL, @FREQ_TYPE, MODEL_RATE_HETEROGENEITY, NUM_RATE_CAT,
LOGL, @UNCONSTRAINED_LOGL, AIC, AICC, BIC, CAIC, ABIC, NUM_FREE_PARAMETERS, NUM_MODEL_PARAMETERS, NUM_BRANCHES,
@vpropInvar, @valpha,
@FREQ_A, @FREQ_R,@FREQ_N,@FREQ_D,@FREQ_C,@FREQ_Q,@FREQ_E,@FREQ_G,@FREQ_H,@FREQ_I,@FREQ_L,@FREQ_K,@FREQ_M,@FREQ_F, @FREQ_P,@FREQ_S,@FREQ_T,@FREQ_W, @FREQ_Y, @FREQ_V,
@vpropCat_1, @vrelRateCat_1, @vpropCat_2, @vrelRateCat_2, @vpropCat_3, @vrelRateCat_3, @vpropCat_4, @vrelRateCat_4,
@vpropCat_5, @vrelRateCat_5, @vpropCat_6, @vrelRateCat_6, @vpropCat_7, @vrelRateCat_7, @vpropCat_8, @vrelRateCat_8,
@vpropCat_9, @vrelRateCat_9, @vpropCat_10, @vrelRateCat_10,
TREE_LENGTH, SUM_IBL, TREE_DIAMETER, @DIST_MIN, @DIST_MAX, @DIST_MEAN, @DIST_MEDIAN, @DIST_VAR,
BL_MIN, BL_MAX, BL_MEAN, BL_MEDIAN, BL_VAR,
@IBL_MIN, @IBL_MAX, @IBL_MEAN, @IBL_MEDIAN, @IBL_VAR,
@EBL_MIN, @EBL_MAX, @EBL_MEAN, @EBL_MEDIAN, @EBL_VAR,
POT_LBA_7, POT_LBA_8, POT_LBA_9, POT_LBA_10,
NEWICK_STRING)
set
PROP_INVAR = NULLIF(@vpropInvar, ''),
CHOICE_CRITERIUM = NULLIF(@CHOICE_CRITERIUM, ''),
UNCONSTRAINED_LOGL = NULLIF(@UNCONSTRAINED_LOGL, ''),
ALPHA = NULLIF(@valpha, ''),
STAT_FREQ_TYPE = IF(@FREQ_TYPE = 'equal', 'uniform', @FREQ_TYPE),
MODEL_TYPE='Markov',
STAT_FREQ_A=@FREQ_A,
STAT_FREQ_R=@FREQ_R,
STAT_FREQ_N=@FREQ_N,
STAT_FREQ_D=@FREQ_D,
STAT_FREQ_C=@FREQ_C,
STAT_FREQ_Q=@FREQ_Q,
STAT_FREQ_E=@FREQ_E,
STAT_FREQ_G=@FREQ_G,
STAT_FREQ_H=@FREQ_H,
STAT_FREQ_I=@FREQ_I,
STAT_FREQ_L=@FREQ_L,
STAT_FREQ_K=@FREQ_K,
STAT_FREQ_M=@FREQ_M,
STAT_FREQ_F=@FREQ_F,
STAT_FREQ_P=@FREQ_P,
STAT_FREQ_S=@FREQ_S,
STAT_FREQ_T=@FREQ_T,
STAT_FREQ_W=@FREQ_W,
STAT_FREQ_Y=@FREQ_Y,
STAT_FREQ_V=@FREQ_V,
REL_RATE_CAT_1 = NULLIF(@vrelRateCat_1, ''),
PROP_CAT_1 = NULLIF(@vpropCat_1, ''),
REL_RATE_CAT_2 = NULLIF(@vrelRateCat_2, ''),
PROP_CAT_2 = NULLIF(@vpropCat_2, ''),
REL_RATE_CAT_3 = NULLIF(@vrelRateCat_3, ''),
PROP_CAT_3 = NULLIF(@vpropCat_3, ''),
REL_RATE_CAT_4 = NULLIF(@vrelRateCat_4, ''),
PROP_CAT_4 = NULLIF(@vpropCat_4, ''),
REL_RATE_CAT_5 = NULLIF(@vrelRateCat_5, ''),
PROP_CAT_5 = NULLIF(@vpropCat_5, ''),
REL_RATE_CAT_6 = NULLIF(@vrelRateCat_6, ''),
PROP_CAT_6 = NULLIF(@vpropCat_6, ''),
REL_RATE_CAT_7 = NULLIF(@vrelRateCat_7, ''),
PROP_CAT_7 = NULLIF(@vpropCat_7, ''),
REL_RATE_CAT_8 = NULLIF(@vrelRateCat_8, ''),
PROP_CAT_8 = NULLIF(@vpropCat_8, ''),
REL_RATE_CAT_9 = NULLIF(@vrelRateCat_9, ''),
PROP_CAT_9 = NULLIF(@vpropCat_9, ''),
REL_RATE_CAT_10 = NULLIF(@vrelRateCat_10, ''),
PROP_CAT_10 = NULLIF(@vpropCat_10, ''),
DIST_MIN = NULLIF(@DIST_MIN, ''),
DIST_MAX = NULLIF(@DIST_MAX, ''),
DIST_MEAN = NULLIF(@DIST_MEAN, ''),
DIST_MEDIAN = NULLIF(@DIST_MEDIAN, ''),
DIST_VAR = NULLIF(@DIST_VAR, ''),
IBL_MIN = NULLIF(@IBL_MIN, ''),
IBL_MAX = NULLIF(@IBL_MAX, ''),
IBL_MEAN = NULLIF(@IBL_MEAN, ''),
IBL_MEDIAN = NULLIF(@IBL_MEDIAN, ''),
IBL_VAR = NULLIF(@IBL_VAR, ''),
EBL_MIN = NULLIF(@EBL_MIN, ''),
EBL_MAX = NULLIF(@EBL_MAX, ''),
EBL_MEAN = NULLIF(@EBL_MEAN, ''),
EBL_MEDIAN = NULLIF(@EBL_MEDIAN, ''),
EBL_VAR = NULLIF(@EBL_VAR, '')
;
/*Loading data into the aa_branches table from the corresponding branch_parameters-file.*/
LOAD DATA LOCAL INFILE '/PATH/TO/FILE_NAME_branch_parameters.tsv'
IGNORE INTO TABLE aa_branches FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(ALI_ID, @IQTREE_VERSION, @RANDOM_SEED_NUM, TIME_STAMP, TREE_TYPE, BRANCH_INDEX, BRANCH_TYPE, BL, SPLIT_SIZE,
MEAN_PATH_1, MEDIAN_PATH_1, MIN_PATH_1, MAX_PATH_1, MEAN_PATH_2, MEDIAN_PATH_2, MIN_PATH_2, MAX_PATH_2)
;