From 2cfcdf2dd2bcc5141b0e7a6474dd27646fa6ee25 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Sun, 17 Apr 2022 22:27:04 +0200 Subject: [PATCH 1/3] Add finer controler over for hostremoval saving --- conf/modules.config | 20 ++++++++++++++++---- nextflow.config | 7 +++++-- nextflow_schema.json | 39 ++++++++++++++++++++++++++++++++------- 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index ccd1748..55119ff 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -133,21 +133,33 @@ process { } withName: BOWTIE2_BUILD { - ext.prefix = { "${meta.id}_${meta.run_accession}" } publishDir = [ path: { "${params.outdir}/bowtie2/build" }, mode: params.publish_dir_mode, - pattern: '*.bt2' + enabled: params.save_hostremoval_index, + pattern: 'bowtie2/*' ] } withName: BOWTIE2_ALIGN { ext.prefix = { "${meta.id}_${meta.run_accession}" } + publishDir = [[ + path: { "${params.outdir}/bowtie2/align" }, + mode: params.publish_dir_mode, + pattern: '*.log' + ], + [ + path: { "${params.outdir}/bowtie2/align" }, + mode: params.publish_dir_mode, + enabled: params.save_hostremoval_mapped, + pattern: '*.bam' + ], publishDir = [ path: { "${params.outdir}/bowtie2/align" }, mode: params.publish_dir_mode, - pattern: '*.{fastq.gz,bam}' - ] + enabled: params.save_hostremoval_unmapped, + pattern: '*.fastq.gz' + ]] } withName: BBMAP_BBDUK { diff --git a/nextflow.config b/nextflow.config index bf3ca92..5616b0e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -82,8 +82,11 @@ params { // Host Removal perform_shortread_hostremoval = false - shortread_hostremoval_reference = null - shortread_hostremoval_index = null + shortread_hostremoval_reference = null + shortread_hostremoval_index = null + save_hostremoval_index = false + save_hostremoval_mapped = false + save_hostremoval_unmapped = false // MALT run_malt = false diff --git a/nextflow_schema.json b/nextflow_schema.json index cf0edab..7890517 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,7 +10,10 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["input", "outdir"], + "required": [ + "input", + "outdir" + ], "properties": { "input": { "type": "string", @@ -173,7 +176,14 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "enum": [ + "symlink", + "rellink", + "link", + "copy", + "copyNoFollow", + "move" + ], "hidden": true }, "email_on_fail": { @@ -294,7 +304,10 @@ "shortread_clipmerge_tool": { "type": "string", "default": "fastp", - "enum": ["fastp", "adapterremoval"] + "enum": [ + "fastp", + "adapterremoval" + ] }, "shortread_clipmerge_skipadaptertrim": { "type": "boolean" @@ -335,7 +348,10 @@ "shortread_complexityfilter_prinseqplusplus_mode": { "type": "string", "default": "entropy", - "enum": ["entropy", "dust"] + "enum": [ + "entropy", + "dust" + ] }, "shortread_complexityfilter_prinseqplusplus_dustscore": { "type": "number", @@ -364,11 +380,20 @@ }, "shortread_hostremoval_reference": { "type": "string", - "default": null + "default": "None" }, "shortread_hostremoval_index": { "type": "string", - "default": null + "default": "None" + }, + "save_hostremoval_index": { + "type": "boolean" + }, + "save_hostremoval_mapped": { + "type": "boolean" + }, + "save_hostremoval_unmapped": { + "type": "boolean" } } -} +} \ No newline at end of file From b036ed5b7354df252bf819dfdd65771b8ebcfc98 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Sun, 17 Apr 2022 22:28:18 +0200 Subject: [PATCH 2/3] Prettier --- nextflow_schema.json | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 7890517..c0d3597 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,10 +10,7 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": [ - "input", - "outdir" - ], + "required": ["input", "outdir"], "properties": { "input": { "type": "string", @@ -176,14 +173,7 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": [ - "symlink", - "rellink", - "link", - "copy", - "copyNoFollow", - "move" - ], + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], "hidden": true }, "email_on_fail": { @@ -304,10 +294,7 @@ "shortread_clipmerge_tool": { "type": "string", "default": "fastp", - "enum": [ - "fastp", - "adapterremoval" - ] + "enum": ["fastp", "adapterremoval"] }, "shortread_clipmerge_skipadaptertrim": { "type": "boolean" @@ -348,10 +335,7 @@ "shortread_complexityfilter_prinseqplusplus_mode": { "type": "string", "default": "entropy", - "enum": [ - "entropy", - "dust" - ] + "enum": ["entropy", "dust"] }, "shortread_complexityfilter_prinseqplusplus_dustscore": { "type": "number", @@ -396,4 +380,4 @@ "type": "boolean" } } -} \ No newline at end of file +} From 9880baa0b813a1d7721c9270224a37bb064a31fc Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Mon, 18 Apr 2022 06:37:23 +0200 Subject: [PATCH 3/3] Get build directory working --- conf/modules.config | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 55119ff..ba3c5c9 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -137,29 +137,31 @@ process { path: { "${params.outdir}/bowtie2/build" }, mode: params.publish_dir_mode, enabled: params.save_hostremoval_index, - pattern: 'bowtie2/*' + pattern: 'bowtie2' ] } withName: BOWTIE2_ALIGN { ext.prefix = { "${meta.id}_${meta.run_accession}" } - publishDir = [[ + publishDir = [ + [ path: { "${params.outdir}/bowtie2/align" }, mode: params.publish_dir_mode, pattern: '*.log' - ], - [ + ], + [ path: { "${params.outdir}/bowtie2/align" }, mode: params.publish_dir_mode, enabled: params.save_hostremoval_mapped, pattern: '*.bam' - ], - publishDir = [ + ], + [ path: { "${params.outdir}/bowtie2/align" }, mode: params.publish_dir_mode, enabled: params.save_hostremoval_unmapped, pattern: '*.fastq.gz' - ]] + ] + ] } withName: BBMAP_BBDUK {