Skip to content

Commit

Permalink
wittyer input fix and version update (#5844)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubranarci authored Jun 19, 2024
1 parent f82c181 commit be84844
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 153 deletions.
12 changes: 12 additions & 0 deletions modules/nf-core/wittyer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions modules/nf-core/wittyer/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
21 changes: 11 additions & 10 deletions modules/nf-core/wittyer/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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) {
error "WITTYER module does not support Conda. Please use Docker / Singularity / Podman instead."
}

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
Expand All @@ -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}
Expand All @@ -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
Expand Down
14 changes: 4 additions & 10 deletions modules/nf-core/wittyer/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
93 changes: 69 additions & 24 deletions modules/nf-core/wittyer/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])}
"""
}
}
Expand All @@ -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)])
}
"""
}
}
Expand All @@ -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") }
)
}

Expand All @@ -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),
[]
]
"""
Expand Down
Loading

0 comments on commit be84844

Please sign in to comment.