diff --git a/modules/rtgtools/vcfeval/main.nf b/modules/rtgtools/vcfeval/main.nf index 1d981204..4e27ed6b 100644 --- a/modules/rtgtools/vcfeval/main.nf +++ b/modules/rtgtools/vcfeval/main.nf @@ -11,19 +11,21 @@ process RTGTOOLS_VCFEVAL { tuple val(meta), path(query_vcf), path(query_vcf_tbi) tuple path(truth_vcf), path(truth_vcf_tbi) path(truth_regions) + path(evaluation_regions) path(sdf) output: - tuple val(meta), path("*.txt"), emit: results - path "versions.yml" , emit: versions + tuple val(meta), path("${task.ext.prefix ?: meta.id}/*") , emit: results + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" - def regions = truth_regions ? "--bed-regions=$truth_regions" : "" + def bed_regions = truth_regions ? "--bed-regions=$truth_regions" : "" + def eval_regions = evaluation_regions ? "--evaluation-regions=$evaluation_regions" : "" def truth_index = truth_vcf_tbi ? "" : "rtg index $truth_vcf" def query_index = query_vcf_tbi ? "" : "rtg index $query_vcf" @@ -34,12 +36,12 @@ process RTGTOOLS_VCFEVAL { rtg vcfeval \\ $args \\ --baseline=$truth_vcf \\ - $regions \\ + $bed_regions \\ + $eval_regions \\ --calls=$query_vcf \\ --output=$prefix \\ --template=$sdf \\ --threads=$task.cpus \\ - > ${prefix}_results.txt cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/rtgtools/vcfeval/meta.yml b/modules/rtgtools/vcfeval/meta.yml index baf9e87a..1f448fdc 100644 --- a/modules/rtgtools/vcfeval/meta.yml +++ b/modules/rtgtools/vcfeval/meta.yml @@ -37,7 +37,11 @@ input: pattern: "*.tbi" - truth_regions: type: file - description: The BED file containing the truth regions + description: A BED file containining the strict regions where VCFeval should only evaluate the fully overlapping variants (optional) + pattern: "*.bed" + - evaluation_regions: + type: file + description: A BED file containing the regions where VCFeval will evaluate every fully and partially overlapping variant (optional) pattern: "*.bed" - sdf: type: file @@ -56,8 +60,8 @@ output: pattern: "versions.yml" - results: type: file - description: A text file containing the results of the benchmark - pattern: "*.txt" + description: A folder containing all results of the evaluation + pattern: "*" authors: - "@nvnieuwk" diff --git a/tests/modules/rtgtools/vcfeval/main.nf b/tests/modules/rtgtools/vcfeval/main.nf index 9a28e2d7..9a1c3c71 100644 --- a/tests/modules/rtgtools/vcfeval/main.nf +++ b/tests/modules/rtgtools/vcfeval/main.nf @@ -18,7 +18,9 @@ workflow test_rtgtools_vcfeval { file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true) ] - bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + truth_regions = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + + evaluation_regions = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) compressed_sdf = [ [], @@ -32,10 +34,10 @@ workflow test_rtgtools_vcfeval { }) - RTGTOOLS_VCFEVAL ( input, truth, bed, sdf ) + RTGTOOLS_VCFEVAL ( input, truth, truth_regions, evaluation_regions, sdf ) } -workflow test_rtgtools_vcfeval_no_index { +workflow test_rtgtools_vcfeval_no_optional_inputs { input = [ [ id:'test' ], // meta map @@ -48,7 +50,9 @@ workflow test_rtgtools_vcfeval_no_index { [] ] - bed = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + truth_regions = [] + + evaluation_regions = [] compressed_sdf = [ [], @@ -61,5 +65,5 @@ workflow test_rtgtools_vcfeval_no_index { [folder] }) - RTGTOOLS_VCFEVAL ( input, truth, bed, sdf ) + RTGTOOLS_VCFEVAL ( input, truth, truth_regions, evaluation_regions, sdf ) } diff --git a/tests/modules/rtgtools/vcfeval/test.yml b/tests/modules/rtgtools/vcfeval/test.yml index 86252c68..06d39701 100644 --- a/tests/modules/rtgtools/vcfeval/test.yml +++ b/tests/modules/rtgtools/vcfeval/test.yml @@ -4,16 +4,73 @@ - rtgtools - rtgtools/vcfeval files: - - path: output/rtgtools/test_results.txt - md5sum: 2e011aa6e54d258fcc3b45b2dda02ae4 + - path: output/rtgtools/test/done + md5sum: 8b5623b26ee9b8722816afbec270bff0 + - path: output/rtgtools/test/fn.vcf.gz + md5sum: 4577a8c3226b9f8ed9e260c3bd4b1259 + - path: output/rtgtools/test/fn.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/fp.vcf.gz + md5sum: 1417bb8ac7a0e202df660291a74de0db + - path: output/rtgtools/test/fp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/non_snp_roc.tsv.gz + md5sum: 8fd51a1e5084d15d43880cb1e31a0180 + - path: output/rtgtools/test/phasing.txt + md5sum: 133677dbd8be657439ea2b03fdfb8795 + - path: output/rtgtools/test/progress + - path: output/rtgtools/test/snp_roc.tsv.gz + md5sum: ff2ece544adfcefaa06da054876a9ae3 + - path: output/rtgtools/test/summary.txt + md5sum: f4c8df93c8bdab603036bbc27b4a28c3 + - path: output/rtgtools/test/tp-baseline.vcf.gz + md5sum: 4577a8c3226b9f8ed9e260c3bd4b1259 + - path: output/rtgtools/test/tp-baseline.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/tp.vcf.gz + md5sum: 1417bb8ac7a0e202df660291a74de0db + - path: output/rtgtools/test/tp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/vcfeval.log + - path: output/rtgtools/test/weighted_roc.tsv.gz + md5sum: 5209f1bdeb03704714ae92b183d08e0f - path: output/rtgtools/versions.yml -- name: rtgtools vcfeval test_rtgtools_vcfeval_no_index - command: nextflow run tests/modules/rtgtools/vcfeval -entry test_rtgtools_vcfeval_no_index -c tests/config/nextflow.config +- name: rtgtools vcfeval test_rtgtools_vcfeval_no_optional_inputs + command: nextflow run tests/modules/rtgtools/vcfeval -entry test_rtgtools_vcfeval_no_optional_inputs -c tests/config/nextflow.config tags: - rtgtools - rtgtools/vcfeval files: - - path: output/rtgtools/test_results.txt - md5sum: 2e011aa6e54d258fcc3b45b2dda02ae4 + - path: output/rtgtools/test/done + md5sum: 8b5623b26ee9b8722816afbec270bff0 + - path: output/rtgtools/test/fn.vcf.gz + md5sum: e51420e4be520ae309a2384830bf4c15 + - path: output/rtgtools/test/fn.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/fp.vcf.gz + md5sum: 7d818cf526983de6cbb5cf517c44a8f7 + - path: output/rtgtools/test/fp.vcf.gz.tbi + md5sum: 092a7a3162e7cff25d273525751eb284 + - path: output/rtgtools/test/non_snp_roc.tsv.gz + md5sum: a535fb80081b43b19788347152b6b8b4 + - path: output/rtgtools/test/phasing.txt + md5sum: 133677dbd8be657439ea2b03fdfb8795 + - path: output/rtgtools/test/progress + - path: output/rtgtools/test/snp_roc.tsv.gz + md5sum: 6006656c4a534935c7873398287bc110 + - path: output/rtgtools/test/summary.txt + md5sum: f33feb32f84958fb931063044fba369b + - path: output/rtgtools/test/tp-baseline.vcf.gz + md5sum: ed68ea567a26d3b864ada79e9253bc97 + - path: output/rtgtools/test/tp-baseline.vcf.gz.tbi + md5sum: 3518deff814eed340b0f5386294b5879 + - path: output/rtgtools/test/tp.vcf.gz + md5sum: 92fd51021d101c99da066324655d24c9 + - path: output/rtgtools/test/tp.vcf.gz.tbi + md5sum: 169063c1f570f0055059f3cb3518a8b4 + - path: output/rtgtools/test/vcfeval.log + - path: output/rtgtools/test/weighted_roc.tsv.gz + md5sum: 0ba825084bd6b94accdf54fff23ea18c - path: output/rtgtools/versions.yml +