Skip to content

Commit

Permalink
Tcoffee stub tests (#6555)
Browse files Browse the repository at this point in the history
* Fix align module test

* Fix nf-tests

* update typos

* Update snaps

* Update modules/nf-core/tcoffee/align/tests/main.nf.test

Co-authored-by: Famke Bäuerle <[email protected]>

* Update modules/nf-core/tcoffee/align/tests/main.nf.test

Co-authored-by: Famke Bäuerle <[email protected]>

* Update modules/nf-core/tcoffee/alncompare/tests/main.nf.test

Co-authored-by: Famke Bäuerle <[email protected]>

* update tetss

* update tests align

* update tests

* update irmsd test

* Update modules/nf-core/tcoffee/align/main.nf

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/alncompare/main.nf

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/irmsd/main.nf

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/irmsd/tests/main.nf.test

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/seqreformat/main.nf

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/tcs/main.nf

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* Update modules/nf-core/tcoffee/tcs/meta.yml

Co-authored-by: Jose Espinosa-Carrasco <[email protected]>

* remove changes in consensus

* fix

* update snap

* add

* add tree test

* rerun

* test

* test

---------

Co-authored-by: Famke Bäuerle <[email protected]>
Co-authored-by: Jose Espinosa-Carrasco <[email protected]>
Co-authored-by: Maxime U Garcia <[email protected]>
  • Loading branch information
4 people authored Sep 18, 2024
1 parent ba8aac9 commit 6453bce
Show file tree
Hide file tree
Showing 23 changed files with 421 additions and 339 deletions.
20 changes: 0 additions & 20 deletions modules/nf-core/fastme/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-03-19T10:03:04.842045"
},
"versions": {
Expand All @@ -66,10 +62,6 @@
"versions.yml:md5,0e7f28ae349efffa1ef75c2279e975b6"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-03-19T10:02:58.72899"
},
"stats_boot": {
Expand All @@ -90,10 +82,6 @@
""
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-03-19T10:09:35.813028"
},
"setoxin - phylip - with_tree": {
Expand Down Expand Up @@ -151,10 +139,6 @@
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-03-19T10:02:51.77025"
},
"setoxin - phylip - basic": {
Expand Down Expand Up @@ -212,10 +196,6 @@
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-03-19T10:02:44.598308"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/tcoffee/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ process TCOFFEE_ALIGN {
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
# Otherwise, tcoffee will crash when calling its version
export TEMP='./'
touch ${prefix}.aln${compress ? '.gz':''}
cat <<-END_VERSIONS > versions.yml
Expand Down
72 changes: 51 additions & 21 deletions modules/nf-core/tcoffee/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ nextflow_process {
tag "famsa/guidetree"
tag "untar"

test("fasta - align_sequence") {
test("align_sequence - compressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[],[]]
Expand All @@ -31,21 +31,21 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.alignment).match("alignment")},
{ assert snapshot(process.out.versions).match("versions_uncomp") }
{ assert snapshot(process.out.versions).match()},
{ assert path(process.out.alignment.get(0).get(1)).getTextGzip().contains("1ahl") },
)
}
}

test("fasta - align_sequence - uncompressed") {
test("align_sequence - uncompressed - seatoxin") {

config "./sequence.config"

when {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[],[]]
Expand All @@ -57,13 +57,13 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.alignment).match("alignment - uncompressed")},
{ assert snapshot(process.out.versions).match("versions_comp") }
{ assert snapshot(process.out.versions).match()},
{ assert path(process.out.alignment.get(0).get(1)).getText().contains("1ahl") },
)
}
}

