From 088f4a8a9bf32dab0ac7ea76ea94bc0db2c69893 Mon Sep 17 00:00:00 2001 From: jvfe Date: Tue, 31 Oct 2023 13:03:17 -0300 Subject: [PATCH 1/6] refactor: Remove host check for preprocess --- workflows/euryale.nf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/workflows/euryale.nf b/workflows/euryale.nf index 0ea7834..59db3d9 100644 --- a/workflows/euryale.nf +++ b/workflows/euryale.nf @@ -101,13 +101,8 @@ workflow EURYALE { ) ch_versions = ch_versions.mix(PREPROCESS.out.versions) - if (ch_host_reference) { - PREPROCESS.out.reads - .set { clean_reads } - } else { - PREPROCESS.out.merged_reads - .set { clean_reads } - } + PREPROCESS.out.reads + .set { clean_reads } ch_multiqc_files = ch_multiqc_files.mix(PREPROCESS.out.multiqc_files.collect()) if (ch_host_reference || ch_bowtie2_db) { From ccbf570a17ca951f22d69b59e86e6c6317a272fe Mon Sep 17 00:00:00 2001 From: jvfe Date: Tue, 31 Oct 2023 13:06:52 -0300 Subject: [PATCH 2/6] feat: Add skip host removal --- nextflow.config | 1 + workflows/euryale.nf | 1 + 2 files changed, 2 insertions(+) diff --git a/nextflow.config b/nextflow.config index 8ecfe8e..a89809e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -43,6 +43,7 @@ params { maximum_evalue = 0.0001 // Skips + skip_host_removal = false skip_classification = false skip_functional = false skip_alignment = false diff --git a/workflows/euryale.nf b/workflows/euryale.nf index 59db3d9..3f8c610 100644 --- a/workflows/euryale.nf +++ b/workflows/euryale.nf @@ -76,6 +76,7 @@ workflow EURYALE { if (params.host_fasta == null && params.bowtie2_db == null) {exit 1, 'Either a host reference FASTA (--host_fasta) or a pre-built bowtie2 index (--bowtie2_db) must be specified'} if (params.run_kaiju == true && params.kaiju_db == null) {exit 1, 'A Kaiju tar.gz database must be specified with --kaiju_db'} if (params.run_kraken2 == true && params.kraken2_db == null) {exit 1, 'A Kraken2 database must be specified with --kraken2_db'} + if (params.host_fasta == null && params.bowtie2_db == null && params.skip_host_removal == false) {exit 1, 'Either a host reference FASTA (--host_fasta) or a pre-built bowtie2 index (--bowtie2_db) must be specified'} ch_versions = Channel.empty() ch_kraken_db = params.run_kraken2 ? file(params.kraken2_db) : [] From d3496654b9a5dce5cd5b238bbe6952ba3538c344 Mon Sep 17 00:00:00 2001 From: jvfe Date: Tue, 31 Oct 2023 13:31:38 -0300 Subject: [PATCH 3/6] feat: Add flag to skip preprocess --- workflows/euryale.nf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/workflows/euryale.nf b/workflows/euryale.nf index 3f8c610..41f08d6 100644 --- a/workflows/euryale.nf +++ b/workflows/euryale.nf @@ -97,14 +97,18 @@ workflow EURYALE { ch_versions = ch_versions.mix(INPUT_CHECK.out.versions) INPUT_CHECK.out.reads.set { reads } - PREPROCESS ( - reads - ) - ch_versions = ch_versions.mix(PREPROCESS.out.versions) + if (params.skip_preprocess) { + clean_reads = reads + } else { + PREPROCESS ( + reads + ) + ch_versions = ch_versions.mix(PREPROCESS.out.versions) - PREPROCESS.out.reads - .set { clean_reads } - ch_multiqc_files = ch_multiqc_files.mix(PREPROCESS.out.multiqc_files.collect()) + PREPROCESS.out.reads + .set { clean_reads } + ch_multiqc_files = ch_multiqc_files.mix(PREPROCESS.out.multiqc_files.collect()) + } if (ch_host_reference || ch_bowtie2_db) { HOST_REMOVAL ( From 5cec0de84d55a71206f9e31c7945184cf18e6659 Mon Sep 17 00:00:00 2001 From: jvfe Date: Tue, 31 Oct 2023 13:41:38 -0300 Subject: [PATCH 4/6] refactor: Also skip fastx with skip preprocess --- workflows/euryale.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/euryale.nf b/workflows/euryale.nf index 41f08d6..d342e11 100644 --- a/workflows/euryale.nf +++ b/workflows/euryale.nf @@ -132,7 +132,7 @@ workflow EURYALE { ch_versions = ch_versions.mix(ASSEMBLY.out.versions) } - if (!params.assembly_based) { + if (!params.assembly_based && !params.skip_preprocess) { GUNZIP ( clean_reads ) From 6bc6f2c53bbdd92d55a3c586d4e4e00c6fb5b08d Mon Sep 17 00:00:00 2001 From: jvfe Date: Sun, 24 Mar 2024 11:06:09 -0300 Subject: [PATCH 5/6] fix: Remove repeated line --- workflows/euryale.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/workflows/euryale.nf b/workflows/euryale.nf index d342e11..bac4bf0 100644 --- a/workflows/euryale.nf +++ b/workflows/euryale.nf @@ -73,7 +73,6 @@ def multiqc_report = [] workflow EURYALE { if (params.reference_fasta == null && params.diamond_db == null) { exit 1, 'A reference fasta (--reference_fasta) or a DIAMOND db (--diamond_db) must be specified' } - if (params.host_fasta == null && params.bowtie2_db == null) {exit 1, 'Either a host reference FASTA (--host_fasta) or a pre-built bowtie2 index (--bowtie2_db) must be specified'} if (params.run_kaiju == true && params.kaiju_db == null) {exit 1, 'A Kaiju tar.gz database must be specified with --kaiju_db'} if (params.run_kraken2 == true && params.kraken2_db == null) {exit 1, 'A Kraken2 database must be specified with --kraken2_db'} if (params.host_fasta == null && params.bowtie2_db == null && params.skip_host_removal == false) {exit 1, 'Either a host reference FASTA (--host_fasta) or a pre-built bowtie2 index (--bowtie2_db) must be specified'} From e2d74d326a9fc18ee394ee7bdec6309969077495 Mon Sep 17 00:00:00 2001 From: jvfe Date: Sun, 24 Mar 2024 11:07:48 -0300 Subject: [PATCH 6/6] docs: Add host removal to schema --- docs/params.md | 1 + nextflow_schema.json | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/params.md b/docs/params.md index fb2970b..3ca92a6 100644 --- a/docs/params.md +++ b/docs/params.md @@ -23,6 +23,7 @@ Choose to skip pipeline steps | `skip_classification` | Skip taxonomic classification | `boolean` | | | | | `skip_alignment` | Skip alignment | `boolean` | | | | | `skip_functional` | Skip functional annotation | `boolean` | | | | +| `skip_host_removal` | Skip host removal | `boolean` | | | | ## Decontamination diff --git a/nextflow_schema.json b/nextflow_schema.json index 3346dde..6cdec5c 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", @@ -66,6 +69,11 @@ "type": "boolean", "fa_icon": "fas fa-database", "description": "Skip functional annotation" + }, + "skip_host_removal": { + "type": "boolean", + "description": "Skip host removal", + "fa_icon": "fab fa-ioxhost" } }, "fa_icon": "fas fa-angle-double-right" @@ -136,7 +144,9 @@ "description": "Run Kraken2 classifier" } }, - "required": ["kaiju_db"], + "required": [ + "kaiju_db" + ], "fa_icon": "fab fa-pagelines" }, "functional": { @@ -170,7 +180,9 @@ "description": "Maximum evalue of a match to be used for annotation" } }, - "required": ["id_mapping"], + "required": [ + "id_mapping" + ], "fa_icon": "fas fa-gavel" }, "assembly": { @@ -278,7 +290,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": { @@ -394,4 +413,4 @@ "$ref": "#/definitions/generic_options" } ] -} +} \ No newline at end of file