Skip to content

Colons in VCF #CHROM columns are not parsed and throw error #2179

Description

@groodri

Note: Specific regions were substituted by <gene>, <chrom> and <pos> to hide sensitive information. Real usage did not contain brackets.

After combining region of interest locations with bedtools to build a new reference FASTA:

bedtools getfasta -fi <genome>.fasta -bed <regions_of_interest>.bed -name+

And then doing variant calling with this new reference, we obtain a chromosome (VCF column #CHROM) name structure like so:
<gene>::<chrom>:<pos>

Upon using bcftools concat to merge VCF files:

bcftools concat -a <file>.snp.vcf.gz <indel>.indel.vcf.gz -O v -o <file>.merged.vcf

This structure throws an error:

Checking the headers and starting positions of 2 files
[E::_regions_init_string] Could not parse the region(s): <gene>::<chrom>:<pos>

However, as of VCFv4.3 and later this structure should be legal. See the official VCFv4.3 changelog:

7.1 Changes to VCFv4.3
(...)
The VCF specification previously disallowed colons (‘:’) in contig names to avoid confusion when parsing
breakends, but this was unnecessary. Even with contig names containing colons, the breakend mate position
notation can be unambiguously parsed because the “:pos” part is always present.

This was tested on bcftools=1.20, installed from source code, and previously bcftools=1.15.1, installed on conda.

I tried to confirm which HTSlib version was being compiled, but I couldn't figure it out. Does the current release of bcftools support VCFv4.3 and later?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions