Skip to content
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

update vcfeval inputs + nf-test conversion #6714

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/nf-core/rtgtools/rocplot/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true)
]
input[1] = UNTAR.out.untar
println(projectDir)
Expand Down
20 changes: 10 additions & 10 deletions modules/nf-core/rtgtools/vcfeval/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ process RTGTOOLS_VCFEVAL {
'biocontainers/rtg-tools:3.12.1--hdfd78af_0' }"

input:
tuple val(meta), path(query_vcf), path(query_vcf_tbi), path(truth_vcf), path(truth_vcf_tbi), path(truth_bed), path(evaluation_bed)
tuple val(meta), path(query_vcf), path(query_vcf_tbi), path(truth_vcf), path(truth_vcf_tbi), path(truth_bed), path(regions_bed)
tuple val(meta2), path(sdf)

output:
Expand All @@ -33,8 +33,8 @@ process RTGTOOLS_VCFEVAL {
script:
def args = task.ext.args ?: ""
def prefix = task.ext.prefix ?: "${meta.id}"
def bed_regions = truth_bed ? "--bed-regions=${truth_bed}" : ""
def eval_regions = evaluation_bed ? "--evaluation-regions=${evaluation_bed}" : ""
def bed_regions = regions_bed ? "--bed-regions=${regions_bed}" : ""
def eval_regions = truth_bed ? "--evaluation-regions=${truth_bed}" : ""
def truth_index = truth_vcf_tbi ? "" : "rtg index ${truth_vcf}"
def query_index = query_vcf_tbi ? "" : "rtg index ${query_vcf}"
def avail_mem = task.memory.toGiga() + "G"
Expand Down Expand Up @@ -68,17 +68,17 @@ process RTGTOOLS_VCFEVAL {
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.tp.vcf.gz
echo | gzip > ${prefix}.tp.vcf.gz
touch ${prefix}.tp.vcf.gz.tbi
touch ${prefix}.fn.vcf.gz
echo | gzip > ${prefix}.fn.vcf.gz
touch ${prefix}.fn.vcf.gz.tbi
touch ${prefix}.fp.vcf.gz
echo | gzip > ${prefix}.fp.vcf.gz
touch ${prefix}.fp.vcf.gz.tbi
touch ${prefix}.tp-baseline.vcf.gz
echo | gzip > ${prefix}.tp-baseline.vcf.gz
touch ${prefix}.tp-baseline.vcf.gz.tbi
touch ${prefix}.snp_roc.tsv.gz
touch ${prefix}.non_snp_roc.tsv.gz
touch ${prefix}.weighted_roc.tsv.gz
echo | gzip > ${prefix}.snp_roc.tsv.gz
echo | gzip > ${prefix}.non_snp_roc.tsv.gz
echo | gzip > ${prefix}.weighted_roc.tsv.gz
touch ${prefix}.summary.txt
touch ${prefix}.phasing.txt

Expand Down
4 changes: 3 additions & 1 deletion modules/nf-core/rtgtools/vcfeval/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ input:
type: file
description: A BED file containining the strict regions where VCFeval should
only evaluate the fully overlapping variants (optional)
This input should be used to provide the golden truth BED files.
pattern: "*.bed"
- evaluation_bed:
- regions_bed:
type: file
description: A BED file containing the regions where VCFeval will evaluate every
fully and partially overlapping variant (optional)
This input should be used to provide the regions used by the analysis
pattern: "*.bed"
- - meta2:
type: map
Expand Down
113 changes: 113 additions & 0 deletions modules/nf-core/rtgtools/vcfeval/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
nextflow_process {

name "Test Process RTGTOOLS_VCFEVAL"
script "../main.nf"
process "RTGTOOLS_VCFEVAL"

tag "modules"
tag "modules_nfcore"
tag "rtgtools"
tag "rtgtools/vcfeval"
tag "untar"

setup {
run("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = Channel.value([
[id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome_sdf.tar.gz', checkIfExists:true)
])
"""
}
}
}

test("homo_sapiens - [vcf, tbi, truth, truth_tbi, truth_bed, regions_bed], sdf") {

when {
process {
"""
input[0] = Channel.of([
[id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists:true)
])
input[1] = UNTAR.out.untar
"""
}
}

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

}

test("homo_sapiens - [vcf, [], truth, [], [], []], sdf") {

when {
process {
"""
input[0] = Channel.of([
[id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists:true),
[],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists:true),
[],
[],
[]
])
input[1] = UNTAR.out.untar
"""
}
}

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

}

test("homo_sapiens - [vcf, tbi, truth, truth_tbi, truth_bed, regions_bed], sdf - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists:true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists:true)
])
input[1] = UNTAR.out.untar
"""
}
}

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

}

}
Loading
Loading