Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions nf-core/vcontact3/prepareddatabases/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::vcontact3=3.1.6"
47 changes: 47 additions & 0 deletions nf-core/vcontact3/prepareddatabases/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
process VCONTACT3_PREPAREDDATABASES {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/vcontact3:3.1.6--py310h4b81fae_0':
'quay.io/biocontainers/vcontact3:3.1.6--py310h4b81fae_0' }"

input:
tuple val(meta), val(db_version)

output:
tuple val(meta), path ("${prefix}/"), emit: database
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
"""
vcontact3 prepare_databases \\
--get-version "${db_version}" \\
--set-location "${prefix}" \\
$args

cat <<EOF > versions.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"${task.process}":
vcontact3: \$(vcontact3 --version 2>&1 | sed 's/vcontact3 //g')
EOF
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir -p "${prefix}"
touch "${prefix}/version.json"
touch ${prefix}/stub_database.db

cat <<EOF > versions.yml
"${task.process}":
vcontact3: 3.1.6
EOF
"""
}
77 changes: 77 additions & 0 deletions nf-core/vcontact3/prepareddatabases/meta.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file does not seem updated from the boilerplate files, please replace/add content as necessary!

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
# # TODO nf-core: Add a description of the module and list keywords
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# # TODO nf-core: Add a description of the module and list keywords

name: "vcontact3_prepareddatabases"
description: write your description here
keywords:
- sort
- example
- genomics
tools:
## TODO nf-core: Add a description and other details for the software below
- "vcontact3":
description: "Viral Contig Automatic Clustering and Taxonomy"
homepage: "https://bitbucket.org/MAVERICLab/vcontact3/src/master/README.md"
documentation: "https://bitbucket.org/MAVERICLab/vcontact3/src/master/README.md"
tool_dev_url: "None"
doi: ""
licence: ['GPL v3']
identifier: null

input:
### TODO nf-core: Add a description of all of the variables used as input
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- bam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
- edam: "http://edamontology.org/format_2573" # CRAM
- edam: "http://edamontology.org/format_3462" # SAM

output:
### TODO nf-core: Add a description of all of the variables used as output
bam:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.bam":
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
- edam: "http://edamontology.org/format_2573" # CRAM
- edam: "http://edamontology.org/format_3462" # SAM
versions_vcontact3:
- - "${task.process}":
type: string
description: The name of the process
- "vcontact3":
type: string
description: The name of the tool
- "vcontact3 --version":
type: eval
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
- vcontact3 --version:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@olawal1001"
maintainers:
- "@olawal1001"
69 changes: 69 additions & 0 deletions nf-core/vcontact3/prepareddatabases/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
nextflow_process {

name "Test Process VCONTACT3_PREPAREDDATABASES"
script "../main.nf"
process "VCONTACT3_PREPAREDDATABASES"

tag "modules"
tag "modules_nfcore"
tag "vcontact3"
tag "vcontact3/prepareddatabases"

test("vcontact3_prepare_databases - latest_version") {

when {
process {
"""
input[0] = [
[ id:'test' ],
'latest'
]
"""
}
}

then {
assert process.success

def meta = process.out.database.get(0).get(0)
def dbDir = process.out.database.get(0).get(1)

assertAll(
{ assert meta.id == 'test' },
{ assert path(dbDir).exists() },
{ assert snapshot(process.out.versions).match("real_versions") }
)
}
}

test("vcontact3_prepare_databases - latest_version - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
'latest'
]
"""
}
}

then {
assert process.success

def meta = process.out.database.get(0).get(0)
def dbDir = process.out.database.get(0).get(1)

assertAll(
{ assert meta.id == 'test' },
{ assert path(dbDir).exists() },
{ assert path("${dbDir}/version.json").exists() },
{ assert path("${dbDir}/stub_database.db").exists() },
{ assert snapshot(process.out.versions).match("stub_versions") }
)
}
}
}
63 changes: 63 additions & 0 deletions nf-core/vcontact3/prepareddatabases/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"real_versions": {
"content": [
[
"versions.yml:md5,00d4049fe50f682cda026d348995df3d"
]
],
"timestamp": "2026-05-20T17:12:33.278397904",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
}
},
"stub_versions": {
"content": [
[
"versions.yml:md5,eef00dbab0560cd5f7e06c11bafe33de"
]
],
"timestamp": "2026-05-19T18:30:59.489287902",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
}
},
"sarscov2 - database_and_fasta- stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"stub_database.db:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"1": [
"versions.yml:md5,eef00dbab0560cd5f7e06c11bafe33de"
],
"database": [
[
{
"id": "test"
},
[
"stub_database.db:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"versions": [
"versions.yml:md5,eef00dbab0560cd5f7e06c11bafe33de"
]
}
],
"timestamp": "2026-05-18T18:23:58.3091529",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
}
}
}