-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(vcontact3): add vcontact3/prepareddatabases module #11738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
olawal1001
wants to merge
5
commits into
nf-core:master
Choose a base branch
from
olawal1001:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b5a5ef9
feat(vcontact3): add prepareddatabases module
1822559
Update nf-core/vcontact3/prepareddatabases/environment.yml
olawal1001 c39f14f
Update nf-core/vcontact3/prepareddatabases/main.nf
olawal1001 647ffd0
Update nf-core/vcontact3/prepareddatabases/main.nf
olawal1001 303108c
Update nf-core/vcontact3/prepareddatabases/main.nf
olawal1001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| "${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 | ||
| """ | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| 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" | ||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
63
nf-core/vcontact3/prepareddatabases/tests/main.nf.test.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old method reporting versions, please instead use: