Skip to content

Commit

Permalink
Nextclade vers bump (#6356)
Browse files Browse the repository at this point in the history
* Update environment.yml

* Update main.nf

Updated containers to 3.8.2

* Update meta.yml

* Update main.nf

* Create nf-test.config

* Create main.nf.test

nf-test module

* Create main.nf.test.snap

* Create nextflow.config

* Update main.nf

fixing biocontainer issue

* Update meta.yml

* nextclade version bump from 2.12 to 3.8.2

* Update meta.yml

* Update test.yml

regenerated test.yml

* Update modules/nf-core/nextclade/datasetget/main.nf

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* Update modules/nf-core/nextclade/run/main.nf

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* Delete tests/modules/nf-core/nextclade/run/test.yml

deleted

* Delete modules/nf-core/nextclade/run/tests/nextflow.config

Deleting

* Delete modules/nf-core/nextclade/run/nf-test.config

* Delete modules/nf-core/nextclade/datasetget/tests/nextflow.config

* Delete modules/nf-core/nextclade/datasetget/nf-test.config

* Update main.nf.test

* Update main.nf.test

making tag adhere to guidelines

* Update main.nf.test

add params block [this mainly because I couldn't run the test locally without it)

* Update main.nf.test.snap

* Update main.nf.test

* Update main.nf.test

add stub

* Update main.nf.test

* Update tests/config/pytest_modules.yml

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* Update pytest_modules.yml

* Delete tests/modules/nf-core/nextclade/datasetget/main.nf

* Delete tests/modules/nf-core/nextclade/datasetget/test.yml

* Delete tests/modules/nf-core/nextclade/run/main.nf

* Update main.nf.test

add stub to nextclade/datasetget test

* Delete tests/modules/nf-core/nextclade/datasetget/nextflow.config

* Update snapshot

* Update meta.yml

* Update main.nf.test

updated main.nf.test

* Update main.nf.test.snap

* Add stubs and swap to only snapshoting part of the json

* Update modules/nf-core/nextclade/datasetget/main.nf

---------

Co-authored-by: shahirnm <uoi4@cdc.gov>
Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent f195be8 commit 1d73b33
Show file tree
Hide file tree
Showing 13 changed files with 445 additions and 129 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/nextclade/datasetget/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::nextclade=2.12.0
- bioconda::nextclade=3.8.2
26 changes: 21 additions & 5 deletions modules/nf-core/nextclade/datasetget/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ process NEXTCLADE_DATASETGET {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/nextclade:2.12.0--h9ee0642_0' :
'biocontainers/nextclade:2.12.0--h9ee0642_0' }"
'https://depot.galaxyproject.org/singularity/nextclade:3.8.2--h9ee0642_0' :
'biocontainers/nextclade:3.8.2--h9ee0642_0' }"

input:
val dataset
val reference
val tag

output:
Expand All @@ -22,15 +21,13 @@ process NEXTCLADE_DATASETGET {
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${dataset}"
def fasta = reference ? "--reference ${reference}" : ''
def version = tag ? "--tag ${tag}" : ''
"""
nextclade \\
dataset \\
get \\
$args \\
--name $dataset \\
$fasta \\
$version \\
--output-dir $prefix
Expand All @@ -39,4 +36,23 @@ process NEXTCLADE_DATASETGET {
nextclade: \$(echo \$(nextclade --version 2>&1) | sed 's/^.*nextclade //; s/ .*\$//')
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${dataset}"
"""
mkdir -p ${prefix}
touch ${prefix}/CHANGELOG.md
touch ${prefix}/README.md
touch ${prefix}/genome_annotation.gff3
touch ${prefix}/pathogen.json
touch ${prefix}/reference.fasta
touch ${prefix}/sequences.fasta
touch ${prefix}/tree.json
cat <<-END_VERSIONS > versions.yml
"${task.process}":
nextclade: \$(echo \$(nextclade --version 2>&1) | sed 's/^.*nextclade //; s/ .*\$//')
END_VERSIONS
"""

}
6 changes: 2 additions & 4 deletions modules/nf-core/nextclade/datasetget/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ input:
type: string
description: Name of dataset to retrieve. A list of available datasets can be obtained using the nextclade dataset list command.
pattern: ".+"
- reference:
type: string
description: Accession id to download dataset based on a particular reference sequence. A list of available datasets can be obtained using the nextclade dataset list command.
pattern: ".+"
- tag:
type: string
description: Version tag of the dataset to download. A list of available datasets can be obtained using the nextclade dataset list command.
Expand All @@ -39,3 +35,5 @@ authors:
maintainers:
- "@antunderwood"
- "@drpatelh"
updated on 2024.08.27:
- "@nmshahir"
31 changes: 25 additions & 6 deletions modules/nf-core/nextclade/datasetget/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,40 @@ nextflow_process {
tag "nextclade"
tag "nextclade/datasetget"

test("species-id-time") {

test("species-tag") {

when {
process {
"""
input[0] = 'nextstrain/sars-cov-2/wuhan-hu-1/orfs'
input[1] = '2024-01-16--20-31-02Z'
"""
}
}

then {
assert process.success
assert snapshot(process.out).match()
}

}

test("species-tag-stub") {
options '-stub'

when {
process {
"""
input[0] = 'sars-cov-2'
input[1] = 'MN908947'
input[2] = '2022-01-18T12:00:00Z'
input[0] = 'nextstrain/sars-cov-2/wuhan-hu-1/orfs'
input[1] = '2024-01-16--20-31-02Z'
"""
}
}

then {
assertAll(
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
Expand Down
36 changes: 17 additions & 19 deletions modules/nf-core/nextclade/datasetget/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
{
"test-nextclade-datasetget": {
"species-tag": {
"content": [
{
"0": [
[
"genemap.gff:md5,21ebebfd0f416eeb959e55ebffd808e8",
"primers.csv:md5,5990c3483bf66ce607aeb90a44e7ef2e",
"qc.json:md5,c512f51fda0212b21ffff05779180963",
"CHANGELOG.md:md5,ebbe8be5a3c378ed903c1afb4d8c441d",
"README.md:md5,c69387d632361334f0d7c9b66065f947",
"genome_annotation.gff3:md5,4dff84d2d6ada820e0e3a8bc6798d402",
"pathogen.json:md5,db5bbec52359c1e168ffc5e6dc0ea32a",
"reference.fasta:md5,c7ce05f28e4ec0322c96f24e064ef55c",
"sequences.fasta:md5,41129d255b99e0e92bdf20e866b99a1b",
"tag.json:md5,402ac2b87e2a6a64a3fbf5ad16497af3",
"tree.json:md5,b8f32f547ff9e2131d6fc66b68fc54b1",
"virus_properties.json:md5,5f2de3949e07cb633f3d9e4a7654dc81"
"sequences.fasta:md5,c2a4d6cbb837dce22d81f9c36dd0629e",
"tree.json:md5,e180607cd34a6cb6bab101d295f6cedf"
]
],
"1": [
"versions.yml:md5,12e8751f1d841b9aee87d31206c102a7"
"versions.yml:md5,8c64a653330d1c5cb58ee1b8363b22d3"
],
"dataset": [
[
"genemap.gff:md5,21ebebfd0f416eeb959e55ebffd808e8",
"primers.csv:md5,5990c3483bf66ce607aeb90a44e7ef2e",
"qc.json:md5,c512f51fda0212b21ffff05779180963",
"CHANGELOG.md:md5,ebbe8be5a3c378ed903c1afb4d8c441d",
"README.md:md5,c69387d632361334f0d7c9b66065f947",
"genome_annotation.gff3:md5,4dff84d2d6ada820e0e3a8bc6798d402",
"pathogen.json:md5,db5bbec52359c1e168ffc5e6dc0ea32a",
"reference.fasta:md5,c7ce05f28e4ec0322c96f24e064ef55c",
"sequences.fasta:md5,41129d255b99e0e92bdf20e866b99a1b",
"tag.json:md5,402ac2b87e2a6a64a3fbf5ad16497af3",
"tree.json:md5,b8f32f547ff9e2131d6fc66b68fc54b1",
"virus_properties.json:md5,5f2de3949e07cb633f3d9e4a7654dc81"
"sequences.fasta:md5,c2a4d6cbb837dce22d81f9c36dd0629e",
"tree.json:md5,e180607cd34a6cb6bab101d295f6cedf"
]
],
"versions": [
"versions.yml:md5,12e8751f1d841b9aee87d31206c102a7"
"versions.yml:md5,8c64a653330d1c5cb58ee1b8363b22d3"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T11:33:31.41372"
"timestamp": "2024-08-27T19:55:42.211731791"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/nextclade/run/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::nextclade=2.12.0
- bioconda::nextclade=3.8.2
24 changes: 21 additions & 3 deletions modules/nf-core/nextclade/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process NEXTCLADE_RUN {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/nextclade:2.12.0--h9ee0642_0' :
'biocontainers/nextclade:2.12.0--h9ee0642_0' }"
'https://depot.galaxyproject.org/singularity/nextclade:3.8.2--h9ee0642_0' :
'biocontainers/nextclade:3.8.2--h9ee0642_0' }"

input:
tuple val(meta), path(fasta)
Expand All @@ -20,7 +20,8 @@ process NEXTCLADE_RUN {
tuple val(meta), path("${prefix}.auspice.json") , optional:true, emit: json_auspice
tuple val(meta), path("${prefix}.ndjson") , optional:true, emit: ndjson
tuple val(meta), path("${prefix}.aligned.fasta") , optional:true, emit: fasta_aligned
tuple val(meta), path("*.translation.fasta") , optional:true, emit: fasta_translation
tuple val(meta), path("*_translation.*.fasta") , optional:true, emit: fasta_translation
tuple val(meta), path("${prefix}.nwk") , optional:true, emit: nwk
path "versions.yml" , emit: versions

when:
Expand All @@ -44,4 +45,21 @@ process NEXTCLADE_RUN {
nextclade: \$(echo \$(nextclade --version 2>&1) | sed 's/^.*nextclade //; s/ .*\$//')
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.csv
touch ${prefix}.tsv
touch ${prefix}.json
touch ${prefix}.auspice.json
touch ${prefix}.aligned.fasta
touch ${prefix}.cds_translation.test.fasta
touch ${prefix}.nwk
cat <<-END_VERSIONS > versions.yml
"${task.process}":
nextclade: \$(echo \$(nextclade --version 2>&1) | sed 's/^.*nextclade //; s/ .*\$//')
END_VERSIONS
"""
}
32 changes: 30 additions & 2 deletions modules/nf-core/nextclade/run/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ input:
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- dataset:
type: file
type: directory
description: Path containing the dataset files obtained by running nextclade dataset get
pattern: "*"
- fasta:
type: file
description: FASTA file containing one or more consensus sequences
pattern: "*.{fasta,fa}"

output:
- meta:
type: map
Expand All @@ -39,21 +40,48 @@ output:
type: file
description: CSV file containing nextclade results
pattern: "*.{csv}"
- csv_errors:
type: file
description: CSV file containing errors from nextclade results
pattern: "*.{errors.csv}"
- csv_insertions:
type: file
description: CSV file containing insertions from nextclade results
pattern: "*.{insertions.csv}"
- fasta_aligned:
type: file
description: FASTA file containing aligned sequences from nextclade results
pattern: "*.{aligned.fasta}"
- fasta_translation:
type: file
description: FASTA file containing aligned peptides from nextclade results
pattern: "*.{_translation.}*.{fasta}"
- ndjson:
type: file
description: newline-delimited JSON file containing nextclade results
pattern: "*.{ndjson}"
- json:
type: file
description: JSON file containing nextclade results
pattern: "*.{json}"
- json_tree:
- json_auspice:
type: file
description: Auspice JSON V2 containing nextclade results
pattern: "*.{tree.json}"
- tsv:
type: file
description: TSV file containing nextclade results
pattern: "*.{tsv}"
- nwk:
type: file
description: NWK file containing nextclade results
pattern: "*.{nwk}"
authors:
- "@antunderwood"
- "@drpatelh"
maintainers:
- "@antunderwood"
- "@drpatelh"
- "@drpatelh"
updated on 2024.08.23:
- "@nmshahir"
82 changes: 82 additions & 0 deletions modules/nf-core/nextclade/run/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "nextclade"
tag "nextclade/datasetget"
tag "nextclade/run"

setup {
run("NEXTCLADE_DATASETGET") {
script "../../datasetget/main.nf"
process {
"""
input[0] = 'nextstrain/sars-cov-2/wuhan-hu-1/orfs'
input[1] = '2024-01-16--20-31-02Z'
"""
}
}
}

test("sarscov2 default") {

when {
process {
"""
input[0] = [[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = NEXTCLADE_DATASETGET.out.dataset
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.csv,
process.out.csv_errors,
process.out.csv_insertions,
process.out.fasta_aligned,
process.out.fasta_translation,
file(process.out.json[0][1]).readLines()[4..10],
process.out.json_auspice,
process.out.ndjson,
process.out.nwk,
process.out.tsv,
process.out.versions
).match() }
)
}
}

test("sarscov2 default-stub") {
options '-stub'

when {
process {
"""
input[0] = [[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = NEXTCLADE_DATASETGET.out.dataset
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
Loading

0 comments on commit 1d73b33

Please sign in to comment.