diff --git a/modules/nf-core/genomad/download/environment.yml b/modules/nf-core/genomad/download/environment.yml index eacd45d0f81..5c9b27a8405 100644 --- a/modules/nf-core/genomad/download/environment.yml +++ b/modules/nf-core/genomad/download/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::genomad=1.5.2 + - bioconda::genomad=1.7.4 diff --git a/modules/nf-core/genomad/download/main.nf b/modules/nf-core/genomad/download/main.nf index 7e7b12ed437..d5717e390ad 100644 --- a/modules/nf-core/genomad/download/main.nf +++ b/modules/nf-core/genomad/download/main.nf @@ -3,8 +3,8 @@ process GENOMAD_DOWNLOAD { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genomad:1.5.2--pyhdfd78af_0': - 'biocontainers/genomad:1.5.2--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genomad:1.7.4--pyhdfd78af_0': + 'biocontainers/genomad:1.7.4--pyhdfd78af_0' }" output: path "genomad_db/" , emit: genomad_db diff --git a/modules/nf-core/genomad/download/meta.yml b/modules/nf-core/genomad/download/meta.yml index 6a527eb55de..5df21ee6a80 100644 --- a/modules/nf-core/genomad/download/meta.yml +++ b/modules/nf-core/genomad/download/meta.yml @@ -15,7 +15,7 @@ tools: documentation: https://portal.nersc.gov/genomad/ tool_dev_url: https://github.com/apcamargo/genomad/ doi: 10.1101/2023.03.05.531206 - licence: "['Lawrence Berkeley National Labs BSD variant license']" + licence: ["Lawrence Berkeley National Labs BSD variant license"] output: - versions: type: file diff --git a/modules/nf-core/genomad/download/tests/main.nf.test b/modules/nf-core/genomad/download/tests/main.nf.test new file mode 100644 index 00000000000..18456f6119b --- /dev/null +++ b/modules/nf-core/genomad/download/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process GENOMAD_DOWNLOAD" + script "../main.nf" + process "GENOMAD_DOWNLOAD" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "genomad" + tag "genomad/download" + + test("No input") { + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("No input - stub") { + + options "-stub" + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/genomad/download/tests/main.nf.test.snap b/modules/nf-core/genomad/download/tests/main.nf.test.snap new file mode 100644 index 00000000000..320bef8832b --- /dev/null +++ b/modules/nf-core/genomad/download/tests/main.nf.test.snap @@ -0,0 +1,190 @@ +{ + "No input - stub": { + "content": [ + { + "0": [ + [ + "genomad_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_mapping:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_taxonomy:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_marker_metadata.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_mapping:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_taxonomy:md5,d41d8cd98f00b204e9800998ecf8427e", + "mini_set_ids:md5,d41d8cd98f00b204e9800998ecf8427e", + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "plasmid_hallmark_annotation.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "version.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "virus_hallmark_annotation.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,e98d6885d0b88a7a71f288fcff0b7b14" + ], + "genomad_db": [ + [ + "genomad_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_mapping:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_db_taxonomy:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_integrase_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_marker_metadata.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.lookup:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db.source:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h.dbtype:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_h.index:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_mapping:md5,d41d8cd98f00b204e9800998ecf8427e", + "genomad_mini_db_taxonomy:md5,d41d8cd98f00b204e9800998ecf8427e", + "mini_set_ids:md5,d41d8cd98f00b204e9800998ecf8427e", + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "plasmid_hallmark_annotation.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "version.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "virus_hallmark_annotation.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e98d6885d0b88a7a71f288fcff0b7b14" + ] + } + ], + "timestamp": "2024-01-03T17:41:56.803756044" + }, + "No input": { + "content": [ + { + "0": [ + [ + [ + "version-checkpoint.txt:md5,6527da533ace4cb4473cc907f265f170" + ], + "genomad_db:md5,b9ce17f8b01203c37a9147b5294dace6", + "genomad_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_db.index:md5,5693ab7d5fe2c7947a9a43a9b5705f55", + "genomad_db.lookup:md5,973c8434e0cf70593af1f888c4424876", + "genomad_db.source:md5,6805958c7c99a8e8ab38095a40dc0081", + "genomad_db_h:md5,1325d5db1da081c479a455a3e7440ae4", + "genomad_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_db_h.index:md5,8c14ed8d3b520be4cd22340a250d26bf", + "genomad_db_mapping:md5,2e10dbb66f99183ff42092777a8089ca", + "genomad_db_taxonomy:md5,5abcff23ab2efa5f5dcfc37cc55ccbbc", + "genomad_integrase_db:md5,23e19f271d2d65261588821a1e7d2b30", + "genomad_integrase_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_integrase_db.index:md5,7bae797a783d3f12c75845130ccb9b8a", + "genomad_integrase_db.lookup:md5,cc0702fcafb9a0b27992fd54fc699d25", + "genomad_integrase_db.source:md5,b6ff391f60a2d9d615c7eb41fbf01c19", + "genomad_integrase_db_h:md5,118e59c1b7bbbdfa6776c17da3db430b", + "genomad_integrase_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_integrase_db_h.index:md5,2e8987568dae1a3f4c0207657fd84205", + "genomad_marker_metadata.tsv:md5,fcf64cdbfcd0e099b44143ff99133fed", + "genomad_mini_db:md5,b9ce17f8b01203c37a9147b5294dace6", + "genomad_mini_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_mini_db.index:md5,e62e3de510ea7f5e73038f51ab02330f", + "genomad_mini_db.lookup:md5,973c8434e0cf70593af1f888c4424876", + "genomad_mini_db.source:md5,6805958c7c99a8e8ab38095a40dc0081", + "genomad_mini_db_h:md5,1325d5db1da081c479a455a3e7440ae4", + "genomad_mini_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_mini_db_h.index:md5,8c14ed8d3b520be4cd22340a250d26bf", + "genomad_mini_db_mapping:md5,2e10dbb66f99183ff42092777a8089ca", + "genomad_mini_db_taxonomy:md5,5abcff23ab2efa5f5dcfc37cc55ccbbc", + "mini_set_ids:md5,9cc65ecf08bba29cd75e436b18f49e4b", + "names.dmp:md5,83f879df06a69bf16687b5de575ed5ba", + "nodes.dmp:md5,ee4db67cdcf75a5bba6a17b83e57425d", + "plasmid_hallmark_annotation.txt:md5,b4c2568e65b1b8dc9b6f4e506b8ad402", + "version.txt:md5,55a9f2aa32fbd44a46f3b190efa91312", + "virus_hallmark_annotation.txt:md5,351e10e8593afa69d881b7a0128887e9" + ] + ], + "1": [ + "versions.yml:md5,e98d6885d0b88a7a71f288fcff0b7b14" + ], + "genomad_db": [ + [ + [ + "version-checkpoint.txt:md5,6527da533ace4cb4473cc907f265f170" + ], + "genomad_db:md5,b9ce17f8b01203c37a9147b5294dace6", + "genomad_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_db.index:md5,5693ab7d5fe2c7947a9a43a9b5705f55", + "genomad_db.lookup:md5,973c8434e0cf70593af1f888c4424876", + "genomad_db.source:md5,6805958c7c99a8e8ab38095a40dc0081", + "genomad_db_h:md5,1325d5db1da081c479a455a3e7440ae4", + "genomad_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_db_h.index:md5,8c14ed8d3b520be4cd22340a250d26bf", + "genomad_db_mapping:md5,2e10dbb66f99183ff42092777a8089ca", + "genomad_db_taxonomy:md5,5abcff23ab2efa5f5dcfc37cc55ccbbc", + "genomad_integrase_db:md5,23e19f271d2d65261588821a1e7d2b30", + "genomad_integrase_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_integrase_db.index:md5,7bae797a783d3f12c75845130ccb9b8a", + "genomad_integrase_db.lookup:md5,cc0702fcafb9a0b27992fd54fc699d25", + "genomad_integrase_db.source:md5,b6ff391f60a2d9d615c7eb41fbf01c19", + "genomad_integrase_db_h:md5,118e59c1b7bbbdfa6776c17da3db430b", + "genomad_integrase_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_integrase_db_h.index:md5,2e8987568dae1a3f4c0207657fd84205", + "genomad_marker_metadata.tsv:md5,fcf64cdbfcd0e099b44143ff99133fed", + "genomad_mini_db:md5,b9ce17f8b01203c37a9147b5294dace6", + "genomad_mini_db.dbtype:md5,f2dd0dedb2c260419ece4a9e03b2e828", + "genomad_mini_db.index:md5,e62e3de510ea7f5e73038f51ab02330f", + "genomad_mini_db.lookup:md5,973c8434e0cf70593af1f888c4424876", + "genomad_mini_db.source:md5,6805958c7c99a8e8ab38095a40dc0081", + "genomad_mini_db_h:md5,1325d5db1da081c479a455a3e7440ae4", + "genomad_mini_db_h.dbtype:md5,740bab4f9ec8808aedb68d6b1281aeb2", + "genomad_mini_db_h.index:md5,8c14ed8d3b520be4cd22340a250d26bf", + "genomad_mini_db_mapping:md5,2e10dbb66f99183ff42092777a8089ca", + "genomad_mini_db_taxonomy:md5,5abcff23ab2efa5f5dcfc37cc55ccbbc", + "mini_set_ids:md5,9cc65ecf08bba29cd75e436b18f49e4b", + "names.dmp:md5,83f879df06a69bf16687b5de575ed5ba", + "nodes.dmp:md5,ee4db67cdcf75a5bba6a17b83e57425d", + "plasmid_hallmark_annotation.txt:md5,b4c2568e65b1b8dc9b6f4e506b8ad402", + "version.txt:md5,55a9f2aa32fbd44a46f3b190efa91312", + "virus_hallmark_annotation.txt:md5,351e10e8593afa69d881b7a0128887e9" + ] + ], + "versions": [ + "versions.yml:md5,e98d6885d0b88a7a71f288fcff0b7b14" + ] + } + ], + "timestamp": "2024-01-03T17:38:10.13471002" + } +} \ No newline at end of file diff --git a/modules/nf-core/genomad/download/tests/nextflow.config b/modules/nf-core/genomad/download/tests/nextflow.config new file mode 100644 index 00000000000..3ae5aa12459 --- /dev/null +++ b/modules/nf-core/genomad/download/tests/nextflow.config @@ -0,0 +1,2 @@ +docker.fixOwnership = false +docker.runOptions = '-u $(id -u):$(id -g)' diff --git a/modules/nf-core/genomad/download/tests/tags.yml b/modules/nf-core/genomad/download/tests/tags.yml new file mode 100644 index 00000000000..27b7acb6e75 --- /dev/null +++ b/modules/nf-core/genomad/download/tests/tags.yml @@ -0,0 +1,2 @@ +genomad/download: + - "modules/nf-core/genomad/download/**" diff --git a/modules/nf-core/genomad/endtoend/environment.yml b/modules/nf-core/genomad/endtoend/environment.yml index 11e50f7945e..6ec4ebe9714 100644 --- a/modules/nf-core/genomad/endtoend/environment.yml +++ b/modules/nf-core/genomad/endtoend/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::genomad=1.5.2 + - bioconda::genomad=1.7.4 diff --git a/modules/nf-core/genomad/endtoend/main.nf b/modules/nf-core/genomad/endtoend/main.nf index 81bb944ae0e..00918a1383d 100644 --- a/modules/nf-core/genomad/endtoend/main.nf +++ b/modules/nf-core/genomad/endtoend/main.nf @@ -4,26 +4,26 @@ process GENOMAD_ENDTOEND { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genomad:1.5.2--pyhdfd78af_0': - 'biocontainers/genomad:1.5.2--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genomad:1.7.4--pyhdfd78af_0': + 'biocontainers/genomad:1.7.4--pyhdfd78af_0' }" input: tuple val(meta) , path(fasta) path genomad_db output: - tuple val(meta), path("*_aggregated_classification/*_aggregated_classification.tsv") , emit: aggregated_classification + tuple val(meta), path("*_aggregated_classification/*_aggregated_classification.tsv") , emit: aggregated_classification , optional: true tuple val(meta), path("*_annotate/*_taxonomy.tsv") , emit: taxonomy tuple val(meta), path("*_find_proviruses/*_provirus.tsv") , emit: provirus tuple val(meta), path("*_score_calibration/*_compositions.tsv") , emit: compositions , optional: true tuple val(meta), path("*_score_calibration/*_calibrated_aggregated_classification.tsv") , emit: calibrated_classification , optional: true - tuple val(meta), path("*_summary/*_plasmid.fna") , emit: plasmid_fasta + tuple val(meta), path("*_summary/*_plasmid.fna.gz") , emit: plasmid_fasta tuple val(meta), path("*_summary/*_plasmid_genes.tsv") , emit: plasmid_genes - tuple val(meta), path("*_summary/*_plasmid_proteins.faa") , emit: plasmid_proteins + tuple val(meta), path("*_summary/*_plasmid_proteins.faa.gz") , emit: plasmid_proteins tuple val(meta), path("*_summary/*_plasmid_summary.tsv") , emit: plasmid_summary - tuple val(meta), path("*_summary/*_virus.fna") , emit: virus_fasta + tuple val(meta), path("*_summary/*_virus.fna.gz") , emit: virus_fasta tuple val(meta), path("*_summary/*_virus_genes.tsv") , emit: virus_genes - tuple val(meta), path("*_summary/*_virus_proteins.faa") , emit: virus_proteins + tuple val(meta), path("*_summary/*_virus_proteins.faa.gz") , emit: virus_proteins tuple val(meta), path("*_summary/*_virus_summary.tsv") , emit: virus_summary path "versions.yml" , emit: versions @@ -42,6 +42,9 @@ process GENOMAD_ENDTOEND { --threads $task.cpus \\ $args + gzip ./**/*.fna + gzip ./**/*.faa + cat <<-END_VERSIONS > versions.yml "${task.process}": genomad: \$(echo \$(genomad --version 2>&1) | sed 's/^.*geNomad, version //; s/ .*\$//') @@ -65,13 +68,13 @@ process GENOMAD_ENDTOEND { touch ${filename}_score_calibration/${filename}_calibrated_aggregated_classification.tsv touch ${filename}_score_calibration/${filename}_compositions.tsv mkdir ${filename}_summary - touch ${filename}_summary/${filename}_plasmid.fna + touch ${filename}_summary/${filename}_plasmid.fna.gz touch ${filename}_summary/${filename}_plasmid_genes.tsv - touch ${filename}_summary/${filename}_plasmid_proteins.faa + touch ${filename}_summary/${filename}_plasmid_proteins.faa.gz touch ${filename}_summary/${filename}_plasmid_summary.tsv - touch ${filename}_summary/${filename}_virus.fna + touch ${filename}_summary/${filename}_virus.fna.gz touch ${filename}_summary/${filename}_virus_genes.tsv - touch ${filename}_summary/${filename}_virus_proteins.faa + touch ${filename}_summary/${filename}_virus_proteins.faa.gz touch ${filename}_summary/${filename}_virus_summary.tsv cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/genomad/endtoend/meta.yml b/modules/nf-core/genomad/endtoend/meta.yml index 8868bfbe2f6..044496cdf1d 100644 --- a/modules/nf-core/genomad/endtoend/meta.yml +++ b/modules/nf-core/genomad/endtoend/meta.yml @@ -15,7 +15,7 @@ tools: documentation: https://portal.nersc.gov/genomad/ tool_dev_url: https://github.com/apcamargo/genomad/ doi: 10.1101/2023.03.05.531206 - licence: "['Lawrence Berkeley National Labs BSD variant license']" + licence: ["Lawrence Berkeley National Labs BSD variant license"] input: - meta: type: map diff --git a/modules/nf-core/genomad/endtoend/tests/main.nf.test b/modules/nf-core/genomad/endtoend/tests/main.nf.test new file mode 100644 index 00000000000..55c6771f9b1 --- /dev/null +++ b/modules/nf-core/genomad/endtoend/tests/main.nf.test @@ -0,0 +1,83 @@ +nextflow_process { + + name "Test Process GENOMAD_ENDTOEND" + script "../main.nf" + process "GENOMAD_ENDTOEND" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "genomad" + tag "genomad/download" + tag "genomad/endtoend" + + test("sarscov2 - genome - fasta") { + setup { + run("GENOMAD_DOWNLOAD") { + script "../../download/main.nf" + } + } + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[1] = GENOMAD_DOWNLOAD.out.genomad_db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.aggregated_classification, + process.out.taxonomy, + process.out.provirus, + process.out.compositions, + process.out.calibrated_classification, + process.out.plasmid_genes, + process.out.virus_fasta, + process.out.virus_genes, + process.out.virus_proteins, + process.out.virus_summary, + process.out.versions, + ).match() + }, + { assert file(process.out.plasmid_fasta.get(0).get(1)).exists() }, + { assert file(process.out.plasmid_proteins.get(0).get(1)).exists() } + ) + } + } + + test("sarscov2 - genome - fasta - stub") { + + setup { + run("GENOMAD_DOWNLOAD") { + script "../../download/main.nf" + } + } + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[1] = GENOMAD_DOWNLOAD.out.genomad_db + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/genomad/endtoend/tests/main.nf.test.snap b/modules/nf-core/genomad/endtoend/tests/main.nf.test.snap new file mode 100644 index 00000000000..00c02faaf08 --- /dev/null +++ b/modules/nf-core/genomad/endtoend/tests/main.nf.test.snap @@ -0,0 +1,281 @@ +{ + "sarscov2 - genome - fasta": { + "content": [ + [ + + ], + [ + [ + { + "id": "test" + }, + "genome_taxonomy.tsv:md5,44c6cf5ff4c836f66648457ae8deb0d5" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_provirus.tsv:md5,93a6bca59b0bf7f57c0b9b60d2e57082" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_compositions.tsv:md5,9168bea9fe82a979a698d259e1bb906a" + ] + ], + [ + + ], + [ + [ + { + "id": "test" + }, + "genome_plasmid_genes.tsv:md5,55818cae5a57381b77778076e99605e6" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_virus.fna.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_virus_genes.tsv:md5,f84d8a9fce3c92c49e78672bea16561f" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_virus_proteins.faa.gz:md5,6850bd46dcb921e5cfb23bfbb8fcc12b" + ] + ], + [ + [ + { + "id": "test" + }, + "genome_virus_summary.tsv:md5,8cbcf95c2ab397da26b6dca8014e86f4" + ] + ], + [ + "versions.yml:md5,cebe18512f616530fff490a64e595cb6" + ] + ], + "timestamp": "2024-01-03T00:05:48.225084591" + }, + "sarscov2 - genome - fasta - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test" + }, + "genome_taxonomy.tsv:md5,44c6cf5ff4c836f66648457ae8deb0d5" + ] + ], + "10": [ + [ + { + "id": "test" + }, + "genome_virus_genes.tsv:md5,f84d8a9fce3c92c49e78672bea16561f" + ] + ], + "11": [ + [ + { + "id": "test" + }, + "genome_virus_proteins.faa.gz:md5,6850bd46dcb921e5cfb23bfbb8fcc12b" + ] + ], + "12": [ + [ + { + "id": "test" + }, + "genome_virus_summary.tsv:md5,8cbcf95c2ab397da26b6dca8014e86f4" + ] + ], + "13": [ + "versions.yml:md5,cebe18512f616530fff490a64e595cb6" + ], + "2": [ + [ + { + "id": "test" + }, + "genome_provirus.tsv:md5,93a6bca59b0bf7f57c0b9b60d2e57082" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "genome_compositions.tsv:md5,9168bea9fe82a979a698d259e1bb906a" + ] + ], + "4": [ + + ], + "5": [ + [ + { + "id": "test" + }, + "genome_plasmid.fna.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test" + }, + "genome_plasmid_genes.tsv:md5,55818cae5a57381b77778076e99605e6" + ] + ], + "7": [ + [ + { + "id": "test" + }, + "genome_plasmid_proteins.faa.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test" + }, + "genome_plasmid_summary.tsv:md5,8c4ddaa8a90da779c11537be0fddb799" + ] + ], + "9": [ + [ + { + "id": "test" + }, + "genome_virus.fna.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "aggregated_classification": [ + + ], + "calibrated_classification": [ + + ], + "compositions": [ + [ + { + "id": "test" + }, + "genome_compositions.tsv:md5,9168bea9fe82a979a698d259e1bb906a" + ] + ], + "plasmid_fasta": [ + [ + { + "id": "test" + }, + "genome_plasmid.fna.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "plasmid_genes": [ + [ + { + "id": "test" + }, + "genome_plasmid_genes.tsv:md5,55818cae5a57381b77778076e99605e6" + ] + ], + "plasmid_proteins": [ + [ + { + "id": "test" + }, + "genome_plasmid_proteins.faa.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "plasmid_summary": [ + [ + { + "id": "test" + }, + "genome_plasmid_summary.tsv:md5,8c4ddaa8a90da779c11537be0fddb799" + ] + ], + "provirus": [ + [ + { + "id": "test" + }, + "genome_provirus.tsv:md5,93a6bca59b0bf7f57c0b9b60d2e57082" + ] + ], + "taxonomy": [ + [ + { + "id": "test" + }, + "genome_taxonomy.tsv:md5,44c6cf5ff4c836f66648457ae8deb0d5" + ] + ], + "versions": [ + "versions.yml:md5,cebe18512f616530fff490a64e595cb6" + ], + "virus_fasta": [ + [ + { + "id": "test" + }, + "genome_virus.fna.gz:md5,483f4a5dfe60171c86ee9b7e6dff908b" + ] + ], + "virus_genes": [ + [ + { + "id": "test" + }, + "genome_virus_genes.tsv:md5,f84d8a9fce3c92c49e78672bea16561f" + ] + ], + "virus_proteins": [ + [ + { + "id": "test" + }, + "genome_virus_proteins.faa.gz:md5,6850bd46dcb921e5cfb23bfbb8fcc12b" + ] + ], + "virus_summary": [ + [ + { + "id": "test" + }, + "genome_virus_summary.tsv:md5,8cbcf95c2ab397da26b6dca8014e86f4" + ] + ] + } + ], + "timestamp": "2024-01-03T00:07:52.60021527" + } +} \ No newline at end of file diff --git a/modules/nf-core/genomad/endtoend/tests/nextflow.config b/modules/nf-core/genomad/endtoend/tests/nextflow.config new file mode 100644 index 00000000000..149f4a4f819 --- /dev/null +++ b/modules/nf-core/genomad/endtoend/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GENOMAD_ENDTOEND { + ext.args = '--splits 6 --enable-score-calibration --sensitivity 0.1 --disable-nn-classification' + } +} diff --git a/modules/nf-core/genomad/endtoend/tests/tags.yml b/modules/nf-core/genomad/endtoend/tests/tags.yml new file mode 100644 index 00000000000..497ed727ba3 --- /dev/null +++ b/modules/nf-core/genomad/endtoend/tests/tags.yml @@ -0,0 +1,2 @@ +genomad/endtoend: + - "modules/nf-core/genomad/endtoend/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index d37a2629232..3dab96d77b1 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -975,12 +975,6 @@ genmod/models: genmod/score: - modules/nf-core/genmod/score/** - tests/modules/nf-core/genmod/score/** -genomad/download: - - modules/nf-core/genomad/download/** - - tests/modules/nf-core/genomad/download/** -genomad/endtoend: - - modules/nf-core/genomad/endtoend/** - - tests/modules/nf-core/genomad/endtoend/** genomescope2: - modules/nf-core/genomescope2/** - tests/modules/nf-core/genomescope2/** diff --git a/tests/modules/nf-core/genomad/download/main.nf b/tests/modules/nf-core/genomad/download/main.nf deleted file mode 100644 index c14b1003d32..00000000000 --- a/tests/modules/nf-core/genomad/download/main.nf +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GENOMAD_DOWNLOAD } from '../../../../../modules/nf-core/genomad/download/main.nf' - -workflow test_genomad_download { - - GENOMAD_DOWNLOAD ( ) -} diff --git a/tests/modules/nf-core/genomad/download/nextflow.config b/tests/modules/nf-core/genomad/download/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/genomad/download/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/genomad/download/test.yml b/tests/modules/nf-core/genomad/download/test.yml deleted file mode 100644 index f134e5055b5..00000000000 --- a/tests/modules/nf-core/genomad/download/test.yml +++ /dev/null @@ -1,120 +0,0 @@ -- name: genomad download test_genomad_download - command: nextflow run ./tests/modules/nf-core/genomad/download -entry test_genomad_download -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genomad/download/nextflow.config - tags: - - genomad - - genomad/download - files: - - path: output/genomad/genomad_db/genomad_db - md5sum: b9ce17f8b01203c37a9147b5294dace6 - - path: output/genomad/genomad_db/genomad_db.dbtype - md5sum: f2dd0dedb2c260419ece4a9e03b2e828 - - path: output/genomad/genomad_db/genomad_db.index - md5sum: 5693ab7d5fe2c7947a9a43a9b5705f55 - - path: output/genomad/genomad_db/genomad_db.lookup - md5sum: 973c8434e0cf70593af1f888c4424876 - - path: output/genomad/genomad_db/genomad_db.source - md5sum: 6805958c7c99a8e8ab38095a40dc0081 - - path: output/genomad/genomad_db/genomad_db_h - md5sum: 1325d5db1da081c479a455a3e7440ae4 - - path: output/genomad/genomad_db/genomad_db_h.dbtype - md5sum: 740bab4f9ec8808aedb68d6b1281aeb2 - - path: output/genomad/genomad_db/genomad_db_h.index - md5sum: 8c14ed8d3b520be4cd22340a250d26bf - - path: output/genomad/genomad_db/genomad_db_mapping - md5sum: e56fa490b1050a8a3e82119976918e60 - - path: output/genomad/genomad_db/genomad_db_taxonomy - md5sum: bf46bbcd28214cb34aa9ef6c891b7114 - - path: output/genomad/genomad_db/genomad_integrase_db - md5sum: 23e19f271d2d65261588821a1e7d2b30 - - path: output/genomad/genomad_db/genomad_integrase_db.dbtype - md5sum: f2dd0dedb2c260419ece4a9e03b2e828 - - path: output/genomad/genomad_db/genomad_integrase_db.index - md5sum: 7bae797a783d3f12c75845130ccb9b8a - - path: output/genomad/genomad_db/genomad_integrase_db.lookup - md5sum: cc0702fcafb9a0b27992fd54fc699d25 - - path: output/genomad/genomad_db/genomad_integrase_db.source - md5sum: b6ff391f60a2d9d615c7eb41fbf01c19 - - path: output/genomad/genomad_db/genomad_integrase_db_h - md5sum: 118e59c1b7bbbdfa6776c17da3db430b - - path: output/genomad/genomad_db/genomad_integrase_db_h.dbtype - md5sum: 740bab4f9ec8808aedb68d6b1281aeb2 - - path: output/genomad/genomad_db/genomad_integrase_db_h.index - md5sum: 2e8987568dae1a3f4c0207657fd84205 - - path: output/genomad/genomad_db/genomad_marker_metadata.tsv - md5sum: e7f98a16fee1e71498384ca9b2492eeb - - path: output/genomad/genomad_db/genomad_mini_db - md5sum: b9ce17f8b01203c37a9147b5294dace6 - - path: output/genomad/genomad_db/genomad_mini_db.dbtype - md5sum: f2dd0dedb2c260419ece4a9e03b2e828 - - path: output/genomad/genomad_db/genomad_mini_db.index - md5sum: e62e3de510ea7f5e73038f51ab02330f - - path: output/genomad/genomad_db/genomad_mini_db.lookup - md5sum: 973c8434e0cf70593af1f888c4424876 - - path: output/genomad/genomad_db/genomad_mini_db.source - md5sum: 6805958c7c99a8e8ab38095a40dc0081 - - path: output/genomad/genomad_db/genomad_mini_db_h - md5sum: 1325d5db1da081c479a455a3e7440ae4 - - path: output/genomad/genomad_db/genomad_mini_db_h.dbtype - md5sum: 740bab4f9ec8808aedb68d6b1281aeb2 - - path: output/genomad/genomad_db/genomad_mini_db_h.index - md5sum: 8c14ed8d3b520be4cd22340a250d26bf - - path: output/genomad/genomad_db/genomad_mini_db_mapping - md5sum: e56fa490b1050a8a3e82119976918e60 - - path: output/genomad/genomad_db/genomad_mini_db_taxonomy - md5sum: bf46bbcd28214cb34aa9ef6c891b7114 - - path: output/genomad/genomad_db/mini_set_ids - md5sum: 9cc65ecf08bba29cd75e436b18f49e4b - - path: output/genomad/genomad_db/names.dmp - md5sum: 83f879df06a69bf16687b5de575ed5ba - - path: output/genomad/genomad_db/nodes.dmp - md5sum: ee4db67cdcf75a5bba6a17b83e57425d - - path: output/genomad/genomad_db/plasmid_hallmark_annotation.txt - md5sum: 36bbd98d2f9e2f7abad5ef31aca1ce0c - - path: output/genomad/genomad_db/version.txt - md5sum: 84b17206d983a7430710b2a1f8ae52b8 - - path: output/genomad/genomad_db/virus_hallmark_annotation.txt - md5sum: 5211d849ade305ab989472a82c206700 - - path: output/genomad/versions.yml - -- name: genomad download test_genomad_download_stub - command: nextflow run ./tests/modules/nf-core/genomad/download -entry test_genomad_download -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genomad/download/nextflow.config -stub-run - tags: - - genomad - - genomad/download - files: - - path: output/genomad/genomad_db/genomad_db - - path: output/genomad/genomad_db/genomad_db.dbtype - - path: output/genomad/genomad_db/genomad_db.index - - path: output/genomad/genomad_db/genomad_db.lookup - - path: output/genomad/genomad_db/genomad_db.source - - path: output/genomad/genomad_db/genomad_db_h - - path: output/genomad/genomad_db/genomad_db_h.dbtype - - path: output/genomad/genomad_db/genomad_db_h.index - - path: output/genomad/genomad_db/genomad_db_mapping - - path: output/genomad/genomad_db/genomad_db_taxonomy - - path: output/genomad/genomad_db/genomad_integrase_db - - path: output/genomad/genomad_db/genomad_integrase_db.dbtype - - path: output/genomad/genomad_db/genomad_integrase_db.index - - path: output/genomad/genomad_db/genomad_integrase_db.lookup - - path: output/genomad/genomad_db/genomad_integrase_db.source - - path: output/genomad/genomad_db/genomad_integrase_db_h - - path: output/genomad/genomad_db/genomad_integrase_db_h.dbtype - - path: output/genomad/genomad_db/genomad_integrase_db_h.index - - path: output/genomad/genomad_db/genomad_marker_metadata.tsv - - path: output/genomad/genomad_db/genomad_mini_db - - path: output/genomad/genomad_db/genomad_mini_db.dbtype - - path: output/genomad/genomad_db/genomad_mini_db.index - - path: output/genomad/genomad_db/genomad_mini_db.lookup - - path: output/genomad/genomad_db/genomad_mini_db.source - - path: output/genomad/genomad_db/genomad_mini_db_h - - path: output/genomad/genomad_db/genomad_mini_db_h.dbtype - - path: output/genomad/genomad_db/genomad_mini_db_h.index - - path: output/genomad/genomad_db/genomad_mini_db_mapping - - path: output/genomad/genomad_db/genomad_mini_db_taxonomy - - path: output/genomad/genomad_db/mini_set_ids - - path: output/genomad/genomad_db/names.dmp - - path: output/genomad/genomad_db/nodes.dmp - - path: output/genomad/genomad_db/plasmid_hallmark_annotation.txt - - path: output/genomad/genomad_db/version.txt - - path: output/genomad/genomad_db/virus_hallmark_annotation.txt - - path: output/genomad/versions.yml diff --git a/tests/modules/nf-core/genomad/endtoend/main.nf b/tests/modules/nf-core/genomad/endtoend/main.nf deleted file mode 100644 index 7fe54484cc0..00000000000 --- a/tests/modules/nf-core/genomad/endtoend/main.nf +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GENOMAD_DOWNLOAD } from '../../../../../modules/nf-core/genomad/download/main.nf' -include { GENOMAD_ENDTOEND } from '../../../../../modules/nf-core/genomad/endtoend/main.nf' - -workflow test_genomad_endtoend { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['scaffolds_fasta'], checkIfExists: true) - ] - - GENOMAD_DOWNLOAD ( ) - - GENOMAD_ENDTOEND ( input, GENOMAD_DOWNLOAD.out.genomad_db ) - -} diff --git a/tests/modules/nf-core/genomad/endtoend/nextflow.config b/tests/modules/nf-core/genomad/endtoend/nextflow.config deleted file mode 100644 index f14d04170f2..00000000000 --- a/tests/modules/nf-core/genomad/endtoend/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: GENOMAD_ENDTOEND { - ext.args = '--splits 6 --enable-score-calibration' - } -} diff --git a/tests/modules/nf-core/genomad/endtoend/test.yml b/tests/modules/nf-core/genomad/endtoend/test.yml deleted file mode 100644 index db99b81bb7a..00000000000 --- a/tests/modules/nf-core/genomad/endtoend/test.yml +++ /dev/null @@ -1,52 +0,0 @@ -- name: genomad endtoend test_genomad_endtoend - command: nextflow run ./tests/modules/nf-core/genomad/endtoend -entry test_genomad_endtoend -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genomad/endtoend/nextflow.config - tags: - - genomad - - genomad/endtoend - files: - - path: output/genomad/scaffolds_aggregated_classification/scaffolds_aggregated_classification.tsv - md5sum: cb1429d7f21235e86a85a7ee64b1c447 - - path: output/genomad/scaffolds_annotate/scaffolds_taxonomy.tsv - md5sum: a43a36aa68f9cb87a2221381d106c6e0 - - path: output/genomad/scaffolds_find_proviruses/scaffolds_provirus.tsv - md5sum: 93a6bca59b0bf7f57c0b9b60d2e57082 - - path: output/genomad/scaffolds_score_calibration/scaffolds_calibrated_aggregated_classification.tsv - md5sum: bf35570c88a4bf39a3b90424062911bd - - path: output/genomad/scaffolds_score_calibration/scaffolds_compositions.tsv - md5sum: 9168bea9fe82a979a698d259e1bb906a - - path: output/genomad/scaffolds_summary/scaffolds_plasmid.fna - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_genes.tsv - md5sum: 55818cae5a57381b77778076e99605e6 - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_proteins.faa - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_summary.tsv - md5sum: 8c4ddaa8a90da779c11537be0fddb799 - - path: output/genomad/scaffolds_summary/scaffolds_virus.fna - md5sum: 430784780f04e095a9fee7613e030052 - - path: output/genomad/scaffolds_summary/scaffolds_virus_genes.tsv - md5sum: 13e72216197de1c6e46bca01eb585eda - - path: output/genomad/scaffolds_summary/scaffolds_virus_proteins.faa - md5sum: 13526a60bf0149b8d48e5ff68190e5d4 - - path: output/genomad/scaffolds_summary/scaffolds_virus_summary.tsv - md5sum: ec7b0da75d18b25a18494b5d66c89ef8 - - path: output/genomad/versions.yml - -- name: genomad endtoend test_genomad_endtoend_stub - command: nextflow run ./tests/modules/nf-core/genomad/endtoend -entry test_genomad_endtoend -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/genomad/endtoend/nextflow.config -stub-run - tags: - - genomad - - genomad/endtoend - files: - - path: output/genomad/scaffolds_aggregated_classification/scaffolds_aggregated_classification.tsv - - path: output/genomad/scaffolds_annotate/scaffolds_taxonomy.tsv - - path: output/genomad/scaffolds_find_proviruses/scaffolds_provirus.tsv - - path: output/genomad/scaffolds_score_calibration/scaffolds_calibrated_aggregated_classification.tsv - - path: output/genomad/scaffolds_score_calibration/scaffolds_compositions.tsv - - path: output/genomad/scaffolds_summary/scaffolds_plasmid.fna - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_genes.tsv - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_proteins.faa - - path: output/genomad/scaffolds_summary/scaffolds_plasmid_summary.tsv - - path: output/genomad/scaffolds_summary/scaffolds_virus.fna - - path: output/genomad/scaffolds_summary/scaffolds_virus_genes.tsv - - path: output/genomad/scaffolds_summary/scaffolds_virus_proteins.faa - - path: output/genomad/scaffolds_summary/scaffolds_virus_summary.tsv - - path: output/genomad/versions.yml