diff --git a/modules/nf-core/vcontact3/run/environment.yml b/modules/nf-core/vcontact3/run/environment.yml new file mode 100644 index 000000000000..02610442e3dd --- /dev/null +++ b/modules/nf-core/vcontact3/run/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::vcontact3=3.1.6=pyhdfd78af_0 diff --git a/modules/nf-core/vcontact3/run/main.nf b/modules/nf-core/vcontact3/run/main.nf new file mode 100644 index 000000000000..8bae6b3fc8ae --- /dev/null +++ b/modules/nf-core/vcontact3/run/main.nf @@ -0,0 +1,38 @@ +process VCONTACT3_RUN { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularityOptions ? + 'docker://quay.io/biocontainers/vcontact3:3.1.6--pyhdfd78af_0' : + 'quay.io/biocontainers/vcontact3:3.1.6--pyhdfd78af_0' }" + + input: + tuple val(meta), path(genomes) + + output: + tuple val(meta), path("vcontact3_output/"), emit: results + tuple val("${task.process}"), val('vcontact3'), val('3.1.6'), emit: versions_vcontact3, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + vcontact3 run \\ + -n ${genomes.join(' ')} \\ + -o vcontact3_output/ \\ + --threads ${task.cpus} \\ + ${args} + """ + + stub: + """ + mkdir -p vcontact3_output/ + touch vcontact3_output/clusters.csv + touch vcontact3_output/merged_df.csv + touch vcontact3_output/vContact_contig_id.txt + """ +} diff --git a/modules/nf-core/vcontact3/run/meta.yml b/modules/nf-core/vcontact3/run/meta.yml new file mode 100644 index 000000000000..4820154fc53d --- /dev/null +++ b/modules/nf-core/vcontact3/run/meta.yml @@ -0,0 +1,61 @@ +name: vcontact3_run +description: Cluster viral genomes using protein-level homology comparison +keywords: + - virology + - clustering + - metagenomics + - virus + - homology +tools: + - vcontact3: + description: Automated host-to-phage gene-level similarity searching + homepage: https://bitbucket.org/MAVERICLab/vcontact3 + documentation: https://vcontact3.readthedocs.io/en/latest/ + tool_dev_url: https://bitbucket.org/MAVERICLab/vcontact3 + licence: + - GPL-3.0-or-later + doi: 10.1186/s13059-019-1879-9 + identifier: "" +input: + - - meta: + type: map + description: Groovy map containing sample metadata + - genomes: + type: file + description: Input FASTA or GenBank files with viral sequences + pattern: "*.{fasta,fa,faa,gbk,gb}" + ontologies: [] +output: + results: + - - meta: + type: map + description: Groovy map with sample metadata + - vcontact3_output/: + type: directory + description: VCONTACT3 output directory containing clustering results + pattern: "vcontact3_output/" + versions_vcontact3: + - - ${task.process}: + type: string + description: The name of the process + - vcontact3: + type: string + description: The name of the tool + - 3.1.6: + type: string + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - vcontact3: + type: string + description: The name of the tool + - 3.1.6: + type: string + description: The expression to obtain the version of the tool +authors: + - "@JP-Bro" +maintainers: + - "@JP-Bro" diff --git a/modules/nf-core/vcontact3/run/tests/main.nf.test b/modules/nf-core/vcontact3/run/tests/main.nf.test new file mode 100644 index 000000000000..7f0bd3adcdf3 --- /dev/null +++ b/modules/nf-core/vcontact3/run/tests/main.nf.test @@ -0,0 +1,47 @@ +nextflow_process { + name "Test Process VCONTACT3_RUN" + script "../main.nf" + process "VCONTACT3_RUN" + + tag "modules" + tag "modules_nfcore" + tag "vcontact3" + tag "vcontact3/run" + + test("vcontact3_run - stub") { + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + } + } + + test("vcontact3_run - real") { + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert path(process.out.results[0][1]).exists() + } + } +} diff --git a/modules/nf-core/vcontact3/run/tests/main.nf.test.snap b/modules/nf-core/vcontact3/run/tests/main.nf.test.snap new file mode 100644 index 000000000000..9476a534419e --- /dev/null +++ b/modules/nf-core/vcontact3/run/tests/main.nf.test.snap @@ -0,0 +1,21 @@ +{ + "vcontact3_run - stub": { + "results": [ + [ + { + "id": "test" + }, + [ + "vcontact3_output" + ] + ] + ], + "versions_vcontact3": [ + [ + "VCONTACT3_RUN", + "vcontact3", + "3.1.6" + ] + ] + } +}