Skip to content

Commit

Permalink
Added nf-tests to geNomad modules (nf-core#4674)
Browse files Browse the repository at this point in the history
* Added nf-tests to geNomad modules

* Fixed meta.yml linting

* Updated genomad version and removed empty files from snapshot

* Fixed Docker

* Updated genomad_download snapshot

* Changed docker options to bypass fixOwnership issues
  • Loading branch information
CarsonJM authored Jan 17, 2024
1 parent b0b3d49 commit 9b68cbd
Show file tree
Hide file tree
Showing 21 changed files with 619 additions and 237 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/genomad/download/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::genomad=1.5.2
- bioconda::genomad=1.7.4
4 changes: 2 additions & 2 deletions modules/nf-core/genomad/download/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/genomad/download/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions modules/nf-core/genomad/download/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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() }
)
}
}
}
190 changes: 190 additions & 0 deletions modules/nf-core/genomad/download/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/genomad/download/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker.fixOwnership = false
docker.runOptions = '-u $(id -u):$(id -g)'
2 changes: 2 additions & 0 deletions modules/nf-core/genomad/download/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
genomad/download:
- "modules/nf-core/genomad/download/**"
2 changes: 1 addition & 1 deletion modules/nf-core/genomad/endtoend/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::genomad=1.5.2
- bioconda::genomad=1.7.4
25 changes: 14 additions & 11 deletions modules/nf-core/genomad/endtoend/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/ .*\$//')
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/genomad/endtoend/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 9b68cbd

Please sign in to comment.