From 597a12eace6fc3f7ca696d68bcbcefcb0c3a7bb3 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 13 Nov 2024 17:07:12 +0100 Subject: [PATCH 1/5] automap tests --- .../local/automap/automap/tests/main.nf.test | 95 +++++++++++++++ .../automap/automap/tests/main.nf.test.snap | 109 ++++++++++++++++++ .../automap/automap/tests/nextflow.config | 5 + .../local/automap/repeats/tests/main.nf.test | 58 ++++++++++ .../automap/repeats/tests/main.nf.test.snap | 72 ++++++++++++ 5 files changed, 339 insertions(+) create mode 100644 modules/local/automap/automap/tests/main.nf.test create mode 100644 modules/local/automap/automap/tests/main.nf.test.snap create mode 100644 modules/local/automap/automap/tests/nextflow.config create mode 100644 modules/local/automap/repeats/tests/main.nf.test create mode 100644 modules/local/automap/repeats/tests/main.nf.test.snap diff --git a/modules/local/automap/automap/tests/main.nf.test b/modules/local/automap/automap/tests/main.nf.test new file mode 100644 index 00000000..77e12a9c --- /dev/null +++ b/modules/local/automap/automap/tests/main.nf.test @@ -0,0 +1,95 @@ +nextflow_process { + + name "Test Process AUTOMAP_AUTOMAP" + script "../main.nf" + process "AUTOMAP_AUTOMAP" + + tag "modules" + tag "modules_local" + tag "automap" + tag "automap/automap" + + setup { + run("AUTOMAP_REPEATS") { + script "../../repeats/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + "hg38" + ] + """ + } + } + } + + test("homo_sapiens - vcf, tbi, repeats, [], hg38") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller" ], // meta map + file(params.famvcf, checkIfExists: true), + file(params.famtbi, checkIfExists: true) + ] + input[1] = AUTOMAP_REPEATS.out.repeats + input[2] = [[],[]] + input[3] = "hg38" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.automap.collect { meta, out -> + [ + meta, + path(out).list().collect { + it.list().collect { + "${file(it.toString()).name},variantsMD5:${it.vcf.variantsMD5}" + } + } + ] + }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - vcf, tbi, repeats, [], hg38 - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller" ], // meta map + file(params.famvcf, checkIfExists: true), + file(params.famtbi, checkIfExists: true) + ] + input[1] = AUTOMAP_REPEATS.out.repeats + input[2] = [[],[]] + input[3] = "hg38" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/local/automap/automap/tests/main.nf.test.snap b/modules/local/automap/automap/tests/main.nf.test.snap new file mode 100644 index 00000000..356704a3 --- /dev/null +++ b/modules/local/automap/automap/tests/main.nf.test.snap @@ -0,0 +1,109 @@ +{ + "homo_sapiens - vcf, tbi, repeats, [], hg38": { + "content": [ + [ + [ + { + "id": "test", + "family_samples": "NA24143,NA24149,NA24385", + "caller": "haplotypecaller" + }, + [ + [ + "NA24143.individual.vcf,variantsMD5:d87c6d5aea196c746312a8a383eede4b" + ], + [ + "NA24149.individual.vcf,variantsMD5:24eacd6958a767b7768b4282caea52cc" + ], + [ + "NA24385.individual.vcf,variantsMD5:f7f27a20139824e3e49cf17a2867489b" + ] + ] + ] + ], + [ + "versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T17:03:29.44273724" + }, + "homo_sapiens - vcf, tbi, repeats, [], hg38 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "family_samples": "NA24143,NA24149,NA24385", + "caller": "haplotypecaller" + }, + [ + [ + "sample1.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "sample2.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "sample3.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ] + ], + "1": [ + "versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562" + ], + "automap": [ + [ + { + "id": "test", + "family_samples": "NA24143,NA24149,NA24385", + "caller": "haplotypecaller" + }, + [ + [ + "sample1.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample1.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "sample2.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample2.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "sample3.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e", + "sample3.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T17:00:28.503010269" + } +} \ No newline at end of file diff --git a/modules/local/automap/automap/tests/nextflow.config b/modules/local/automap/automap/tests/nextflow.config new file mode 100644 index 00000000..205fb08f --- /dev/null +++ b/modules/local/automap/automap/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: "AUTOMAP_AUTOMAP" { + ext.args = "--panelname cmgg_bio --multivcf" + } +} \ No newline at end of file diff --git a/modules/local/automap/repeats/tests/main.nf.test b/modules/local/automap/repeats/tests/main.nf.test new file mode 100644 index 00000000..728c037c --- /dev/null +++ b/modules/local/automap/repeats/tests/main.nf.test @@ -0,0 +1,58 @@ +nextflow_process { + + name "Test Process AUTOMAP_REPEATS" + script "../main.nf" + process "AUTOMAP_REPEATS" + + tag "modules" + tag "modules_local" + tag "automap" + tag "automap/repeats" + + test("homo_sapiens - hg38") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + "hg38" + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - hg38 - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + "hg38" + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/local/automap/repeats/tests/main.nf.test.snap b/modules/local/automap/repeats/tests/main.nf.test.snap new file mode 100644 index 00000000..5f114982 --- /dev/null +++ b/modules/local/automap/repeats/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "homo_sapiens - hg38": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,74190e74851226329342a3fcae133cdb" + ] + ], + "1": [ + "versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4" + ], + "repeats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,74190e74851226329342a3fcae133cdb" + ] + ], + "versions": [ + "versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T16:31:33.522485317" + }, + "homo_sapiens - hg38 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4" + ], + "repeats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T16:31:43.895708133" + } +} \ No newline at end of file From b89614359cc6e88e580bd8986869b99ca334eebb Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 13 Nov 2024 17:12:57 +0100 Subject: [PATCH 2/5] test filter_beds --- modules/local/filter_beds/tests/main.nf.test | 60 ++++++++++++++++ .../local/filter_beds/tests/main.nf.test.snap | 72 +++++++++++++++++++ .../local/filter_beds/tests/nextflow.config | 4 ++ 3 files changed, 136 insertions(+) create mode 100644 modules/local/filter_beds/tests/main.nf.test create mode 100644 modules/local/filter_beds/tests/main.nf.test.snap create mode 100644 modules/local/filter_beds/tests/nextflow.config diff --git a/modules/local/filter_beds/tests/main.nf.test b/modules/local/filter_beds/tests/main.nf.test new file mode 100644 index 00000000..904f84d7 --- /dev/null +++ b/modules/local/filter_beds/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process FILTER_BEDS" + script "../main.nf" + process "FILTER_BEDS" + + tag "modules" + tag "modules_local" + tag "filter_beds" + + test("homo_sapiens - bed") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.bed, checkIfExists:true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bed - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.bed, checkIfExists:true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/local/filter_beds/tests/main.nf.test.snap b/modules/local/filter_beds/tests/main.nf.test.snap new file mode 100644 index 00000000..c4e2ba18 --- /dev/null +++ b/modules/local/filter_beds/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "homo_sapiens - bed": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,fa245abf8add7a80650566a1de67ec04" + ] + ], + "1": [ + "versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,fa245abf8add7a80650566a1de67ec04" + ] + ], + "versions": [ + "versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T17:12:06.470648263" + }, + "homo_sapiens - bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T17:09:43.531020092" + } +} \ No newline at end of file diff --git a/modules/local/filter_beds/tests/nextflow.config b/modules/local/filter_beds/tests/nextflow.config new file mode 100644 index 00000000..2d7d8e7b --- /dev/null +++ b/modules/local/filter_beds/tests/nextflow.config @@ -0,0 +1,4 @@ +process { + ext.args = "-vE \"LOW_COVERAGE|NO_COVERAGE\"" + ext.args2 = "-d 150" +} \ No newline at end of file From 4f200f11a0b280955922c095f66b41f8dbf244aa Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 14 Nov 2024 09:58:16 +0100 Subject: [PATCH 3/5] test updio and merge_beds --- modules/local/merge_beds/tests/main.nf.test | 68 ++++++++++++++ .../local/merge_beds/tests/main.nf.test.snap | 72 +++++++++++++++ .../local/merge_beds/tests/nextflow.config | 3 + modules/local/updio/tests/main.nf.test | 63 +++++++++++++ modules/local/updio/tests/main.nf.test.snap | 92 +++++++++++++++++++ modules/local/updio/tests/nextflow.config | 3 + 6 files changed, 301 insertions(+) create mode 100644 modules/local/merge_beds/tests/main.nf.test create mode 100644 modules/local/merge_beds/tests/main.nf.test.snap create mode 100644 modules/local/merge_beds/tests/nextflow.config create mode 100644 modules/local/updio/tests/main.nf.test create mode 100644 modules/local/updio/tests/main.nf.test.snap create mode 100644 modules/local/updio/tests/nextflow.config diff --git a/modules/local/merge_beds/tests/main.nf.test b/modules/local/merge_beds/tests/main.nf.test new file mode 100644 index 00000000..4434a3db --- /dev/null +++ b/modules/local/merge_beds/tests/main.nf.test @@ -0,0 +1,68 @@ +nextflow_process { + + name "Test Process MERGE_BEDS" + script "../main.nf" + process "MERGE_BEDS" + + tag "modules" + tag "modules_local" + tag "merge_beds" + + test("homo_sapiens - bed") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.bed, checkIfExists:true) + ] + input[1] = [ + [ id:'fai' ], + file(params.fai, checkIfExists:true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - bed - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.bed, checkIfExists:true) + ] + input[1] = [ + [ id:'fai' ], + file(params.fai, checkIfExists:true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/local/merge_beds/tests/main.nf.test.snap b/modules/local/merge_beds/tests/main.nf.test.snap new file mode 100644 index 00000000..a6eb4e35 --- /dev/null +++ b/modules/local/merge_beds/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "homo_sapiens - bed": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,fa245abf8add7a80650566a1de67ec04" + ] + ], + "1": [ + "versions.yml:md5,273f887b675fb5feb6073a5313a191a9" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,fa245abf8add7a80650566a1de67ec04" + ] + ], + "versions": [ + "versions.yml:md5,273f887b675fb5feb6073a5313a191a9" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T09:49:08.980488978" + }, + "homo_sapiens - bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,273f887b675fb5feb6073a5313a191a9" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,273f887b675fb5feb6073a5313a191a9" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T09:49:17.089675797" + } +} \ No newline at end of file diff --git a/modules/local/merge_beds/tests/nextflow.config b/modules/local/merge_beds/tests/nextflow.config new file mode 100644 index 00000000..d7ef0d61 --- /dev/null +++ b/modules/local/merge_beds/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = "-d 150" +} \ No newline at end of file diff --git a/modules/local/updio/tests/main.nf.test b/modules/local/updio/tests/main.nf.test new file mode 100644 index 00000000..7afe29f4 --- /dev/null +++ b/modules/local/updio/tests/main.nf.test @@ -0,0 +1,63 @@ +nextflow_process { + + name "Test Process UPDIO" + script "../main.nf" + process "UPDIO" + + tag "modules" + tag "modules_local" + tag "updio" + + test("homo_sapiens - vcf, tbi, []") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', child:'NA24385' ], // meta map + file(params.famvcf, checkIfExists:true), + file(params.famtbi, checkIfExists:true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - vcf, tbi, [] - stub") { + + options "-stub" + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', child:'NA24385' ], // meta map + file(params.famvcf, checkIfExists:true), + file(params.famtbi, checkIfExists:true) + ] + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} \ No newline at end of file diff --git a/modules/local/updio/tests/main.nf.test.snap b/modules/local/updio/tests/main.nf.test.snap new file mode 100644 index 00000000..dc030bb0 --- /dev/null +++ b/modules/local/updio/tests/main.nf.test.snap @@ -0,0 +1,92 @@ +{ + "homo_sapiens - vcf, tbi, [] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "child": "NA24385" + }, + [ + "NA24385.events_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.log:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.table:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.upd:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,8a807f51c31f64de1c707210fabe7029" + ], + "updio": [ + [ + { + "id": "test", + "child": "NA24385" + }, + [ + "NA24385.events_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.log:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.table:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA24385.upd:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,8a807f51c31f64de1c707210fabe7029" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T09:57:26.032830013" + }, + "homo_sapiens - vcf, tbi, []": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "child": "NA24385" + }, + [ + "NA24385.events_list:md5,4a26c133ef193d31eddfd18dae94f0a0", + "NA24385.log:md5,a40a24f379127a9cde7e40a1ce1032ec", + "NA24385.table:md5,ca8165fc7869a113ca034396de7cf579", + "NA24385.upd:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,8a807f51c31f64de1c707210fabe7029" + ], + "updio": [ + [ + { + "id": "test", + "child": "NA24385" + }, + [ + "NA24385.events_list:md5,4a26c133ef193d31eddfd18dae94f0a0", + "NA24385.log:md5,a40a24f379127a9cde7e40a1ce1032ec", + "NA24385.table:md5,ca8165fc7869a113ca034396de7cf579", + "NA24385.upd:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,8a807f51c31f64de1c707210fabe7029" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T09:57:17.522197249" + } +} \ No newline at end of file diff --git a/modules/local/updio/tests/nextflow.config b/modules/local/updio/tests/nextflow.config new file mode 100644 index 00000000..a55cccce --- /dev/null +++ b/modules/local/updio/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = "--childID NA24385 --momID NA24149 --dadID NA24143" +} \ No newline at end of file From f6165bf18dcd60d3fcd1b36bf66365a975627db7 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 14 Nov 2024 11:37:11 +0100 Subject: [PATCH 4/5] pre-commit --- modules/local/automap/automap/tests/main.nf.test | 12 ++++++------ modules/local/automap/automap/tests/nextflow.config | 2 +- modules/local/automap/repeats/tests/main.nf.test | 2 +- modules/local/filter_beds/tests/main.nf.test | 2 +- modules/local/filter_beds/tests/nextflow.config | 2 +- modules/local/merge_beds/tests/main.nf.test | 2 +- modules/local/merge_beds/tests/nextflow.config | 2 +- modules/local/updio/tests/main.nf.test | 2 +- modules/local/updio/tests/nextflow.config | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/local/automap/automap/tests/main.nf.test b/modules/local/automap/automap/tests/main.nf.test index 77e12a9c..f19fe051 100644 --- a/modules/local/automap/automap/tests/main.nf.test +++ b/modules/local/automap/automap/tests/main.nf.test @@ -46,12 +46,12 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.automap.collect { meta, out -> - [ - meta, - path(out).list().collect { + process.out.automap.collect { meta, out -> + [ + meta, + path(out).list().collect { it.list().collect { - "${file(it.toString()).name},variantsMD5:${it.vcf.variantsMD5}" + "${file(it.toString()).name},variantsMD5:${it.vcf.variantsMD5}" } } ] @@ -92,4 +92,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/local/automap/automap/tests/nextflow.config b/modules/local/automap/automap/tests/nextflow.config index 205fb08f..ba4da41d 100644 --- a/modules/local/automap/automap/tests/nextflow.config +++ b/modules/local/automap/automap/tests/nextflow.config @@ -2,4 +2,4 @@ process { withName: "AUTOMAP_AUTOMAP" { ext.args = "--panelname cmgg_bio --multivcf" } -} \ No newline at end of file +} diff --git a/modules/local/automap/repeats/tests/main.nf.test b/modules/local/automap/repeats/tests/main.nf.test index 728c037c..94f1ddb6 100644 --- a/modules/local/automap/repeats/tests/main.nf.test +++ b/modules/local/automap/repeats/tests/main.nf.test @@ -55,4 +55,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/local/filter_beds/tests/main.nf.test b/modules/local/filter_beds/tests/main.nf.test index 904f84d7..f139e316 100644 --- a/modules/local/filter_beds/tests/main.nf.test +++ b/modules/local/filter_beds/tests/main.nf.test @@ -57,4 +57,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/local/filter_beds/tests/nextflow.config b/modules/local/filter_beds/tests/nextflow.config index 2d7d8e7b..1734cd70 100644 --- a/modules/local/filter_beds/tests/nextflow.config +++ b/modules/local/filter_beds/tests/nextflow.config @@ -1,4 +1,4 @@ process { ext.args = "-vE \"LOW_COVERAGE|NO_COVERAGE\"" ext.args2 = "-d 150" -} \ No newline at end of file +} diff --git a/modules/local/merge_beds/tests/main.nf.test b/modules/local/merge_beds/tests/main.nf.test index 4434a3db..ea07e119 100644 --- a/modules/local/merge_beds/tests/main.nf.test +++ b/modules/local/merge_beds/tests/main.nf.test @@ -65,4 +65,4 @@ nextflow_process { } -} \ No newline at end of file +} diff --git a/modules/local/merge_beds/tests/nextflow.config b/modules/local/merge_beds/tests/nextflow.config index d7ef0d61..4fda00bd 100644 --- a/modules/local/merge_beds/tests/nextflow.config +++ b/modules/local/merge_beds/tests/nextflow.config @@ -1,3 +1,3 @@ process { ext.args = "-d 150" -} \ No newline at end of file +} diff --git a/modules/local/updio/tests/main.nf.test b/modules/local/updio/tests/main.nf.test index 7afe29f4..50df983e 100644 --- a/modules/local/updio/tests/main.nf.test +++ b/modules/local/updio/tests/main.nf.test @@ -60,4 +60,4 @@ nextflow_process { } } -} \ No newline at end of file +} diff --git a/modules/local/updio/tests/nextflow.config b/modules/local/updio/tests/nextflow.config index a55cccce..ed9191f4 100644 --- a/modules/local/updio/tests/nextflow.config +++ b/modules/local/updio/tests/nextflow.config @@ -1,3 +1,3 @@ process { ext.args = "--childID NA24385 --momID NA24149 --dadID NA24143" -} \ No newline at end of file +} From da5d1f8a33647eb62297e0e5f1f4b58cdbc23840 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 14 Nov 2024 13:21:42 +0100 Subject: [PATCH 5/5] update rtgtools/format --- modules.json | 2 +- modules/nf-core/rtgtools/format/main.nf | 1 - .../rtgtools/format/tests/fastq.config | 3 + .../rtgtools/format/tests/main.nf.test | 138 ++++++++++++++++++ .../rtgtools/format/tests/main.nf.test.snap | 118 +++++++++++++++ .../nf-core/rtgtools/format/tests/sam.config | 3 + 6 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 modules/nf-core/rtgtools/format/tests/fastq.config create mode 100644 modules/nf-core/rtgtools/format/tests/main.nf.test create mode 100644 modules/nf-core/rtgtools/format/tests/main.nf.test.snap create mode 100644 modules/nf-core/rtgtools/format/tests/sam.config diff --git a/modules.json b/modules.json index a9c6c52c..4696c359 100644 --- a/modules.json +++ b/modules.json @@ -137,7 +137,7 @@ }, "rtgtools/format": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "167a20a2e267261af397e9ea5bf58426e6345ce7", "installed_by": ["modules"] }, "rtgtools/pedfilter": { diff --git a/modules/nf-core/rtgtools/format/main.nf b/modules/nf-core/rtgtools/format/main.nf index 802d3b20..9cae7f99 100644 --- a/modules/nf-core/rtgtools/format/main.nf +++ b/modules/nf-core/rtgtools/format/main.nf @@ -46,7 +46,6 @@ process RTGTOOLS_FORMAT { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def avail_mem = "3G" diff --git a/modules/nf-core/rtgtools/format/tests/fastq.config b/modules/nf-core/rtgtools/format/tests/fastq.config new file mode 100644 index 00000000..24540986 --- /dev/null +++ b/modules/nf-core/rtgtools/format/tests/fastq.config @@ -0,0 +1,3 @@ +process { + ext.args = "--format fastq" +} diff --git a/modules/nf-core/rtgtools/format/tests/main.nf.test b/modules/nf-core/rtgtools/format/tests/main.nf.test new file mode 100644 index 00000000..d3b39800 --- /dev/null +++ b/modules/nf-core/rtgtools/format/tests/main.nf.test @@ -0,0 +1,138 @@ +nextflow_process { + + name "Test Process RTGTOOLS_FORMAT" + script "../main.nf" + process "RTGTOOLS_FORMAT" + + tag "modules" + tag "modules_nfcore" + tag "rtgtools" + tag "rtgtools/format" + + test("sarscov2 - fasta") { + + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [], + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.sdf[0][1]).list().collect { file(it.toString()).name }, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - fastqs") { + + config "./fastq.config" + + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + [] + ] + """ + } + } + + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.sdf[0][1]).list().collect { file(it.toString()).name }, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - bam, rg") { + + config "./sam.config" + + when { + process { + """ + def rg = Channel.of("@RG\tID:READGROUP1\tSM:SAMPLE\tPL:ILLUMINA") + .collectFile(name:'sam_rg.txt') + + input[0] = Channel.of([ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true), + [] + ]).combine(rg) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.sdf[0][1]).list().collect { file(it.toString()).name }, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [], + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/rtgtools/format/tests/main.nf.test.snap b/modules/nf-core/rtgtools/format/tests/main.nf.test.snap new file mode 100644 index 00000000..1494221b --- /dev/null +++ b/modules/nf-core/rtgtools/format/tests/main.nf.test.snap @@ -0,0 +1,118 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.sdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,2ed5b05daa28126a8c34ab9e30f0f3b5" + ], + "sdf": [ + [ + { + "id": "test" + }, + "test.sdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,2ed5b05daa28126a8c34ab9e30f0f3b5" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-04T16:20:31.290508593" + }, + "sarscov2 - fasta": { + "content": [ + [ + "done", + "format.log", + "mainIndex", + "nameIndex0", + "namedata0", + "namepointer0", + "progress", + "seqdata0", + "seqpointer0", + "sequenceIndex0", + "suffixIndex0", + "suffixdata0", + "suffixpointer0", + "summary.txt" + ], + [ + "versions.yml:md5,2ed5b05daa28126a8c34ab9e30f0f3b5" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-05T12:26:34.333493927" + }, + "sarscov2 - fastqs": { + "content": [ + [ + "done", + "format.log", + "mainIndex", + "nameIndex0", + "namedata0", + "namepointer0", + "progress", + "qualitydata0", + "seqdata0", + "seqpointer0", + "sequenceIndex0", + "suffixIndex0", + "suffixdata0", + "suffixpointer0", + "summary.txt" + ], + [ + "versions.yml:md5,2ed5b05daa28126a8c34ab9e30f0f3b5" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-05T12:26:56.018604071" + }, + "sarscov2 - bam, rg": { + "content": [ + [ + "done", + "format.log", + "mainIndex", + "nameIndex0", + "namedata0", + "namepointer0", + "progress", + "qualitydata0", + "seqdata0", + "seqpointer0", + "sequenceIndex0", + "summary.txt" + ], + [ + "versions.yml:md5,2ed5b05daa28126a8c34ab9e30f0f3b5" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-05T12:27:10.103855977" + } +} \ No newline at end of file diff --git a/modules/nf-core/rtgtools/format/tests/sam.config b/modules/nf-core/rtgtools/format/tests/sam.config new file mode 100644 index 00000000..cd57e8b6 --- /dev/null +++ b/modules/nf-core/rtgtools/format/tests/sam.config @@ -0,0 +1,3 @@ +process { + ext.args = "--format sam-se" +} \ No newline at end of file