mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-11 04:33:10 +00:00
57 lines
1.9 KiB
Text
57 lines
1.9 KiB
Text
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:
|
|
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("done"), path("progress"), path("*.log") , emit: logs
|
|
tuple val(meta), path("*{tp,fn,fp,baseline}.vcf.gz.tbi"), path("*{tp,fn,fp,baseline}.vcf.gz") , emit: vcf
|
|
tuple val(meta), path("*.tsv.gz") , emit: roc
|
|
tuple val(meta), path("summary.txt") , emit: summary
|
|
tuple val(meta), path("phasing.txt") , emit: phasing
|
|
path "versions.yml" , emit: versions
|
|
|
|
when:
|
|
task.ext.when == null || task.ext.when
|
|
|
|
script:
|
|
def args = task.ext.args ?: ""
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
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"
|
|
|
|
"""
|
|
$truth_index
|
|
$query_index
|
|
|
|
rtg vcfeval \\
|
|
$args \\
|
|
--baseline=$truth_vcf \\
|
|
$bed_regions \\
|
|
$eval_regions \\
|
|
--calls=$query_vcf \\
|
|
--output=$prefix \\
|
|
--template=$sdf \\
|
|
--threads=$task.cpus \\
|
|
|
|
mv ${prefix}/* .
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
rtg-tools: \$(echo \$(rtg version | head -n 1 | awk '{print \$4}'))
|
|
END_VERSIONS
|
|
"""
|
|
}
|