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