@@ -21,6 +21,14 @@ nf-core/sarek:
2121
2222nextflow. preview. dsl = 2
2323
24+ // Print help message if required
25+
26+ if (params. help) {
27+ def command = " nextflow run nf-core/sarek -profile docker --input sample.tsv"
28+ log. info Schema . params_help(" $baseDir /nextflow_schema.json" , command)
29+ exit 0
30+ }
31+
2432/*
2533================================================================================
2634 INCLUDE SAREK FUNCTIONS
@@ -244,16 +252,6 @@ workflow_summary = Channel.value(workflow_summary)
244252if (' mutect2' in tools && ! (params. pon)) log. warn " [nf-core/sarek] Mutect2 was requested, but as no panel of normals were given, results will not be optimal"
245253if (params. sentieon) log. warn " [nf-core/sarek] Sentieon will be used, only works if Sentieon is available where nf-core/sarek is run"
246254
247- // Print help message if required
248-
249- if (params. help) {
250- def command = " nextflow run nf-core/sarek --input sample.tsv -profile docker"
251- log. info Headers . nf_core(workflow, params. monochrome_logs)
252- log. info Schema . params_help(" $baseDir /nextflow_schema.json" , command)
253- exit 0
254- }
255-
256-
257255/*
258256================================================================================
259257 INCLUDE LOCAL PIPELINE MODULES
@@ -336,15 +334,14 @@ workflow {
336334 pon,
337335 step)
338336
339- bwa = params. bwa ? Channel . value(file(params. bwa)) : BUILD_INDICES . out. bwa_built
340- dict = params. dict ? Channel . value(file(params. dict)) : BUILD_INDICES . out. dictBuilt
341- fai = params. fasta_fai ? Channel . value(file(params. fasta_fai)) : BUILD_INDICES . out. fai_built
342- dbsnp_tbi = params. dbsnp ? params. dbsnp_index ? Channel . value(file(params. dbsnp_index)) : BUILD_INDICES . out. dbsnp_tbi : " null"
343- germline_resource_tbi = params. germline_resource ? params. germline_resource_index ? Channel . value(file(params. germline_resource_index)) : BUILD_INDICES . out. germline_resource_tbi : " null"
344- known_indels_tbi = params. known_indels ? params. known_indels_index ? Channel . value(file(params. known_indels_index)) : BUILD_INDICES . out. known_indels_tbi. collect() : " null"
345- pon_tbi = params. pon ? params. pon_index ? Channel . value(file(params. pon_index)) : BUILD_INDICES . out. pon_tbi : " null"
346- intervals = params. no_intervals ? " null" : params. intervals && ! (' annotate' in step) ? Channel . value(file(params. intervals)) : BUILD_INDICES . out. intervalBuilt
347- intervals. dump(tag : ' intervals' )
337+ bwa = params. bwa ?: BUILD_INDICES . out. bwa
338+ dbsnp_tbi = params. dbsnp ? params. dbsnp_index ?: BUILD_INDICES . out. dbsnp_tbi : Channel . empty()
339+ dict = params. dict ?: BUILD_INDICES . out. dict
340+ fai = params. fasta_fai ? params. fasta_fai : BUILD_INDICES . out. fai
341+ germline_resource_tbi = params. germline_resource ? params. germline_resource_index ?: BUILD_INDICES . out. germline_resource_tbi : Channel . empty()
342+ intervals = params. no_intervals ? Channel . empty() : params. intervals && ! (' annotate' in step) ? params. intervals : BUILD_INDICES . out. intervals
343+ known_indels_tbi = params. known_indels ? params. known_indels_index ?: BUILD_INDICES . out. known_indels_tbi. collect() : Channel . empty()
344+ pon_tbi = params. pon ? params. pon_index ?: BUILD_INDICES . out. pon_tbi : Channel . empty()
348345
349346 // PREPROCESSING
350347 if ((! params. no_intervals) && step != ' annotate' )
@@ -375,14 +372,16 @@ workflow {
375372 ch_bed_intervals = Channel . from(file(" ${ params.outdir} /no_intervals.bed" ))
376373 }
377374
378- // if(!('fastqc' in skipQC))
375+ // if(!('fastqc' in skipQC))
379376 FASTQC (input_sample)
380377
381- if (params. trim_fastq) {
378+ if (params. trim_fastq) {
382379 TRIM_GALORE (input_sample)
380+ result_trim_galore = TRIM_GALORE . out. report
383381 BWAMEM2_MEM (TRIM_GALORE . out. trimmed_reads, bwa, fasta, fai)
384382 }
385383 else {
384+ result_trim_galore = Channel . empty()
386385 BWAMEM2_MEM (input_sample, bwa, fasta, fai)
387386 }
388387
@@ -397,7 +396,7 @@ workflow {
397396 multiqc_config,
398397 multiqc_custom_config. ifEmpty([]),
399398 GET_SOFTWARE_VERSIONS . out. yml,
400- TRIM_GALORE . out . report . ifEmpty([]),
399+ result_trim_galore . ifEmpty([]),
401400 workflow_summary)
402401}
403402
0 commit comments