-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration_reader.py
More file actions
519 lines (492 loc) · 37.9 KB
/
configuration_reader.py
File metadata and controls
519 lines (492 loc) · 37.9 KB
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
import xlrd
import yaml
import sys
import os
class ConfigurationReader:
def __init__(self, conf_file_path):
self.conf_file_path = conf_file_path
with open(os.path.dirname(os.path.realpath(__file__))+'/conf.yaml', encoding='UTF-8') as yaml_file:
self.conf = yaml.safe_load(yaml_file)
super().__init__()
def run(self):
self.read_preprocessing_configuration()
self.read_resequencing_configuration()
self.read_annotation_configuration()
return self.conf
def read_preprocessing_configuration(self):
preprocessing_sheet = xlrd.open_workbook(self.conf_file_path).sheet_by_name('preprocessing')
if preprocessing_sheet.cell_value(1, 1) != True:
self.conf["preprocessing"]["enable"] = False
if preprocessing_sheet.cell_value(3, 1) != True:
self.conf["preprocessing"]["fastqc"]["enable"] = False
if preprocessing_sheet.cell_value(4, 1) != "":
self.conf["preprocessing"]["fastqc"]["--casava"] = preprocessing_sheet.cell_value(4, 1)
if preprocessing_sheet.cell_value(5, 1) != "":
self.conf["preprocessing"]["fastqc"]["--nofilter"] = preprocessing_sheet.cell_value(5, 1)
if preprocessing_sheet.cell_value(6, 1) != "":
self.conf["preprocessing"]["fastqc"]["--nogroup"] = preprocessing_sheet.cell_value(6, 1)
if preprocessing_sheet.cell_value(7, 1) != "":
self.conf["preprocessing"]["fastqc"]["-t"] = preprocessing_sheet.cell_value(7, 1)
if preprocessing_sheet.cell_value(8, 1) != "":
self.conf["preprocessing"]["fastqc"]["-c"] = preprocessing_sheet.cell_value(8, 1)
if preprocessing_sheet.cell_value(9, 1) != "":
self.conf["preprocessing"]["fastqc"]["-a"] = preprocessing_sheet.cell_value(9, 1)
if preprocessing_sheet.cell_value(10, 1) != "":
self.conf["preprocessing"]["fastqc"]["-l"] = preprocessing_sheet.cell_value(10, 1)
if preprocessing_sheet.cell_value(11, 1) != "":
self.conf["preprocessing"]["fastqc"]["-k"] = preprocessing_sheet.cell_value(11, 1)
if preprocessing_sheet.cell_value(3, 3) != True:
self.conf["preprocessing"]["fastp"]["enable"] = False
if preprocessing_sheet.cell_value(4, 3) != "":
self.conf["preprocessing"]["fastp"]["--phred64"] = preprocessing_sheet.cell_value(4, 3)
if preprocessing_sheet.cell_value(5, 3) != "":
self.conf["preprocessing"]["fastp"]["-V"] = preprocessing_sheet.cell_value(5, 3)
if preprocessing_sheet.cell_value(6, 3) != "":
self.conf["preprocessing"]["fastp"]["-A"] = preprocessing_sheet.cell_value(6, 3)
if preprocessing_sheet.cell_value(7, 3) != "":
self.conf["preprocessing"]["fastp"]["--adapter_sequence"] = preprocessing_sheet.cell_value(7, 3)
if preprocessing_sheet.cell_value(8, 3) != "":
self.conf["preprocessing"]["fastp"]["--adapter_sequence_r2"] = preprocessing_sheet.cell_value(8, 3)
if preprocessing_sheet.cell_value(9, 3) != "":
self.conf["preprocessing"]["fastp"]["--adapter_fasta"] = preprocessing_sheet.cell_value(9, 3)
if preprocessing_sheet.cell_value(10, 3) != "":
self.conf["preprocessing"]["fastp"]["--detect_adapter_for_pe"] = preprocessing_sheet.cell_value(10, 3)
if preprocessing_sheet.cell_value(11, 3) != "":
self.conf["preprocessing"]["fastp"]["-f"] = preprocessing_sheet.cell_value(11, 3)
if preprocessing_sheet.cell_value(12, 3) != "":
self.conf["preprocessing"]["fastp"]["-t"] = preprocessing_sheet.cell_value(12, 3)
if preprocessing_sheet.cell_value(13, 3) != "":
self.conf["preprocessing"]["fastp"]["-b"] = preprocessing_sheet.cell_value(13, 3)
if preprocessing_sheet.cell_value(14, 3) != "":
self.conf["preprocessing"]["fastp"]["-F"] = preprocessing_sheet.cell_value(14, 3)
if preprocessing_sheet.cell_value(15, 3) != "":
self.conf["preprocessing"]["fastp"]["-T"] = preprocessing_sheet.cell_value(15, 3)
if preprocessing_sheet.cell_value(16, 3) != "":
self.conf["preprocessing"]["fastp"]["-B"] = preprocessing_sheet.cell_value(16, 3)
if preprocessing_sheet.cell_value(17, 3) != "":
self.conf["preprocessing"]["fastp"]["--trim_poly_g"] = preprocessing_sheet.cell_value(17, 3)
if preprocessing_sheet.cell_value(18, 3) != "":
self.conf["preprocessing"]["fastp"]["--poly_g_min_len"] = preprocessing_sheet.cell_value(18, 3)
if preprocessing_sheet.cell_value(19, 3) != "":
self.conf["preprocessing"]["fastp"]["-G"] = preprocessing_sheet.cell_value(19, 3)
if preprocessing_sheet.cell_value(20, 3) != "":
self.conf["preprocessing"]["fastp"]["--trim_poly_x"] = preprocessing_sheet.cell_value(20, 3)
if preprocessing_sheet.cell_value(21, 3) != "":
self.conf["preprocessing"]["fastp"]["--poly_x_min_len"] = preprocessing_sheet.cell_value(21, 3)
if preprocessing_sheet.cell_value(22, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_front"] = preprocessing_sheet.cell_value(22, 3)
if preprocessing_sheet.cell_value(23, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_end"] = preprocessing_sheet.cell_value(23, 3)
if preprocessing_sheet.cell_value(24, 3) != "":
self.conf["preprocessing"]["fastp"]["-r"] = preprocessing_sheet.cell_value(24, 3)
if preprocessing_sheet.cell_value(25, 3) != "":
self.conf["preprocessing"]["fastp"]["-W"] = preprocessing_sheet.cell_value(25, 3)
if preprocessing_sheet.cell_value(26, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_mean_quality"] = preprocessing_sheet.cell_value(26, 3)
if preprocessing_sheet.cell_value(27, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_front_window_size"] = preprocessing_sheet.cell_value(27, 3)
if preprocessing_sheet.cell_value(28, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_front_mean_quality"] = preprocessing_sheet.cell_value(28, 3)
if preprocessing_sheet.cell_value(29, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_tail_window_size"] = preprocessing_sheet.cell_value(29, 3)
if preprocessing_sheet.cell_value(30, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_tail_mean_quality"] = preprocessing_sheet.cell_value(30, 3)
if preprocessing_sheet.cell_value(31, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_right_window_size"] = preprocessing_sheet.cell_value(31, 3)
if preprocessing_sheet.cell_value(32, 3) != "":
self.conf["preprocessing"]["fastp"]["--cut_right_mean_quality"] = preprocessing_sheet.cell_value(32, 3)
if preprocessing_sheet.cell_value(33, 3) != "":
self.conf["preprocessing"]["fastp"]["-Q"] = preprocessing_sheet.cell_value(33, 3)
if preprocessing_sheet.cell_value(34, 3) != "":
self.conf["preprocessing"]["fastp"]["-q"] = preprocessing_sheet.cell_value(34, 3)
if preprocessing_sheet.cell_value(35, 3) != "":
self.conf["preprocessing"]["fastp"]["-u"] = preprocessing_sheet.cell_value(35, 3)
if preprocessing_sheet.cell_value(36, 3) != "":
self.conf["preprocessing"]["fastp"]["-n"] = preprocessing_sheet.cell_value(36, 3)
if preprocessing_sheet.cell_value(37, 3) != "":
self.conf["preprocessing"]["fastp"]["-e"] = preprocessing_sheet.cell_value(37, 3)
if preprocessing_sheet.cell_value(38, 3) != "":
self.conf["preprocessing"]["fastp"]["-L"] = preprocessing_sheet.cell_value(38, 3)
if preprocessing_sheet.cell_value(39, 3) != "":
self.conf["preprocessing"]["fastp"]["--length_required"] = preprocessing_sheet.cell_value(39, 3)
if preprocessing_sheet.cell_value(40, 3) != "":
self.conf["preprocessing"]["fastp"]["--length_limit"] = preprocessing_sheet.cell_value(40, 3)
if preprocessing_sheet.cell_value(41, 3) != "":
self.conf["preprocessing"]["fastp"]["--low_complexity_filter"] = preprocessing_sheet.cell_value(41, 3)
if preprocessing_sheet.cell_value(42, 3) != "":
self.conf["preprocessing"]["fastp"]["--complexity_threshold"] = preprocessing_sheet.cell_value(42, 3)
if preprocessing_sheet.cell_value(43, 3) != "":
self.conf["preprocessing"]["fastp"]["--filter_by_index1"] = preprocessing_sheet.cell_value(43, 3)
if preprocessing_sheet.cell_value(44, 3) != "":
self.conf["preprocessing"]["fastp"]["--filter_by_index2"] = preprocessing_sheet.cell_value(44, 3)
if preprocessing_sheet.cell_value(45, 3) != "":
self.conf["preprocessing"]["fastp"]["--filter_by_index_threshold"] = preprocessing_sheet.cell_value(45, 3)
if preprocessing_sheet.cell_value(46, 3) != "":
self.conf["preprocessing"]["fastp"]["--correction"] = preprocessing_sheet.cell_value(46, 3)
if preprocessing_sheet.cell_value(47, 3) != "":
self.conf["preprocessing"]["fastp"]["--overlap_len_require"] = preprocessing_sheet.cell_value(47, 3)
if preprocessing_sheet.cell_value(48, 3) != "":
self.conf["preprocessing"]["fastp"]["--overlap_diff_limit"] = preprocessing_sheet.cell_value(48, 3)
if preprocessing_sheet.cell_value(49, 3) != "":
self.conf["preprocessing"]["fastp"]["--overlap_diff_percent_limit"] = preprocessing_sheet.cell_value(49, 3)
if preprocessing_sheet.cell_value(50, 3) != "":
self.conf["preprocessing"]["fastp"]["--umi"] = preprocessing_sheet.cell_value(50, 3)
if preprocessing_sheet.cell_value(51, 3) != "":
self.conf["preprocessing"]["fastp"]["--umi_loc"] = preprocessing_sheet.cell_value(51, 3)
if preprocessing_sheet.cell_value(52, 3) != "":
self.conf["preprocessing"]["fastp"]["--umi_len"] = preprocessing_sheet.cell_value(52, 3)
if preprocessing_sheet.cell_value(53, 3) != "":
self.conf["preprocessing"]["fastp"]["--umi_prefix"] = preprocessing_sheet.cell_value(53, 3)
if preprocessing_sheet.cell_value(54, 3) != "":
self.conf["preprocessing"]["fastp"]["--umi_skip"] = preprocessing_sheet.cell_value(54, 3)
if preprocessing_sheet.cell_value(55, 3) != "":
self.conf["preprocessing"]["fastp"]["-p"] = preprocessing_sheet.cell_value(55, 3)
if preprocessing_sheet.cell_value(56, 3) != "":
self.conf["preprocessing"]["fastp"]["-P"] = preprocessing_sheet.cell_value(56, 3)
if preprocessing_sheet.cell_value(57, 3) != "":
self.conf["preprocessing"]["fastp"]["-w"] = preprocessing_sheet.cell_value(57, 3)
if preprocessing_sheet.cell_value(3, 5) != True:
self.conf["preprocessing"]["trimmomatic"]["enable"] = False
if preprocessing_sheet.cell_value(4, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["-threads"] = preprocessing_sheet.cell_value(4, 5)
if preprocessing_sheet.cell_value(5, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["-phred33"] = preprocessing_sheet.cell_value(5, 5)
if preprocessing_sheet.cell_value(6, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["-phred64"] = preprocessing_sheet.cell_value(6, 5)
if preprocessing_sheet.cell_value(7, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["-validatePairs"] = preprocessing_sheet.cell_value(7, 5)
if preprocessing_sheet.cell_value(8, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["ILLUMINACLIP"] = preprocessing_sheet.cell_value(8, 5)
if preprocessing_sheet.cell_value(9, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["LEADING"] = preprocessing_sheet.cell_value(9, 5)
if preprocessing_sheet.cell_value(10, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["TRAILING"] = preprocessing_sheet.cell_value(10, 5)
if preprocessing_sheet.cell_value(11, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["SLIDINGWINDOW"] = preprocessing_sheet.cell_value(11, 5)
if preprocessing_sheet.cell_value(11, 5) != "":
self.conf["preprocessing"]["trimmomatic"]["MINLEN"] = preprocessing_sheet.cell_value(11, 5)
if preprocessing_sheet.cell_value(3, 7) != True:
self.conf["preprocessing"]["cutadapt"]["enable"] = False
if preprocessing_sheet.cell_value(4, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-a"] = preprocessing_sheet.cell_value(4, 7)
if preprocessing_sheet.cell_value(5, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-g"] = preprocessing_sheet.cell_value(5, 7)
if preprocessing_sheet.cell_value(6, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-b"] = preprocessing_sheet.cell_value(6, 7)
if preprocessing_sheet.cell_value(7, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-e"] = preprocessing_sheet.cell_value(7, 7)
if preprocessing_sheet.cell_value(8, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--no-indels"] = preprocessing_sheet.cell_value(8, 7)
if preprocessing_sheet.cell_value(9, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-n"] = preprocessing_sheet.cell_value(9, 7)
if preprocessing_sheet.cell_value(10, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-O"] = preprocessing_sheet.cell_value(10, 7)
if preprocessing_sheet.cell_value(11, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--match-read-wildcards"] = preprocessing_sheet.cell_value(11, 7)
if preprocessing_sheet.cell_value(12, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-N"] = preprocessing_sheet.cell_value(12, 7)
if preprocessing_sheet.cell_value(13, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-u"] = preprocessing_sheet.cell_value(13, 7)
if preprocessing_sheet.cell_value(14, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--nextseq-trim"] = preprocessing_sheet.cell_value(14, 7)
if preprocessing_sheet.cell_value(15, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-q"] = preprocessing_sheet.cell_value(15, 7)
if preprocessing_sheet.cell_value(16, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--quality-base"] = preprocessing_sheet.cell_value(16, 7)
if preprocessing_sheet.cell_value(17, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--length"] = preprocessing_sheet.cell_value(17, 7)
if preprocessing_sheet.cell_value(18, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--trim-n"] = preprocessing_sheet.cell_value(18, 7)
if preprocessing_sheet.cell_value(19, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--length-tag"] = preprocessing_sheet.cell_value(19, 7)
if preprocessing_sheet.cell_value(20, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--strip-suffix"] = preprocessing_sheet.cell_value(20, 7)
if preprocessing_sheet.cell_value(21, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-x"] = preprocessing_sheet.cell_value(21, 7)
if preprocessing_sheet.cell_value(22, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-y"] = preprocessing_sheet.cell_value(22, 7)
if preprocessing_sheet.cell_value(23, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--zero-cap"] = preprocessing_sheet.cell_value(23, 7)
if preprocessing_sheet.cell_value(24, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-m"] = preprocessing_sheet.cell_value(24, 7)
if preprocessing_sheet.cell_value(25, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-M"] = preprocessing_sheet.cell_value(25, 7)
if preprocessing_sheet.cell_value(26, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--max-n"] = preprocessing_sheet.cell_value(26, 7)
if preprocessing_sheet.cell_value(27, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--discard-trimmed"] = preprocessing_sheet.cell_value(27, 7)
if preprocessing_sheet.cell_value(28, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--discard-untrimmed"] = preprocessing_sheet.cell_value(28, 7)
if preprocessing_sheet.cell_value(29, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--discard-casava"] = preprocessing_sheet.cell_value(29, 7)
if preprocessing_sheet.cell_value(30, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-A"] = preprocessing_sheet.cell_value(30, 7)
if preprocessing_sheet.cell_value(31, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-G"] = preprocessing_sheet.cell_value(31, 7)
if preprocessing_sheet.cell_value(32, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-B"] = preprocessing_sheet.cell_value(32, 7)
if preprocessing_sheet.cell_value(33, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-U"] = preprocessing_sheet.cell_value(33, 7)
if preprocessing_sheet.cell_value(34, 7) != "":
self.conf["preprocessing"]["cutadapt"]["-p"] = preprocessing_sheet.cell_value(34, 7)
if preprocessing_sheet.cell_value(35, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--pair-adapters"] = preprocessing_sheet.cell_value(35, 7)
if preprocessing_sheet.cell_value(36, 7) != "":
self.conf["preprocessing"]["cutadapt"]["--pair-filter"] = preprocessing_sheet.cell_value(36, 7)
if preprocessing_sheet.cell_value(3, 9) != True:
self.conf["preprocessing"]["sickle"]["enable"] = False
if preprocessing_sheet.cell_value(4, 9) != "":
self.conf["preprocessing"]["sickle"]["-t"] = preprocessing_sheet.cell_value(4, 9)
if preprocessing_sheet.cell_value(5, 9) != "":
self.conf["preprocessing"]["sickle"]["-q"] = preprocessing_sheet.cell_value(5, 9)
if preprocessing_sheet.cell_value(6, 9) != "":
self.conf["preprocessing"]["sickle"]["-l"] = preprocessing_sheet.cell_value(6, 9)
if preprocessing_sheet.cell_value(7, 9) != "":
self.conf["preprocessing"]["sickle"]["-x"] = preprocessing_sheet.cell_value(7, 9)
if preprocessing_sheet.cell_value(8, 9) != "":
self.conf["preprocessing"]["sickle"]["-n"] = preprocessing_sheet.cell_value(8, 9)
def read_resequencing_configuration(self):
resequencing_sheet = xlrd.open_workbook(self.conf_file_path).sheet_by_name('identification')
# if resequencing_sheet.cell_value(1, 1) != True:
# self.conf["identification"]["enable"] = False
# if resequencing_sheet.cell_value(3, 1) != True:
# self.conf["identification"]["assembly"]["enable"] = False
if resequencing_sheet.cell_value(2, 1) != "":
self.conf["identification"]["number_of_candidate_similar_genome"] = resequencing_sheet.cell_value(2, 1)
# if resequencing_sheet.cell_value(3, 1) != "":
# self.conf["identification"]["blast_db_path"] = resequencing_sheet.cell_value(3, 1)
if resequencing_sheet.cell_value(3, 1) != True:
self.conf["identification"]["assembly"]["enable"] = False
if resequencing_sheet.cell_value(5, 1) != True:
self.conf["identification"]["assembly"]["megahit"]["enable"] = False
if resequencing_sheet.cell_value(6, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--min-count"] = resequencing_sheet.cell_value(6, 1)
if resequencing_sheet.cell_value(7, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--k-list"] = resequencing_sheet.cell_value(7, 1)
if resequencing_sheet.cell_value(8, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--no-mercy"] = resequencing_sheet.cell_value(8, 1)
if resequencing_sheet.cell_value(9, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--bubble-level"] = resequencing_sheet.cell_value(9, 1)
if resequencing_sheet.cell_value(10, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--merge-level"] = resequencing_sheet.cell_value(10, 1)
if resequencing_sheet.cell_value(11, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--prune-level"] = resequencing_sheet.cell_value(11, 1)
if resequencing_sheet.cell_value(12, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--prune-depth"] = resequencing_sheet.cell_value(12, 1)
if resequencing_sheet.cell_value(13, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--low-local-ratio"] = resequencing_sheet.cell_value(13, 1)
if resequencing_sheet.cell_value(14, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--max-tip-len"] = resequencing_sheet.cell_value(14, 1)
if resequencing_sheet.cell_value(15, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--no-local"] = resequencing_sheet.cell_value(15, 1)
if resequencing_sheet.cell_value(16, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--kmin-1pass"] = resequencing_sheet.cell_value(16, 1)
if resequencing_sheet.cell_value(17, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["-m"] = resequencing_sheet.cell_value(17, 1)
if resequencing_sheet.cell_value(18, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--mem-flag"] = resequencing_sheet.cell_value(18, 1)
if resequencing_sheet.cell_value(19, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["-t"] = resequencing_sheet.cell_value(19, 1)
if resequencing_sheet.cell_value(20, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--no-hw-accel"] = resequencing_sheet.cell_value(20, 1)
if resequencing_sheet.cell_value(21, 1) != "":
self.conf["identification"]["assembly"]["megahit"]["--min-contig-len"] = resequencing_sheet.cell_value(21, 1)
if resequencing_sheet.cell_value(5, 3) != True:
self.conf["identification"]["assembly"]["spades"]["enable"] = False
if resequencing_sheet.cell_value(6, 3) != "":
self.conf["identification"]["assembly"]["spades"]["--iontorrent"] = resequencing_sheet.cell_value(6, 3)
if resequencing_sheet.cell_value(7, 3) != "":
self.conf["identification"]["assembly"]["spades"]["--pacbio"] = resequencing_sheet.cell_value(7, 3)
if resequencing_sheet.cell_value(8, 3) != "":
self.conf["identification"]["assembly"]["spades"]["--nanopore"] = resequencing_sheet.cell_value(8, 3)
if resequencing_sheet.cell_value(9, 3) != "":
self.conf["identification"]["assembly"]["spades"]["-t"] = resequencing_sheet.cell_value(9, 3)
if resequencing_sheet.cell_value(10, 3) != "":
self.conf["identification"]["assembly"]["spades"]["-m"] = resequencing_sheet.cell_value(10, 3)
if resequencing_sheet.cell_value(11, 3) != "":
self.conf["identification"]["assembly"]["spades"]["-k"] = resequencing_sheet.cell_value(11, 3)
if resequencing_sheet.cell_value(12, 3) != "":
self.conf["identification"]["assembly"]["spades"]["--cov-cutoff"] = resequencing_sheet.cell_value(12, 3)
if resequencing_sheet.cell_value(13, 3) != "":
self.conf["identification"]["assembly"]["spades"]["--phred-offset"] = resequencing_sheet.cell_value(13, 3)
if resequencing_sheet.cell_value(5, 5) != True:
self.conf["identification"]["assembly"]["velvet"]["enable"] = False
if resequencing_sheet.cell_value(7, 5) != "":
self.conf["identification"]["assembly"]["velveth"]["hash_length"] = resequencing_sheet.cell_value(7, 5)
if resequencing_sheet.cell_value(8, 5) != "":
self.conf["identification"]["assembly"]["velveth"]["-short"] = resequencing_sheet.cell_value(8, 5)
if resequencing_sheet.cell_value(9, 5) != "":
self.conf["identification"]["assembly"]["velveth"]["-short2"] = resequencing_sheet.cell_value(9, 5)
if resequencing_sheet.cell_value(10, 5) != "":
self.conf["identification"]["assembly"]["velveth"]["-long"] = resequencing_sheet.cell_value(10, 5)
if resequencing_sheet.cell_value(12, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-cov_cutoff"] = resequencing_sheet.cell_value(12, 5)
if resequencing_sheet.cell_value(13, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-ins_length"] = resequencing_sheet.cell_value(13, 5)
if resequencing_sheet.cell_value(14, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-read_trkg"] = resequencing_sheet.cell_value(14, 5)
if resequencing_sheet.cell_value(15, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-min_contig_lgth"] = resequencing_sheet.cell_value(15, 5)
if resequencing_sheet.cell_value(16, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-amos_file"] = resequencing_sheet.cell_value(16, 5)
if resequencing_sheet.cell_value(17, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-exp_cov"] = resequencing_sheet.cell_value(17, 5)
if resequencing_sheet.cell_value(18, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-long_cov_cutoff"] = resequencing_sheet.cell_value(18, 5)
if resequencing_sheet.cell_value(19, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-ins_length*"] = resequencing_sheet.cell_value(19, 5)
if resequencing_sheet.cell_value(20, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-ins_length_long"] = resequencing_sheet.cell_value(20, 5)
if resequencing_sheet.cell_value(21, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-ins_length*_sd"] = resequencing_sheet.cell_value(21, 5)
if resequencing_sheet.cell_value(22, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-scaffolding"] = resequencing_sheet.cell_value(22, 5)
if resequencing_sheet.cell_value(23, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-max_branch_length"] = resequencing_sheet.cell_value(23, 5)
if resequencing_sheet.cell_value(24, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-max_divergence"] = resequencing_sheet.cell_value(24, 5)
if resequencing_sheet.cell_value(25, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-max_gap_count"] = resequencing_sheet.cell_value(25, 5)
if resequencing_sheet.cell_value(26, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-min_pair_count"] = resequencing_sheet.cell_value(26, 5)
if resequencing_sheet.cell_value(27, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-max_coverage"] = resequencing_sheet.cell_value(27, 5)
if resequencing_sheet.cell_value(28, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-coverage_mask"] = resequencing_sheet.cell_value(28, 5)
if resequencing_sheet.cell_value(29, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-long_mult_cutoff"] = resequencing_sheet.cell_value(29, 5)
if resequencing_sheet.cell_value(30, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-alignments"] = resequencing_sheet.cell_value(30, 5)
if resequencing_sheet.cell_value(31, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-exportFiltered"] = resequencing_sheet.cell_value(31, 5)
if resequencing_sheet.cell_value(32, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-clean"] = resequencing_sheet.cell_value(32, 5)
if resequencing_sheet.cell_value(33, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-very_clean"] = resequencing_sheet.cell_value(33, 5)
if resequencing_sheet.cell_value(34, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-paired_exp_fraction"] = resequencing_sheet.cell_value(34, 5)
if resequencing_sheet.cell_value(35, 5) != "":
self.conf["identification"]["assembly"]["velvetg"]["-conserveLong"] = resequencing_sheet.cell_value(35, 5)
if resequencing_sheet.cell_value(5, 7) != True:
self.conf["identification"]["assembly"]["canu"]["enable"] = False
if resequencing_sheet.cell_value(6, 7) != "":
self.conf["identification"]["assembly"]["canu"]["genomeSize="] = resequencing_sheet.cell_value(6, 7)
if resequencing_sheet.cell_value(7, 7) != "":
self.conf["identification"]["assembly"]["canu"]["-pacbio-raw"] = resequencing_sheet.cell_value(7, 7)
if resequencing_sheet.cell_value(8, 7) != "":
self.conf["identification"]["assembly"]["canu"]["-pacbio-corrected"] = resequencing_sheet.cell_value(8, 7)
if resequencing_sheet.cell_value(9, 7) != "":
self.conf["identification"]["assembly"]["canu"]["-nanopore-raw"] = resequencing_sheet.cell_value(9, 7)
if resequencing_sheet.cell_value(10, 7) != "":
self.conf["identification"]["assembly"]["canu"]["-nanopore-corrected"] = resequencing_sheet.cell_value(10, 7)
if resequencing_sheet.cell_value(11, 7) != "":
self.conf["identification"]["assembly"]["canu"]["minReadLength="] = resequencing_sheet.cell_value(11, 7)
if resequencing_sheet.cell_value(12, 7) != "":
self.conf["identification"]["assembly"]["canu"]["minOverlapLength="] = resequencing_sheet.cell_value(12, 7)
if resequencing_sheet.cell_value(37, 1) != "":
self.conf["identification"]["blastn"]["blast_db_path"] = resequencing_sheet.cell_value(37, 1)
if resequencing_sheet.cell_value(38, 1) != True:
self.conf["identification"]["blastn"]["enable"] = False
if resequencing_sheet.cell_value(39, 1) != "":
self.conf["identification"]["blastn"]["num_threads"] = resequencing_sheet.cell_value(39, 1)
if resequencing_sheet.cell_value(40, 1) != "":
self.conf["identification"]["blastn"]["evalue"] = resequencing_sheet.cell_value(40, 1)
if resequencing_sheet.cell_value(41, 1) != "":
self.conf["identification"]["blastn"]["num_alignments"] = resequencing_sheet.cell_value(41, 1)
if resequencing_sheet.cell_value(43, 1) != "":
self.conf["identification"]["blastn"]["penalty"] = resequencing_sheet.cell_value(43, 1)
if resequencing_sheet.cell_value(44, 1) != "":
self.conf["identification"]["blastn"]["reward"] = resequencing_sheet.cell_value(44, 1)
# if resequencing_sheet.cell_value(45, 1) != "":
# self.conf["identification"]["blastn"]["dust"] = resequencing_sheet.cell_value(45, 1)
# if resequencing_sheet.cell_value(46, 1) != "":
# self.conf["identification"]["blastn"]["filtering_db"] = resequencing_sheet.cell_value(46, 1)
# if resequencing_sheet.cell_value(47, 1) != "":
# self.conf["identification"]["blastn"]["window_masker_taxid"] = resequencing_sheet.cell_value(47, 1)
# if resequencing_sheet.cell_value(48, 1) != "":
# self.conf["identification"]["blastn"]["no_greedy"] = resequencing_sheet.cell_value(48, 1)
# if resequencing_sheet.cell_value(49, 1) != "":
# self.conf["identification"]["blastn"]["min_raw_gapped_score"] = resequencing_sheet.cell_value(49, 1)
# if resequencing_sheet.cell_value(50, 1) != "":
# self.conf["identification"]["blastn"]["ungapped"] = resequencing_sheet.cell_value(50, 1)
# if resequencing_sheet.cell_value(51, 1) != "":
# self.conf["identification"]["blastn"]["off_diagonal_range"] = resequencing_sheet.cell_value(51, 1)
def read_annotation_configuration(self):
annotation_sheet = xlrd.open_workbook(self.conf_file_path).sheet_by_name('annotation')
if annotation_sheet.cell_value(3, 1) != True:
self.conf["annotation"]["cds_annotation"]["enable"] = False
if annotation_sheet.cell_value(6, 1) != True:
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["bowtie2"] = False
if annotation_sheet.cell_value(6, 3) != True:
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["snap"] = False
if annotation_sheet.cell_value(6, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-H"] = annotation_sheet.cell_value(6, 5)
if annotation_sheet.cell_value(7, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-k"] = annotation_sheet.cell_value(7, 5)
if annotation_sheet.cell_value(8, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-w"] = annotation_sheet.cell_value(8, 5)
if annotation_sheet.cell_value(9, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-I"] = annotation_sheet.cell_value(9, 5)
if annotation_sheet.cell_value(10, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-f"] = annotation_sheet.cell_value(10, 5)
if annotation_sheet.cell_value(11, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-g"] = annotation_sheet.cell_value(11, 5)
if annotation_sheet.cell_value(12, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-G"] = annotation_sheet.cell_value(12, 5)
if annotation_sheet.cell_value(13, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-F"] = annotation_sheet.cell_value(13, 5)
if annotation_sheet.cell_value(14, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-r"] = annotation_sheet.cell_value(14, 5)
if annotation_sheet.cell_value(15, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-n"] = annotation_sheet.cell_value(15, 5)
if annotation_sheet.cell_value(16, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-m"] = annotation_sheet.cell_value(16, 5)
if annotation_sheet.cell_value(17, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-X"] = annotation_sheet.cell_value(17, 5)
if annotation_sheet.cell_value(18, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-p"] = annotation_sheet.cell_value(18, 5)
if annotation_sheet.cell_value(19, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-N"] = annotation_sheet.cell_value(19, 5)
if annotation_sheet.cell_value(20, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-A"] = annotation_sheet.cell_value(20, 5)
if annotation_sheet.cell_value(21, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-B"] = annotation_sheet.cell_value(21, 5)
if annotation_sheet.cell_value(22, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-O"] = annotation_sheet.cell_value(22, 5)
if annotation_sheet.cell_value(23, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-E"] = annotation_sheet.cell_value(23, 5)
if annotation_sheet.cell_value(24, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-z"] = annotation_sheet.cell_value(24, 5)
if annotation_sheet.cell_value(25, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-s"] = annotation_sheet.cell_value(25, 5)
if annotation_sheet.cell_value(26, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-u"] = annotation_sheet.cell_value(26, 5)
if annotation_sheet.cell_value(27, 5) != "":
self.conf["annotation"]["cds_annotation"]["alignment_tool"]["minimap2"]["-x"] = annotation_sheet.cell_value(27, 5)
if annotation_sheet.cell_value(29, 1) != True:
self.conf["annotation"]["mlst"] = False
if annotation_sheet.cell_value(31, 1) != True:
self.conf["annotation"]["prokka"]["enable"] = False
if annotation_sheet.cell_value(32, 1) != "":
self.conf["annotation"]["prokka"]["--addgenes"] = annotation_sheet.cell_value(32, 1)
if annotation_sheet.cell_value(33, 1) != "":
self.conf["annotation"]["prokka"]["--addmrna"] = annotation_sheet.cell_value(33, 1)
if annotation_sheet.cell_value(34, 1) != "":
self.conf["annotation"]["prokka"]["--evalue"] = annotation_sheet.cell_value(34, 1)
if annotation_sheet.cell_value(35, 1) != "":
self.conf["annotation"]["prokka"]["--coverage"] = annotation_sheet.cell_value(35, 1)
if annotation_sheet.cell_value(36, 1) != "":
self.conf["annotation"]["prokka"]["--cpus"] = annotation_sheet.cell_value(36, 1)
if annotation_sheet.cell_value(37, 1) != "":
self.conf["annotation"]["prokka"]["--mincontiglen"] = annotation_sheet.cell_value(37, 1)
if annotation_sheet.cell_value(38, 1) != "":
self.conf["annotation"]["prokka"]["--rfam"] = annotation_sheet.cell_value(38, 1)
if annotation_sheet.cell_value(39, 1) != "":
self.conf["annotation"]["prokka"]["--norrna"] = annotation_sheet.cell_value(39, 1)
if annotation_sheet.cell_value(40, 1) != "":
self.conf["annotation"]["prokka"]["--notrna"] = annotation_sheet.cell_value(40, 1)
if annotation_sheet.cell_value(41, 1) != "":
self.conf["annotation"]["prokka"]["--rnammer"] = annotation_sheet.cell_value(41, 1)
if __name__ == "__main__":
cr = ConfigurationReader(sys.argv[1])
cr.run()