From 7ab3aa546b8e1d0388981757d259284bf67f5fc8 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Wed, 6 Apr 2022 10:27:11 +0200 Subject: [PATCH] refactor: use flags to publish reads --- conf/modules.config | 25 ++++++++++++++----------- nextflow.config | 2 ++ nextflow_schema.json | 8 ++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index f9cfe3b..b59850f 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -28,10 +28,6 @@ process { ] } - withName: UNTAR { - publishDir = [enabled: false] - } - withName: FASTQC { ext.args = '--quiet' ext.prefix = { "${meta.id}_${meta.run_accession}_raw" } @@ -64,7 +60,8 @@ process { publishDir = [ path: { "${params.outdir}/fastp" }, mode: params.publish_dir_mode, - pattern: '*.fastq.gz' + pattern: '*.fastq.gz', + enabled: params.save_preprocessed_reads ] } @@ -83,7 +80,8 @@ process { publishDir = [ path: { "${params.outdir}/fastp" }, mode: params.publish_dir_mode, - pattern: '*.fastq.gz' + pattern: '*.fastq.gz', + enabled: params.save_preprocessed_reads ] } @@ -99,7 +97,8 @@ process { publishDir = [ path: { "${params.outdir}/adapterremoval" }, mode: params.publish_dir_mode, - pattern: '*.fastq.gz' + pattern: '*.fastq.gz', + enabled: params.save_preprocessed_reads ] } @@ -118,7 +117,8 @@ process { publishDir = [ path: { "${params.outdir}/adapterremoval" }, mode: params.publish_dir_mode, - pattern: '*.fastq.gz' + pattern: '*.fastq.gz', + enabled: params.save_preprocessed_reads ] } @@ -127,7 +127,8 @@ process { publishDir = [ path: { "${params.outdir}/porechop" }, mode: params.publish_dir_mode, - pattern: '*.fastq.gz' + pattern: '*.fastq.gz', + enabled: params.save_preprocessed_reads ] } @@ -141,7 +142,8 @@ process { publishDir = [ path: { "${params.outdir}/bbduk/" }, mode: params.publish_dir_mode, - pattern: '*.{fastq.gz,log}' + pattern: '*.{fastq.gz,log}', + enabled: params.save_complexityfiltered_reads ] } @@ -154,7 +156,8 @@ process { publishDir = [ path: { "${params.outdir}/prinseqplusplus/" }, mode: params.publish_dir_mode, - pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz,log}' + pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz,log}', + enabled: params.save_complexityfiltered_reads ] } diff --git a/nextflow.config b/nextflow.config index e6d6307..19cc823 100644 --- a/nextflow.config +++ b/nextflow.config @@ -64,6 +64,7 @@ params { shortread_clipmerge_adapter2 = null shortread_clipmerge_minlength = 15 longread_clip = false + save_preprocessed_reads = false // Complexity filtering shortread_complexityfilter = false @@ -73,6 +74,7 @@ params { shortread_complexityfilter_bbduk_mask = false shortread_complexityfilter_prinseqplusplus_mode = 'entropy' shortread_complexityfilter_prinseqplusplus_dustscore = 0.5 + save_complexityfiltered_reads = false // MALT diff --git a/nextflow_schema.json b/nextflow_schema.json index 6f6125e..6858409 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -308,6 +308,10 @@ "type": "integer", "default": 15 }, + "save_preprocessed_reads": { + "type": "boolean", + "default": false + }, "shortread_complexityfilter_tool": { "type": "string", "default": "bbduk" @@ -334,6 +338,10 @@ "shortread_complexityfilter_prinseqplusplus_dustscore": { "type": "number", "default": 0.5 + }, + "save_complexityfiltered_reads": { + "type": "boolean", + "default": false } } }