From e2bc234a0417c9a1a65f2bebddb572ba3045d1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Sch=C3=B6nherr?= Date: Thu, 3 Oct 2024 09:12:31 +0200 Subject: [PATCH] Create tabix index to skip HTSJDK index creation --- modules/local/quality_control/quality_control_vcf.nf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/local/quality_control/quality_control_vcf.nf b/modules/local/quality_control/quality_control_vcf.nf index dcca87c..37f6820 100644 --- a/modules/local/quality_control/quality_control_vcf.nf +++ b/modules/local/quality_control/quality_control_vcf.nf @@ -36,6 +36,18 @@ process QUALITY_CONTROL_VCF { set +e echo '${JsonOutput.toJson(params.refpanel)}' > reference-panel.json + # Verify if VCF files are valid + for vcf in $vcf_files; do + # Attempt to create the index using tabix + if ! output=\$(tabix -p vcf "\$vcf" 2>&1); then + echo ::group type=error + echo "The provided VCF file is malformed." + echo "Error: \$output" + echo ::endgroup:: + exit 1 + fi + done + # TODO: create directories in java mkdir ${chunksDir} mkdir ${metaFilesDir}