Skip to content

bcftools reheader -f negative lengths #1959

@jbruxaux

Description

@jbruxaux

Hi!

I'm trying to use the bcftools reheader command with the -f option, providing a fai file.
In my fai file, I have this:

chr1 2364278061 6 2364278061 2364278062
chr10 1752849333 2364278075 1752849333 1752849334
chr11 1650012615 4117127416 1650012615 1650012616
chr12 1392452741 5767140039 1392452741 1392452742
chr2 2317450362 7159592787 2317450362 2317450363
chr3 2291775479 9477043156 2291775479 2291775480
chr4 2192534405 11768818642 2192534405 2192534406
chr5 2148190925 13961353054 2148190925 2148190926
chr6 2107674557 16109543986 2107674557 2107674558
chr7 2082167746 18217218550 2082167746 2082167747
chr8 2081484518 20299386303 2081484518 2081484519
chr9 2024734096 22380870828 2024734096 2024734097

And I end up with this in my new vcf file header:

##contig=<ID=chr1,length=-1930689235>
##contig=<ID=chr10,length=1752849333>
##contig=<ID=chr11,length=1650012615>
##contig=<ID=chr12,length=1392452741>
##contig=<ID=chr2,length=-1977516934>
##contig=<ID=chr3,length=-2003191817>
##contig=<ID=chr4,length=-2102432891>
##contig=<ID=chr5,length=-2146776371>
##contig=<ID=chr6,length=2107674557>
##contig=<ID=chr7,length=2082167746>
##contig=<ID=chr8,length=2081484518>
##contig=<ID=chr9,length=2024734096>

Any idea why?

I am using bcftools v.1.14, but didn't see any change in the last versions descriptions.
My command line is
bcftools reheader -f ref.fa.fai --threads 4 -o file_reheader.vcf.gz file.vcf.gz

And to see these negative lengths, I need to use the command
zcat file_reheader.vcf.gz | grep "#"
If I use the normal command
bcftools view -h file_reheader.vcf.gz
those lines do not appear at all (no line with chr1, chr2...).

I don't know if that helps though...

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions