diff --git a/modules/nf-core/wittyer/Dockerfile b/modules/nf-core/wittyer/Dockerfile new file mode 100644 index 00000000000..3955699c92d --- /dev/null +++ b/modules/nf-core/wittyer/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0 as builder +WORKDIR /src +COPY . /src +RUN cd Wittyer \ + && dotnet publish -f net6.0 -r linux-x64 -c Release -o /output \ + && chmod +x /output/Wittyer + +FROM mcr.microsoft.com/dotnet/runtime:6.0 +LABEL git_repository=https://git.illumina.com/DASTE/Ilmn.Das.App.Wittyer.git +WORKDIR /opt/Wittyer +RUN apt-get -y update && apt-get -y install tabix libunwind8 openssl procps +COPY --from=builder /output /opt/Wittyer diff --git a/modules/nf-core/wittyer/README.md b/modules/nf-core/wittyer/README.md index d2ba0e09b41..8aa81a565f6 100644 --- a/modules/nf-core/wittyer/README.md +++ b/modules/nf-core/wittyer/README.md @@ -1,6 +1,7 @@ # Updating the docker container and making a new module release witty.er is a commercial tool from Illumina. The container provided for the witty.er nf-core module is not provided nor supported by Illumina. Updating the witty.er versions in the container and pushing the update to Dockerhub needs to be done manually. +NOTE: an updated version of Dockerfile than the official one in github is used to build nf-core/wittyer:0.5.2, which is inserted here ./Dockerfile. 1. Navigate to the witty.er github repository. - [witty.er](https://github.com/Illumina/witty.er) 2. Download the latest release. diff --git a/modules/nf-core/wittyer/main.nf b/modules/nf-core/wittyer/main.nf index c2b943f393b..1dda32e2c71 100644 --- a/modules/nf-core/wittyer/main.nf +++ b/modules/nf-core/wittyer/main.nf @@ -2,7 +2,7 @@ process WITTYER { tag "$meta.id" label 'process_single' - container "nf-core/wittyer:0.3.3.0" + container "nf-core/wittyer:0.5.2.0" // Exit if running this module with -profile conda / -profile mamba if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { @@ -10,7 +10,7 @@ process WITTYER { } input: - tuple val(meta), path(query_vcf), path(query_vcf_index), path(truth_vcf), path(truth_vcf_index), path(bed) + tuple val(meta), path(query_vcf), path(truth_vcf), path(bed) output: tuple val(meta), path("*.json") , emit: report @@ -24,20 +24,18 @@ process WITTYER { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def regions = bed ? "--includeBed=$bed" : "" - if ("$truth_vcf" == "${prefix}.vcf.gz") error "Input and output names are the same, set prefix in module configuration to disambiguate!" - if ("$query_vcf" == "${prefix}.vcf.gz") error "Input and output names are the same, set prefix in module configuration to disambiguate!" - if ("$query_vcf_index" == "${prefix}.vcf.gz.tbi") error "Input and output names are the same, set prefix in module configuration to disambiguate!" - if ("$query_vcf_index" == "${prefix}.vcf.gz.tbi") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + def regions = bed ? "-b $bed" : "" + if ("$truth_vcf" == "${prefix}.vcf") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + if ("$query_vcf" == "${prefix}.vcf") error "Input and output names are the same, set prefix in module configuration to disambiguate!" // dotnet /opt/Wittyer/Wittyer.dll might need to be replaced with new docker image """ mkdir bench dotnet /opt/Wittyer/Wittyer.dll \\ - --truthVcf=${truth_vcf} \\ - --inputVcf=${query_vcf} \\ - --outputDirectory=bench \\ + -t ${truth_vcf} \\ + -i ${query_vcf} \\ + -o bench \\ ${regions} \\ ${args} @@ -56,6 +54,9 @@ process WITTYER { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + if ("$truth_vcf" == "${prefix}.vcf") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + if ("$query_vcf" == "${prefix}.vcf") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + """ touch ${prefix}.json echo "" | gzip > ${prefix}.vcf.gz diff --git a/modules/nf-core/wittyer/meta.yml b/modules/nf-core/wittyer/meta.yml index 097f90fbbad..3fbba8680f9 100644 --- a/modules/nf-core/wittyer/meta.yml +++ b/modules/nf-core/wittyer/meta.yml @@ -21,19 +21,13 @@ input: - query_vcf: type: file description: A VCF with called variants to benchmark against the standard - pattern: "*.{vcf,vcf.gz}" - - query_vcf_index: - type: file - description: The index of the called VCF (optional) - pattern: "*.tbi" + pattern: "*.{vcf}" + - truth_vcf: type: file description: A standard VCF to compare against - pattern: "*.{vcf,vcf.gz}" - - truth_vcf_index: - type: file - description: The index of the standard VCF (optional) - pattern: "*.tbi" + pattern: "*.{vcf}" + - bed: type: file description: A BED file specifying regions to be included in the analysis (optional) diff --git a/modules/nf-core/wittyer/tests/main.nf.test b/modules/nf-core/wittyer/tests/main.nf.test index 3c23ffe66eb..75bf5996767 100644 --- a/modules/nf-core/wittyer/tests/main.nf.test +++ b/modules/nf-core/wittyer/tests/main.nf.test @@ -7,20 +7,42 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "wittyer" + tag "tabix/bgzip" test("human - simulatedSV - vcf_gz") { + config "./test.config" + setup { + run('TABIX_BGZIP', alias: 'TABIX_BGZIP_1') { + script "../../../nf-core/tabix/bgzip" + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true) + ] + """ + } + } + + run('TABIX_BGZIP', alias: 'TABIX_BGZIP_2') { + script "../../../nf-core/tabix/bgzip" + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv2'], checkIfExists: true) + ] + """ + } + } + } when { process { """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv2'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv2_tbi'], checkIfExists: true), - [] - ] + input[0] = TABIX_BGZIP_1.out.output.join(TABIX_BGZIP_2.out.output).map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [])} """ } } @@ -37,20 +59,45 @@ nextflow_process { } } + test("human - simulatedSV - vcf_gz - bed") { + config "./test.config" + + setup { + run('TABIX_BGZIP', alias: 'TABIX_BGZIP_1') { + script "../../../nf-core/tabix/bgzip" + + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true) + ] + """ + } + } - test("human - simulatedSV - vcf_gz - bed") { + run('TABIX_BGZIP', alias: 'TABIX_BGZIP_2') { + script "../../../nf-core/tabix/bgzip" + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['simulated_sv2'], checkIfExists: true) + ] + """ + } + } + } when { process { """ - input[0] = [ - [ id:'test_bed', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv2'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv2_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] + input[0] = TABIX_BGZIP_1.out.output + .join(TABIX_BGZIP_2.out.output) + .map{meta, vcf1, vcf2 -> + tuple(meta, vcf1, vcf2, + [file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)]) + } """ } } @@ -59,10 +106,10 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out).match() }, - { assert snapshot(process.out.bench_vcf).match("bed_bench_vcf") }, - { assert snapshot(process.out.bench_vcf_tbi).match("bed_bench_vcf_tbi") }, - { assert snapshot(process.out.report).match("bed_report") }, - { assert snapshot(process.out.version).match("bed_version") } + { assert snapshot(process.out.bench_vcf).match("bench2_vcf") }, + { assert snapshot(process.out.bench_vcf_tbi).match("bench2_vcf_tbi") }, + { assert snapshot(process.out.report).match("report2") }, + { assert snapshot(process.out.version).match("version2") } ) } @@ -74,13 +121,11 @@ nextflow_process { when { process { - """ + """ input[0] = [ [ id:'test_stub', single_end:false ], // meta map file(params.test_data['homo_sapiens']['illumina']['simulated_sv'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv_tbi'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['simulated_sv2'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['simulated_sv2_tbi'], checkIfExists: true), [] ] """ diff --git a/modules/nf-core/wittyer/tests/main.nf.test.snap b/modules/nf-core/wittyer/tests/main.nf.test.snap index a25d824420d..4fb5e48b7ad 100644 --- a/modules/nf-core/wittyer/tests/main.nf.test.snap +++ b/modules/nf-core/wittyer/tests/main.nf.test.snap @@ -5,62 +5,56 @@ "0": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.json:md5,c6515ada81b5ccf5aa5b4f1268da2800" + "test.json:md5,8dfd8086fcb0ccc677fb31ea1f3dfb67" ] ], "1": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.vcf.gz:md5,7e5f24415c80ca986e81be90f831e000" + "test.vcf.gz:md5,cc98541af04597aca412190ef2e30ad3" ] ], "2": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.vcf.gz.tbi:md5,e4de1e1d27208b56f5a7bfbe31542240" + "test.vcf.gz.tbi:md5,7edea8651ab3a419e132c9b0c9a5e18c" ] ], "3": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ], "bench_vcf": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.vcf.gz:md5,7e5f24415c80ca986e81be90f831e000" + "test.vcf.gz:md5,cc98541af04597aca412190ef2e30ad3" ] ], "bench_vcf_tbi": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.vcf.gz.tbi:md5,e4de1e1d27208b56f5a7bfbe31542240" + "test.vcf.gz.tbi:md5,7edea8651ab3a419e132c9b0c9a5e18c" ] ], "report": [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.json:md5,c6515ada81b5ccf5aa5b4f1268da2800" + "test.json:md5,8dfd8086fcb0ccc677fb31ea1f3dfb67" ] ], "versions": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ] } ], @@ -68,7 +62,41 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:41:49.782336703" + "timestamp": "2024-06-19T14:08:56.301601" + }, + "bench2_vcf": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,cc98541af04597aca412190ef2e30ad3" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-06-19T14:13:49.114615" + }, + "report2": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.json:md5,8dfd8086fcb0ccc677fb31ea1f3dfb67" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-06-19T14:13:49.159771" }, "stub_version": { "content": null, @@ -84,62 +112,56 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.json:md5,fb70eac691c1067167091ab2d3b12de3" + "test.json:md5,d1e6eccb85b0f4b5bf82336bbf1f8ce3" ] ], "1": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz:md5,ff56c3084a59507362f6b7b7dc46ffdc" + "test.vcf.gz:md5,c4d57ea31aefabe0b90bf971fb32ccf5" ] ], "2": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz.tbi:md5,b9b448e5f11eebbcfeb9a123e838caa4" + "test.vcf.gz.tbi:md5,0a7e5b371ec0103c945f5c15b15a952b" ] ], "3": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ], "bench_vcf": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz:md5,ff56c3084a59507362f6b7b7dc46ffdc" + "test.vcf.gz:md5,c4d57ea31aefabe0b90bf971fb32ccf5" ] ], "bench_vcf_tbi": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz.tbi:md5,b9b448e5f11eebbcfeb9a123e838caa4" + "test.vcf.gz.tbi:md5,0a7e5b371ec0103c945f5c15b15a952b" ] ], "report": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.json:md5,fb70eac691c1067167091ab2d3b12de3" + "test.json:md5,d1e6eccb85b0f4b5bf82336bbf1f8ce3" ] ], "versions": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ] } ], @@ -147,17 +169,16 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:41:44.466462714" + "timestamp": "2024-06-19T14:01:43.19118" }, - "bench_vcf": { + "bench2_vcf_tbi": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz:md5,ff56c3084a59507362f6b7b7dc46ffdc" + "test.vcf.gz.tbi:md5,7edea8651ab3a419e132c9b0c9a5e18c" ] ] ], @@ -165,17 +186,24 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:36:47.523573536" + "timestamp": "2024-06-19T14:13:49.14488" }, - "bench_vcf_tbi": { + "version2": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-06-19T14:13:49.167498" + }, + "bench_vcf": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.vcf.gz.tbi:md5,b9b448e5f11eebbcfeb9a123e838caa4" + "test.vcf.gz:md5,c4d57ea31aefabe0b90bf971fb32ccf5" ] ] ], @@ -183,17 +211,16 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:36:47.532504108" + "timestamp": "2024-06-19T14:01:43.23893" }, - "report": { + "bench_vcf_tbi": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.json:md5,fb70eac691c1067167091ab2d3b12de3" + "test.vcf.gz.tbi:md5,0a7e5b371ec0103c945f5c15b15a952b" ] ] ], @@ -201,17 +228,16 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:36:47.537692046" + "timestamp": "2024-06-19T14:01:43.278491" }, - "bed_report": { + "report": { "content": [ [ [ { - "id": "test_bed", - "single_end": false + "id": "test" }, - "test_bed.json:md5,c6515ada81b5ccf5aa5b4f1268da2800" + "test.json:md5,d1e6eccb85b0f4b5bf82336bbf1f8ce3" ] ] ], @@ -219,15 +245,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:36:52.863563564" - }, - "bed_version": { - "content": null, - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T09:36:52.868467701" + "timestamp": "2024-06-19T14:01:43.317753" }, "version": { "content": null, @@ -268,7 +286,7 @@ ] ], "3": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ], "bench_vcf": [ [ @@ -298,7 +316,7 @@ ] ], "versions": [ - "versions.yml:md5,4a5148f206a3b12f0ebe87e81cedc31a" + "versions.yml:md5,0db2ca1c465a92f9352d4cfc4e5082d7" ] } ], @@ -306,42 +324,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:36:57.215084162" - }, - "bed_bench_vcf": { - "content": [ - [ - [ - { - "id": "test_bed", - "single_end": false - }, - "test_bed.vcf.gz:md5,7e5f24415c80ca986e81be90f831e000" - ] - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T09:36:52.852045028" - }, - "bed_bench_vcf_tbi": { - "content": [ - [ - [ - { - "id": "test_bed", - "single_end": false - }, - "test_bed.vcf.gz.tbi:md5,e4de1e1d27208b56f5a7bfbe31542240" - ] - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T09:36:52.857651771" + "timestamp": "2024-06-19T14:01:49.799446" } } \ No newline at end of file diff --git a/modules/nf-core/wittyer/tests/test.config b/modules/nf-core/wittyer/tests/test.config new file mode 100644 index 00000000000..afd097c942d --- /dev/null +++ b/modules/nf-core/wittyer/tests/test.config @@ -0,0 +1,8 @@ +process{ + withName: TABIX_BGZIP_1 { + ext.prefix = {input.toString() - ".vcf.gz"} + } + withName: TABIX_BGZIP_2 { + ext.prefix = {input.toString() - ".vcf.gz"} + } +}