Moved untarring the genome sdf folder to the test itself

This commit is contained in:
Nicolas Vannieuwkerke 2022-05-09 09:20:42 +02:00
parent 6fd9246aef
commit d18af7358a
2 changed files with 37 additions and 23 deletions

View file

@ -8,8 +8,8 @@ process RTGTOOLS_VCFEVAL {
'quay.io/biocontainers/rtg-tools:3.12.1--hdfd78af_0' }" 'quay.io/biocontainers/rtg-tools:3.12.1--hdfd78af_0' }"
input: input:
tuple val(meta), path(query_vcf), path(query_vcf_tbi), path(bed) tuple val(meta), path(query_vcf), path(query_vcf_tbi), path(bed)
tuple path(truth_vcf), path(truth_vcf_tbi), tuple path(truth_vcf), path(truth_vcf_tbi)
path(sdf) path(sdf)
output: output:
@ -26,15 +26,7 @@ process RTGTOOLS_VCFEVAL {
def truth_index = truth_vcf_tbi ? "" : "rtg index $truth_vcf" def truth_index = truth_vcf_tbi ? "" : "rtg index $truth_vcf"
def query_index = query_vcf_tbi ? "" : "rtg index $query_vcf" def query_index = query_vcf_tbi ? "" : "rtg index $query_vcf"
sdf_basename = sdf.getBaseName().replace(".tar","")
tar_decomp = ""
if((sdf =~ /.tar.gz\b/).find() == true) {
tar_decomp = "tar -xzf $sdf"
}
""" """
$tar_decomp
$truth_index $truth_index
$query_index $query_index
@ -44,7 +36,7 @@ process RTGTOOLS_VCFEVAL {
$regions \\ $regions \\
--calls=$query_vcf \\ --calls=$query_vcf \\
--output=$prefix \\ --output=$prefix \\
--template=$sdf_basename \\ --template=$sdf \\
--threads=$task.cpus \\ --threads=$task.cpus \\
> ${prefix}_results.txt > ${prefix}_results.txt

View file

@ -3,39 +3,61 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { RTGTOOLS_VCFEVAL } from '../../../../modules/rtgtools/vcfeval/main.nf' include { RTGTOOLS_VCFEVAL } from '../../../../modules/rtgtools/vcfeval/main.nf'
include { UNTAR } from '../../../modules/untar/main.nf'
workflow test_rtgtools_vcfeval { workflow test_rtgtools_vcfeval {
input = [ input = [
[ id:'test' ], // meta map [ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz_tbi'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz_tbi'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
] ]
sdf = Channel.value( truth = [
file(params.test_data['homo_sapiens']['genome']['genome_21_sdf']) file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true),
) file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true)
]
RTGTOOLS_VCFEVAL ( input, sdf ) compressed_sdf = [
[],
file(params.test_data['homo_sapiens']['genome']['genome_21_sdf'])
]
sdf = UNTAR( compressed_sdf ).untar
.map({
meta, folder ->
folder
})
RTGTOOLS_VCFEVAL ( input, truth, sdf )
} }
workflow test_rtgtools_vcfeval_no_index { workflow test_rtgtools_vcfeval_no_index {
input = [ input = [
[ id:'test' ], // meta map [ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true),
[],
file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true),
[], [],
file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
] ]
sdf = Channel.value( truth = [
file(params.test_data['homo_sapiens']['genome']['genome_21_sdf']) file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true),
) []
]
RTGTOOLS_VCFEVAL ( input, sdf ) compressed_sdf = [
[],
file(params.test_data['homo_sapiens']['genome']['genome_21_sdf'])
]
sdf = UNTAR( compressed_sdf ).untar
.map({
meta, folder ->
[folder]
})
RTGTOOLS_VCFEVAL ( input, truth, sdf )
} }