test("sarscov2 - fasta - align_with_guide_tree") {
test("align_with_guide_tree - uncompressed - seatoxin") {

config "./tree.config"

Expand All @@ -74,7 +74,7 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
"""
Expand All @@ -86,7 +86,7 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/alignment/informative_sites.fas', checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = FAMSA_GUIDETREE.out.tree.collect{ meta, tree -> tree }.map{ tree -> [[ id: 'test'], tree]}
input[2] = [ [:], [], [] ]
Expand All @@ -98,14 +98,14 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.alignment).match("alignment_guidetree")},
{ assert snapshot(process.out.versions).match("versions_guidetree") }
{ assert snapshot(process.out.versions).match()},
{ assert path(process.out.alignment.get(0).get(1)).getTextGzip().contains("1ahl") },
)
}

}

test("fasta - align_with_structure") {
test("align_with_structure - uncompressed - seatoxin") {

config "./structure.config"

Expand All @@ -116,7 +116,7 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/structures/seatoxin-ref.tar.gz", checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/structures/seatoxin-ref.tar.gz", checkIfExists: true)
]
"""
Expand All @@ -128,7 +128,7 @@ nextflow_process {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [ [:], [] ]
input[2] = UNTAR.out.untar.map { meta,dir -> [[ id:'test' ], [] ,file(dir).listFiles().collect()]}
Expand All @@ -148,15 +148,15 @@ nextflow_process {

}

test("fasta - align_with_lib") {
test("align_with_lib - seatoxin") {

config "./lib.config"

when {
process {
"""
input[0] = [ [ id:'test' ],
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[],[]]
Expand All @@ -168,10 +168,40 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.alignment).match("alignment - lib") },
{ assert path(process.out.lib.get(0).get(1)).getText().contains("1ahl") },
{ assert snapshot(process.out.versions).match("versions_lib") }
{ assert path(process.out.alignment.get(0).get(1)).getTextGzip().contains("1ahl") },
{ assert snapshot(process.out.versions).match()
}
)
}
}

test("align_sequence - uncompressed - seatoxin - stub") {
options "-stub"
config "./sequence.config"

when {
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + "../../multiplesequencealign/testdata/setoxin-ref.fa", checkIfExists: true)
]
input[1] = [[:],[]]
input[2] = [[:],[],[]]
input[3] = false
"""
}
}

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

}
98 changes: 25 additions & 73 deletions modules/nf-core/tcoffee/align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,125 +6,77 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-02-28T19:00:28.712838"
},
"versions_lib": {
"align_sequence - uncompressed - seatoxin": {
"content": [
[
"versions.yml:md5,fb187c9186b50a8076d08cd3be3c1b70"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-03-19T14:04:06.031557"
"timestamp": "2024-09-16T10:38:34.006567221"
},
"alignment - uncompressed": {
"content": [
[
[
{
"id": "test"
},
"test.aln:md5,bd1db08ad04514cc6d1334598c1a6ef0"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
},
"timestamp": "2024-02-28T18:59:54.582504"
},
"versions_comp": {
"align_sequence - compressed - seatoxin": {
"content": [
[
"versions.yml:md5,fb187c9186b50a8076d08cd3be3c1b70"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-02-28T18:59:54.593312"
"timestamp": "2024-09-16T10:38:18.99603304"
},
"versions_guidetree": {
"align_with_guide_tree - uncompressed - seatoxin": {
"content": [
[
"versions.yml:md5,fb187c9186b50a8076d08cd3be3c1b70"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-02-28T19:00:10.618213"
"timestamp": "2024-09-16T10:38:48.044669392"
},
"alignment - lib": {
"align_with_lib - seatoxin": {
"content": [
[
[
{
"id": "test"
},
"test.aln.gz:md5,bd1db08ad04514cc6d1334598c1a6ef0"
]
"versions.yml:md5,fb187c9186b50a8076d08cd3be3c1b70"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-03-19T13:57:39.653762"
"timestamp": "2024-09-16T10:47:34.909457138"
},
"alignment": {
"align_sequence - uncompressed - seatoxin - stub": {
"content": [
[
[
{
"id": "test"
},
"test.aln.gz:md5,bd1db08ad04514cc6d1334598c1a6ef0"
"test.aln:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
},
"timestamp": "2024-02-28T18:59:35.169119"
},
"versions_uncomp": {
"content": [
],
[
"versions.yml:md5,fb187c9186b50a8076d08cd3be3c1b70"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
},
"timestamp": "2024-02-28T18:59:35.2062"
},
"alignment_guidetree": {
"content": [
[
[
{
"id": "test"
},
"test.aln.gz:md5,93bc8adfcd88f7913718eacc13da8e4a"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.01.0"
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-02-28T19:00:10.611489"
"timestamp": "2024-09-16T12:55:10.267649283"
}
}
Loading

0 comments on commit 6453bce

Please sign in to comment.