Skip to content

Commit 4bc3068

Browse files
authored
sort annotsv VCFs (#114)
* sort annotsv VCFs * changelog * add missing contig to header * use fai instead of contig addition * revert last commit * small fix in reheader * small fix in reheader * small fix in reheader
1 parent 58de67f commit 4bc3068

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828

2929
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
3030
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
31+
3. AnnotSV VCF files are now sorted before trying to combine it with the VEP output.
3132

3233
## v0.2.0 - [19 July 2024] - Mighty Manneken Pis
3334

conf/modules.config

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,15 @@ process {
221221
}
222222

223223
withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:BCFTOOLS_CONCAT\$" {
224-
ext.prefix = "annotsv_annotated"
224+
ext.prefix = "annotsv_annotated_unsorted"
225225
ext.args = "--output-type z --naive-force"
226226
}
227227

228+
withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:BCFTOOLS_SORT\$" {
229+
ext.prefix = "annotsv_annotated"
230+
ext.args = "--output-type z --write-index=tbi"
231+
}
232+
228233
withName: "^.*VCF_ANNOTATE_VEP_ANNOTSV:ENSEMBLVEP_VEP\$" {
229234
ext.prefix = {"${meta.id}.vep"}
230235
ext.args = {[

modules/local/bcftools/consensus_reheader/main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ process BCFTOOLS_CONSENSUS_REHEADER {
2323
def add_additional = additional_headers ?
2424
"""
2525
cat <<-EOF >> ${prefix}.temp.txt
26-
${additional_headers.join("\t\n")}
26+
${additional_headers.join("\n ")}
2727
EOF
2828
""" : ""
2929

subworkflows/local/vcf_annotate_vep_annotsv/main.nf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ include { TABIX_TABIX as TABIX_ANNOTSV } from '../../../modules/nf-
1111
include { TABIX_TABIX as TABIX_VEP } from '../../../modules/nf-core/tabix/tabix/main'
1212
include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter/main'
1313
include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat/main'
14+
include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort/main'
1415

1516
workflow VCF_ANNOTATE_VEP_ANNOTSV {
1617
take:
@@ -79,7 +80,8 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV {
7980
}
8081

8182
def val_additional_headers = [
82-
'##INFO=<ID=BNDrescue,Number=0,Type=Flag,Description="The other BND of this pair can be recovered"'
83+
'##INFO=<ID=BNDrescue,Number=0,Type=Flag,Description="The other BND of this pair can be recovered"',
84+
'##contig=<ID=M,length=16569,assembly=GRCh38>'
8385
]
8486

8587
BCFTOOLS_CONSENSUS_REHEADER(
@@ -104,13 +106,13 @@ workflow VCF_ANNOTATE_VEP_ANNOTSV {
104106
)
105107
ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions.first())
106108

107-
TABIX_ANNOTSV(
109+
BCFTOOLS_SORT(
108110
BCFTOOLS_CONCAT.out.vcf
109111
)
110-
ch_versions = ch_versions.mix(TABIX_ANNOTSV.out.versions.first())
112+
ch_versions = ch_versions.mix(BCFTOOLS_SORT.out.versions.first())
111113

112-
def ch_annotsv_output = BCFTOOLS_CONCAT.out.vcf
113-
.join(TABIX_ANNOTSV.out.tbi, failOnDuplicate:true, failOnMismatch:true)
114+
def ch_annotsv_output = BCFTOOLS_SORT.out.vcf
115+
.join(BCFTOOLS_SORT.out.tbi, failOnDuplicate:true, failOnMismatch:true)
114116

115117
ENSEMBLVEP_VEP(
116118
ch_vcfs,

0 commit comments

Comments
 (0)