Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcftools reheader -f negative lengths #1959

Closed
jbruxaux opened this issue Jul 11, 2023 · 1 comment
Closed

bcftools reheader -f negative lengths #1959

jbruxaux opened this issue Jul 11, 2023 · 1 comment

Comments

@jbruxaux
Copy link

jbruxaux commented Jul 11, 2023

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!

@pd3 pd3 closed this as completed in eda84ab Jul 11, 2023
@pd3
Copy link
Member

pd3 commented Jul 11, 2023

This is caused by the long contigs not representable in 32-bit integer. This was just fixed by eda84ab. Thank you for reporting the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants