34
34
import uk .ac .ebi .fgpt .conan .model .param .ConanParameter ;
35
35
import uk .ac .ebi .fgpt .conan .model .param .ParamMap ;
36
36
import uk .ac .ebi .fgpt .conan .service .ConanExecutorService ;
37
- import uk .ac .tgac .conan .core .data .Library ;
38
37
import uk .ac .tgac .conan .core .data .Organism ;
39
38
import uk .ac .tgac .conan .core .util .XmlHelper ;
40
39
import uk .ac .tgac .rampart .stage .*;
@@ -98,13 +97,13 @@ public void init() throws IOException {
98
97
public static class Args extends AbstractProcessArgs {
99
98
100
99
public static final String KEY_ELEM_MECQ = "mecq" ;
101
- public static final String KEY_ELEM_ANALYSE_READS = "mecq_analysis" ;
100
+ public static final String KEY_ELEM_MECQ_ANALYSIS = "mecq_analysis" ;
102
101
public static final String KEY_ELEM_KMER_CALC = "kmer_calc" ;
103
102
public static final String KEY_ELEM_MASS = "mass" ;
104
- public static final String KEY_ELEM_ANALYSE_MASS = "mass_analysis" ;
105
- public static final String KEY_ELEM_SELECT_MASS = "mass_select" ;
103
+ public static final String KEY_ELEM_MASS_ANALYSIS = "mass_analysis" ;
104
+ public static final String KEY_ELEM_MASS_SELECT = "mass_select" ;
106
105
public static final String KEY_ELEM_AMP = "amp" ;
107
- public static final String KEY_ELEM_ANALYSE_AMP = "amp_analysis" ;
106
+ public static final String KEY_ELEM_AMP_ANALYSIS = "amp_analysis" ;
108
107
public static final String KEY_ELEM_FINALISE = "finalise" ;
109
108
public static final String KEY_ELEM_COLLECT = "collect" ;
110
109
@@ -176,13 +175,13 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
176
175
new String [0 ],
177
176
new String []{
178
177
KEY_ELEM_MECQ ,
179
- KEY_ELEM_ANALYSE_READS ,
178
+ KEY_ELEM_MECQ_ANALYSIS ,
180
179
KEY_ELEM_KMER_CALC ,
181
180
KEY_ELEM_MASS ,
182
- KEY_ELEM_ANALYSE_MASS ,
183
- KEY_ELEM_SELECT_MASS ,
181
+ KEY_ELEM_MASS_ANALYSIS ,
182
+ KEY_ELEM_MASS_SELECT ,
184
183
KEY_ELEM_AMP ,
185
- KEY_ELEM_ANALYSE_AMP ,
184
+ KEY_ELEM_AMP_ANALYSIS ,
186
185
KEY_ELEM_FINALISE ,
187
186
KEY_ELEM_COLLECT
188
187
}
@@ -219,15 +218,22 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
219
218
220
219
this .stages .setArgsIfPresent (RampartStage .MECQ , this .mecqArgs );
221
220
221
+ if (this .mecqArgs == null ) {
222
+ // Add ECQ information into samples list
223
+ for (int i = 0 ; i < samples .size (); i ++) {
224
+ samples .get (i ).ecqArgList = new ArrayList <>();
225
+ }
226
+ }
227
+
222
228
223
229
// Analyse reads
224
- Element mecqAnalysisElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_ANALYSE_READS );
230
+ Element mecqAnalysisElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_MECQ_ANALYSIS );
225
231
this .mecqAnalysisArgs = mecqAnalysisElement == null ? null :
226
232
new MecqAnalysis .Args (
227
233
mecqAnalysisElement ,
228
234
this .outputDir ,
229
235
this .jobPrefix ,
230
- this . mecqArgs . getSamples () ,
236
+ samples ,
231
237
this .organism ,
232
238
this .runParallel );
233
239
@@ -240,7 +246,7 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
240
246
kmerCalcElement ,
241
247
this .outputDir ,
242
248
this .jobPrefix ,
243
- this . mecqArgs . getSamples () ,
249
+ samples ,
244
250
this .organism ,
245
251
this .runParallel );
246
252
@@ -253,7 +259,7 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
253
259
massElement ,
254
260
this .outputDir ,
255
261
this .jobPrefix ,
256
- this . mecqArgs . getSamples () ,
262
+ samples ,
257
263
this .organism ,
258
264
this .kmerCalcArgs ,
259
265
this .runParallel );
@@ -276,7 +282,7 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
276
282
}
277
283
278
284
// Analyse MASS assemblies
279
- Element analyseMassElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_ANALYSE_MASS );
285
+ Element analyseMassElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_MASS_ANALYSIS );
280
286
this .analyseMassArgs = analyseMassElement == null ? null :
281
287
new AnalyseMassAssemblies .Args (
282
288
analyseMassElement ,
@@ -290,7 +296,7 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
290
296
this .stages .setArgsIfPresent (RampartStage .MASS_ANALYSIS , this .analyseMassArgs );
291
297
292
298
// Select MASS assembly
293
- Element selectMassElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_SELECT_MASS );
299
+ Element selectMassElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_MASS_SELECT );
294
300
this .selectMassArgs = selectMassElement == null ? null :
295
301
new Select .Args (
296
302
selectMassElement ,
@@ -312,13 +318,13 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
312
318
ampElement ,
313
319
this .outputDir ,
314
320
this .jobPrefix ,
315
- this . mecqArgs . getSamples () ,
321
+ samples ,
316
322
this .organism ,
317
- this .ampInput != null && this . mecqArgs . getSamples () .size () == 1 ?
323
+ this .ampInput != null && samples .size () == 1 ?
318
324
this .ampInput :
319
325
null ,
320
326
this .organism .getPloidy () > 1 ?
321
- this .ampBubble != null && this . mecqArgs . getSamples () .size () == 1 ?
327
+ this .ampBubble != null && samples .size () == 1 ?
322
328
this .ampBubble :
323
329
null :
324
330
null ,
@@ -328,13 +334,13 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
328
334
this .stages .setArgsIfPresent (RampartStage .AMP , this .ampArgs );
329
335
330
336
// Analyse AMP assemblies
331
- Element analyseAmpElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_ANALYSE_AMP );
337
+ Element analyseAmpElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_AMP_ANALYSIS );
332
338
this .analyseAmpArgs = analyseAmpElement == null ? null :
333
339
new AnalyseAmpAssemblies .Args (
334
340
analyseAmpElement ,
335
341
this .outputDir ,
336
342
this .jobPrefix ,
337
- this . mecqArgs . getSamples () ,
343
+ samples ,
338
344
this .organism ,
339
345
this .ampArgs == null ? null : this .ampArgs .getStageArgsList (),
340
346
this .runParallel
@@ -351,7 +357,7 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
351
357
finaliseElement ,
352
358
this .outputDir ,
353
359
this .jobPrefix ,
354
- this . mecqArgs . getSamples () ,
360
+ samples ,
355
361
this .organism ,
356
362
this .institution ,
357
363
inputFromMass ,
@@ -363,13 +369,13 @@ public Args(Element element, List<Mecq.Sample> samples, Organism organism, File
363
369
364
370
this .stages .setArgsIfPresent (RampartStage .FINALISE , this .finaliseArgs );
365
371
366
- if (this . mecqArgs . getSamples () .size () > 1 ) {
372
+ if (samples .size () > 1 ) {
367
373
Element collectElement = XmlHelper .getDistinctElementByName (element , KEY_ELEM_COLLECT );
368
374
this .collectArgs = new Collect .Args (
369
375
collectElement ,
370
376
this .outputDir ,
371
377
this .jobPrefix ,
372
- this . mecqArgs . getSamples () ,
378
+ samples ,
373
379
this .organism ,
374
380
this .finaliseArgs ,
375
381
this .runParallel );
0 commit comments