-
Notifications
You must be signed in to change notification settings - Fork 838
stub and nf-test created for raxmlng #8161
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
base: master
Are you sure you want to change the base?
Changes from all commits
70a558f
6489d35
101496c
da103b7
9fed39a
75ea005
36ddb64
aa58a3b
d19b1b7
71b0b1d
5cd6573
4186ea7
23f9e0a
30c7491
6b32a7f
da7c7a9
ce3e6b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,28 +7,51 @@ process RAXMLNG { | |||||||||
'biocontainers/raxml-ng:1.0.3--h32fcf60_0' }" | ||||||||||
|
||||||||||
input: | ||||||||||
path alignment | ||||||||||
tuple val(meta), path(alignment), val(model) | ||||||||||
|
||||||||||
output: | ||||||||||
path "*.raxml.bestTree", emit: phylogeny | ||||||||||
path "*.raxml.support" , optional:true, emit: phylogeny_bootstrapped | ||||||||||
path "versions.yml" , emit: versions | ||||||||||
tuple val(meta), path("*.raxml.bestTree") , emit: phylogeny | ||||||||||
tuple val(meta), path("*.raxml.support"), optional:true, emit: phylogeny_bootstrapped | ||||||||||
path "versions.yml" , emit: versions | ||||||||||
|
||||||||||
when: | ||||||||||
task.ext.when == null || task.ext.when | ||||||||||
|
||||||||||
script: | ||||||||||
def args = task.ext.args ?: '' | ||||||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||||||
|
||||||||||
""" | ||||||||||
raxml-ng \\ | ||||||||||
$args \\ | ||||||||||
--msa $alignment \\ | ||||||||||
--model $model \\ | ||||||||||
--threads $task.cpus \\ | ||||||||||
--prefix output | ||||||||||
--prefix ${prefix} | ||||||||||
|
||||||||||
cat <<-END_VERSIONS > versions.yml | ||||||||||
"${task.process}": | ||||||||||
raxmlng: \$(echo \$(raxml-ng --version 2>&1) | sed 's/^.*RAxML-NG v. //; s/released.*\$//') | ||||||||||
END_VERSIONS | ||||||||||
""" | ||||||||||
|
||||||||||
stub: | ||||||||||
def args = task.ext.args ?: params.raxmlng_args ?: '' | ||||||||||
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
|
||||||||||
def prefix = task.ext.prefix ?: meta.id | ||||||||||
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
|
||||||||||
if (!meta.id) { | ||||||||||
error "Input meta map does not contain 'id'. Received: ${meta}" | ||||||||||
} | ||||||||||
// Use a dedicated param for stub testing the bootstrap output scenario | ||||||||||
Comment on lines
+41
to
+44
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
|
||||||||||
def touch_support = args.contains('--bootstrap') || args.contains('--bs-trees') ? "touch ${prefix}.raxml.support" : "" | ||||||||||
""" | ||||||||||
# Create stub output files | ||||||||||
touch ${prefix}.raxml.bestTree | ||||||||||
${touch_support} | ||||||||||
|
||||||||||
# Create versions.yml | ||||||||||
cat <<-END_VERSIONS > versions.yml | ||||||||||
"${task.process}": | ||||||||||
raxmlng: stub_version | ||||||||||
END_VERSIONS | ||||||||||
""" | ||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,24 +13,41 @@ tools: | |
documentation: https://github.com/amkozlov/raxml-ng/wiki | ||
tool_dev_url: https://github.com/amkozlov/raxml-ng | ||
doi: 10.1093/bioinformatics/btz305 | ||
licence: ["GPL v2-or-later"] | ||
license: ["GPL v2-or-later"] | ||
identifier: "" | ||
input: | ||
- - alignment: | ||
- - meta: | ||
type: map | ||
description: Groovy Map containing sample information (e.g. [ id:'sample1' ]) | ||
- alignment: | ||
type: file | ||
description: A FASTA format multiple sequence alignment file | ||
pattern: "*.{fasta,fas,fa,mfa}" | ||
- model: | ||
type: string | ||
description: The substitution model to use for the phylogenetic inference | ||
|
||
output: | ||
- phylogeny: | ||
- meta: | ||
type: map | ||
description: Groovy Map containing sample information | ||
pattern: "*.{raxml.bestTree}" | ||
- "*.raxml.bestTree": | ||
type: file | ||
description: A phylogeny in Newick format | ||
type: map | ||
description: Groovy Map containing sample information | ||
Comment on lines
+37
to
+38
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 should still be the previous description and type: |
||
pattern: "*.{raxml.bestTree}" | ||
- phylogeny_bootstrapped: | ||
- meta: | ||
type: map | ||
description: Groovy Map containing sample information | ||
pattern: "*.{raxml.support}" | ||
optional: true | ||
- "*.raxml.support": | ||
type: file | ||
description: A phylogeny in Newick format with bootstrap values | ||
type: map | ||
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 should still be the previous description and type |
||
description: Groovy Map containing sample information | ||
pattern: "*.{raxml.support}" | ||
optional: true | ||
- versions: | ||
- versions.yml: | ||
type: file | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
nextflow_process { | ||
name "Test Process RAXMLNG" | ||
script "../main.nf" | ||
process "RAXMLNG" | ||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "raxmlng" | ||
|
||
test("raxmlng - main") { | ||
when { | ||
process { | ||
""" | ||
// alignment fasta file is required | ||
input[0] = [ | ||
[ id:'test' ], // meta map with id | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true), // alignment fasta | ||
'GTR+G' // model | ||
] | ||
""" | ||
} | ||
|
||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
// Check phylogeny output (tuple: meta, path) | ||
{ assert process.out.phylogeny.size() == 1 }, | ||
{ assert process.out.phylogeny[0][0].id == 'test' }, // Check meta.id passed through | ||
{ assert process.out.phylogeny[0][1].toString().endsWith(".raxml.bestTree") }, | ||
{ assert process.out.phylogeny[0][1].toString().contains("test") }, // Check if prefix 'test' was used | ||
// Check optional bootstrapped output (should be empty) | ||
{ assert process.out.phylogeny_bootstrapped.isEmpty() }, | ||
// Check versions | ||
{ assert process.out.versions.size() == 1 }, | ||
{ assert process.out.versions[0].toString().endsWith("versions.yml") }, | ||
{ assert snapshot(process.out.versions[0]).match("versions_yml") } // Snapshot specific file | ||
) | ||
} | ||
} | ||
|
||
|
||
test("raxmlng - stub - no bootstrap") { | ||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test_stub' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true), // alignment file path | ||
'GTR+G' // model string | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
// This will show phylogeny and versions, but not phylogeny_bootstrapped | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
|
||
test("raxmlng - stub - with bootstrap") { | ||
options "-stub" | ||
when { | ||
params.test_stub_bootstrap = true | ||
params { | ||
// Set the bootstrap parameter to true | ||
test_stub_bootstrap = true | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test_bootstrap' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true), // alignment file path | ||
'GTR+G' // model string | ||
] | ||
""" | ||
} | ||
} | ||
then { | ||
assertAll ( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match("stub_with_bootstrap") } | ||
) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"versions_yml": { | ||
"content": [ | ||
"versions.yml:md5,e5a855c4c9bcde2084ec9e34861379f0" | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.5" | ||
}, | ||
"timestamp": "2025-03-31T17:18:00.904972153" | ||
}, | ||
"stub_with_bootstrap": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test_bootstrap" | ||
}, | ||
"test_bootstrap.raxml.bestTree:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test_bootstrap" | ||
}, | ||
"test_bootstrap.raxml.support:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,e7caecc35f1746920b7e0991adc59b4c" | ||
], | ||
"phylogeny": [ | ||
[ | ||
{ | ||
"id": "test_bootstrap" | ||
}, | ||
"test_bootstrap.raxml.bestTree:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"phylogeny_bootstrapped": [ | ||
[ | ||
{ | ||
"id": "test_bootstrap" | ||
}, | ||
"test_bootstrap.raxml.support:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,e7caecc35f1746920b7e0991adc59b4c" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.5" | ||
}, | ||
"timestamp": "2025-03-31T17:55:18.655533044" | ||
}, | ||
"stub_no_bootstrap": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test_stub" | ||
}, | ||
"test_stub.raxml.bestTree:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
|
||
], | ||
"2": [ | ||
"versions.yml:md5,e7caecc35f1746920b7e0991adc59b4c" | ||
], | ||
"phylogeny": [ | ||
[ | ||
{ | ||
"id": "test_stub" | ||
}, | ||
"test_stub.raxml.bestTree:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"phylogeny_bootstrapped": [ | ||
|
||
], | ||
"versions": [ | ||
"versions.yml:md5,e7caecc35f1746920b7e0991adc59b4c" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "24.10.5" | ||
}, | ||
"timestamp": "2025-03-31T17:55:15.617725178" | ||
} | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
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.
Can you put the emit: first, then the optional:, so it lines up better.