diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b102cc2..c7fe753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,6 @@ on: - checks_requested branches: - master - - dev env: NXF_ANSI_LOG: false diff --git a/assets/samplesheet.csv b/assets/samplesheet.csv index 5f653ab..fa08939 100644 --- a/assets/samplesheet.csv +++ b/assets/samplesheet.csv @@ -1,3 +1,5 @@ -sample,fastq_1,fastq_2 -SAMPLE_PAIRED_END,/path/to/fastq/files/AEG588A1_S1_L002_R1_001.fastq.gz,/path/to/fastq/files/AEG588A1_S1_L002_R2_001.fastq.gz -SAMPLE_SINGLE_END,/path/to/fastq/files/AEG588A4_S4_L003_R1_001.fastq.gz, +sample,replicate,group,fastq_1,fastq_2 +test1,rep1,group1,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz +test1,rep2,group1,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_1.fastq.gz,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_2.fastq.gz +test2,rep1,group1,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_1.fastq.gz,https://github.com/nf-core/test-datasets/raw/modules/data/genomics/prokaryotes/candidatus_portiera_aleyrodidarum/illumina/fastq/test_2.fastq.gz + diff --git a/conf/modules.config b/conf/modules.config deleted file mode 100644 index e3ea8fa..0000000 --- a/conf/modules.config +++ /dev/null @@ -1,42 +0,0 @@ -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Config file for defining DSL2 per module options and publishing paths -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Available keys to override module options: - ext.args = Additional arguments appended to command in module. - ext.args2 = Second set of arguments appended to command in module (multi-tool modules). - ext.args3 = Third set of arguments appended to command in module (multi-tool modules). - ext.prefix = File name prefix for output files. ----------------------------------------------------------------------------------------- -*/ - -process { - - publishDir = [ - path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - - withName: FASTQC { - ext.args = '--quiet' - } - - withName: CUSTOM_DUMPSOFTWAREVERSIONS { - publishDir = [ - path: { "${params.outdir}/pipeline_info" }, - mode: params.publish_dir_mode, - pattern: '*_versions.yml' - ] - } - - withName: 'MULTIQC' { - ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } - publishDir = [ - path: { "${params.outdir}/multiqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - -} diff --git a/conf/test_data.config b/conf/test_data.config deleted file mode 100644 index fac2bee..0000000 --- a/conf/test_data.config +++ /dev/null @@ -1,45 +0,0 @@ -params { - // Base directory for test data - test_data_base = "https://raw.githubusercontent.com/nf-core/test-datasets/modules" - - // TODO: Add all test data to test_data.config - test_data { - 'assets'{ - 'metaphlan' { - metaphlan_sgb_profile1_txt = "${projectDir}/assets/metaphlan/metaphlan_sgb_profile1.txt" - metaphlan_sgb_profile2_txt = "${projectDir}/assets/metaphlan/metaphlan_sgb_profile2.txt" - metaphlan_sgb2gtdb_tsv = "${projectDir}/assets/metaphlan/mpa_vJan21_TOY_CHOCOPhlAnSGB_20_SGB2GTDB.tsv" - } - 'fastqs' { - test_1_fastq_gz = "${projectDir}/assets/fastqs/SRX5235702_SRR8427717_1.fastq.gz" - test_2_fastq_gz = "${projectDir}/assets/fastqs/SRX5235702_SRR8427717_2.fastq.gz" - } - 'kneaddata' { - kneaddata1_log = "${projectDir}/assets/kneaddata/kneaddata1.log" - kneaddata2_log = "${projectDir}/assets/kneaddata/kneaddata2.log" - } - } - 'homo_sapiens' { - 'illumina' { - test_1_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz" - test_2_fastq_gz = "${params.test_data_base}/data/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz" - } - } - 'sarscov2' { - 'illumina' { - test_1_fastq_gz = "${params.test_data_base}/data/genomics/sarscov2/illumina/fastq/test_1.fastq.gz" - test_2_fastq_gz = "${params.test_data_base}/data/genomics/sarscov2/illumina/fastq/test_2.fastq.gz" - test2_1_fastq_gz = "${params.test_data_base}/data/genomics/sarscov2/illumina/fastq/test2_1.fastq.gz" - test2_2_fastq_gz = "${params.test_data_base}/data/genomics/sarscov2/illumina/fastq/test2_2.fastq.gz" - } - } - 'bacteroides_fragilis' { - 'illumina' { - test1_1_fastq_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz" - test1_2_fastq_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz" - test2_1_fastq_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_1.fastq.gz" - test2_2_fastq_gz = "${params.test_data_base}/data/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test2_2.fastq.gz" - } - } - } -} diff --git a/main.nf b/main.nf index e09bd06..565d747 100644 --- a/main.nf +++ b/main.nf @@ -90,24 +90,6 @@ workflow { ) } - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - COMPLETION EMAIL AND SUMMARY -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -workflow.onComplete { - if (params.email || params.email_on_fail) { - NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report) - } - NfcoreTemplate.summary(workflow, params, log) - if (params.hook_url) { - NfcoreTemplate.IM_notification(workflow, params, summary_params, projectDir, log) - } -} - - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END diff --git a/modules/local/kneaddata/database/nextflow.config b/modules/local/kneaddata/database/nextflow.config new file mode 100644 index 0000000..e9fcc63 --- /dev/null +++ b/modules/local/kneaddata/database/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: KNEADDATA_DATABASE { + publishDir = [ + enabled: params.kneaddata_save_db, + path: { "${params.outdir}/ReadPreprocessing/kneaddata/database" }, + mode: params.publish_dir_mode, + pattern: 'kneaddata_*/', + ] + } +} diff --git a/modules/local/kneaddata/kneaddata/nextflow.config b/modules/local/kneaddata/kneaddata/nextflow.config new file mode 100644 index 0000000..0783713 --- /dev/null +++ b/modules/local/kneaddata/kneaddata/nextflow.config @@ -0,0 +1,17 @@ +process { + withName: KNEADDATA_KNEADDATA { + publishDir = [ + [ + path: { "${params.outdir}/ReadPreprocessing/kneaddata/kneaddata" }, + mode: params.publish_dir_mode, + pattern: '*_kneaddata_paired_*.fastq.gz' + ], + [ + path: { "${params.outdir}/ReadPreprocessing/kneaddata/kneaddata" }, + mode: params.publish_dir_mode, + pattern: '*_kneaddata.log' + ] + ] + ext.args = params.kneaddata_options ? params.kneaddata_options : "" + } +} diff --git a/modules/local/kneaddata/kneaddata/tests/main.nf.test.snap b/modules/local/kneaddata/kneaddata/tests/main.nf.test.snap index 3704aab..ce967b3 100644 --- a/modules/local/kneaddata/kneaddata/tests/main.nf.test.snap +++ b/modules/local/kneaddata/kneaddata/tests/main.nf.test.snap @@ -7,8 +7,8 @@ "id": "test" }, [ - "test_kneaddata_paired_1.fastq.gz:md5,bc575548c0169cf3f12c38590060cbec", - "test_kneaddata_paired_2.fastq.gz:md5,6dd6bd3bcb33e9dda68afa0c78a33b2d" + "test_kneaddata_paired_1.fastq.gz:md5,acba94fdc94d1e4229beec12086a93af", + "test_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" ] ] ], @@ -20,7 +20,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-24T10:06:32.04321443" + "timestamp": "2024-04-24T11:11:09.743832394" }, "fastq.gz - stub": { "content": [ @@ -75,6 +75,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-24T10:06:43.652978972" + "timestamp": "2024-04-24T11:11:19.559542979" } } \ No newline at end of file diff --git a/modules/local/kneaddata/readcounts/environment.yml b/modules/local/kneaddata/readcounts/environment.yml new file mode 100644 index 0000000..6d67dce --- /dev/null +++ b/modules/local/kneaddata/readcounts/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::kneaddata=0.12.0 diff --git a/modules/local/kneaddata/readcounts/nextflow.config b/modules/local/kneaddata/readcounts/nextflow.config new file mode 100644 index 0000000..f50b0ba --- /dev/null +++ b/modules/local/kneaddata/readcounts/nextflow.config @@ -0,0 +1,9 @@ +process { + withName: KNEADDATA_READCOUNTS { + publishDir = [ + path: { "${params.outdir}/ReadPreprocessing/kneaddata/readcounts" }, + mode: params.publish_dir_mode, + pattern: '*_kneaddata_read_counts.tsv' + ] + } +} diff --git a/modules/local/metaphlan/sgbtogtdbprofile/nextflow.config b/modules/local/metaphlan/sgbtogtdbprofile/nextflow.config new file mode 100644 index 0000000..19709eb --- /dev/null +++ b/modules/local/metaphlan/sgbtogtdbprofile/nextflow.config @@ -0,0 +1,9 @@ +process { + withName: METAPHLAN_SGBTOGTDBPROFILE { + publishDir = [ + path: { "${params.outdir}/ReadTaxonomy/metaphlan/sgbtogtdbprofile" }, + mode: params.publish_dir_mode, + pattern: '*_gtdb_profile.txt' + ] + } +} diff --git a/modules/nf-core/cat/fastq/nextflow.config b/modules/nf-core/cat/fastq/nextflow.config new file mode 100644 index 0000000..677af45 --- /dev/null +++ b/modules/nf-core/cat/fastq/nextflow.config @@ -0,0 +1,9 @@ +process { + withName: CAT_FASTQ { + publishDir = [ + path: { "${params.outdir}/RunMerging/cat/fastq" }, + mode: params.publish_dir_mode, + pattern: '*.merged.fastq.gz' + ] + } +} diff --git a/modules/nf-core/fastqc/nextflow.config b/modules/nf-core/fastqc/nextflow.config new file mode 100644 index 0000000..20e9423 --- /dev/null +++ b/modules/nf-core/fastqc/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: FASTQC { + ext.args = '--quiet' + publishDir = [ + path: { "${params.outdir}/ReadQuality/fastqc" }, + mode: params.publish_dir_mode, + pattern: '*.html' + ] + } +} \ No newline at end of file diff --git a/modules/nf-core/metaphlan/makedb/nextflow.config b/modules/nf-core/metaphlan/makedb/nextflow.config new file mode 100644 index 0000000..27d29d4 --- /dev/null +++ b/modules/nf-core/metaphlan/makedb/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: METAPHLAN_MAKEDB { + publishDir = [ + enabled: params.metaphlan_save_db, + path: { "${params.outdir}/ReadTaxonomy/metaphlan/makedb" }, + mode: params.publish_dir_mode, + pattern: '*/' + ] + } +} diff --git a/modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config b/modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config index f060329..a5166c0 100644 --- a/modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config +++ b/modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config @@ -1,3 +1,9 @@ process { - + withName: METAPHLAN_MERGEMETAPHLANTABLES { + publishDir = [ + path: { "${params.outdir}/ReadTaxonomy/metaphlan/makedb" }, + mode: params.publish_dir_mode, + pattern: '*.txt' + ] + } } \ No newline at end of file diff --git a/modules/nf-core/metaphlan/metaphlan/nextflow.config b/modules/nf-core/metaphlan/metaphlan/nextflow.config new file mode 100644 index 0000000..ac39a15 --- /dev/null +++ b/modules/nf-core/metaphlan/metaphlan/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: METAPHLAN_METAPHLAN { + publishDir = [ + path: { "${params.outdir}/ReadTaxonomy/metaphlan/metaphlan" }, + mode: params.publish_dir_mode, + pattern: '*_profile.txt' + ] + ext.args = params.metaphlan_options ? params.metaphlan_options : "" + } +} diff --git a/modules/nf-core/multiqc/nextflow.config b/modules/nf-core/multiqc/nextflow.config new file mode 100644 index 0000000..4e507e7 --- /dev/null +++ b/modules/nf-core/multiqc/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: 'MULTIQC' { + ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } + publishDir = [ + path: { "${params.outdir}/multiqc" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] + } +} \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index 90d9d39..0c0b78d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -12,24 +12,26 @@ params { // TODO nf-core: Specify your pipeline's command line flags // Input options input = null - run_runmerging = true + run_runmerging = false // KneadData options - run_kneaddata = true + run_kneaddata = false kneaddata_db = null kneaddata_db_version = 'human_genome' + kneaddata_save_db = false kneaddata_trimmomatic_path = '/usr/local/share/trimmomatic-0.39-2' kneaddata_options = null // MetaPhlAn options - run_metaphlan = true + run_metaphlan = false metaphlan_db = null metaphlan_db_version = null + metaphlan_save_db = false metaphlan_options = null metaphlan_sgb2gtbd_file = "https://github.com/biobakery/MetaPhlAn/raw/master/metaphlan/utils/mpa_vOct22_CHOCOPhlAnSGB_202212_SGB2GTDB.tsv" // HUMAnN options - run_humann = true + run_humann = false chocophlan_db_version ='DEMO' uniref_db_version ='DEMO_diamond' utility_mapping_version ='DEMO' @@ -250,9 +252,6 @@ manifest { doi = '' } -// Load modules.config for DSL2 module specific options -includeConfig 'conf/modules.config' - // Function to ensure that resource requirements don't go beyond // a maximum limit def check_max(obj, type) { diff --git a/subworkflows/local/fastq_read_preprocessing_kneaddata/nextflow.config b/subworkflows/local/fastq_read_preprocessing_kneaddata/nextflow.config new file mode 100644 index 0000000..370a428 --- /dev/null +++ b/subworkflows/local/fastq_read_preprocessing_kneaddata/nextflow.config @@ -0,0 +1,3 @@ +includeConfig '../../../modules/local/kneaddata/database/nextflow.config' +includeConfig '../../../modules/local/kneaddata/kneaddata/nextflow.config' +includeConfig '../../../modules/local/kneaddata/readcounts/nextflow.config' diff --git a/subworkflows/local/fastq_read_preprocessing_kneaddata/tests/main.nf.test.snap b/subworkflows/local/fastq_read_preprocessing_kneaddata/tests/main.nf.test.snap index 78edb55..294fbec 100644 --- a/subworkflows/local/fastq_read_preprocessing_kneaddata/tests/main.nf.test.snap +++ b/subworkflows/local/fastq_read_preprocessing_kneaddata/tests/main.nf.test.snap @@ -1,201 +1,23 @@ { - " ['sarscov2']['illumina']['test_fastq_gz'] ": { - "content": [ - { - "0": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,acba94fdc94d1e4229beec12086a93af", - "test2_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,acba94fdc94d1e4229beec12086a93af", - "test_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ] - ], - "1": [ - "all_samples_kneaddata_read_counts.tsv:md5,0cbc1c285d40c25876ce0675fe36f34b" - ], - "2": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", - "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" - ], - "preprocessed_fastq_gz": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,acba94fdc94d1e4229beec12086a93af", - "test2_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,acba94fdc94d1e4229beec12086a93af", - "test_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ] - ], - "read_counts_tsv": [ - "all_samples_kneaddata_read_counts.tsv:md5,0cbc1c285d40c25876ce0675fe36f34b" - ], - "versions": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", - "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-15T11:13:45.851750436" - }, " fasta.gz + 'human_genome' ": { "content": [ { "0": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,fa375e325db8088f41103e27be7b9fd7", - "test2_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,fa375e325db8088f41103e27be7b9fd7", - "test_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ] - ], - "1": [ - "all_samples_kneaddata_read_counts.tsv:md5,0cbc1c285d40c25876ce0675fe36f34b" - ], - "2": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", - "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" - ], - "preprocessed_fastq_gz": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,fa375e325db8088f41103e27be7b9fd7", - "test2_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,fa375e325db8088f41103e27be7b9fd7", - "test_kneaddata_paired_2.fastq.gz:md5,7c8a08782ad6705eced33d11d5032859" - ] - ] - ], - "read_counts_tsv": [ - "all_samples_kneaddata_read_counts.tsv:md5,0cbc1c285d40c25876ce0675fe36f34b" - ], - "versions": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", - "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-04-24T10:32:19.654450168" - }, - " ['sarscov2']['illumina']['test_fastq_gz'] - stub ": { - "content": [ - { - "0": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "test2_kneaddata_paired_2.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "test_kneaddata_paired_2.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] + ], "1": [ - "all_samples_kneaddata_read_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], "2": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" ], "preprocessed_fastq_gz": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "test2_kneaddata_paired_2.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "test_kneaddata_paired_2.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] + ], "read_counts_tsv": [ - "all_samples_kneaddata_read_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], "versions": [ - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,78fbce8ab53a0d6fb8dbf43cd7624846", - "versions.yml:md5,bb0ae5552fe7c380606c211bcf91f2c8", "versions.yml:md5,c97c9af1b0da5c6c85c297ad365653cc" ] } @@ -204,6 +26,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-02-15T11:14:00.523579719" + "timestamp": "2024-04-24T11:21:29.845724761" } } \ No newline at end of file diff --git a/subworkflows/local/fastq_read_taxonomy_metaphlan/nextflow.config b/subworkflows/local/fastq_read_taxonomy_metaphlan/nextflow.config new file mode 100644 index 0000000..552f48a --- /dev/null +++ b/subworkflows/local/fastq_read_taxonomy_metaphlan/nextflow.config @@ -0,0 +1,4 @@ +includeConfig '../../../modules/nf-core/metaphlan/makedb/nextflow.config' +includeConfig '../../../modules/nf-core/metaphlan/metaphlan/nextflow.config' +includeConfig '../../../modules/local/metaphlan/sgbtogtdbprofile/nextflow.config' +includeConfig '../../../modules/nf-core/metaphlan/mergemetaphlantables/nextflow.config' diff --git a/tests/main.nf.test b/tests/main.nf.test new file mode 100644 index 0000000..4e471eb --- /dev/null +++ b/tests/main.nf.test @@ -0,0 +1,36 @@ +nextflow_pipeline { + + name "Test pipeline: HOFFLAB_BIOBAKERYMGX" + script "main.nf" + tag "PIPELINE" + + test("Parameters: default") { + when { + params { + input = "$projectDir/assets/samplesheet.csv" + outdir = "$outputDir" + perform_runmerging = true + run_kneaddata = true + kneaddata_db_version = 'human_genome' + run_metaphlan = true + metaphlan_db_version = 'mpa_vJan21_TOY_CHOCOPhlAnSGB_202103' + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + path("${params.outdir}/RunMerging"), + path("${params.outdir}/ReadPreprocessing"), + path("${params.outdir}/ReadTaxonomy"), + ).match() }, + { assert new File("$outputDir/ReadQuality/fastqc/test1_1_fastqc.html").exists() }, + { assert new File("$outputDir/ReadQuality/fastqc/test1_2_fastqc.html").exists() }, + { assert new File("$outputDir/ReadQuality/fastqc/test2_1_fastqc.html").exists() }, + { assert new File("$outputDir/ReadQuality/fastqc/test2_2_fastqc.html").exists() }, + { assert new File("$outputDir/multiqc/multiqc_report.html").exists() } + ) + } + } +} diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap new file mode 100644 index 0000000..0e7e3c8 --- /dev/null +++ b/tests/main.nf.test.snap @@ -0,0 +1,46 @@ +{ + "Parameters: default": { + "content": [ + [ + [ + [ + "test1_1.merged.fastq.gz:md5,398c2de2315ee0621bf7e7ae9f4da6c3", + "test1_2.merged.fastq.gz:md5,cc9b09043a3eb49d274c2c137e6c092f" + ] + ] + ], + [ + [ + [ + "test1_kneaddata.log:md5,599db60bf0e6c175b6213b8668eae520", + "test1_kneaddata_paired_1.fastq.gz:md5,1ec2131229365e22ed29ebbe6af110e4", + "test1_kneaddata_paired_2.fastq.gz:md5,1be4ea1124566c44cfd46f577f26f180", + "test2_kneaddata.log:md5,237254fffe9a34bd47d42544ce85a42e", + "test2_kneaddata_paired_1.fastq.gz:md5,5676b9ae1d87e3802fa52a0ff31d0c5a", + "test2_kneaddata_paired_2.fastq.gz:md5,37cb67e5022c7df99829945dfa82b22a" + ], + [ + "all_samples_kneaddata_read_counts.tsv:md5,6673fd8ca96ff68546187b963e5ed34c" + ] + ] + ], + [ + [ + [ + "test1_profile.txt:md5,81a9163b96ae997981da78d32ae8758e", + "test2_profile.txt:md5,ab726ce4b471954d789cf2f67401d8f6" + ], + [ + "test1_gtdb_profile.txt:md5,32b4336da6f56f660f767ed3b778f0b4", + "test2_gtdb_profile.txt:md5,2d696bb46715192d78b256616914090c" + ] + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-24T13:58:41.505643708" + } +} \ No newline at end of file diff --git a/tests/nextflow.config b/tests/nextflow.config index 70d247e..9866ebb 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -10,8 +10,14 @@ params { // Impose sensible resource limits for testing process { withName: '.*' { - cpus = 2 - memory = 3.GB + cpus = 4 + memory = 15.GB + time = 2.h + } + + withName: 'KNEADDATA_KNEADDATA' { + cpus = 1 + memory = 15.GB time = 2.h } } @@ -26,6 +32,3 @@ timeline { enabled = false } report { enabled = false } trace { enabled = false } dag { enabled = false } - -// Load test_data.config -includeConfig '../conf/test_data.config' diff --git a/workflows/biobakerymgx/nextflow.config b/workflows/biobakerymgx/nextflow.config index 4c02b2b..e0b5553 100644 --- a/workflows/biobakerymgx/nextflow.config +++ b/workflows/biobakerymgx/nextflow.config @@ -1 +1,5 @@ -includeConfig "../../subworkflows/local/fastq_microbial_pathway_humann/nextflow.config" +includeConfig '../../modules/nf-core/fastqc/nextflow.config' +includeConfig '../../modules/nf-core/cat/fastq/nextflow.config' +includeConfig '../../modules/nf-core/multiqc/nextflow.config' +includeConfig '../../subworkflows/local/fastq_read_preprocessing_kneaddata/nextflow.config' +includeConfig '../../subworkflows/local/fastq_read_taxonomy_metaphlan/nextflow.config' diff --git a/workflows/biobakerymgx/tests/main.nf.test b/workflows/biobakerymgx/tests/main.nf.test index 4511807..e98d724 100644 --- a/workflows/biobakerymgx/tests/main.nf.test +++ b/workflows/biobakerymgx/tests/main.nf.test @@ -7,7 +7,7 @@ nextflow_workflow { tag "biobakerymgx" tag "biobakerymgx_default" - test("") { + test("fastq.gz") { when { workflow { """ diff --git a/workflows/biobakerymgx/tests/main.nf.test.snap b/workflows/biobakerymgx/tests/main.nf.test.snap index 68e7d9c..f546c69 100644 --- a/workflows/biobakerymgx/tests/main.nf.test.snap +++ b/workflows/biobakerymgx/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - " ['bacteroides_fragilis']['illumina']['test_fastq_gz'] - stub ": { + "fastq.gz": { "content": [ { "0": [ @@ -8,8 +8,8 @@ "id": "test2" }, [ - "test2_kneaddata_paired_1.fastq.gz:md5,071e7aef3d82d5559f7019a64cd6843f", - "test2_kneaddata_paired_2.fastq.gz:md5,53712e57f0562da5a314177515ac01f0" + "SRX5235702_SRR8427717_1.fastq.gz:md5,cc895d36dc655210366086535f359fb0", + "SRX5235702_SRR8427717_2.fastq.gz:md5,2b1a67a42fb71032d6c54776fad5a790" ] ], [ @@ -17,140 +17,28 @@ "id": "test" }, [ - "test_kneaddata_paired_1.fastq.gz:md5,5f73374f13068e4daaa26a1ce73cc1af", - "test_kneaddata_paired_2.fastq.gz:md5,6e2f1123a77c6426fa97b70328edae73" + "SRX5235702_SRR8427717_1.fastq.gz:md5,cc895d36dc655210366086535f359fb0", + "SRX5235702_SRR8427717_2.fastq.gz:md5,2b1a67a42fb71032d6c54776fad5a790" ] ] ], "1": [ - "all_samples_kneaddata_read_counts.tsv:md5,86c322a123efddea60c8cda32550eb27" + ], "2": [ - [ - { - "id": "all_samples" - }, - "all_samples.txt:md5,8e259b652de82d5279b58c2a846ec4c8" - ] + ], "3": [ - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4ba9f8a902b9acb7c6e248cf73ee3a9d", - "versions.yml:md5,595699df0017182801b030ce8a44b4e5", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,d6c57b942810378ae3f0e5027bc798da", - "versions.yml:md5,decdaf6f1a1ec3798868928b45e73bbd" - ], - "ch_preprocessed_read_counts_tsv": [ - "all_samples_kneaddata_read_counts.tsv:md5,86c322a123efddea60c8cda32550eb27" - ], - "cread_taxonomy_tsv": [ - [ - { - "id": "all_samples" - }, - "all_samples.txt:md5,8e259b652de82d5279b58c2a846ec4c8" - ] - ], - "preprocessed_fastq_gz": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,071e7aef3d82d5559f7019a64cd6843f", - "test2_kneaddata_paired_2.fastq.gz:md5,53712e57f0562da5a314177515ac01f0" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,5f73374f13068e4daaa26a1ce73cc1af", - "test_kneaddata_paired_2.fastq.gz:md5,6e2f1123a77c6426fa97b70328edae73" - ] - ] - ], - "versions": [ - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4ba9f8a902b9acb7c6e248cf73ee3a9d", - "versions.yml:md5,595699df0017182801b030ce8a44b4e5", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,d6c57b942810378ae3f0e5027bc798da", - "versions.yml:md5,decdaf6f1a1ec3798868928b45e73bbd" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-15T12:43:31.299823001" - }, - " ['bacteroides_fragilis']['illumina']['test_fastq_gz'] ": { - "content": [ - { - "0": [ - [ - { - "id": "test2" - }, - [ - "test2_kneaddata_paired_1.fastq.gz:md5,071e7aef3d82d5559f7019a64cd6843f", - "test2_kneaddata_paired_2.fastq.gz:md5,53712e57f0562da5a314177515ac01f0" - ] - ], - [ - { - "id": "test" - }, - [ - "test_kneaddata_paired_1.fastq.gz:md5,5f73374f13068e4daaa26a1ce73cc1af", - "test_kneaddata_paired_2.fastq.gz:md5,6e2f1123a77c6426fa97b70328edae73" - ] - ] - ], - "1": [ - "all_samples_kneaddata_read_counts.tsv:md5,86c322a123efddea60c8cda32550eb27" - ], - "2": [ [ - { - "id": "all_samples" - }, - "all_samples.txt:md5,8e259b652de82d5279b58c2a846ec4c8" + "multiqc_report.html:md5,667c271a46fac8be87db9c8b51c7eb3f" ] ], - "3": [ - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4ba9f8a902b9acb7c6e248cf73ee3a9d", - "versions.yml:md5,595699df0017182801b030ce8a44b4e5", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,d6c57b942810378ae3f0e5027bc798da", - "versions.yml:md5,decdaf6f1a1ec3798868928b45e73bbd" - ], - "ch_preprocessed_read_counts_tsv": [ - "all_samples_kneaddata_read_counts.tsv:md5,86c322a123efddea60c8cda32550eb27" + "4": [ + "versions.yml:md5,d9f2edf37349457eccb7644ee1db2ae7" ], - "cread_taxonomy_tsv": [ + "multiqc_report": [ [ - { - "id": "all_samples" - }, - "all_samples.txt:md5,8e259b652de82d5279b58c2a846ec4c8" + "multiqc_report.html:md5,667c271a46fac8be87db9c8b51c7eb3f" ] ], "preprocessed_fastq_gz": [ @@ -159,8 +47,8 @@ "id": "test2" }, [ - "test2_kneaddata_paired_1.fastq.gz:md5,071e7aef3d82d5559f7019a64cd6843f", - "test2_kneaddata_paired_2.fastq.gz:md5,53712e57f0562da5a314177515ac01f0" + "SRX5235702_SRR8427717_1.fastq.gz:md5,cc895d36dc655210366086535f359fb0", + "SRX5235702_SRR8427717_2.fastq.gz:md5,2b1a67a42fb71032d6c54776fad5a790" ] ], [ @@ -168,22 +56,19 @@ "id": "test" }, [ - "test_kneaddata_paired_1.fastq.gz:md5,5f73374f13068e4daaa26a1ce73cc1af", - "test_kneaddata_paired_2.fastq.gz:md5,6e2f1123a77c6426fa97b70328edae73" + "SRX5235702_SRR8427717_1.fastq.gz:md5,cc895d36dc655210366086535f359fb0", + "SRX5235702_SRR8427717_2.fastq.gz:md5,2b1a67a42fb71032d6c54776fad5a790" ] ] + ], + "preprocessed_read_counts_tsv": [ + + ], + "read_taxonomy_tsv": [ + ], "versions": [ - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4b242c78db48e8cca6ceb92c79000a94", - "versions.yml:md5,4ba9f8a902b9acb7c6e248cf73ee3a9d", - "versions.yml:md5,595699df0017182801b030ce8a44b4e5", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,789b2aa7e05b16aa826f583b8dac2b43", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,cb5e83f1143646d81fb20728cff2ec6d", - "versions.yml:md5,d6c57b942810378ae3f0e5027bc798da", - "versions.yml:md5,decdaf6f1a1ec3798868928b45e73bbd" + "versions.yml:md5,d9f2edf37349457eccb7644ee1db2ae7" ] } ], @@ -191,6 +76,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-02-15T12:30:10.646686544" + "timestamp": "2024-04-24T13:17:57.217658994" } } \ No newline at end of file diff --git a/workflows/nextflow.config b/workflows/nextflow.config deleted file mode 100644 index e69de29..0000000