From a426c4f62ad91a9ca4cac060cd12301ea8257dfd Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 13:44:26 +0200 Subject: [PATCH 1/8] sort annotsv VCFs --- conf/modules.config | 7 ++++++- subworkflows/local/vcf_annotate_vep_annotsv/main.nf | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/conf/modules.config b/conf/modules.config index 782f805f..ed24085e 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -221,10 +221,15 @@ process { } withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:BCFTOOLS_CONCAT\$" { - ext.prefix = "annotsv_annotated" + ext.prefix = "annotsv_annotated_unsorted" ext.args = "--output-type z --naive-force" } + withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:BCFTOOLS_SORT\$" { + ext.prefix = "annotsv_annotated" + ext.args = "--output-type z --write-index=tbi" + } + withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:ENSEMBLVEP_VEP\$" { ext.prefix = {"${meta.id}.vep"} ext.args = {[ diff --git a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf index cc24bd79..b3e5aafb 100644 --- a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf +++ b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf @@ -11,6 +11,7 @@ include { TABIX_TABIX as TABIX_ANNOTSV } from '../../../modules/nf- include { TABIX_TABIX as TABIX_VEP } from '../../../modules/nf-core/tabix/tabix/main' include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter/main' include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat/main' +include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort/main' workflow VCF_ANNOTATE_VEP_ANNOTSV { take: @@ -104,13 +105,13 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { ) ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions.first()) - TABIX_ANNOTSV( + BCFTOOLS_SORT( BCFTOOLS_CONCAT.out.vcf ) - ch_versions = ch_versions.mix(TABIX_ANNOTSV.out.versions.first()) + ch_versions = ch_versions.mix(BCFTOOLS_SORT.out.versions.first()) - def ch_annotsv_output = BCFTOOLS_CONCAT.out.vcf - .join(TABIX_ANNOTSV.out.tbi, failOnDuplicate:true, failOnMismatch:true) + def ch_annotsv_output = BCFTOOLS_SORT.out.vcf + .join(BCFTOOLS_SORT.out.tbi, failOnDuplicate:true, failOnMismatch:true) ENSEMBLVEP_VEP( ch_vcfs, From bfd990df3caaaf4bca08f2bb84fd7aaf9eb8d5fb Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 13:46:10 +0200 Subject: [PATCH 2/8] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd67f09..29543936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 1. Fail the pipeline when the sex determination failed. This will now prompt the user to add the sex to the samplesheet so the pipeline doesn't do any wrong assumptions 2. Fixed the Jasmine module output VCFs being empty when no variants have been merged. This file now contains the header of one of the input VCFs +3. AnnotSV VCF files are now sorted before trying to combine it with the VEP output. ## v0.2.0 - [19 July 2024] - Mighty Manneken Pis From 4f94203bb7da6d15dc7679773bc263ffbc518811 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 13:52:25 +0200 Subject: [PATCH 3/8] add missing contig to header --- subworkflows/local/vcf_annotate_vep_annotsv/main.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf index b3e5aafb..724e09ec 100644 --- a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf +++ b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf @@ -80,7 +80,8 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { } def val_additional_headers = [ - '##INFO=' ] BCFTOOLS_CONSENSUS_REHEADER( From 4c21c2e6202e043bd7204895ef39ddf0d4139b32 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 14:10:53 +0200 Subject: [PATCH 4/8] use fai instead of contig addition --- subworkflows/local/vcf_annotate_vep_annotsv/main.nf | 6 +++--- workflows/structural.nf | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf index 724e09ec..b93ce406 100644 --- a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf +++ b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf @@ -18,6 +18,7 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { ch_vcfs // channel: [mandatory] [ val(meta), path(vcf), path(tbi) ] VCFs containing the called structural variants ch_small_variants // channel: [mandatory] [ val(meta), path(vcf) ] VCFs containing small variants used in AnnotSV ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ] => The fasta reference file + ch_fai // channel: [mandatory] [ val(meta), path(fasta) ] => The fasta reference file ch_annotsv_annotations // channel: [mandatory] [ val(meta), path(annotations) ] => The annotations for AnnotSV ch_annotsv_candidate_genes // channel: [optional] [ val(meta), path(candidate_genes) ] ch_annotsv_gene_transcripts // channel: [optional] [ val(meta), path(gene_transcripts) ] @@ -80,13 +81,12 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { } def val_additional_headers = [ - '##INFO=' + '##INFO= Date: Wed, 9 Jul 2025 14:20:40 +0200 Subject: [PATCH 5/8] revert last commit --- subworkflows/local/vcf_annotate_vep_annotsv/main.nf | 6 +++--- workflows/structural.nf | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf index b93ce406..724e09ec 100644 --- a/subworkflows/local/vcf_annotate_vep_annotsv/main.nf +++ b/subworkflows/local/vcf_annotate_vep_annotsv/main.nf @@ -18,7 +18,6 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { ch_vcfs // channel: [mandatory] [ val(meta), path(vcf), path(tbi) ] VCFs containing the called structural variants ch_small_variants // channel: [mandatory] [ val(meta), path(vcf) ] VCFs containing small variants used in AnnotSV ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ] => The fasta reference file - ch_fai // channel: [mandatory] [ val(meta), path(fasta) ] => The fasta reference file ch_annotsv_annotations // channel: [mandatory] [ val(meta), path(annotations) ] => The annotations for AnnotSV ch_annotsv_candidate_genes // channel: [optional] [ val(meta), path(candidate_genes) ] ch_annotsv_gene_transcripts // channel: [optional] [ val(meta), path(gene_transcripts) ] @@ -81,12 +80,13 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV { } def val_additional_headers = [ - '##INFO=' ] BCFTOOLS_CONSENSUS_REHEADER( ch_consensus_reheader_input, - ch_fai, + [[],[]], val_additional_headers ) ch_versions = ch_versions.mix(BCFTOOLS_CONSENSUS_REHEADER.out.versions.first()) diff --git a/workflows/structural.nf b/workflows/structural.nf index 5b104616..c899bd54 100644 --- a/workflows/structural.nf +++ b/workflows/structural.nf @@ -391,7 +391,6 @@ workflow STRUCTURAL { ch_annotation_input, ch_inputs.small_variants, ch_fasta, - ch_fai, ch_annotsv_annotations, ch_annotsv_candidate_genes, ch_annotsv_gene_transcripts, From 1c24fcaf44c7d2b6144faaa426e04114e072ccfb Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 14:26:09 +0200 Subject: [PATCH 6/8] small fix in reheader --- modules/local/bcftools/consensus_reheader/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/local/bcftools/consensus_reheader/main.nf b/modules/local/bcftools/consensus_reheader/main.nf index 636f58f5..b20b9f81 100644 --- a/modules/local/bcftools/consensus_reheader/main.nf +++ b/modules/local/bcftools/consensus_reheader/main.nf @@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS_REHEADER { def add_additional = additional_headers ? """ cat <<-EOF >> ${prefix}.temp.txt - ${additional_headers.join("\t\n")} +${additional_headers.join("\t\n")} EOF """ : "" From 46fb81e3cf131e20677a038066c2b85f21880f77 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 14:34:37 +0200 Subject: [PATCH 7/8] small fix in reheader --- modules/local/bcftools/consensus_reheader/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/local/bcftools/consensus_reheader/main.nf b/modules/local/bcftools/consensus_reheader/main.nf index b20b9f81..000a00fd 100644 --- a/modules/local/bcftools/consensus_reheader/main.nf +++ b/modules/local/bcftools/consensus_reheader/main.nf @@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS_REHEADER { def add_additional = additional_headers ? """ cat <<-EOF >> ${prefix}.temp.txt -${additional_headers.join("\t\n")} +${additional_headers.join("\t\t\n")} EOF """ : "" From a08911586e7f021eb03030190ddf04d049cc4cd0 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Wed, 9 Jul 2025 14:45:09 +0200 Subject: [PATCH 8/8] small fix in reheader --- modules/local/bcftools/consensus_reheader/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/local/bcftools/consensus_reheader/main.nf b/modules/local/bcftools/consensus_reheader/main.nf index 000a00fd..2483c1d3 100644 --- a/modules/local/bcftools/consensus_reheader/main.nf +++ b/modules/local/bcftools/consensus_reheader/main.nf @@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS_REHEADER { def add_additional = additional_headers ? """ cat <<-EOF >> ${prefix}.temp.txt -${additional_headers.join("\t\t\n")} + ${additional_headers.join("\n ")} EOF """ : ""