2022-05-04 14:51:09 +00:00
|
|
|
process RTGTOOLS_VCFEVAL {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::rtg-tools=3.12.1" : null)
|
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/rtg-tools:3.12.1--hdfd78af_0':
|
|
|
|
'quay.io/biocontainers/rtg-tools:3.12.1--hdfd78af_0' }"
|
|
|
|
|
|
|
|
input:
|
2022-05-09 13:55:48 +00:00
|
|
|
tuple val(meta), path(query_vcf), path(query_vcf_tbi)
|
2022-05-09 07:20:42 +00:00
|
|
|
tuple path(truth_vcf), path(truth_vcf_tbi)
|
2022-05-09 13:51:19 +00:00
|
|
|
path(truth_regions)
|
2022-05-10 07:35:42 +00:00
|
|
|
path(evaluation_regions)
|
2022-05-06 12:23:40 +00:00
|
|
|
path(sdf)
|
2022-05-04 14:51:09 +00:00
|
|
|
|
|
|
|
output:
|
2022-05-10 10:34:52 +00:00
|
|
|
tuple val(meta), path("**results/{done,progress,*.log}") , emit: logs
|
2022-05-10 10:22:49 +00:00
|
|
|
tuple val(meta), path("**tp.vcf.gz"), path("**tp.vcf.gz.tbi") , emit: tp
|
|
|
|
tuple val(meta), path("**fn.vcf.gz"), path("**fn.vcf.gz.tbi") , emit: fn
|
|
|
|
tuple val(meta), path("**fp.vcf.gz"), path("**fp.vcf.gz.tbi") , emit: fp
|
|
|
|
tuple val(meta), path("**baseline.vcf.gz"), path("**baseline.vcf.gz.tbi") , emit: baseline
|
|
|
|
tuple val(meta), path("**.tsv.gz") , emit: roc
|
2022-05-10 10:34:52 +00:00
|
|
|
tuple val(meta), path("**results/summary.txt") , emit: summary
|
|
|
|
tuple val(meta), path("**results/phasing.txt") , emit: phasing
|
2022-05-10 10:05:42 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2022-05-04 14:51:09 +00:00
|
|
|
|
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
|
|
|
script:
|
2022-05-10 07:35:42 +00:00
|
|
|
def args = task.ext.args ?: ""
|
2022-05-04 14:51:09 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2022-05-10 07:35:42 +00:00
|
|
|
def bed_regions = truth_regions ? "--bed-regions=$truth_regions" : ""
|
|
|
|
def eval_regions = evaluation_regions ? "--evaluation-regions=$evaluation_regions" : ""
|
2022-05-06 12:23:40 +00:00
|
|
|
def truth_index = truth_vcf_tbi ? "" : "rtg index $truth_vcf"
|
|
|
|
def query_index = query_vcf_tbi ? "" : "rtg index $query_vcf"
|
2022-05-06 14:21:32 +00:00
|
|
|
|
2022-05-04 14:51:09 +00:00
|
|
|
"""
|
2022-05-06 12:23:40 +00:00
|
|
|
$truth_index
|
|
|
|
$query_index
|
|
|
|
|
|
|
|
rtg vcfeval \\
|
|
|
|
$args \\
|
|
|
|
--baseline=$truth_vcf \\
|
2022-05-10 07:35:42 +00:00
|
|
|
$bed_regions \\
|
|
|
|
$eval_regions \\
|
2022-05-06 12:23:40 +00:00
|
|
|
--calls=$query_vcf \\
|
2022-05-10 10:34:52 +00:00
|
|
|
--output=${prefix}_results \\
|
2022-05-09 07:20:42 +00:00
|
|
|
--template=$sdf \\
|
2022-05-06 12:23:40 +00:00
|
|
|
--threads=$task.cpus \\
|
|
|
|
|
2022-05-10 10:05:42 +00:00
|
|
|
|
2022-05-04 14:51:09 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
2022-05-06 12:23:40 +00:00
|
|
|
rtg-tools: \$(echo \$(rtg version | head -n 1 | awk '{print \$4}'))
|
2022-05-04 14:51:09 +00:00
|
|
|
END_VERSIONS
|
|
|
|
"""
|
|
|
|
}
|