From 7860035686e846e2be560993581117ad1ad32719 Mon Sep 17 00:00:00 2001 From: Joon Klaps Date: Tue, 10 Dec 2024 15:48:56 +0100 Subject: [PATCH 1/9] new module pangolin/updatedata & patch pangolin/run (#7182) * new module pangolin-updatedataset * update pangolin/run & snapshots * update meta.yml plus snapshots * fix nf-core linting * update test to check for header --- .../pangolin/{ => run}/environment.yml | 0 modules/nf-core/pangolin/{ => run}/main.nf | 18 +++- modules/nf-core/pangolin/{ => run}/meta.yml | 8 +- .../nf-core/pangolin/run/tests/main.nf.test | 99 +++++++++++++++++++ .../{ => run}/tests/main.nf.test.snap | 37 ++++--- modules/nf-core/pangolin/tests/main.nf.test | 57 ----------- .../pangolin/updatedata/environment.yml | 7 ++ modules/nf-core/pangolin/updatedata/main.nf | 49 +++++++++ modules/nf-core/pangolin/updatedata/meta.yml | 39 ++++++++ .../pangolin/updatedata/tests/main.nf.test | 54 ++++++++++ .../updatedata/tests/main.nf.test.snap | 46 +++++++++ 11 files changed, 343 insertions(+), 71 deletions(-) rename modules/nf-core/pangolin/{ => run}/environment.yml (100%) rename modules/nf-core/pangolin/{ => run}/main.nf (72%) rename modules/nf-core/pangolin/{ => run}/meta.yml (89%) create mode 100644 modules/nf-core/pangolin/run/tests/main.nf.test rename modules/nf-core/pangolin/{ => run}/tests/main.nf.test.snap (56%) delete mode 100644 modules/nf-core/pangolin/tests/main.nf.test create mode 100644 modules/nf-core/pangolin/updatedata/environment.yml create mode 100644 modules/nf-core/pangolin/updatedata/main.nf create mode 100644 modules/nf-core/pangolin/updatedata/meta.yml create mode 100644 modules/nf-core/pangolin/updatedata/tests/main.nf.test create mode 100644 modules/nf-core/pangolin/updatedata/tests/main.nf.test.snap diff --git a/modules/nf-core/pangolin/environment.yml b/modules/nf-core/pangolin/run/environment.yml similarity index 100% rename from modules/nf-core/pangolin/environment.yml rename to modules/nf-core/pangolin/run/environment.yml diff --git a/modules/nf-core/pangolin/main.nf b/modules/nf-core/pangolin/run/main.nf similarity index 72% rename from modules/nf-core/pangolin/main.nf rename to modules/nf-core/pangolin/run/main.nf index 08200de2cea..75ab8e2a841 100644 --- a/modules/nf-core/pangolin/main.nf +++ b/modules/nf-core/pangolin/run/main.nf @@ -1,4 +1,4 @@ -process PANGOLIN { +process PANGOLIN_RUN { tag "$meta.id" label 'process_medium' @@ -9,6 +9,7 @@ process PANGOLIN { input: tuple val(meta), path(fasta) + path(db) output: tuple val(meta), path('*.csv'), emit: report @@ -20,11 +21,13 @@ process PANGOLIN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def db_command = db ? "--datadir ${db}" : '' """ export XDG_CACHE_HOME=/tmp/.cache pangolin \\ $fasta\\ + $db_command \\ --outfile ${prefix}.pangolin.csv \\ --threads $task.cpus \\ $args @@ -34,4 +37,17 @@ process PANGOLIN { pangolin: \$(pangolin --version | sed "s/pangolin //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + export XDG_CACHE_HOME=/tmp/.cache + + touch ${prefix}.pangolin.csv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pangolin: \$(pangolin --version | sed "s/pangolin //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/pangolin/meta.yml b/modules/nf-core/pangolin/run/meta.yml similarity index 89% rename from modules/nf-core/pangolin/meta.yml rename to modules/nf-core/pangolin/run/meta.yml index 78713c13221..ab11b48b50a 100644 --- a/modules/nf-core/pangolin/meta.yml +++ b/modules/nf-core/pangolin/run/meta.yml @@ -1,9 +1,10 @@ -name: pangolin +name: pangolin_run description: Phylogenetic Assignment of Named Global Outbreak LINeages keywords: - covid - pangolin - lineage + - run tools: - pangolin: description: | @@ -21,6 +22,11 @@ input: type: file description: | The genome assembly to be evaluated + - - db: + type: directory + description: | + Directory containing the Pangolin database + output: - report: - meta: diff --git a/modules/nf-core/pangolin/run/tests/main.nf.test b/modules/nf-core/pangolin/run/tests/main.nf.test new file mode 100644 index 00000000000..a189f7dde1b --- /dev/null +++ b/modules/nf-core/pangolin/run/tests/main.nf.test @@ -0,0 +1,99 @@ +nextflow_process { + + name "Test Process PANGOLIN_RUN" + script "../main.nf" + process "PANGOLIN_RUN" + + tag "modules" + tag "modules_nfcore" + tag "pangolin/updatedata" + tag "pangolin/run" + tag "pangolin" + + test("sarscov2 genome [fasta]") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 genome [fasta] - update data") { + setup{ + run("PANGOLIN_UPDATEDATA") { + script "../../updatedata/main.nf" + process { + """ + input[0] = 'testdb' + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + ] + input[1] = PANGOLIN_UPDATEDATA.out.db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.report[0][1]).readLines().first().contains("taxon,lineage,conflict,ambiguity_score,scorpio_call,scorpio_support,scorpio_conflict,scorpio_notes,version,pangolin_version,scorpio_version,constellation_version,is_designated,qc_status,qc_notes,note") }, + { assert snapshot( + file(process.out.report[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + + test("sarscov2 genome [fasta] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + +} \ No newline at end of file diff --git a/modules/nf-core/pangolin/tests/main.nf.test.snap b/modules/nf-core/pangolin/run/tests/main.nf.test.snap similarity index 56% rename from modules/nf-core/pangolin/tests/main.nf.test.snap rename to modules/nf-core/pangolin/run/tests/main.nf.test.snap index 681a4783686..1abde2af2f6 100644 --- a/modules/nf-core/pangolin/tests/main.nf.test.snap +++ b/modules/nf-core/pangolin/run/tests/main.nf.test.snap @@ -7,30 +7,43 @@ { "id": "test" }, - "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + "test.pangolin.csv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ - "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + "versions.yml:md5,4e70f8b44182b5be5eb0b706c2c551bd" ], "report": [ [ { "id": "test" }, - "test.pangolin.csv:md5,2cc701567cf37bad5c6574c29aa595d4" + "test.pangolin.csv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ - "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + "versions.yml:md5,4e70f8b44182b5be5eb0b706c2c551bd" ] } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-09T16:27:30.099020683" + }, + "sarscov2 genome [fasta] - update data": { + "content": [ + "test.pangolin.csv", + [ + "versions.yml:md5,4e70f8b44182b5be5eb0b706c2c551bd" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-18T10:33:48.797026222" + "timestamp": "2024-12-09T16:36:50.212759186" }, "sarscov2 genome [fasta]": { "content": [ @@ -44,7 +57,7 @@ ] ], "1": [ - "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + "versions.yml:md5,4e70f8b44182b5be5eb0b706c2c551bd" ], "report": [ [ @@ -55,14 +68,14 @@ ] ], "versions": [ - "versions.yml:md5,65ec45a19faa92a922073b9b08d90a8a" + "versions.yml:md5,4e70f8b44182b5be5eb0b706c2c551bd" ] } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-18T10:33:17.535254436" + "timestamp": "2024-12-09T16:25:48.834093927" } } \ No newline at end of file diff --git a/modules/nf-core/pangolin/tests/main.nf.test b/modules/nf-core/pangolin/tests/main.nf.test deleted file mode 100644 index 1ee097e3c74..00000000000 --- a/modules/nf-core/pangolin/tests/main.nf.test +++ /dev/null @@ -1,57 +0,0 @@ -nextflow_process { - - name "Test Process PANGOLIN" - script "../main.nf" - process "PANGOLIN" - - tag "modules" - tag "modules_nfcore" - tag "pangolin" - - test("sarscov2 genome [fasta]") { - - when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 genome [fasta] - stub") { - - options "-stub" - - when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - -} \ No newline at end of file diff --git a/modules/nf-core/pangolin/updatedata/environment.yml b/modules/nf-core/pangolin/updatedata/environment.yml new file mode 100644 index 00000000000..d4379368c85 --- /dev/null +++ b/modules/nf-core/pangolin/updatedata/environment.yml @@ -0,0 +1,7 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::pangolin-data=1.30 + - bioconda::pangolin=4.3 + - bioconda::snakemake=7.30.1 diff --git a/modules/nf-core/pangolin/updatedata/main.nf b/modules/nf-core/pangolin/updatedata/main.nf new file mode 100644 index 00000000000..79b07b92b23 --- /dev/null +++ b/modules/nf-core/pangolin/updatedata/main.nf @@ -0,0 +1,49 @@ +process PANGOLIN_UPDATEDATA { + tag "$dbname" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/bb/bb7bac48e43a9cd6274e1f99c761a5785b74f6d8a55313ee634aaffbe87c1869/data' : + 'community.wave.seqera.io/library/pangolin-data_pangolin_snakemake:5bbc297f7502ff33' }" + + input: + val(dbname) + + output: + path("${prefix}") , emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${dbname}" + """ + export XDG_CACHE_HOME=/tmp/.cache + mkdir -p ${prefix} + + pangolin \\ + $args \\ + --update-data \\ + --threads $task.cpus \\ + --datadir ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pangolin: \$(pangolin --version | sed "s/pangolin //g") + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${dbname}" + """ + mkdir -p ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + pangolin: \$(pangolin --version | sed "s/pangolin //g") + END_VERSIONS + """ +} diff --git a/modules/nf-core/pangolin/updatedata/meta.yml b/modules/nf-core/pangolin/updatedata/meta.yml new file mode 100644 index 00000000000..5f6430284d6 --- /dev/null +++ b/modules/nf-core/pangolin/updatedata/meta.yml @@ -0,0 +1,39 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: pangolin_updatedata +description: Phylogenetic Assignment of Named Global Outbreak LINeages +keywords: + - covid + - pangolin + - database + - lineage + - updatedata +tools: + - pangolin: + description: | + Phylogenetic Assignment of Named Global Outbreak LINeages + homepage: https://github.com/cov-lineages/pangolin#pangolearn-description + manual: https://github.com/cov-lineages/pangolin#pangolearn-description + licence: ["GPL-3.0-or-later"] + identifier: biotools:pangolin_cov-lineages + +input: + - - dbname: + type: string + description: Name of directory to store the most recent pangolin dataset. +output: + - db: + - "${prefix}": + type: file + description: Directory containing downloaded data with directory naming being + the user provided dbname or prefix. + - versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Joon-Klaps" +maintainers: + - "@Joon-Klaps" diff --git a/modules/nf-core/pangolin/updatedata/tests/main.nf.test b/modules/nf-core/pangolin/updatedata/tests/main.nf.test new file mode 100644 index 00000000000..7d7dcaf0c62 --- /dev/null +++ b/modules/nf-core/pangolin/updatedata/tests/main.nf.test @@ -0,0 +1,54 @@ +// nf-core modules test pangolin/updatedata +nextflow_process { + + name "Test Process PANGOLIN_UPDATEDATA" + script "../main.nf" + process "PANGOLIN_UPDATEDATA" + + tag "modules" + tag "modules_nfcore" + tag "pangolin" + tag "pangolin/updatedata" + + test("str - testdb") { + + when { + process { + """ + input[0] = 'testdb' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.db[0].toString()).listFiles().collect { it.name }.toSorted(), // A mix of empty and non-empty files + process.out.versions + ).match() + } + ) + } + } + + test("str - testdb - stub") { + + options "-stub" + + when { + process { + """ + input[0] = 'testdb' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/pangolin/updatedata/tests/main.nf.test.snap b/modules/nf-core/pangolin/updatedata/tests/main.nf.test.snap new file mode 100644 index 00000000000..652a5e62ba9 --- /dev/null +++ b/modules/nf-core/pangolin/updatedata/tests/main.nf.test.snap @@ -0,0 +1,46 @@ +{ + "str - testdb": { + "content": [ + [ + "bin", + "pangolin_data", + "pangolin_data-1.31.dist-info" + ], + [ + "versions.yml:md5,65119f93071bb8769953b7cb1aa9af4c" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:18:37.005116436" + }, + "str - testdb - stub": { + "content": [ + { + "0": [ + [ + + ] + ], + "1": [ + "versions.yml:md5,65119f93071bb8769953b7cb1aa9af4c" + ], + "db": [ + [ + + ] + ], + "versions": [ + "versions.yml:md5,65119f93071bb8769953b7cb1aa9af4c" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:20:56.504134367" + } +} \ No newline at end of file From 299a26fd029ac355872edc7ae79bc8a1f983aea1 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 11 Dec 2024 14:16:10 +0100 Subject: [PATCH 2/9] METABAT2_METABAT2: Add nf-test and stub (#7196) * Add stub * Add nf-test (empty TSV for depth test expected) * Update modules/nf-core/metabat2/metabat2/tests/main.nf.test * Apply suggestions from code review * Use name for expected empty file --- modules/nf-core/metabat2/metabat2/main.nf | 19 ++ .../metabat2/metabat2/tests/main.nf.test | 99 ++++++++++ .../metabat2/metabat2/tests/main.nf.test.snap | 178 ++++++++++++++++++ .../metabat2/metabat2/tests}/nextflow.config | 4 - tests/config/pytest_modules.yml | 3 - .../modules/nf-core/metabat2/metabat2/main.nf | 35 ---- .../nf-core/metabat2/metabat2/test.yml | 27 --- 7 files changed, 296 insertions(+), 69 deletions(-) create mode 100644 modules/nf-core/metabat2/metabat2/tests/main.nf.test create mode 100644 modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap rename {tests/modules/nf-core/metabat2/metabat2 => modules/nf-core/metabat2/metabat2/tests}/nextflow.config (56%) delete mode 100644 tests/modules/nf-core/metabat2/metabat2/main.nf delete mode 100644 tests/modules/nf-core/metabat2/metabat2/test.yml diff --git a/modules/nf-core/metabat2/metabat2/main.nf b/modules/nf-core/metabat2/metabat2/main.nf index b601c84fa5b..aa7ff9a5dca 100644 --- a/modules/nf-core/metabat2/metabat2/main.nf +++ b/modules/nf-core/metabat2/metabat2/main.nf @@ -45,4 +45,23 @@ process METABAT2_METABAT2 { metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def decompress_depth = depth ? "gzip -d -f $depth" : "" + def depth_file = depth ? "-a ${depth.baseName}" : "" + + """ + echo "" | gzip -c > ${prefix}.1.fa.gz + echo "" | gzip -c > ${prefix}.1.tooShort.fa.gz + echo "" | gzip -c > ${prefix}.1.lowDepth.fa.gz + echo "" | gzip -c > ${prefix}.1.unbinned.fa.gz + echo "" | gzip -c > ${prefix}.tsv.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + metabat2: \$( metabat2 --help 2>&1 | head -n 2 | tail -n 1| sed 's/.*\\:\\([0-9]*\\.[0-9]*\\).*/\\1/' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/metabat2/metabat2/tests/main.nf.test b/modules/nf-core/metabat2/metabat2/tests/main.nf.test new file mode 100644 index 00000000000..6b796fc09ac --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/tests/main.nf.test @@ -0,0 +1,99 @@ +// nf-core modules test metabat2/metabat2 +nextflow_process { + + name "Test Process METABAT2_METABAT2" + script "../main.nf" + process "METABAT2_METABAT2" + + tag "modules" + tag "modules_nfcore" + tag "metabat2" + tag "metabat2/metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + + test("sarscov2 - genome - fasta") { + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - genome - fasta - depths") { + + setup { + run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") { + script "../../jgisummarizebamcontigdepths/main.nf" + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + ] + """ + } + } + } + + when { + process { + """ + input[0] = Channel + .fromPath(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + .map { it -> [[ id:'test', single_end:false ], it] } + .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.membership[0][1]).name).match() } + ) + } + + } + + test("sarscov2 - genome - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'test', single_end: false], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap b/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap new file mode 100644 index 00000000000..2552bca86bf --- /dev/null +++ b/modules/nf-core/metabat2/metabat2/tests/main.nf.test.snap @@ -0,0 +1,178 @@ +{ + "sarscov2 - genome - fasta": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb" + ], + "fasta": [ + + ], + "lowdepth": [ + + ], + "membership": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,f50e2528d24fcd9a200cae3421945f05" + ] + ], + "tooshort": [ + + ], + "unbinned": [ + + ], + "versions": [ + "versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-11T12:28:01.970872008" + }, + "sarscov2 - genome - fasta - depths": { + "content": [ + "test.tsv.gz" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-11T13:08:47.777561763" + }, + "sarscov2 - genome - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + "versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb" + ], + "fasta": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "lowdepth": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.lowDepth.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "membership": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tooshort": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.tooShort.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "unbinned": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.unbinned.fa.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,872d18278c2ba7812c62a8bc6b2120eb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-11T12:28:32.122007408" + } +} \ No newline at end of file diff --git a/tests/modules/nf-core/metabat2/metabat2/nextflow.config b/modules/nf-core/metabat2/metabat2/tests/nextflow.config similarity index 56% rename from tests/modules/nf-core/metabat2/metabat2/nextflow.config rename to modules/nf-core/metabat2/metabat2/tests/nextflow.config index 83754d8b100..c2d809dcca6 100644 --- a/tests/modules/nf-core/metabat2/metabat2/nextflow.config +++ b/modules/nf-core/metabat2/metabat2/tests/nextflow.config @@ -1,9 +1,5 @@ process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: METABAT2_METABAT2 { ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' } - } diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 01df2f69185..65451e16eb6 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -338,9 +338,6 @@ merquryfk/katgc: merquryfk/ploidyplot: - modules/nf-core/merquryfk/ploidyplot/** - tests/modules/nf-core/merquryfk/ploidyplot/** -metabat2/metabat2: - - modules/nf-core/metabat2/metabat2/** - - tests/modules/nf-core/metabat2/metabat2/** metaeuk/easypredict: - modules/nf-core/metaeuk/easypredict/** - tests/modules/nf-core/metaeuk/easypredict/** diff --git a/tests/modules/nf-core/metabat2/metabat2/main.nf b/tests/modules/nf-core/metabat2/metabat2/main.nf deleted file mode 100644 index 7bead547365..00000000000 --- a/tests/modules/nf-core/metabat2/metabat2/main.nf +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { METABAT2_METABAT2 } from '../../../../../modules/nf-core/metabat2/metabat2/main.nf' -include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../../modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf' - -workflow test_metabat2_no_depth { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - Channel.fromPath(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it, []] } - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) -} - -workflow test_metabat2_depth { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) -} diff --git a/tests/modules/nf-core/metabat2/metabat2/test.yml b/tests/modules/nf-core/metabat2/metabat2/test.yml deleted file mode 100644 index b7746132976..00000000000 --- a/tests/modules/nf-core/metabat2/metabat2/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: metabat2 metabat2 test_metabat2_no_depth - command: nextflow run ./tests/modules/nf-core/metabat2/metabat2 -entry test_metabat2_no_depth -c ./tests/config/nextflow.config - tags: - - metabat2 - - metabat2/metabat2 - files: - - path: output/metabat2/test.1.fa.gz - contains: - - ">MT192765.1" - - path: output/metabat2/test.tsv.gz - contains: - - "MT192765.1\t1" - - path: output/metabat2/versions.yml - -- name: metabat2 metabat2 test_metabat2_depth - command: nextflow run ./tests/modules/nf-core/metabat2/metabat2 -entry test_metabat2_depth -c ./tests/config/nextflow.config - tags: - - metabat2 - - metabat2/metabat2 - files: - - path: output/metabat2/test.1.fa.gz - contains: - - ">MT192765.1" - - path: output/metabat2/test.tsv.gz - contains: - - "MT192765.1\t1" - - path: output/metabat2/versions.yml From a62c79866962c066501200d0a687f7486e74dfa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:18:24 +0100 Subject: [PATCH 3/9] port parabricks/indexgvcf to nf-test (#6996) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * port parabricks/indexgvcf to nf-test * fix linting * update test yaml * remove test.yml * remove log * add to conda_skip * add tag gpu * try different profile combination * avoid string concatination * revert changes to profile * update snap - sorry * fix: testfile paths * fix: index file is now created * fix linting * Update modules/nf-core/parabricks/indexgvcf/main.nf --------- Co-authored-by: Matthias Hörtenhuber --- .github/conda_skip.yml | 2 + modules/nf-core/parabricks/indexgvcf/main.nf | 28 ++--- modules/nf-core/parabricks/indexgvcf/meta.yml | 8 +- .../parabricks/indexgvcf/tests/main.nf.test | 109 +++++++++++++++++ .../indexgvcf/tests/main.nf.test.snap | 114 ++++++++++++++++++ tests/config/pytest_modules.yml | 3 - .../nf-core/parabricks/indexgvcf/main.nf | 53 -------- .../parabricks/indexgvcf/nextflow.config | 5 - .../nf-core/parabricks/indexgvcf/test.yml | 19 --- .../parabricks/indexgvcf/test_GPU_config.txt | 9 -- .../parabricks/indexgvcf/test_GPU_yml.txt | 19 --- 11 files changed, 240 insertions(+), 129 deletions(-) create mode 100644 modules/nf-core/parabricks/indexgvcf/tests/main.nf.test create mode 100644 modules/nf-core/parabricks/indexgvcf/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/parabricks/indexgvcf/main.nf delete mode 100644 tests/modules/nf-core/parabricks/indexgvcf/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/indexgvcf/test.yml delete mode 100644 tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt delete mode 100644 tests/modules/nf-core/parabricks/indexgvcf/test_GPU_yml.txt diff --git a/.github/conda_skip.yml b/.github/conda_skip.yml index 14da877f04d..8e7683a4d55 100644 --- a/.github/conda_skip.yml +++ b/.github/conda_skip.yml @@ -182,5 +182,7 @@ exclude: path: modules/nf-core/xeniumranger/resegment - profile: conda path: modules/nf-core/xeniumranger/import-segmentation + - profile: conda + path: modules/nf-core/parabricks/indexgvcf - profile: conda path: modules/nf-core/parabricks/genotypegvcf diff --git a/modules/nf-core/parabricks/indexgvcf/main.nf b/modules/nf-core/parabricks/indexgvcf/main.nf index bc082fca255..378f3a8b88b 100644 --- a/modules/nf-core/parabricks/indexgvcf/main.nf +++ b/modules/nf-core/parabricks/indexgvcf/main.nf @@ -1,16 +1,17 @@ process PARABRICKS_INDEXGVCF { tag "$meta.id" label 'process_high' + label 'process_gpu' + stageInMode 'copy' // needed by the module to work properly - might be removed when this is fixed upstream - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" input: - tuple val(meta), path(gvcf, stageAs:'') + tuple val(meta), path(gvcf) output: - // This tool outputs g.vcf.idx if input is uncompressed, g.vcf.gz.tbi if input is compressed - tuple val(meta), path("*.g.vcf*") , emit: gvcf_index - path "versions.yml" , emit: versions + tuple val(meta), path("*.{idx,tbi}") , emit: gvcf_index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -21,12 +22,12 @@ process PARABRICKS_INDEXGVCF { error "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead." } def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ pbrun \\ indexgvcf \\ --input $gvcf \\ + $num_gpus \\ $args cat <<-END_VERSIONS > versions.yml @@ -39,19 +40,10 @@ process PARABRICKS_INDEXGVCF { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead." } - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - + def output_cmd = gvcf.any{ it.name.endsWith(".gz") } ? "touch ${prefix}.g.vcf.gz.tbi" : "touch ${prefix}.g.vcf.idx" """ - # Different outputs generated depending if file is gzipped - case $gvcf in - *.gz ) - touch ${prefix}.g.vcf.gz.tbi - ;; - * ) - touch ${prefix}.g.vcf.idx - ;; - esac + $output_cmd cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/parabricks/indexgvcf/meta.yml b/modules/nf-core/parabricks/indexgvcf/meta.yml index be57547075a..bc0e277660a 100644 --- a/modules/nf-core/parabricks/indexgvcf/meta.yml +++ b/modules/nf-core/parabricks/indexgvcf/meta.yml @@ -30,9 +30,11 @@ output: type: map description: | Groovy Map containing output information - - "*.g.vcf*": - type: file - description: Indexed gvcf file + pattern: "*.g.vcf" + - "*.{idx,tbi}": + type: map + description: | + Groovy Map containing output information pattern: "*.g.vcf" - versions: - versions.yml: diff --git a/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test b/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test new file mode 100644 index 00000000000..a6c0c79946e --- /dev/null +++ b/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test @@ -0,0 +1,109 @@ +nextflow_process { + + name "Test Process PARABRICKS_INDEXGVCF" + script "../main.nf" + process "PARABRICKS_INDEXGVCF" + + tag "modules" + tag "modules_nfcore" + tag "parabricks" + tag "parabricks/indexgvcf" + tag "gpu" + + test("human - gvcf") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.g.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.gvcf_index[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + + test("human - gvcf.gz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.g.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("human - gvcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.g.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("human - gvcf.gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.g.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test.snap b/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test.snap new file mode 100644 index 00000000000..e25496cc885 --- /dev/null +++ b/modules/nf-core/parabricks/indexgvcf/tests/main.nf.test.snap @@ -0,0 +1,114 @@ +{ + "human - gvcf.gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.genome.g.vcf.gz.tbi:md5,a581ec2827af89dbe82d09951c1725ec" + ] + ], + "1": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ], + "gvcf_index": [ + [ + { + "id": "test" + }, + "test.genome.g.vcf.gz.tbi:md5,a581ec2827af89dbe82d09951c1725ec" + ] + ], + "versions": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:16:48.994612337" + }, + "human - gvcf": { + "content": [ + "test.genome.g.vcf.idx", + [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:21:20.010561875" + }, + "human - gvcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.g.vcf.idx:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ], + "gvcf_index": [ + [ + { + "id": "test" + }, + "test.g.vcf.idx:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:21:32.292223281" + }, + "human - gvcf.gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.g.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ], + "gvcf_index": [ + [ + { + "id": "test" + }, + "test.g.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,a6c2622b9fd9223dbc349c2a27e9a2e4" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T10:14:58.744532337" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 65451e16eb6..adfddd44dad 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -401,9 +401,6 @@ parabricks/deepvariant: parabricks/haplotypecaller: - modules/nf-core/parabricks/haplotypecaller/** - tests/modules/nf-core/parabricks/haplotypecaller/** -parabricks/indexgvcf: - - modules/nf-core/parabricks/indexgvcf/** - - tests/modules/nf-core/parabricks/indexgvcf/** parabricks/mutectcaller: - modules/nf-core/parabricks/mutectcaller/** - tests/modules/nf-core/parabricks/mutectcaller/** diff --git a/tests/modules/nf-core/parabricks/indexgvcf/main.nf b/tests/modules/nf-core/parabricks/indexgvcf/main.nf deleted file mode 100644 index 0be4206915d..00000000000 --- a/tests/modules/nf-core/parabricks/indexgvcf/main.nf +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARABRICKS_INDEXGVCF } from '../../../../../modules/nf-core/parabricks/indexgvcf/main.nf' - -workflow test_parabricks_indexgvcf { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true) - ] - - process stage { - input: - tuple val(meta), path(gvcf) - - output: - tuple val(meta), path("*.g.vcf") - - script: - """ - mv $gvcf test.genome.g.vcf - """ - } - - PARABRICKS_INDEXGVCF ( stage ( input ) ) -} - -workflow test_parabricks_indexgvcf_gz { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) - ] - - process stage_gz { - stageInMode "copy" - - input: - tuple val(meta), path(gvcf) - - output: - tuple val(meta), path("*.g.vcf.gz") - - script: - """ - mv $gvcf test.genome.g.vcf.gz - """ - } - - PARABRICKS_INDEXGVCF ( stage_gz ( input ) ) -} diff --git a/tests/modules/nf-core/parabricks/indexgvcf/nextflow.config b/tests/modules/nf-core/parabricks/indexgvcf/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/parabricks/indexgvcf/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/parabricks/indexgvcf/test.yml b/tests/modules/nf-core/parabricks/indexgvcf/test.yml deleted file mode 100644 index d13fd56c4b1..00000000000 --- a/tests/modules/nf-core/parabricks/indexgvcf/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: parabricks indexgvcf test_parabricks_indexgvcf - command: nextflow run ./tests/modules/nf-core/parabricks/indexgvcf -entry test_parabricks_indexgvcf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/indexgvcf/nextflow.config -stub-run - tags: - - parabricks - - parabricks/indexgvcf - files: - - path: output/parabricks/test.g.vcf.idx - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks indexgvcf test_parabricks_indexgvcf_gz - command: nextflow run ./tests/modules/nf-core/parabricks/indexgvcf -entry test_parabricks_indexgvcf_gz -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/indexgvcf/nextflow.config -stub-run - tags: - - parabricks - - parabricks/indexgvcf - files: - - path: output/parabricks/test.g.vcf.gz.tbi - should_exist: true - - path: output/parabricks/versions.yml diff --git a/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt b/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt deleted file mode 100644 index 7d5cca922bd..00000000000 --- a/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - memory = "15.GB" - cpus = 4 - accelerator = 1 -} -docker.runOptions = "--gpus all" -singularity.runOptions = "--nv" diff --git a/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_yml.txt b/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_yml.txt deleted file mode 100644 index fde28ba6cd0..00000000000 --- a/tests/modules/nf-core/parabricks/indexgvcf/test_GPU_yml.txt +++ /dev/null @@ -1,19 +0,0 @@ -- name: parabricks indexgvcf test_parabricks_indexgvcf - command: nextflow run ./tests/modules/nf-core/parabricks/indexgvcf -entry test_parabricks_indexgvcf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt - tags: - - parabricks - - parabricks/indexgvcf - files: - - path: output/parabricks/test.g.vcf.idx - md5sum: 40eef3bc2d5cd28b576d3db308674a1d - - path: output/parabricks/versions.yml - -- name: parabricks indexgvcf test_parabricks_indexgvcf_gz - command: nextflow run ./tests/modules/nf-core/parabricks/indexgvcf -entry test_parabricks_indexgvcf_gz -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/indexgvcf/test_GPU_config.txt - tags: - - parabricks - - parabricks/indexgvcf - files: - - path: output/parabricks/test.g.vcf.gz.tbi - md5sum: a581ec2827af89dbe82d09951c1725ec - - path: output/parabricks/versions.yml From 356e5e6470138ae1b616c1a9f30a2ce77526efd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:21:09 +0100 Subject: [PATCH 4/9] Port `parabricks/dbsnp` to nf-test (#6977) * port dbsnp * modify paths * modify paths * add process_gpu * update container * add snap * Update .github/workflows/test.yml * add stageInMode copy and snap * [automated] Fix linting with Prettier * remove old folder * remove test.yml * add to conda_skip * switch config and add tag gpu * update snap * Delete modules/nf-core/parabricks/dbsnp/tests/nextflow.config * Update modules/nf-core/parabricks/dbsnp/main.nf * Update modules/nf-core/parabricks/dbsnp/tests/main.nf.test --------- Co-authored-by: nf-core-bot --- .github/conda_skip.yml | 2 + modules/nf-core/parabricks/dbsnp/main.nf | 15 ++--- .../parabricks/dbsnp/tests/main.nf.test | 67 +++++++++++++++++++ .../parabricks/dbsnp/tests/main.nf.test.snap | 50 ++++++++++++++ tests/config/pytest_modules.yml | 3 - .../modules/nf-core/parabricks/dbsnp/main.nf | 17 ----- .../nf-core/parabricks/dbsnp/nextflow.config | 5 -- .../modules/nf-core/parabricks/dbsnp/test.yml | 10 --- .../parabricks/dbsnp/test_GPU_config.txt | 9 --- .../nf-core/parabricks/dbsnp/test_GPU_yml.txt | 10 --- 10 files changed, 126 insertions(+), 62 deletions(-) create mode 100644 modules/nf-core/parabricks/dbsnp/tests/main.nf.test create mode 100644 modules/nf-core/parabricks/dbsnp/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/parabricks/dbsnp/main.nf delete mode 100644 tests/modules/nf-core/parabricks/dbsnp/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/dbsnp/test.yml delete mode 100644 tests/modules/nf-core/parabricks/dbsnp/test_GPU_config.txt delete mode 100644 tests/modules/nf-core/parabricks/dbsnp/test_GPU_yml.txt diff --git a/.github/conda_skip.yml b/.github/conda_skip.yml index 8e7683a4d55..d14707c45f8 100644 --- a/.github/conda_skip.yml +++ b/.github/conda_skip.yml @@ -182,6 +182,8 @@ exclude: path: modules/nf-core/xeniumranger/resegment - profile: conda path: modules/nf-core/xeniumranger/import-segmentation + - profile: conda + path: modules/nf-core/parabricks/dbsnp - profile: conda path: modules/nf-core/parabricks/indexgvcf - profile: conda diff --git a/modules/nf-core/parabricks/dbsnp/main.nf b/modules/nf-core/parabricks/dbsnp/main.nf index cda2e37f37c..3bcd118498a 100644 --- a/modules/nf-core/parabricks/dbsnp/main.nf +++ b/modules/nf-core/parabricks/dbsnp/main.nf @@ -1,8 +1,10 @@ process PARABRICKS_DBSNP { tag "$meta.id" label 'process_high' + label 'process_gpu' + stageInMode 'copy' // needed by the module to work properly - might be removed when this is fixed upstream - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" input: tuple val(meta), path(vcf_file), path(dbsnp_file), path(tabix_file) @@ -15,22 +17,20 @@ process PARABRICKS_DBSNP { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { exit 1, "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead." } - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def ann_vcf = "${prefix}.vcf" + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ - pbrun \\ dbsnp \\ --in-vcf $vcf_file \\ --in-dbsnp-file $dbsnp_file \\ - --out-vcf $ann_vcf \\ + --out-vcf ${prefix}.vcf \\ + $num_gpus \\ $args cat <<-END_VERSIONS > versions.yml @@ -42,9 +42,8 @@ process PARABRICKS_DBSNP { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def ann_vcf = "${prefix}.vcf" """ - touch $ann_vcf + touch ${prefix}.vcf cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/parabricks/dbsnp/tests/main.nf.test b/modules/nf-core/parabricks/dbsnp/tests/main.nf.test new file mode 100644 index 00000000000..5ae0f847678 --- /dev/null +++ b/modules/nf-core/parabricks/dbsnp/tests/main.nf.test @@ -0,0 +1,67 @@ +nextflow_process { + + name "Test Process PARABRICKS_DBSNP" + script "../main.nf" + process "PARABRICKS_DBSNP" + + tag "modules" + tag "modules_nfcore" + tag "parabricks" + tag "parabricks/dbsnp" + tag "gpu" + + test("human - vcf") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.versions + ).match() + } + ) + } + + } + + test("human - vcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/parabricks/dbsnp/tests/main.nf.test.snap b/modules/nf-core/parabricks/dbsnp/tests/main.nf.test.snap new file mode 100644 index 00000000000..3e14c1a5991 --- /dev/null +++ b/modules/nf-core/parabricks/dbsnp/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "human - vcf": { + "content": [ + "242dbff8325d7f958c95b34598146a0d", + [ + "versions.yml:md5,08b9f4ea1507e634b70b8e0ab85ab536" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T14:17:11.379908895" + }, + "human - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,08b9f4ea1507e634b70b8e0ab85ab536" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,08b9f4ea1507e634b70b8e0ab85ab536" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-09T15:33:22.588142501" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index adfddd44dad..1147031e8b3 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -392,9 +392,6 @@ ncbitools/vecscreen: oncocnv: - modules/nf-core/oncocnv/** - tests/modules/nf-core/oncocnv/** -parabricks/dbsnp: - - modules/nf-core/parabricks/dbsnp/** - - tests/modules/nf-core/parabricks/dbsnp/** parabricks/deepvariant: - modules/nf-core/parabricks/deepvariant/** - tests/modules/nf-core/parabricks/deepvariant/** diff --git a/tests/modules/nf-core/parabricks/dbsnp/main.nf b/tests/modules/nf-core/parabricks/dbsnp/main.nf deleted file mode 100644 index b1d5aee646d..00000000000 --- a/tests/modules/nf-core/parabricks/dbsnp/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARABRICKS_DBSNP } from '../../../../../modules/nf-core/parabricks/dbsnp/main.nf' - -workflow test_parabricks_dbsnp { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) - ] - - PARABRICKS_DBSNP ( input ) -} diff --git a/tests/modules/nf-core/parabricks/dbsnp/nextflow.config b/tests/modules/nf-core/parabricks/dbsnp/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/parabricks/dbsnp/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/parabricks/dbsnp/test.yml b/tests/modules/nf-core/parabricks/dbsnp/test.yml deleted file mode 100644 index b9fb84e857e..00000000000 --- a/tests/modules/nf-core/parabricks/dbsnp/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: parabricks dbsnp test_parabricks_dbsnp - command: nextflow run ./tests/modules/nf-core/parabricks/dbsnp -entry test_parabricks_dbsnp -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/dbsnp/nextflow.config -stub-run - tags: - - "parabricks" - - "parabricks/dbsnp" - files: - - path: "output/parabricks/test.vcf" - should_exist: true - - path: "output/parabricks/versions.yml" - should_exist: true diff --git a/tests/modules/nf-core/parabricks/dbsnp/test_GPU_config.txt b/tests/modules/nf-core/parabricks/dbsnp/test_GPU_config.txt deleted file mode 100644 index 2c916c20501..00000000000 --- a/tests/modules/nf-core/parabricks/dbsnp/test_GPU_config.txt +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - memory = "15.GB" - cpus = 4 - accelerator = 1 -} -docker.runOptions = "--gpus all" -singularity.runOptions = "--nv" \ No newline at end of file diff --git a/tests/modules/nf-core/parabricks/dbsnp/test_GPU_yml.txt b/tests/modules/nf-core/parabricks/dbsnp/test_GPU_yml.txt deleted file mode 100644 index 4ecb3fb676c..00000000000 --- a/tests/modules/nf-core/parabricks/dbsnp/test_GPU_yml.txt +++ /dev/null @@ -1,10 +0,0 @@ -- name: parabricks dbsnp test_parabricks_dbsnp - command: nextflow run ./tests/modules/nf-core/parabricks/dbsnp -entry test_parabricks_dbsnp -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/dbsnp/nextflow.config - tags: - - parabricks - - parabricks/dbsnp - files: - - path: output/parabricks/test.vcf - md5sum: e4ca0133b93c3c8e8469b817dcb34052 - - path: output/parabricks/versions.yml - should_exist: true From 6d736588f4af4bc9b615bd7189442bd4272ae26e Mon Sep 17 00:00:00 2001 From: Jim Downie <19718667+prototaxites@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:38:34 +0000 Subject: [PATCH 5/9] Modify DAS_Tool input structure, bump version, switch to nf-test (#7163) * Update DAS_Tool and add nf-test tests * Remove old tests * Fix tags and remove dastool from pytest modules YAML * Fix meta.yml * Update snapshot * Update test * Add stubs to dastool/dastool, dastool/fastatocontig2bin, and metabat2/metabat2. Add tests for dastool stub runs. Add test for log file output from dastool/dastool * Fix linting + change test ext args config to match documentation * Move config inside tests as it's not needed for the stub * Deprecate dastool/fastatoscaffolds2bin * Fix test --- .../nf-core/dastool/dastool/environment.yml | 2 +- modules/nf-core/dastool/dastool/main.nf | 36 +- modules/nf-core/dastool/dastool/meta.yml | 11 +- .../dastool/dastool/tests/main.nf.test | 177 ++++++++ .../dastool/dastool/tests/main.nf.test.snap | 424 ++++++++++++++++++ .../dastool/dastool/tests}/nextflow.config | 8 +- .../dastool/fastatocontig2bin/environment.yml | 2 +- .../nf-core/dastool/fastatocontig2bin/main.nf | 15 +- .../fastatocontig2bin/tests/main.nf.test | 83 ++++ .../fastatocontig2bin/tests/main.nf.test.snap | 72 +++ modules/nf-core/dastool/scaffolds2bin/main.nf | 27 +- .../dastool/scaffolds2bin/tests/main.nf.test | 59 +++ .../scaffolds2bin/tests/main.nf.test.snap | 37 ++ modules/nf-core/metabat2/metabat2/main.nf | 1 - tests/config/pytest_modules.yml | 9 - tests/modules/nf-core/dastool/dastool/main.nf | 33 -- .../nf-core/dastool/dastool/nextflow.config | 13 - .../modules/nf-core/dastool/dastool/test.yml | 27 -- .../nf-core/dastool/fastatocontig2bin/main.nf | 48 -- .../dastool/fastatocontig2bin/test.yml | 19 - .../nf-core/dastool/scaffolds2bin/main.nf | 48 -- .../dastool/scaffolds2bin/nextflow.config | 9 - .../nf-core/dastool/scaffolds2bin/test.yml | 18 - 23 files changed, 916 insertions(+), 262 deletions(-) create mode 100644 modules/nf-core/dastool/dastool/tests/main.nf.test create mode 100644 modules/nf-core/dastool/dastool/tests/main.nf.test.snap rename {tests/modules/nf-core/dastool/fastatocontig2bin => modules/nf-core/dastool/dastool/tests}/nextflow.config (59%) create mode 100644 modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test create mode 100644 modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test.snap create mode 100644 modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test create mode 100644 modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test.snap delete mode 100644 tests/modules/nf-core/dastool/dastool/main.nf delete mode 100644 tests/modules/nf-core/dastool/dastool/nextflow.config delete mode 100644 tests/modules/nf-core/dastool/dastool/test.yml delete mode 100644 tests/modules/nf-core/dastool/fastatocontig2bin/main.nf delete mode 100644 tests/modules/nf-core/dastool/fastatocontig2bin/test.yml delete mode 100644 tests/modules/nf-core/dastool/scaffolds2bin/main.nf delete mode 100644 tests/modules/nf-core/dastool/scaffolds2bin/nextflow.config delete mode 100644 tests/modules/nf-core/dastool/scaffolds2bin/test.yml diff --git a/modules/nf-core/dastool/dastool/environment.yml b/modules/nf-core/dastool/dastool/environment.yml index 0ede57bfb27..48ee9e0c5ab 100644 --- a/modules/nf-core/dastool/dastool/environment.yml +++ b/modules/nf-core/dastool/dastool/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::das_tool=1.1.6 + - bioconda::das_tool=1.1.7 diff --git a/modules/nf-core/dastool/dastool/main.nf b/modules/nf-core/dastool/dastool/main.nf index 463ae519e1d..88c1dad8fd4 100644 --- a/modules/nf-core/dastool/dastool/main.nf +++ b/modules/nf-core/dastool/dastool/main.nf @@ -4,12 +4,11 @@ process DASTOOL_DASTOOL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/das_tool:1.1.6--r42hdfd78af_0' : - 'biocontainers/das_tool:1.1.6--r42hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/das_tool:1.1.7--r43hdfd78af_0' : + 'biocontainers/das_tool:1.1.7--r43hdfd78af_0' }" input: - tuple val(meta), path(contigs), path(bins) - path(proteins) + tuple val(meta), path(contigs), path(bins), path(proteins) path(db_directory) output: @@ -19,8 +18,8 @@ process DASTOOL_DASTOOL { tuple val(meta), path("*.eval") , optional: true, emit: eval tuple val(meta), path("*_DASTool_bins/*.fa") , optional: true, emit: bins tuple val(meta), path("*.pdf") , optional: true, emit: pdfs - tuple val(meta), path("*.candidates.faa") , optional: true, emit: fasta_proteins - tuple val(meta), path("*.faa") , optional: true, emit: candidates_faa + tuple val(meta), path("*.candidates.faa") , optional: true, emit: candidates_faa + tuple val(meta), path("*_proteins.faa") , optional: true, emit: fasta_proteins tuple val(meta), path("*.archaea.scg") , optional: true, emit: fasta_archaea_scg tuple val(meta), path("*.bacteria.scg") , optional: true, emit: fasta_bacteria_scg tuple val(meta), path("*.b6") , optional: true, emit: b6 @@ -38,9 +37,8 @@ process DASTOOL_DASTOOL { def clean_contigs = contigs.toString() - ".gz" def decompress_contigs = contigs.toString() == clean_contigs ? "" : "gunzip -q -f $contigs" def clean_proteins = proteins ? proteins.toString() - ".gz" : "" - def decompress_proteins = proteins ? "gunzip -f $proteins" : "" + def decompress_proteins = (proteins && (proteins.toString() != clean_proteins)) ? "gunzip -f $proteins" : "" def proteins_pred = proteins ? "-p $clean_proteins" : "" - """ $decompress_proteins $decompress_contigs @@ -59,4 +57,26 @@ process DASTOOL_DASTOOL { dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool //' ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_DASTool.log + touch ${prefix}_DASTool_summary.tsv + touch ${prefix}_DASTool_contig2bin.tsv + touch ${prefix}_allBins.eval + touch ${prefix}_proteins.faa.scg.candidates.faa + touch ${prefix}_proteins.faa + touch ${prefix}_proteins.faa.archaea.scg + touch ${prefix}_proteins.faa.bacteria.scg + touch ${prefix}_proteins.faa.findSCG.b6 + touch ${prefix}.seqlength + mkdir ${prefix}_DASTool_bins + touch ${prefix}_DASTool_bins/${prefix}.1.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool //' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/dastool/dastool/meta.yml b/modules/nf-core/dastool/dastool/meta.yml index 7eab655a842..a327524e456 100644 --- a/modules/nf-core/dastool/dastool/meta.yml +++ b/modules/nf-core/dastool/dastool/meta.yml @@ -31,11 +31,12 @@ input: type: file description: fasta file pattern: "*.{fa.gz,fas.gz,fasta.gz}" + - bins: type: file description: "FastaToContig2Bin tabular file generated with dastool/fastatocontig2bin" pattern: "*.tsv" - - - proteins: + - proteins: type: file description: Predicted proteins in prodigal fasta format (>scaffoldID_geneNo) pattern: "*.{fa.gz,fas.gz,fasta.gz}" @@ -110,20 +111,20 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.candidates.faa": + - "*_proteins.faa": type: file description: Output from prodigal if not already supplied - pattern: "*.proteins.faa" + pattern: "*_proteins.faa" - candidates_faa: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.faa": + - "*.candidates.faa": type: file description: FAA file - pattern: "*.faa" + pattern: "*.candidates.faa" - fasta_archaea_scg: - meta: type: map diff --git a/modules/nf-core/dastool/dastool/tests/main.nf.test b/modules/nf-core/dastool/dastool/tests/main.nf.test new file mode 100644 index 00000000000..fcf9a77d7dc --- /dev/null +++ b/modules/nf-core/dastool/dastool/tests/main.nf.test @@ -0,0 +1,177 @@ +nextflow_process { + + name "Test Process DASTOOL_DASTOOL" + script "../main.nf" + process "DASTOOL_DASTOOL" + + tag "modules" + tag "modules_nfcore" + tag "dastool" + tag "dastool/dastool" + tag "dastool/fastatocontig2bin" + tag "metabat2/metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + tag "prodigal" + + setup { + run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") { + script "../../../metabat2/jgisummarizebamcontigdepths/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam.bai", checkIfExists: true), + ] + """ + } + } + run("METABAT2_METABAT2") { + script "../../../metabat2/metabat2/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]).join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + """ + } + } + run("DASTOOL_FASTATOCONTIG2BIN") { + script "../../fastatocontig2bin/main.nf" + process { + """ + input[0] = METABAT2_METABAT2.out.fasta.collect() + input[1] = "fa" + """ + } + } + run("PRODIGAL") { + script "../../../prodigal/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]) + input[1] = "gff" + """ + } + } + } + + test("dastool dastool - bacteroides fragilis - noproteins") { + + config "./nextflow.config" + + when { + params { + module_args = '--write_bins --write_bin_evals' + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]).join(DASTOOL_FASTATOCONTIG2BIN.out.fastatocontig2bin) + .map { meta, contigs, c2b -> [ meta, contigs, c2b, [] ]} + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.log.get(0).get(1)).text.contains("Dereplicating, aggregating, and scoring bins") }, + { assert path(process.out.fasta_proteins.get(0).get(1)).text.contains("MKIGIITICKVNNYGAELQAFATQKKLEQMGHNAEIINYLYYKDWHFKDTPLSQPFVPLD") }, + { assert snapshot( + process.out.summary, + process.out.contig2bin, + process.out.eval, + process.out.bins, + process.out.pdfs, + process.out.candidates_faa, + process.out.fasta_archaea_scg, + process.out.fasta_bacteria_scg, + process.out.b6, + process.out.seqlength, + process.out.versions + ).match() } + ) + } + + } + + test("dastool dastool - bacteroides fragilis - proteins") { + + config "./nextflow.config" + + when { + params { + module_args = '--write_bins --write_bin_evals' + } + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]) + .join(DASTOOL_FASTATOCONTIG2BIN.out.fastatocontig2bin) + .join(PRODIGAL.out.amino_acid_fasta) + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.log.get(0).get(1)).text.contains("Dereplicating, aggregating, and scoring bins") }, + { assert snapshot( + process.out.summary, + process.out.contig2bin, + process.out.eval, + process.out.bins, + process.out.pdfs, + process.out.fasta_proteins, + process.out.candidates_faa, + process.out.fasta_archaea_scg, + process.out.fasta_bacteria_scg, + process.out.b6, + process.out.seqlength, + process.out.versions + ).match() } + ) + } + + } + + test("dastool dastool - bacteroides fragilis - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]) + .join(DASTOOL_FASTATOCONTIG2BIN.out.fastatocontig2bin) + .join(PRODIGAL.out.amino_acid_fasta) + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} + diff --git a/modules/nf-core/dastool/dastool/tests/main.nf.test.snap b/modules/nf-core/dastool/dastool/tests/main.nf.test.snap new file mode 100644 index 00000000000..f927b3bd611 --- /dev/null +++ b/modules/nf-core/dastool/dastool/tests/main.nf.test.snap @@ -0,0 +1,424 @@ +{ + "dastool dastool - bacteroides fragilis - noproteins": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_summary.tsv:md5,ab9dd3709a59a69bc66030b9e0ff3d5b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_contig2bin.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_allBins.eval:md5,ab9dd3709a59a69bc66030b9e0ff3d5b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa:md5,70d2b1ddd4aaa89803c05fb7dba602d1" + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.scg.candidates.faa:md5,81599ff26de20528205cc654465a02f6" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.archaea.scg:md5,db2d0c086b57b76e1a63674dca437607" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.bacteria.scg:md5,847cd1729fd35956f5e0be4b977f0b64" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_proteins.faa.all.b6:md5,5d01f9cceaecfc52ae841d168f355fff", + "test_proteins.faa.findSCG.b6:md5,2d4159e486dc74bbe114752c61a4cb8b" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.seqlength:md5,b815a5811008c36808a59b1d0dcfab24" + ] + ], + [ + "versions.yml:md5,ea5c2d7e0c1be82784aaeb94d4038526" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T09:07:28.504635964" + }, + "dastool dastool - bacteroides fragilis - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.findSCG.b6:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.seqlength:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,ea5c2d7e0c1be82784aaeb94d4038526" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_contig2bin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_allBins.eval:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.scg.candidates.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.archaea.scg:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.bacteria.scg:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "b6": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.findSCG.b6:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bins": [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidates_faa": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.scg.candidates.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "contig2bin": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_contig2bin.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "eval": [ + [ + { + "id": "test", + "single_end": false + }, + "test_allBins.eval:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fasta_archaea_scg": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.archaea.scg:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fasta_bacteria_scg": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa.bacteria.scg:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fasta_proteins": [ + [ + { + "id": "test", + "single_end": false + }, + "test_proteins.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdfs": [ + + ], + "seqlength": [ + [ + { + "id": "test", + "single_end": false + }, + "test.seqlength:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ea5c2d7e0c1be82784aaeb94d4038526" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T09:15:36.924260874" + }, + "dastool dastool - bacteroides fragilis - proteins": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_summary.tsv:md5,ab9dd3709a59a69bc66030b9e0ff3d5b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_DASTool_contig2bin.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_allBins.eval:md5,ab9dd3709a59a69bc66030b9e0ff3d5b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.1.fa:md5,70d2b1ddd4aaa89803c05fb7dba602d1" + ] + ], + [ + + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa.scg.candidates.faa:md5,5cf97eab6da0a70cc4de01f31a8163c6" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa.archaea.scg:md5,561528a484afc60c0ff81bdb2a7486f8" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa.bacteria.scg:md5,82f6e2f23f76d8e782979b1a26da3f82" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.faa.all.b6:md5,f25a3c0945af01da9f50f992612ea86d", + "test.faa.findSCG.b6:md5,90bc9bbcfa579ca2b265b3c48f548725" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.seqlength:md5,b815a5811008c36808a59b1d0dcfab24" + ] + ], + [ + "versions.yml:md5,ea5c2d7e0c1be82784aaeb94d4038526" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T09:08:35.826716296" + } +} \ No newline at end of file diff --git a/tests/modules/nf-core/dastool/fastatocontig2bin/nextflow.config b/modules/nf-core/dastool/dastool/tests/nextflow.config similarity index 59% rename from tests/modules/nf-core/dastool/fastatocontig2bin/nextflow.config rename to modules/nf-core/dastool/dastool/tests/nextflow.config index 50f50a7a357..b8c11600093 100644 --- a/tests/modules/nf-core/dastool/fastatocontig2bin/nextflow.config +++ b/modules/nf-core/dastool/dastool/tests/nextflow.config @@ -1,5 +1,9 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file + + withName: DASTOOL_DASTOOL { + ext.args = params.module_args + } + +} diff --git a/modules/nf-core/dastool/fastatocontig2bin/environment.yml b/modules/nf-core/dastool/fastatocontig2bin/environment.yml index 0ede57bfb27..48ee9e0c5ab 100644 --- a/modules/nf-core/dastool/fastatocontig2bin/environment.yml +++ b/modules/nf-core/dastool/fastatocontig2bin/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::das_tool=1.1.6 + - bioconda::das_tool=1.1.7 diff --git a/modules/nf-core/dastool/fastatocontig2bin/main.nf b/modules/nf-core/dastool/fastatocontig2bin/main.nf index 0da450eceb9..371188c4a45 100644 --- a/modules/nf-core/dastool/fastatocontig2bin/main.nf +++ b/modules/nf-core/dastool/fastatocontig2bin/main.nf @@ -4,8 +4,8 @@ process DASTOOL_FASTATOCONTIG2BIN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/das_tool:1.1.6--r42hdfd78af_0' : - 'biocontainers/das_tool:1.1.6--r42hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/das_tool:1.1.7--r43hdfd78af_0' : + 'biocontainers/das_tool:1.1.7--r43hdfd78af_0' }" input: tuple val(meta), path(fasta) @@ -38,4 +38,15 @@ process DASTOOL_FASTATOCONTIG2BIN { dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool //' ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool //' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test b/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test new file mode 100644 index 00000000000..f2901cb7ecf --- /dev/null +++ b/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test @@ -0,0 +1,83 @@ +nextflow_process { + + name "Test Process DASTOOL_FASTATOCONTIG2BIN" + script "../main.nf" + process "DASTOOL_FASTATOCONTIG2BIN" + + tag "modules" + tag "modules_nfcore" + tag "dastool" + tag "dastool/fastatocontig2bin" + tag "metabat2/metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + + setup { + run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") { + script "../../../metabat2/jgisummarizebamcontigdepths/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam.bai", checkIfExists: true), + ] + """ + } + } + run("METABAT2_METABAT2") { + script "../../../metabat2/metabat2/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]).join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + """ + } + } + } + + test("dastool fastatocontig2bin - bacteroides fragilis") { + + when { + process { + """ + input[0] = METABAT2_METABAT2.out.fasta.collect() + input[1] = 'fa' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("dastool fastatocontig2bin - bacteroides fragilis - stub") { + + options "-stub" + + when { + process { + """ + input[0] = METABAT2_METABAT2.out.fasta.collect() + input[1] = 'fa' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} + diff --git a/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test.snap b/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test.snap new file mode 100644 index 00000000000..32a05ba018e --- /dev/null +++ b/modules/nf-core/dastool/fastatocontig2bin/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "dastool fastatocontig2bin - bacteroides fragilis - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,902d9b18eee9c90141d379e80c1297b9" + ], + "fastatocontig2bin": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,902d9b18eee9c90141d379e80c1297b9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-10T09:12:48.89685928" + }, + "dastool fastatocontig2bin - bacteroides fragilis": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + "1": [ + "versions.yml:md5,902d9b18eee9c90141d379e80c1297b9" + ], + "fastatocontig2bin": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + "versions": [ + "versions.yml:md5,902d9b18eee9c90141d379e80c1297b9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-05T13:56:41.454584667" + } +} \ No newline at end of file diff --git a/modules/nf-core/dastool/scaffolds2bin/main.nf b/modules/nf-core/dastool/scaffolds2bin/main.nf index 1520aaf0515..459e495d1e3 100644 --- a/modules/nf-core/dastool/scaffolds2bin/main.nf +++ b/modules/nf-core/dastool/scaffolds2bin/main.nf @@ -1,3 +1,11 @@ +def deprecation_message = """ +WARNING: This module has been deprecated. Please use nf-core/modules/dastool/fastatocontig2bin + +Reason: +This tool has been renamed in newer versions of DAS_Tool, so any changes +to this tool will not be tracked by this module. +""" + process DASTOOL_SCAFFOLDS2BIN { tag "$meta.id" label 'process_single' @@ -20,23 +28,6 @@ process DASTOOL_SCAFFOLDS2BIN { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def file_extension = extension ? extension : "fasta" - def clean_fasta = fasta.toString() - ".gz" - def decompress_fasta = fasta.toString() == clean_fasta ? "" : "gunzip -q -f $fasta" - """ - $decompress_fasta - - Fasta_to_Scaffolds2Bin.sh \\ - $args \\ - -i . \\ - -e $file_extension \\ - > ${prefix}.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool version //' ) - END_VERSIONS + assert false: deprecation_message """ } diff --git a/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test b/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test new file mode 100644 index 00000000000..f6cf02b86df --- /dev/null +++ b/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test @@ -0,0 +1,59 @@ +nextflow_process { + + name "Test Process DASTOOL_SCAFFOLDS2BIN" + script "../main.nf" + process "DASTOOL_SCAFFOLDS2BIN" + + tag "modules" + tag "modules_nfcore" + tag "dastool" + tag "dastool/scaffolds2bin" + tag "metabat2/metabat2" + tag "metabat2/jgisummarizebamcontigdepths" + + setup { + run("METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS") { + script "../../../metabat2/jgisummarizebamcontigdepths/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/illumina/bam/test1.sorted.bam.bai", checkIfExists: true), + ] + """ + } + } + run("METABAT2_METABAT2") { + script "../../../metabat2/metabat2/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz", checkIfExists: true) + ]).join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) + """ + } + } + } + + test("dastool fastatocontig2bin - bacteroides fragilis") { + + when { + process { + """ + input[0] = METABAT2_METABAT2.out.fasta.collect() + input[1] = 'fa' + """ + } + } + + then { + assertAll( + { assert process.failed }, + ) + } + + } +} + diff --git a/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test.snap b/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test.snap new file mode 100644 index 00000000000..c6cdb48f99a --- /dev/null +++ b/modules/nf-core/dastool/scaffolds2bin/tests/main.nf.test.snap @@ -0,0 +1,37 @@ +{ + "dastool fastatocontig2bin - bacteroides fragilis": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + "1": [ + "versions.yml:md5,a29d3534d93feaca7daf85dc8b6e4e8c" + ], + "scaffolds2bin": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,6e46c0be14dded7cb13af38f54feea47" + ] + ], + "versions": [ + "versions.yml:md5,a29d3534d93feaca7daf85dc8b6e4e8c" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-05T13:59:19.402878557" + } +} \ No newline at end of file diff --git a/modules/nf-core/metabat2/metabat2/main.nf b/modules/nf-core/metabat2/metabat2/main.nf index aa7ff9a5dca..89f4e7fa569 100644 --- a/modules/nf-core/metabat2/metabat2/main.nf +++ b/modules/nf-core/metabat2/metabat2/main.nf @@ -51,7 +51,6 @@ process METABAT2_METABAT2 { def prefix = task.ext.prefix ?: "${meta.id}" def decompress_depth = depth ? "gzip -d -f $depth" : "" def depth_file = depth ? "-a ${depth.baseName}" : "" - """ echo "" | gzip -c > ${prefix}.1.fa.gz echo "" | gzip -c > ${prefix}.1.tooShort.fa.gz diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 1147031e8b3..eb7872b4eca 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -124,15 +124,6 @@ cutesv: damageprofiler: - modules/nf-core/damageprofiler/** - tests/modules/nf-core/damageprofiler/** -dastool/dastool: - - modules/nf-core/dastool/dastool/** - - tests/modules/nf-core/dastool/dastool/** -dastool/fastatocontig2bin: - - modules/nf-core/dastool/fastatocontig2bin/** - - tests/modules/nf-core/dastool/fastatocontig2bin/** -dastool/scaffolds2bin: - - modules/nf-core/dastool/scaffolds2bin/** - - tests/modules/nf-core/dastool/scaffolds2bin/** dedup: - modules/nf-core/dedup/** - tests/modules/nf-core/dedup/** diff --git a/tests/modules/nf-core/dastool/dastool/main.nf b/tests/modules/nf-core/dastool/dastool/main.nf deleted file mode 100644 index efea6dc8436..00000000000 --- a/tests/modules/nf-core/dastool/dastool/main.nf +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env nextflow -nextflow.enable.dsl = 2 - -include { METABAT2_METABAT2 } from '../../../../../modules/nf-core/metabat2/metabat2/main.nf' -include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../../modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf' -include { DASTOOL_FASTATOCONTIG2BIN } from '../../../../../modules/nf-core/dastool/fastatocontig2bin/main.nf' -include { DASTOOL_DASTOOL } from '../../../../../modules/nf-core/dastool/dastool/main.nf' - -workflow test_dastool_dastool { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) - - DASTOOL_FASTATOCONTIG2BIN ( METABAT2_METABAT2.out.fasta.collect(), "fa") - - Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)]) - .join( DASTOOL_FASTATOCONTIG2BIN.out.fastatocontig2bin ) - .set {input_dastool} - - - DASTOOL_DASTOOL ( input_dastool, [], [] ) -} diff --git a/tests/modules/nf-core/dastool/dastool/nextflow.config b/tests/modules/nf-core/dastool/dastool/nextflow.config deleted file mode 100644 index e306b4b4fc8..00000000000 --- a/tests/modules/nf-core/dastool/dastool/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: METABAT2_METABAT2 { - ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' - } - - withName: DASTOOL_DASTOOL { - ext.args = '--score_threshold 0 --debug' - } - -} diff --git a/tests/modules/nf-core/dastool/dastool/test.yml b/tests/modules/nf-core/dastool/dastool/test.yml deleted file mode 100644 index 9b85c5db442..00000000000 --- a/tests/modules/nf-core/dastool/dastool/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: dastool dastool test_dastool_dastool - command: nextflow run ./tests/modules/nf-core/dastool/dastool -entry test_dastool_dastool -c ./tests/config/nextflow.config - tags: - - dastool/dastool - - dastool - files: - - path: output/dastool/test.seqlength - md5sum: b815a5811008c36808a59b1d0dcfab24 - - path: output/dastool/test.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/test_DASTool.log - - path: output/dastool/test_DASTool_contig2bin.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/test_DASTool_summary.tsv - md5sum: ab9dd3709a59a69bc66030b9e0ff3d5b - - path: output/dastool/test_proteins.faa - - path: output/dastool/test_proteins.faa.all.b6 - md5sum: 39c11237ef22ac73109aaac267e185d0 - - path: output/dastool/test_proteins.faa.archaea.scg - md5sum: e79d82eecee25821d1658ea4f082601d - - path: output/dastool/test_proteins.faa.bacteria.scg - md5sum: 8132cfb17cf398d41c036ead55c96ffe - - path: output/dastool/test_proteins.faa.findSCG.b6 - md5sum: 48e90e12cd6c88d00608777dbc48a82a - - path: output/dastool/test_proteins.faa.scg.candidates.faa - md5sum: d94b7bed0f8aa9cf2824d72c548c537c - - path: output/dastool/versions.yml diff --git a/tests/modules/nf-core/dastool/fastatocontig2bin/main.nf b/tests/modules/nf-core/dastool/fastatocontig2bin/main.nf deleted file mode 100644 index 70ea9bdafa8..00000000000 --- a/tests/modules/nf-core/dastool/fastatocontig2bin/main.nf +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GUNZIP } from '../../../../../modules/nf-core/gunzip/main.nf' -include { METABAT2_METABAT2 } from '../../../../../modules/nf-core/metabat2/metabat2/main.nf' -include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../../modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf' -include { DASTOOL_FASTATOCONTIG2BIN } from '../../../../../modules/nf-core/dastool/fastatocontig2bin/main.nf' - -workflow test_dastool_fastatocontig2bin { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) - - DASTOOL_FASTATOCONTIG2BIN ( METABAT2_METABAT2.out.fasta.collect(), "fa") -} - -workflow test_dastool_fastatocontig2bin_ungzipped { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) - - // TODO test unzipped input files - ch_input_2_fastatocontig2bin = GUNZIP( METABAT2_METABAT2.out.fasta ).gunzip - - DASTOOL_FASTATOCONTIG2BIN ( ch_input_2_fastatocontig2bin, "fa") -} diff --git a/tests/modules/nf-core/dastool/fastatocontig2bin/test.yml b/tests/modules/nf-core/dastool/fastatocontig2bin/test.yml deleted file mode 100644 index 0cb94930329..00000000000 --- a/tests/modules/nf-core/dastool/fastatocontig2bin/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: dastool fastatocontig2bin test_dastool_fastatocontig2bin - command: nextflow run ./tests/modules/nf-core/dastool/fastatocontig2bin -entry test_dastool_fastatocontig2bin -c ./tests/config/nextflow.config - tags: - - dastool - - dastool/fastatocontig2bin - files: - - path: output/dastool/test.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/versions.yml - -- name: dastool fastatocontig2bin test_dastool_fastatocontig2bin_ungzipped - command: nextflow run ./tests/modules/nf-core/dastool/fastatocontig2bin -entry test_dastool_fastatocontig2bin_ungzipped -c ./tests/config/nextflow.config - tags: - - dastool - - dastool/fastatocontig2bin - files: - - path: output/dastool/test.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/versions.yml diff --git a/tests/modules/nf-core/dastool/scaffolds2bin/main.nf b/tests/modules/nf-core/dastool/scaffolds2bin/main.nf deleted file mode 100644 index 272b7abf685..00000000000 --- a/tests/modules/nf-core/dastool/scaffolds2bin/main.nf +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GUNZIP } from '../../../../../modules/nf-core/gunzip/main.nf' -include { METABAT2_METABAT2 } from '../../../../../modules/nf-core/metabat2/metabat2/main.nf' -include { METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS } from '../../../../../modules/nf-core/metabat2/jgisummarizebamcontigdepths/main.nf' -include { DASTOOL_SCAFFOLDS2BIN } from '../../../../../modules/nf-core/dastool/scaffolds2bin/main.nf' - -workflow test_dastool_scaffolds2bin { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) - - DASTOOL_SCAFFOLDS2BIN ( METABAT2_METABAT2.out.fasta.collect(), "fa") -} - -workflow test_dastool_scaffolds2bin_ungzipped { - - input_depth = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['bacteroides_fragilis']['illumina']['test1_paired_end_sorted_bam_bai'], checkIfExists: true) ] - - - METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS ( input_depth ) - - Channel.fromPath(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) - .map { it -> [[ id:'test', single_end:false ], it] } - .join(METABAT2_JGISUMMARIZEBAMCONTIGDEPTHS.out.depth) - .set { input_metabat2 } - - METABAT2_METABAT2 ( input_metabat2 ) - - // TODO test unzipped input files - ch_input_2_scaffolds2bin = GUNZIP( METABAT2_METABAT2.out.fasta ).gunzip - - DASTOOL_SCAFFOLDS2BIN ( ch_input_2_scaffolds2bin, "fa") -} diff --git a/tests/modules/nf-core/dastool/scaffolds2bin/nextflow.config b/tests/modules/nf-core/dastool/scaffolds2bin/nextflow.config deleted file mode 100644 index 83754d8b100..00000000000 --- a/tests/modules/nf-core/dastool/scaffolds2bin/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: METABAT2_METABAT2 { - ext.args = '--minContig 1500 --minCV 0.1 --minCVSum 0.1 --minClsSize 10 --minS 2' - } - -} diff --git a/tests/modules/nf-core/dastool/scaffolds2bin/test.yml b/tests/modules/nf-core/dastool/scaffolds2bin/test.yml deleted file mode 100644 index 462a6f180a7..00000000000 --- a/tests/modules/nf-core/dastool/scaffolds2bin/test.yml +++ /dev/null @@ -1,18 +0,0 @@ -- name: dastool scaffolds2bin test_dastool_scaffolds2bin - command: nextflow run ./tests/modules/nf-core/dastool/scaffolds2bin -entry test_dastool_scaffolds2bin -c ./tests/config/nextflow.config - tags: - - dastool - - dastool/scaffolds2bin - files: - - path: output/dastool/test.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/versions.yml -- name: dastool scaffolds2bin test_dastool_scaffolds2bin_ungzipped - command: nextflow run ./tests/modules/nf-core/dastool/scaffolds2bin -entry test_dastool_scaffolds2bin_ungzipped -c ./tests/config/nextflow.config - tags: - - dastool - - dastool/scaffolds2bin - files: - - path: output/dastool/test.tsv - md5sum: 6e46c0be14dded7cb13af38f54feea47 - - path: output/dastool/versions.yml From 4912a732150b64bf76230367301745af6a965b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:39:39 +0100 Subject: [PATCH 6/9] update parabricks/applybqsr (#7189) update applybqsr --- .github/conda_skip.yml | 2 + modules/nf-core/parabricks/applybqsr/main.nf | 10 +---- .../applybqsr/tests/main.nf.test.snap | 44 +++++++++---------- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/conda_skip.yml b/.github/conda_skip.yml index d14707c45f8..b3e1a8407c6 100644 --- a/.github/conda_skip.yml +++ b/.github/conda_skip.yml @@ -188,3 +188,5 @@ exclude: path: modules/nf-core/parabricks/indexgvcf - profile: conda path: modules/nf-core/parabricks/genotypegvcf + - profile: conda + path: modules/nf-core/parabricks/applybqsr diff --git a/modules/nf-core/parabricks/applybqsr/main.nf b/modules/nf-core/parabricks/applybqsr/main.nf index 38b2af002b8..c4900b3f14f 100644 --- a/modules/nf-core/parabricks/applybqsr/main.nf +++ b/modules/nf-core/parabricks/applybqsr/main.nf @@ -2,8 +2,9 @@ process PARABRICKS_APPLYBQSR { tag "$meta.id" label 'process_high' label 'process_gpu' + stageInMode 'copy' - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.2-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" input: tuple val(meta), path(bam) @@ -28,13 +29,8 @@ process PARABRICKS_APPLYBQSR { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def interval_command = intervals ? intervals.collect{"--interval-file $it"}.join(' ') : "" - def copy_index_command = bam_index ? "cp -L $bam_index `readlink -f $bam`.bai" : "" def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ - # parabricks complains when index is not a regular file in the same directory as the bam - # copy the index to this path. - $copy_index_command - pbrun \\ applybqsr \\ --ref $fasta \\ @@ -53,9 +49,7 @@ process PARABRICKS_APPLYBQSR { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def interval_command = intervals ? intervals.collect{"--interval-file $it"}.join(' ') : "" """ touch ${prefix}.bam touch ${prefix}.bam.bai diff --git a/modules/nf-core/parabricks/applybqsr/tests/main.nf.test.snap b/modules/nf-core/parabricks/applybqsr/tests/main.nf.test.snap index c7a55002ac5..e90a1d51324 100644 --- a/modules/nf-core/parabricks/applybqsr/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/applybqsr/tests/main.nf.test.snap @@ -4,42 +4,42 @@ "2f11e4fe3390b8ad0a1852616fd1da04", "test.bam.bai", [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ] ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-31T08:40:58.540517299" + "timestamp": "2024-12-10T08:44:34.058228768" }, "sarscov2 - bam - pe": { "content": [ "894549ee3ced6b5ca2eed2563a985217", "test.bam.bai", [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ] ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-30T10:55:02.759938278" + "timestamp": "2024-12-10T08:44:17.204736211" }, "sarscov2 - bam - pe - intervals": { "content": [ "b194021b699cc5cf4b2b1f715e0b7b4c", "test.bam.bai", [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ] ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-30T11:20:43.476752722" + "timestamp": "2024-12-10T08:44:25.661590103" }, "sarscov2 - bam - pe - intervals - stub": { "content": [ @@ -61,7 +61,7 @@ ] ], "2": [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ], "bai": [ [ @@ -80,15 +80,15 @@ ] ], "versions": [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ] } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-30T11:21:02.658767469" + "timestamp": "2024-12-10T08:44:47.700907318" }, "human - cram - pe - intervals - stub": { "content": [ @@ -110,7 +110,7 @@ ] ], "2": [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ], "bai": [ [ @@ -129,14 +129,14 @@ ] ], "versions": [ - "versions.yml:md5,139b8f2a0926a26cf843ac23daace6d0" + "versions.yml:md5,f396830824c06b6dc30056e423a91634" ] } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-10-30T11:20:56.908929981" + "timestamp": "2024-12-10T08:44:41.08456539" } } \ No newline at end of file From 138b2c45dde12b2075d6fe15a5d374b48d166d4a Mon Sep 17 00:00:00 2001 From: Suzanne Jin Date: Wed, 11 Dec 2024 16:08:07 +0100 Subject: [PATCH 7/9] update module propr/grea (#7198) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * delete previous snapshot * [propr/grea] update container and conda environment * [propr/grea] update main.nf output * [propr/grea] copied the updated template from differentialabundance dev-ratio * [propr/grea] added some comments and checks * [propr/grea] add option to round digits * [propr/grea] updated tests, need to solve some problems with gmt filtering * [propr/grea] updated snapshots, but need to check single cpu vs multiprocessor discrepancies * [propr/grea] update snapshots * [propr/grea] update meta.yml * [propr/grea] remove unnecesary config * [propr/grea] solve linting * Apply suggestions from code review Co-authored-by: Júlia Mir Pedrol --------- Co-authored-by: Júlia Mir Pedrol --- modules/nf-core/propr/grea/environment.yml | 4 +- modules/nf-core/propr/grea/main.nf | 14 +- modules/nf-core/propr/grea/meta.yml | 42 ++-- modules/nf-core/propr/grea/templates/grea.R | 223 +++++++++++------- .../nf-core/propr/grea/tests/grea_test.config | 14 +- modules/nf-core/propr/grea/tests/main.nf.test | 54 +++-- .../propr/grea/tests/main.nf.test.snap | 33 ++- 7 files changed, 224 insertions(+), 160 deletions(-) diff --git a/modules/nf-core/propr/grea/environment.yml b/modules/nf-core/propr/grea/environment.yml index 2bb015a1047..9744dab906b 100644 --- a/modules/nf-core/propr/grea/environment.yml +++ b/modules/nf-core/propr/grea/environment.yml @@ -1,5 +1,7 @@ channels: - conda-forge - bioconda + dependencies: - - conda-forge::r-propr=5.0.4 + - bioconda::bioconductor-limma=3.58.1 + - conda-forge::r-propr=5.1.5 diff --git a/modules/nf-core/propr/grea/main.nf b/modules/nf-core/propr/grea/main.nf index d2e1ee6de9a..fd727208d94 100644 --- a/modules/nf-core/propr/grea/main.nf +++ b/modules/nf-core/propr/grea/main.nf @@ -1,20 +1,20 @@ process PROPR_GREA { tag "$meta.id" - label 'process_single' + label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/r-propr:5.0.4': - 'biocontainers/r-propr:5.0.4' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/b6/b65f7192866fbd9a947df15b104808abb720e7a224bbe3ca8f7f8f680f52c97a/data' : + 'community.wave.seqera.io/library/bioconductor-limma_r-propr:f52f1d4fea746393' }" input: - tuple val(meta), path(adj) + tuple val(meta), path(adjacency) tuple val(meta2), path(gmt) output: - tuple val(meta), path("*.go.tsv"), emit: enrichedGO - path "versions.yml", emit: versions - path "*.R_sessionInfo.log", emit: session_info + tuple val(meta), path("*.grea.tsv"), emit: results + path "versions.yml", emit: versions + path "*.R_sessionInfo.log", emit: session_info when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/propr/grea/meta.yml b/modules/nf-core/propr/grea/meta.yml index 58f73fc4d86..cc0613d3dab 100644 --- a/modules/nf-core/propr/grea/meta.yml +++ b/modules/nf-core/propr/grea/meta.yml @@ -2,12 +2,12 @@ name: "propr_grea" description: Perform Gene Ratio Enrichment Analysis keywords: - - logratio - - differential - propr - grea - - enrichment - - expression + - logratio + - differential expression + - functional enrichment + - functional analysis tools: - "grea": description: "Gene Ratio Enrichment Analysis" @@ -21,34 +21,42 @@ input: - - meta: type: map description: | - Groovy Map containing sample information. + Groovy Map containing data information. This can be used at the workflow level to pass optional parameters to the module. [id: 'test', ...] - - adj: + - adjacency: type: file - description: adjacency matrix for gene ratio proportionality/differential proportionality + description: | + Adjacency matrix representing the graph connections (ie. 1 for edges, 0 otherwise). + This can be the adjacency matrix output from gene ratio approaches like propr/propd. pattern: "*.{csv,tsv}" - - meta2: type: map description: | - Groovy map containing study-wide metadata related to the knowledge database + Groovy Map containing data information. + This can be used at the workflow level to pass optional parameters to the module. + [id: 'test', ...] - gmt: type: file - description: relational database containing genes and GO terms (generated by - mygene module) + description: | + A tab delimited file format that describes gene sets. The first column is the + concept id (eg. GO term, pathway, etc), the second column is the concept description, and the + rest are nodes (eg. genes) that is associated to the given concept. pattern: "*.{gmt}" output: - - enrichedGO: + - results: - meta: - type: map + type: file description: | Groovy Map containing sample information. This can be used at the workflow level to pass optional parameters to the module. [id: 'test', ...] - - "*.go.tsv": + - "*.grea.tsv": type: file - description: File containing GO terms and their enrichment values - pattern: "*.{csv}" + description: | + Output file containing the information about the tested concepts (ie. gene sets) + and enrichment statistics. + pattern: "*.grea.tsv" - versions: - versions.yml: type: file @@ -57,9 +65,11 @@ output: - session_info: - "*.R_sessionInfo.log": type: file - description: R session log + description: dump of R SessionInfo pattern: "*.R_sessionInfo.log" authors: - "@caraiz2001" + - "@suzannejin" maintainers: - "@caraiz2001" + - "@suzannejin" diff --git a/modules/nf-core/propr/grea/templates/grea.R b/modules/nf-core/propr/grea/templates/grea.R index 2d568b70330..3b761f89b1c 100644 --- a/modules/nf-core/propr/grea/templates/grea.R +++ b/modules/nf-core/propr/grea/templates/grea.R @@ -51,66 +51,44 @@ read_delim_flexible <- function(file, header = TRUE, row.names = 1, check.names ) } -#' Converts the .gmt file into a df +#' Loads the .gmt file and converts it into a knowledge database #' -#' @param file_gmt_path path of the .gmt file provided by mygene module. -#' @return output dataframe a Dataframe: 1st column = GOterm, 2nd = Description, 3d to end = genes. -process_gmt_file <- function(file_gmt_path) { - - lines <- readLines(file_gmt_path) - data_list <- list() - - for (line in lines) { - fields <- strsplit(line, "\\t")[[1]] # Split the line based on the tab character - go_term <- fields[1] # Extract the GO term - - # Create a data frame with the GO term in the first column - # Fill in missing values with NA to ensure consistent column lengths - data_list[[go_term]] <- data.frame(GOterm = go_term, - Description = fields[2], - GeneIDs = c(fields[3:length(fields)], rep(NA, max(0, 3 - length(fields))))) +#' @param filename path of the .gmt file +#' @param nodes vector of node (eg. gene) names. Note that this set should be as +#' complete as possible. So it should not only contain the target genes but also +#' the background genes. +#' @return a list with: +#' `db` A knowledge database (matrix) where each row is a graph node (eg. gene) +#' and each column is a concept (eg. GO term, pathway, etc). +#' `description` A list of descriptions for each concept. +load_gmt <- function(filename, nodes) { + + # read gmt file + gmt <- readLines(filename) + gmt <- strsplit(gmt, "\\t") + + # initialize database matrix + db <- matrix(0, nrow = length(nodes), ncol = length(gmt)) + rownames(db) <- nodes + colnames(db) <- sapply(gmt, function(entry) entry[[1]]) + + # description of the concepts + description <- list() + + # for concept in gmt + for (i in 1:length(gmt)) { + + # get concept and description + concept <- gmt[[i]][[1]] + description[[concept]] <- gmt[[i]][[2]] + + # fill 1 if gene is in concept + nodes_in_concept <- gmt[[i]][-c(1, 2)] + nodes_in_concept <- nodes_in_concept[nodes_in_concept %in% nodes] + db[nodes_in_concept, i] <- 1 } - gmt_df <- do.call(rbind, data_list) # Combine all data frames into a single data frame - gmt_df\$GeneIDs <- as.character(gmt_df\$GeneIDs) # Convert gene IDs to character to avoid coercion - - return(gmt_df) -} - -#' Converts the .gmt data frame into a knowledge matrix (contingency table) -#' -#' @param gmt_df .gmt df created by process_gmt_file -#' @return output dataframe. A knowledge database where each row is a graph node (gene) -#' and each column is a concept (GO term). -gmt_to_K<- function(gmt_df){ - - summ_df <- as.data.frame(gmt_df\$GeneIDs) - summ_df <- cbind(summ_df, as.data.frame(gmt_df\$GOterm)) - colnames(summ_df)<- c("GeneIDs", "GOterm") - summ_df<- unique(summ_df) - - summ_df\$value <- 1 - - K <- table(summ_df\$GeneIDs, summ_df\$GOterm) - K <- as.data.frame.matrix(K) - - return(K) -} - -#' Expands knowledge matrix with missing genes to ensure same number of rows for A and K -#' -#' @param adjacency_matrix gene x gene correlation or proportionality adjacency matrix (output propr/propd) -#' @return output dataframe. A knowledge database where each row is a graph node (gene) -#' and each column is a concept (GO term). -add_missing <- function(adjacency_matrix, knowledge_matrix){ - - missing_genes <- setdiff(rownames(adjacency_matrix), rownames(knowledge_matrix)) - extra_rows <- data.frame(matrix(0, nrow = length(missing_genes), ncol = ncol(knowledge_matrix))) - rownames(extra_rows) <- missing_genes - colnames(extra_rows) <- colnames(knowledge_matrix) - - knowledge_matrix <- rbind(knowledge_matrix, extra_rows) - return(knowledge_matrix) + return(list(db = db, description = description)) } ################################################ @@ -119,53 +97,70 @@ add_missing <- function(adjacency_matrix, knowledge_matrix){ ################################################ ################################################ +# Set defaults and classes + opt <- list( - adj = '$adj', - gmt = '$gmt', prefix = ifelse('$task.ext.prefix' == 'null', '$meta.id', '$task.ext.prefix'), - permutation = 100, - fixseed = TRUE, + + # input data + adj = '$adjacency', # adjacency matrix + gmt = '$gmt', # knowledge database .gmt file + + # parameters for gene sets + set_min = 15, # minimum number of genes in a set + set_max = 500, # maximum number of genes in a set + + # parameters for permutation test + permutation = 100, # number of permutations to perform + + # other parameters + seed = NA, # seed for reproducibility + round_digits = NA, # number of digits to round results ncores = as.integer('$task.cpus') ) opt_types <- list( + prefix = 'character', adj = 'character', gmt = 'character', - prefix = 'character', + set_min = 'numeric', + set_max = 'numeric', permutation = 'numeric', - fixseed = 'logical', + seed = 'numeric', + round_digits = 'numeric', ncores = 'numeric' ) # Apply parameter overrides -args_opt <- parse_args('$task.ext.args') +args_ext <- ifelse('$task.ext.args' == 'null', '', '$task.ext.args') +args_opt <- parse_args(args_ext) for ( ao in names(args_opt)){ if (! ao %in% names(opt)){ stop(paste("Invalid option:", ao)) } else { # Preserve classes from defaults where possible - if (! is.null(opt[[ao]])){ - args_opt[[ao]] <- as(args_opt[[ao]], opt_types[[ao]]) - } - # set NA - if (args_opt[[ao]] %in% c('NA', NA, 'null')){ - args_opt[[ao]] <- NA - } + args_opt[[ao]] <- as(args_opt[[ao]], opt_types[[ao]]) + + # handle NA, and avoid errors when NA is provided by user as character + if (args_opt[[ao]] %in% c('NA', NA)) args_opt[[ao]] <- NA + + # replace values opt[[ao]] <- args_opt[[ao]] } } # Check if required parameters have been provided + required_opts <- c('adj', 'gmt') # defines a vector required_opts containing the names of the required parameters. missing <- required_opts[unlist(lapply(opt[required_opts], is.null)) | ! required_opts %in% names(opt)] if (length(missing) > 0){ stop(paste("Missing required options:", paste(missing, collapse=', '))) } - # Check file inputs are valid + for (file_input in c('adj', 'gmt')){ if (is.null(opt[[file_input]])) { stop(paste("Please provide", file_input), call. = FALSE) @@ -175,6 +170,12 @@ for (file_input in c('adj', 'gmt')){ } } +# check parameters are valid + +if (opt\$permutation < 0) { + stop('permutation should be a positive integer') +} + ################################################ ################################################ ## Finish loading libraries ## @@ -189,20 +190,63 @@ library(propr) ################################################ ################################################ -# Read gene x gene adjacency matrix -A <- read_delim_flexible(opt\$adj, header = TRUE, row.names = 1, check.names = TRUE) +# set seed when required + +if (!is.na(opt\$seed)) { + warning('Setting seed ', opt\$seed, ' for reproducibility') + set.seed(opt\$seed) +} + +# load adjacency matrix +# this matrix should have gene x gene dimensions + +message("Loading input data") + +adj <- as.matrix(read_delim_flexible( + opt\$adj, + header = TRUE, + row.names = 1, + check.names = FALSE +)) +if (nrow(adj) != ncol(adj)) { + stop('Adjacency matrix should be a squared matrix that reflects the connections between all the nodes') +} +if (!all(rownames(adj) == colnames(adj))) { + stop('Adjacency matrix row names are not equal to column names') +} + +# load and process knowledge database + +gmt <- load_gmt( + opt\$gmt, + rownames(adj) # adj should contain all the nodes (target and background) +) -# Read and process gene x GO term matrix -gmt_df <- process_gmt_file(opt\$gmt) -K <- gmt_to_K(gmt_df) +# filter gene sets +# gene sets with less than set_min or more than set_max genes are removed -# Ensure same number of rows (genes) -if (nrow(A) != nrow(K)){ - K <- add_missing(A, K) +idx <- which(colSums(gmt\$db) > opt\$set_min & colSums(gmt\$db) < opt\$set_max) +if (length(idx) == 0){ + stop("No gene set pass the filter of set_min=", opt\$set_min, " and set_max=", opt\$set_max) } +gmt\$db <- gmt\$db[, idx] +gmt\$description <- gmt\$description[idx] -# Run Graflex -G <- runGraflex(A, K, opt\$permutation, opt\$fixseed) +# run GREA +# Basically, it calculates the odds ratio of the graph being enriched in each concept, +# and the FDR of the odds ratio through permutation tests + +message("Running GREA") + +odds <- runGraflex( + adj, + gmt\$db, + p=opt\$permutation, + ncores=opt\$ncores +) +odds\$Description <- sapply(odds\$Concept, function(concept) + gmt\$description[[concept]] +) ################################################ ################################################ @@ -210,14 +254,19 @@ G <- runGraflex(A, K, opt\$permutation, opt\$fixseed) ################################################ ################################################ +if (!is.na(opt\$round_digits)) { + for (col in c('Odds', 'LogOR', 'FDR.under', 'FDR.over')){ + odds[,col] <- round(odds[,col], opt\$round_digits) + } +} + write.table( - G, - file = paste0(opt\$prefix, '.go.tsv'), + odds, + file = paste0(opt\$prefix, '.grea.tsv'), col.names = TRUE, - row.names = TRUE, + row.names = FALSE, sep = '\\t', quote = FALSE - ) ################################################ @@ -236,13 +285,11 @@ sink() ################################################ ################################################ -r.version <- strsplit(version[['version.string']], ' ')[[1]][3] propr.version <- as.character(packageVersion('propr')) writeLines( c( '"${task.process}":', - paste(' r-base:', r.version), paste(' r-propr:', propr.version) ), 'versions.yml') diff --git a/modules/nf-core/propr/grea/tests/grea_test.config b/modules/nf-core/propr/grea/tests/grea_test.config index 8d0d229a76d..7d354c013a5 100644 --- a/modules/nf-core/propr/grea/tests/grea_test.config +++ b/modules/nf-core/propr/grea/tests/grea_test.config @@ -1,8 +1,14 @@ process { - withName: "PROPR_PROPR"{ - ext.args = { "--adjacency true --permutation 5 --fixseed true --cutoff_min 0.05 --cutoff_max 0.95 --cutoff_interval 0.05"} + // set single core for reproducibility + // NOTE this method relies on parallelization and permutation tests + // The permutations are done within each node, which makes set.seed not working properly when + // different nodes are starting/ending depending on the case + cpus = 1 + + withName: "PROPR_PROPD"{ + ext.args = { "--round_digits 5 --save_adjacency true --features_id_col gene_name"} } withName: "PROPR_GREA"{ - ext.args = { "--permutation 5 --fixseed true"} + ext.args = { "--permutation 10 --set_min 10 --seed 123 --round_digits 5"} } -} \ No newline at end of file +} diff --git a/modules/nf-core/propr/grea/tests/main.nf.test b/modules/nf-core/propr/grea/tests/main.nf.test index dd442b43459..38a015e4b8c 100644 --- a/modules/nf-core/propr/grea/tests/main.nf.test +++ b/modules/nf-core/propr/grea/tests/main.nf.test @@ -8,34 +8,34 @@ nextflow_process { tag "modules_nfcore" tag "propr" tag "propr/grea" - tag "mygene" - tag "propr/propr" + tag "propr/propd" - test("grea chained to propr using default options") { + test("test grea chained to propd") { tag "default" config "./grea_test.config" setup { - run("PROPR_PROPR") { - script "../../propr/main.nf" + run("PROPR_PROPD") { + script "../../propd/main.nf" process { """ - input[0] = [ - [ id:'test' ], - file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.salmon.merged.gene_counts.top1000cov.tsv") - ] - """ - } - } - run("MYGENE") { - script "../../../mygene/main.nf" - process { - """ - input[0] = [ - [id : 'test'], - file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv") + expression_test_data_dir = params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/' + + ch_contrasts = Channel.fromPath(file(expression_test_data_dir + 'SRP254919.contrasts.csv', checkIfExists: true)) + .splitCsv ( header:true, sep:',' ) + .map{ + tuple(it, it.variable, it.reference, it.target) + } + .first() + ch_matrix = [ + [id: 'test'], + file(expression_test_data_dir + 'SRP254919.samplesheet.csv', checkIfExists: true), + file(expression_test_data_dir + 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', checkIfExists: true) ] + + input[0] = ch_contrasts + input[1] = ch_matrix """ } } @@ -44,8 +44,11 @@ nextflow_process { when { process { """ - input[0] = PROPR_PROPR.out.adj.collect{ meta, adj -> adj }.map{ adj -> [[ id: 'test_adj'], adj]} - input[1] = MYGENE.out.gmt.collect{ meta, gmt -> gmt }.map{ gmt -> [[ id: 'test_gmt'], gmt]} + input[0] = PROPR_PROPD.out.adjacency + input[1] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/mus_musculus/gene_set_analysis/mh.all.v2022.1.Mm.symbols.gmt', checkIfExists: true) + ] """ } } @@ -53,10 +56,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.enrichedGO).match("grea chained to propr using default options - enrichedGO") }, - { assert snapshot(process.out.versions).match("versions") } - + { assert snapshot( + process.out.results, + process.out.versions + ).match()} ) } } -} \ No newline at end of file +} diff --git a/modules/nf-core/propr/grea/tests/main.nf.test.snap b/modules/nf-core/propr/grea/tests/main.nf.test.snap index 2db674fc5ae..6c5dd533ed8 100644 --- a/modules/nf-core/propr/grea/tests/main.nf.test.snap +++ b/modules/nf-core/propr/grea/tests/main.nf.test.snap @@ -1,31 +1,26 @@ { - "versions": { - "content": [ - [ - "versions.yml:md5,222a7a8b79b5a2987637279847c609d1" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-04-29T10:45:07.582509" - }, - "grea chained to propr using default options - enrichedGO": { + "test grea chained to propd": { "content": [ [ [ { - "id": "test_adj" + "id": "treatment_mCherry_hND6_", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "" }, - "test_adj.go.tsv:md5,904e1fe3eed0f2dded8e5b64321a0269" + "treatment_mCherry_hND6_.grea.tsv:md5,786faeccf39926d2f7c980ef549a2697" ] + ], + [ + "versions.yml:md5,060fcd8ce4afc482e237fa75686a0aba" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-08-03T16:06:25.669444" + "timestamp": "2024-12-11T13:00:02.026244403" } -} \ No newline at end of file +} From 7b32b09fe7787c0fc6924e7b6f223a0b1daf0d2f Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Wed, 11 Dec 2024 16:57:50 +0100 Subject: [PATCH 8/9] Correct non-gzipped output from clustalo/align (#7197) --- modules/nf-core/clustalo/align/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/clustalo/align/main.nf b/modules/nf-core/clustalo/align/main.nf index e55ca172e78..c220afd7bd8 100644 --- a/modules/nf-core/clustalo/align/main.nf +++ b/modules/nf-core/clustalo/align/main.nf @@ -31,7 +31,7 @@ process CLUSTALO_ALIGN { def fhmm_batch = hmm_batch ? "--hmm-batch=${hmm_batch}" : "" def fprofile1 = profile1 ? "--profile1=${profile1}" : "" def fprofile2 = profile2 ? "--profile2=${profile2}" : "" - def write_output = compress ? "--force -o >(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "> ${prefix}.aln" + def write_output = compress ? "--force -o >(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "-o ${prefix}.aln" // using >() is necessary to preserve the return value, // so nextflow knows to display an error when it failed // the --force -o is necessary, as clustalo expands the commandline input, From 784b3a38aeafe9bb7e38f1369704dd5e6bcaf9f0 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Wed, 11 Dec 2024 16:41:43 +0000 Subject: [PATCH 9/9] Facilitate iteration in differential subworkflow (#7115) * illustrate differential iteration * Combine matrix metas with contrast metas in differential modules * Propose different iteration approach * Flip input order * Add multi-input test * Update module snaps * update meta.yml * Update module meta.ymls * See if different output prefix for limma_norm helps * [skip ci] move fc to iterable channel * update snapshots * Fix metas * update meta handling * Put modules back to the way they were * Try publishing logic fixes * Try disabling R object save * Revert "Try disabling R object save" This reverts commit 71f804dd967ab21e794c44860cb563a9f35ceb0f. * try fresh docker image URI * Tidy up configs * Don't repeat normalisation ops * Add correct blocking var consideration to configs * Add correct blocking var consideration to configs (snapshots) * remove blank lines * Corrections to channel structure, config * Adding author/ maintainer block pending other author suggestions * Add additional coauthors --- modules/nf-core/limma/differential/main.nf | 2 +- .../abundance_differential_filter/main.nf | 188 +++--- .../abundance_differential_filter/meta.yml | 179 ++++-- .../tests/deseq2_basic.config | 5 + .../tests/deseq2_limmavoom_basic.config | 24 + .../tests/limma_basic_microarray.config | 7 +- .../tests/limma_voom.config | 8 +- .../tests/main.nf.test | 216 +++++-- .../tests/main.nf.test.snap | 600 +++++++++++++++--- 9 files changed, 907 insertions(+), 322 deletions(-) create mode 100644 subworkflows/nf-core/abundance_differential_filter/tests/deseq2_limmavoom_basic.config diff --git a/modules/nf-core/limma/differential/main.nf b/modules/nf-core/limma/differential/main.nf index be6c72ecef3..b7106c397b6 100644 --- a/modules/nf-core/limma/differential/main.nf +++ b/modules/nf-core/limma/differential/main.nf @@ -5,7 +5,7 @@ process LIMMA_DIFFERENTIAL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/af/afd9579a0ff62890ff451d82b360d85e82a0d61a3da40736ee0eee4e45926269/data' : - 'community.wave.seqera.io/library/bioconductor-limma_bioconductor-edger:54dd09078d5db3b3' }" + 'community.wave.seqera.io/library/bioconductor-edger_bioconductor-limma:176c202c82450990' }" input: tuple val(meta), val(contrast_variable), val(reference), val(target) diff --git a/subworkflows/nf-core/abundance_differential_filter/main.nf b/subworkflows/nf-core/abundance_differential_filter/main.nf index f7ca8787512..6d587d58dab 100644 --- a/subworkflows/nf-core/abundance_differential_filter/main.nf +++ b/subworkflows/nf-core/abundance_differential_filter/main.nf @@ -8,113 +8,111 @@ include { DESEQ2_DIFFERENTIAL } from '../../../modules/nf-core/d include { DESEQ2_DIFFERENTIAL as DESEQ2_NORM } from '../../../modules/nf-core/deseq2/differential/main' include { CUSTOM_FILTERDIFFERENTIALTABLE } from '../../../modules/nf-core/custom/filterdifferentialtable/main' +// Combine meta maps, including merging non-identical values of shared keys (e.g. 'id') +def mergeMaps(meta, meta2){ + (meta + meta2).collectEntries { k, v -> + meta[k] && meta[k] != v ? [k, "${meta[k]}_${v}"] : [k, v] + } +} + workflow ABUNDANCE_DIFFERENTIAL_FILTER { take: - ch_abundance // [ meta_exp, counts ] with meta keys: method, args_diff - ch_transcript_lengths // [ meta_exp, transcript_lengths] - ch_control_features // [ meta_exp, control_features] - ch_samplesheet // [ meta_exp, samplesheet ] - ch_contrasts // [ meta_contrast, contrast_variable, reference, target ] - differential_method // limma, deseq2, propd - FC_threshold // float - padj_threshold // float - - main: - - // initialize empty results channels - ch_normalised_matrix = Channel.empty() - ch_variance_stabilised_matrix = Channel.empty() - ch_model = Channel.empty() - - ch_results_genewise = Channel.empty() - ch_results_genewise_filtered = Channel.empty() - ch_versions = Channel.empty() - - // Derive some commonly used derived channels - ch_samples_and_matrix = ch_samplesheet.join(ch_abundance).first() - - logFC_column = null - padj_column = null - - // ---------------------------------------------------- - // Perform differential analysis with DESeq2 - // ---------------------------------------------------- - - if (differential_method == 'deseq2') { - - logFC_column = "log2FoldChange" - padj_column = "padj" - - // Run the module once to generate a normalised matrix. We can't just - // use e.g. the first run of DESEQ_DIFFERENTIAL, because it may remove - // some samples - - DESEQ2_NORM ( - ch_contrasts.first(), - ch_samples_and_matrix, - ch_control_features, - ch_transcript_lengths - ) + // Things we may need to iterate + ch_input // [[meta_input], counts, analysis method, fc_threshold, padj_threshold] - ch_normalised_matrix = DESEQ2_NORM.out.normalised_counts - ch_variance_stabilised_matrix = DESEQ2_NORM.out.rlog_counts.concat(DESEQ2_NORM.out.vst_counts) + // Workflow-wide things, we don't need to iterate + ch_samplesheet // [ meta_exp, samplesheet ] + ch_transcript_lengths // [ meta_exp, transcript_lengths] + ch_control_features // [meta_exp, control_features] + ch_contrasts // [[ meta_contrast, contrast_variable, reference, target ]] - // Run the DESeq differential module - - DESEQ2_DIFFERENTIAL ( - ch_contrasts, - ch_samples_and_matrix, - ch_control_features, - ch_transcript_lengths - ) - - ch_results_genewise = DESEQ2_DIFFERENTIAL.out.results - ch_model = DESEQ2_DIFFERENTIAL.out.model - - ch_versions = ch_versions - .mix(DESEQ2_DIFFERENTIAL.out.versions) - - } else if (differential_method == 'limma'){ - - logFC_column = "logFC" - padj_column = "adj.P.Val" - - // Run the module once to generate a normalised matrix. We can't just - // use e.g. the first run of LIMMA_DIFFERENTIAL, because it may remove - // some samples + main: - LIMMA_NORM ( - ch_contrasts.first(), - ch_samples_and_matrix - ) + // Set up how the channels crossed below will be used to generate channels for processing + def criteria = multiMapCriteria { meta_input, abundance, analysis_method, fc_threshold, padj_threshold, meta_exp, samplesheet, meta_contrasts, variable, reference, target -> + samples_and_matrix: + meta_map = meta_input + [ 'method': analysis_method ] + [meta_map, samplesheet, abundance] + contrasts: + meta_map = mergeMaps(meta_contrasts, meta_input) + [ 'method': analysis_method ] + [ meta_map, variable, reference, target ] + filter_params: + meta_map = mergeMaps(meta_contrasts, meta_input) + [ 'method': analysis_method ] + [meta_map, [ 'fc_threshold': fc_threshold, 'padj_threshold': padj_threshold ]] + } - ch_normalised_matrix = LIMMA_NORM.out.normalised_counts + // For differential we need to cross the things we're iterating so we run + // differential analysis for every combination of matrix and contrast + inputs = ch_input + .combine(ch_samplesheet) + .combine(ch_contrasts) + .multiMap(criteria) + + // We only need a normalised matrix from one contrast. The reason we don't + //just use the output from the first differential is that the methods can + // subset matrices + norm_inputs = ch_input + .combine(ch_samplesheet) + .combine(ch_contrasts.first()) // Just taking the first contrast + .multiMap(criteria) + + // Perform normalization and differential analysis + DESEQ2_NORM( + norm_inputs.contrasts.filter{it[0].method == 'deseq2'}.first(), + norm_inputs.samples_and_matrix.filter{it[0].method == 'deseq2'}, + ch_control_features.first(), + ch_transcript_lengths.first() + ) - LIMMA_DIFFERENTIAL ( - ch_contrasts, - ch_samples_and_matrix - ) - ch_results_genewise = LIMMA_DIFFERENTIAL.out.results - ch_model = LIMMA_DIFFERENTIAL.out.model + LIMMA_NORM( + norm_inputs.contrasts.filter{it[0].method == 'limma'}.first(), + norm_inputs.samples_and_matrix.filter{it[0].method == 'limma'} + ) - ch_versions = ch_versions - .mix(LIMMA_DIFFERENTIAL.out.versions) + DESEQ2_DIFFERENTIAL( + inputs.contrasts.filter{it[0].method == 'deseq2'}, + inputs.samples_and_matrix.filter{it[0].method == 'deseq2'}, + ch_control_features.first(), + ch_transcript_lengths.first() + ) - } + LIMMA_DIFFERENTIAL( + inputs.contrasts.filter{it[0].method == 'limma'}, + inputs.samples_and_matrix.filter { it[0].method == 'limma' } + ) + // Combine results + ch_results = DESEQ2_DIFFERENTIAL.out.results.mix(LIMMA_DIFFERENTIAL.out.results) + ch_normalised_matrix = DESEQ2_NORM.out.normalised_counts.mix(LIMMA_NORM.out.normalised_counts) + ch_model = DESEQ2_DIFFERENTIAL.out.model.mix(LIMMA_DIFFERENTIAL.out.model) + ch_versions = DESEQ2_DIFFERENTIAL.out.versions + .mix(LIMMA_DIFFERENTIAL.out.versions) + + // Extract the fc and pval filters from the metamap we stashed them in + ch_diff_filter_params = ch_results + .join(inputs.filter_params) + .multiMap { meta, results, filter_meta -> + filter_input: [meta + filter_meta, results] + fc_column: meta.method == 'deseq2' ? 'log2FoldChange' : 'logFC' + padj_column: meta.method == 'deseq2' ? 'padj' : 'adj.P.Val' + fc_threshold: filter_meta.fc_threshold + padj_threshold: filter_meta.padj_threshold + } + + // Filter differential results CUSTOM_FILTERDIFFERENTIALTABLE( - ch_results_genewise, - logFC_column, - FC_threshold, - padj_column, - padj_threshold + ch_diff_filter_params.filter_input, + ch_diff_filter_params.fc_column, + ch_diff_filter_params.fc_threshold, + ch_diff_filter_params.padj_column, + ch_diff_filter_params.padj_threshold ) emit: - results_genewise = ch_results_genewise // channel: [ val(meta), path(results) ] - results_genewise_filtered = CUSTOM_FILTERDIFFERENTIALTABLE.out.filtered // channel: [ val(meta), path(filtered_results) ] - normalised_matrix = ch_normalised_matrix // channel: [ val(meta), path(normalised_matrix) ] - variance_stabilised_matrix = ch_variance_stabilised_matrix // channel: [ val(meta), path(variance_stabilised_matrix) ] (Optional) - model = ch_model // channel: [ val(meta), path(model) ] - versions = ch_versions // channel: [ path(versions.yml) ] + results_genewise = ch_results.map{meta, results -> [meta, results] } + results_genewise_filtered = CUSTOM_FILTERDIFFERENTIALTABLE.out.filtered + normalised_matrix = ch_normalised_matrix + variance_stabilised_matrix = DESEQ2_NORM.out.rlog_counts.mix(DESEQ2_NORM.out.vst_counts) + model = ch_model + versions = ch_versions } diff --git a/subworkflows/nf-core/abundance_differential_filter/meta.yml b/subworkflows/nf-core/abundance_differential_filter/meta.yml index 07c31cca254..8a2063e672e 100644 --- a/subworkflows/nf-core/abundance_differential_filter/meta.yml +++ b/subworkflows/nf-core/abundance_differential_filter/meta.yml @@ -1,83 +1,126 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: "abundance_differential_filter" -description: Perform differential analysis and filtering on abundance data -keywords: - - differential expression - - RNA-seq - - DESeq2 - - limma - - filtering -components: - - deseq2/differential - - limma/differential - - custom/filterdifferentialtable input: - - ch_abundance: - type: file - description: | - Channel with abundance data and metadata - Structure: [ val(meta_exp), path(counts) ] - meta keys: method, args_diff + - ch_input: + description: Channel with input data for differential analysis + structure: + - meta_input: + type: map + description: Metadata map + - counts: + type: file + description: Count matrix file + - analysis_method: + type: value + description: Analysis method (deseq2 or limma) + - fc_threshold: + type: value + description: Fold change threshold for filtering + - padj_threshold: + type: value + description: Adjusted p-value threshold for filtering + - ch_samplesheet: + description: Channel with sample information + structure: + - meta_exp: + type: map + description: Experiment metadata map + - samplesheet: + type: file + description: Sample information file - ch_transcript_lengths: - type: file - description: | - Channel with transcript length information - Structure: [ val(meta_exp), path(transcript_lengths) ] + description: Channel with transcript length information + structure: + - meta_exp: + type: map + description: Experiment metadata map + - transcript_lengths: + type: file + description: Transcript length information file - ch_control_features: - type: file - description: | - Channel with control features information - Structure: [ val(meta_exp), path(control_features) ] - - ch_samplesheet: - type: file - description: | - Channel with sample information - Structure: [ val(meta_exp), path(samplesheet) ] + description: Channel with control features information + structure: + - meta_exp: + type: map + description: Experiment metadata map + - control_features: + type: file + description: Control features information file - ch_contrasts: - type: value - description: | - Channel with contrast information - Structure: [ val(meta_contrast), val(contrast_variable), val(reference), val(target) ] - - differential_method: - type: string - description: | - Method to use for differential analysis. Options: 'limma', 'deseq2' - - FC_threshold: - type: float - description: | - Fold change threshold for filtering differential results - - padj_threshold: - type: float - description: | - Adjusted p-value threshold for filtering differential results + description: Channel with contrast information + structure: + - meta_contrast: + type: map + description: Contrast metadata map + - contrast_variable: + type: value + description: Contrast variable + - reference: + type: value + description: Reference level + - target: + type: value + description: Target level output: + - versions: + description: Channel containing software versions file + structure: + - versions.yml: + type: file + description: File containing versions of the software used - results_genewise: - type: file - description: Unfiltered differential analysis results - pattern: "*.{csv,tsv}" + description: Channel containing unfiltered differential analysis results + structure: + - meta: + type: map + description: Metadata map + - results: + type: file + description: Unfiltered differential analysis results file + pattern: "*.{csv,tsv}" - results_genewise_filtered: - type: file - description: Filtered differential analysis results - pattern: "*.{csv,tsv}" + description: Channel containing filtered differential analysis results + structure: + - meta: + type: map + description: Metadata map + - filtered_results: + type: file + description: Filtered differential analysis results file + pattern: "*.{csv,tsv}" - normalised_matrix: - type: file - description: Normalised count matrix - pattern: "*.{csv,tsv}" + description: Channel containing normalised count matrix + structure: + - meta: + type: map + description: Metadata map + - matrix: + type: file + description: Normalised count matrix file + pattern: "*.{csv,tsv}" - variance_stabilised_matrix: - type: file - description: Variance stabilised count matrix (optional, DESeq2 only) - pattern: "*.{csv,tsv}" + description: Channel containing variance stabilised count matrix (DESeq2 only) + structure: + - meta: + type: map + description: Metadata map + - matrix: + type: file + description: Variance stabilised count matrix file + pattern: "*.{csv,tsv}" - model: - type: file - description: Statistical model object from differential analysis - pattern: "*.rds" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - + description: Channel containing statistical model object from differential analysis + structure: + - meta: + type: map + description: Metadata map + - model: + type: file + description: Statistical model object file + pattern: "*.rds" authors: - "@pinin4fjords" + - "@bjlang" + - "@araiz2001" + - "@suzannejin" maintainers: - "@pinin4fjords" diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_basic.config b/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_basic.config index 0e4e63a13f7..508fa04aedc 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_basic.config +++ b/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_basic.config @@ -1,5 +1,10 @@ process { withName: 'DESEQ2_DIFFERENTIAL' { ext.args = { "--round_digits 5 --blocking_variables $meta.blocking --vs_method rlog" } + ext.prefix = { "${meta.id}_${meta.method}" } + } + + withName: 'DESEQ2_NORM' { + ext.prefix = { "${meta.id}_${meta.method}_voom_norm" } } } diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_limmavoom_basic.config b/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_limmavoom_basic.config new file mode 100644 index 00000000000..a2b6e9efbd9 --- /dev/null +++ b/subworkflows/nf-core/abundance_differential_filter/tests/deseq2_limmavoom_basic.config @@ -0,0 +1,24 @@ +process { + withName: 'DESEQ2_DIFFERENTIAL' { + ext.args = { "--round_digits 5 --blocking_variables $meta.blocking --vs_method rlog" } + ext.prefix = { "${meta.id}_${meta.method}" } + } + + withName: 'DESEQ2_NORM' { + ext.prefix = { "${meta.id}_${meta.method}_norm" } + } + + withName: 'LIMMA_DIFFERENTIAL' { + ext.args = { [ + "--blocking_variables $meta.blocking", + "--sample_id_col sample", + "--probe_id_col gene_id", + "--use_voom TRUE" + ].join(' ').trim() } + ext.prefix = { "${meta.id}_${meta.method}_voom" } + } + + withName: 'LIMMA_NORM' { + ext.prefix = { "${meta.id}_${meta.method}_voom_norm" } + } +} diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/limma_basic_microarray.config b/subworkflows/nf-core/abundance_differential_filter/tests/limma_basic_microarray.config index 98c5e882164..59eddbc362a 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/limma_basic_microarray.config +++ b/subworkflows/nf-core/abundance_differential_filter/tests/limma_basic_microarray.config @@ -1,12 +1,15 @@ process { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: 'LIMMA_DIFFERENTIAL' { ext.args = { [ "--sample_id_col name", "--blocking_variables $meta.blocking" ].join(' ').trim() } + ext.prefix = { "${meta.id}_${meta.method}" } + } + + withName: 'LIMMA_NORM' { + ext.prefix = { "${meta.id}_${meta.method}_norm" } } withName: 'AFFY_JUSTRMA' { diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/limma_voom.config b/subworkflows/nf-core/abundance_differential_filter/tests/limma_voom.config index a1e505570e1..241679da0e5 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/limma_voom.config +++ b/subworkflows/nf-core/abundance_differential_filter/tests/limma_voom.config @@ -1,13 +1,17 @@ process { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: 'LIMMA_DIFFERENTIAL' { ext.args = { [ + "--blocking_variables $meta.blocking", "--sample_id_col sample", "--probe_id_col gene_id", "--use_voom TRUE" ].join(' ').trim() } + + ext.prefix = { "${meta.id}_${meta.method}_voom" } } + withName: 'LIMMA_NORM' { + ext.prefix = { "${meta.id}_${meta.method}_voom_norm" } + } } diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test index 144d61c87a7..26a956b2040 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test +++ b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_workflow { test("deseq2 - mouse - basic") { config './deseq2_basic.config' - + when { workflow { """ @@ -28,24 +28,30 @@ nextflow_workflow { ] // Define inputs - input[0] = Channel.of([ - [ id:'test' ], - file(testData.expression_test_data_dir + testData.abundance_file) - ]) - input[1] = Channel.of([ [], [] ]) - input[2] = Channel.of([ [], [] ]) - input[3] = Channel.of([ + ch_samplesheet = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[4] = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) + ch_transcript_lengths = Channel.of([ [], [] ]) + ch_control_features = Channel.of([ [], [] ]) + ch_contrasts = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) .splitCsv ( header:true, sep:',' ) .map{ tuple(it, it.variable, it.reference, it.target) } - input[5] = 'deseq2' - input[6] = 1.5 - input[7] = 0.05 + ch_input = Channel.of([ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'deseq2', // analysis method + 1.5, // FC threshold + 0.05 // padj threshold + ]) + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts """ } } @@ -66,7 +72,7 @@ nextflow_workflow { test("limma - basic - microarray") { config './limma_basic_microarray.config' - + setup { run("UNTAR") { script "../../../../modules/nf-core/untar/main.nf" @@ -106,20 +112,29 @@ nextflow_workflow { ] // Define inputs - input[0] = AFFY_JUSTRMA.out.expression - input[1] = Channel.of([ [], [] ]) - input[2] = Channel.of([ [], [] ]) - input[3] = Channel.of([ + ch_samplesheet = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[4] = Channel.of(['id': 'diagnosis_normal_uremia', 'variable': 'diagnosis', 'reference': 'normal', 'target': 'uremia']) + ch_transcript_lengths = Channel.of([ [], [] ]) + ch_control_features = Channel.of([ [], [] ]) + ch_contrasts = Channel.of(['id': 'diagnosis_normal_uremia', 'variable': 'diagnosis', 'reference': 'normal', 'target': 'uremia']) .map{ tuple(it, it.variable, it.reference, it.target) } - input[5] = 'limma' - input[6] = 1.5 - input[7] = 0.05 + ch_input = AFFY_JUSTRMA.out.expression.map{ meta, file -> [ + meta, + file, + 'limma', + 1.5, // FC threshold + 0.05 // padj threshold + ]} + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts """ } } @@ -139,7 +154,7 @@ nextflow_workflow { test("limma - voom") { config './limma_voom.config' - + when { workflow { """ @@ -152,30 +167,37 @@ nextflow_workflow { ] // Define inputs - input[0] = Channel.of([ - [ id:'test' ], - file(testData.expression_test_data_dir + testData.abundance_file) - ]) - input[1] = Channel.of([ [], [] ]) - input[2] = Channel.of([ [], [] ]) - input[3] = Channel.of([ + ch_samplesheet = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[4] = Channel.of(['id': 'test', 'variable': 'treatment', 'reference': 'hND6', 'target': 'mCherry']) + ch_transcript_lengths = Channel.of([ [], [] ]) + ch_control_features = Channel.of([ [], [] ]) + ch_contrasts = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) + .splitCsv ( header:true, sep:',' ) .map{ tuple(it, it.variable, it.reference, it.target) } - input[5] = 'limma' - input[6] = 1.5 - input[7] = 0.05 + ch_input = Channel.of([ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'limma', + 1.5, // FC threshold + 0.05 // padj threshold + ]) + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts """ } } then { assertAll( { assert workflow.success }, - { assert path(workflow.out.results_genewise[0][1]).getText().contains("ENSMUSG00000023978\t-2.84055986312942") }, + { assert path(workflow.out.results_genewise[0][1]).getText().contains("ENSMUSG00000023978\t2.84055986312942") }, { assert snapshot( workflow.out.results_genewise_filtered, workflow.out.normalised_matrix, @@ -188,7 +210,7 @@ nextflow_workflow { test("deseq2 - with transcript lengths") { config './deseq2_basic.config' - + when { workflow { """ @@ -202,27 +224,99 @@ nextflow_workflow { ] // Define inputs - input[0] = Channel.of([ - [ id:'test' ], - file(testData.expression_test_data_dir + testData.abundance_file) + ch_samplesheet = Channel.of([ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[1] = Channel.of([ + ch_transcript_lengths = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.lengths_file) ]) - input[2] = Channel.of([ [], [] ]) - input[3] = Channel.of([ + ch_control_features = Channel.of([ [], [] ]) + ch_contrasts = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) + .splitCsv ( header:true, sep:',' ) + .map{ + tuple(it, it.variable, it.reference, it.target) + } + ch_input = Channel.of([ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'deseq2', + 1.5, // FC threshold + 0.05 // padj threshold + ]) + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.results_genewise, + workflow.out.results_genewise_filtered, + workflow.out.normalised_matrix, + workflow.out.variance_stabilised_matrix, + workflow.out.model, + workflow.out.versions + ).match() } + ) + } + } + + test("deseq2 and limma - mouse - basic") { + config './deseq2_limmavoom_basic.config' + + when { + workflow { + """ + // Define test data + def testData = [ + expression_test_data_dir: params.modules_testdata_base_path + 'genomics/mus_musculus/rnaseq_expression/', + contrasts_file: 'SRP254919.contrasts.csv', + abundance_file: 'SRP254919.salmon.merged.gene_counts.top1000cov.tsv', + samplesheet_file: 'SRP254919.samplesheet.csv' + ] + + // Define inputs + ch_samplesheet = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[4] = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) + ch_transcript_lengths = Channel.value([ [], [] ]) + ch_control_features = Channel.value([ [], [] ]) + ch_contrasts = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) .splitCsv ( header:true, sep:',' ) .map{ tuple(it, it.variable, it.reference, it.target) } - input[5] = 'deseq2' - input[6] = 1.5 - input[7] = 0.05 + ch_input = Channel.of( + [ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'limma', + 1.5, // FC threshold + 0.05 // padj threshold + ], + [ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'deseq2', + 1.5, // FC threshold + 0.05 // padj threshold + ] + ) + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts """ } } @@ -243,9 +337,9 @@ nextflow_workflow { test("stub") { config './deseq2_basic.config' - + options "-stub" - + when { workflow { """ @@ -258,24 +352,30 @@ nextflow_workflow { ] // Define inputs - input[0] = Channel.of([ - [ id:'test' ], - file(testData.expression_test_data_dir + testData.abundance_file) - ]) - input[1] = Channel.of([ [], [] ]) - input[2] = Channel.of([ [], [] ]) - input[3] = Channel.of([ + ch_samplesheet = Channel.of([ [ id:'test' ], file(testData.expression_test_data_dir + testData.samplesheet_file) ]) - input[4] = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) + ch_transcript_lengths = Channel.of([ [], [] ]) + ch_control_features = Channel.of([ [], [] ]) + ch_contrasts = Channel.fromPath(file(testData.expression_test_data_dir + testData.contrasts_file)) .splitCsv ( header:true, sep:',' ) .map{ tuple(it, it.variable, it.reference, it.target) } - input[5] = 'deseq2' - input[6] = 1.5 - input[7] = 0.05 + ch_input = Channel.of([ + [ id:'test' ], + file(testData.expression_test_data_dir + testData.abundance_file), + 'deseq2', + 1.5, // FC threshold + 0.05 // padj threshold + ]) + + input[0] = ch_input + input[1] = ch_samplesheet + input[2] = ch_transcript_lengths + input[3] = ch_control_features + input[4] = ch_contrasts """ } } diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap index 5053ea3db63..e296cf3ebbb 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap +++ b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap @@ -4,23 +4,27 @@ [ [ { - "id": "diagnosis_normal_uremia", + "id": "diagnosis_normal_uremia_test", "variable": "diagnosis", "reference": "normal", - "target": "uremia" + "target": "uremia", + "method": "limma" }, - "diagnosis_normal_uremia.limma.results.tsv:md5,4f0944b54b3ab7aa6ded5dd4b4e82802" + "diagnosis_normal_uremia_test_limma.limma.results.tsv:md5,4f0944b54b3ab7aa6ded5dd4b4e82802" ] ], [ [ { - "id": "diagnosis_normal_uremia", + "id": "diagnosis_normal_uremia_test", "variable": "diagnosis", "reference": "normal", - "target": "uremia" + "target": "uremia", + "method": "limma", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "diagnosis_normal_uremia_filtered.tsv:md5,a971455ece4ae3c3ab902407b36fc6a5" + "diagnosis_normal_uremia_test_filtered.tsv:md5,a971455ece4ae3c3ab902407b36fc6a5" ] ], [ @@ -29,12 +33,13 @@ [ [ { - "id": "diagnosis_normal_uremia", + "id": "diagnosis_normal_uremia_test", "variable": "diagnosis", "reference": "normal", - "target": "uremia" + "target": "uremia", + "method": "limma" }, - "diagnosis_normal_uremia.limma.model.txt:md5,70b000f632b8bdba4917046362dd876b" + "diagnosis_normal_uremia_test_limma.limma.model.txt:md5,70b000f632b8bdba4917046362dd876b" ] ], [ @@ -42,55 +47,286 @@ ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-11-13T09:33:03.414506" + "timestamp": "2024-12-07T16:33:03.091762783" + }, + "deseq2 and limma - mouse - basic": { + "content": [ + [ + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2.deseq2.results.tsv:md5,791cdba2615a445cded13cae95df73ef" + ], + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma" + }, + "treatment_mCherry_hND6__test_limma_voom.limma.results.tsv:md5,ff36827b7869a8a3c3c905efedcafc93" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2" + }, + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.results.tsv:md5,2438053a4bdc869f467a12d3c22c7ba7" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "limma" + }, + "treatment_mCherry_hND6_sample_number_test_limma_voom.limma.results.tsv:md5,5f34e79dbcb5ba1908d797548921d7fc" + ] + ], + [ + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6__test_filtered.tsv:md5,7829ead408f4c9cad4277598a231c494" + ], + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6__test_filtered.tsv:md5,0bfc9215edc6aad064c3ce6abc81bfce" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,8b084475c9e7e1b34a510a73b613ff39" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "limma", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,0bfc9215edc6aad064c3ce6abc81bfce" + ] + ], + [ + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2_norm.normalised_counts.tsv:md5,46ab7200c626649ab6256ed797ef5071" + ], + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma" + }, + "treatment_mCherry_hND6__test_limma_voom_norm.normalised_counts.tsv:md5,2aa4880ba5ae246a728b25f4316ca2ca" + ] + ], + [ + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2_norm.rlog.tsv:md5,b1adc1fba6bd0c8b55973608f4b97030" + ] + ], + [ + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2.deseq2.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + ], + [ + { + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma" + }, + "treatment_mCherry_hND6__test_limma_voom.limma.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2" + }, + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.model.txt:md5,fa05126a58cb67c107d45426b0bdea83" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "limma" + }, + "treatment_mCherry_hND6_sample_number_test_limma_voom.limma.model.txt:md5,3b96713b4e3f027b0347859f02a9038d" + ] + ], + [ + "versions.yml:md5,1ddaab440e2528c688c05a02dd066f12", + "versions.yml:md5,1ddaab440e2528c688c05a02dd066f12", + "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5", + "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-07T16:34:54.548033825" }, "limma - voom": { "content": [ [ [ { - "id": "test", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6__test_filtered.tsv:md5,0bfc9215edc6aad064c3ce6abc81bfce" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", - "reference": "hND6", - "target": "mCherry" + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "limma", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "test_filtered.tsv:md5,0bfc9215edc6aad064c3ce6abc81bfce" + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,0bfc9215edc6aad064c3ce6abc81bfce" ] ], [ [ { - "id": "test", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", - "reference": "hND6", - "target": "mCherry" + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma" }, - "test.normalised_counts.tsv:md5,2aa4880ba5ae246a728b25f4316ca2ca" + "treatment_mCherry_hND6__test_limma_voom_norm.normalised_counts.tsv:md5,2aa4880ba5ae246a728b25f4316ca2ca" ] ], [ [ { - "id": "test", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", - "reference": "hND6", - "target": "mCherry" + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "limma" }, - "test.limma.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + "treatment_mCherry_hND6__test_limma_voom.limma.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "limma" + }, + "treatment_mCherry_hND6_sample_number_test_limma_voom.limma.model.txt:md5,3b96713b4e3f027b0347859f02a9038d" ] ], [ + "versions.yml:md5,1ddaab440e2528c688c05a02dd066f12", "versions.yml:md5,1ddaab440e2528c688c05a02dd066f12" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-11-12T12:09:18.770313" + "timestamp": "2024-12-07T16:33:26.97858478" }, "stub": { "content": [ @@ -98,279 +334,451 @@ "0": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6_sample_number_test.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "treatment_mCherry_hND6__filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test_filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.normalised_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test.normalised_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "3": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.rlog.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test.rlog.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "4": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2" + }, + "treatment_mCherry_hND6_sample_number_test.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "5": [ + "versions.yml:md5,05e3901f6d78f8839a7e07f422e9bc03", "versions.yml:md5,05e3901f6d78f8839a7e07f422e9bc03" ], "model": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6_sample_number_test.deseq2.model.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "normalised_matrix": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.normalised_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test.normalised_counts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "results_genewise": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6_sample_number_test.deseq2.results.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "results_genewise_filtered": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "treatment_mCherry_hND6__filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test_filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "variance_stabilised_matrix": [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.rlog.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "treatment_mCherry_hND6__test.rlog.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ + "versions.yml:md5,05e3901f6d78f8839a7e07f422e9bc03", "versions.yml:md5,05e3901f6d78f8839a7e07f422e9bc03" ] } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-11-12T12:09:58.505823" + "timestamp": "2024-12-07T16:35:23.476681768" }, "deseq2 - mouse - basic": { "content": [ [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2.deseq2.results.tsv:md5,791cdba2615a445cded13cae95df73ef" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.results.tsv:md5,791cdba2615a445cded13cae95df73ef" + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.results.tsv:md5,2438053a4bdc869f467a12d3c22c7ba7" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6__test_filtered.tsv:md5,7829ead408f4c9cad4277598a231c494" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "treatment_mCherry_hND6__filtered.tsv:md5,7829ead408f4c9cad4277598a231c494" + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,8b084475c9e7e1b34a510a73b613ff39" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.normalised_counts.tsv:md5,46ab7200c626649ab6256ed797ef5071" + "treatment_mCherry_hND6__test_deseq2_voom_norm.normalised_counts.tsv:md5,46ab7200c626649ab6256ed797ef5071" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.rlog.tsv:md5,b1adc1fba6bd0c8b55973608f4b97030" + "treatment_mCherry_hND6__test_deseq2_voom_norm.rlog.tsv:md5,b1adc1fba6bd0c8b55973608f4b97030" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + "treatment_mCherry_hND6__test_deseq2.deseq2.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2" + }, + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.model.txt:md5,fa05126a58cb67c107d45426b0bdea83" ] ], [ + "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5", "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-11-12T12:08:02.729948" + "timestamp": "2024-12-07T16:32:17.301539736" }, "deseq2 - with transcript lengths": { "content": [ [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2.deseq2.results.tsv:md5,944176b73455aa7c8de3ec32c03edef6" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.results.tsv:md5,944176b73455aa7c8de3ec32c03edef6" + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.results.tsv:md5,6a9bc76c9d54034c90fa159372f97516" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 }, - "treatment_mCherry_hND6__filtered.tsv:md5,a48241fb5f24d961d3cce208f060b624" + "treatment_mCherry_hND6__test_filtered.tsv:md5,a48241fb5f24d961d3cce208f060b624" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "sample_number", + "method": "deseq2", + "fc_threshold": 1.5, + "padj_threshold": 0.05 + }, + "treatment_mCherry_hND6_sample_number_test_filtered.tsv:md5,04d6911dce789f284c929694aa3d99b0" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.normalised_counts.tsv:md5,7050f44c460cc13e3f101d048d503527" + "treatment_mCherry_hND6__test_deseq2_voom_norm.normalised_counts.tsv:md5,7050f44c460cc13e3f101d048d503527" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "", + "method": "deseq2" }, - "treatment_mCherry_hND6_.rlog.tsv:md5,22a4b117246b2317e0f4daf7919703f2" + "treatment_mCherry_hND6__test_deseq2_voom_norm.rlog.tsv:md5,22a4b117246b2317e0f4daf7919703f2" ] ], [ [ { - "id": "treatment_mCherry_hND6_", + "id": "treatment_mCherry_hND6__test", + "variable": "treatment", + "reference": "mCherry", + "target": "hND6", + "blocking": "", + "method": "deseq2" + }, + "treatment_mCherry_hND6__test_deseq2.deseq2.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + ], + [ + { + "id": "treatment_mCherry_hND6_sample_number_test", "variable": "treatment", "reference": "mCherry", "target": "hND6", - "blocking": "" + "blocking": "sample_number", + "method": "deseq2" }, - "treatment_mCherry_hND6_.deseq2.model.txt:md5,d2113d82b76046c319e6602da2ad74d6" + "treatment_mCherry_hND6_sample_number_test_deseq2.deseq2.model.txt:md5,fa05126a58cb67c107d45426b0bdea83" ] ], [ + "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5", "versions.yml:md5,2c0576aefff8da32c7c0cfd8529aa4b5" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-11-12T12:09:42.281946" + "timestamp": "2024-12-07T16:34:05.584119298" } } \ No newline at end of file