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

write-index does not appear to work from concat command #2246

Closed
ASLeonard opened this issue Aug 7, 2024 · 1 comment · Fixed by #2296
Closed

write-index does not appear to work from concat command #2246

ASLeonard opened this issue Aug 7, 2024 · 1 comment · Fixed by #2296
Assignees

Comments

@ASLeonard
Copy link

I was concatting 29 uncompressed vcfs and indexing the output

bcftools concat -o autosomes.vcf.gz --write-index {1..29}.vcf

However, the resultant index is more or less empty, and running bcftools index -n autosomes.vcf.gz returns 0.
Deleting that index and re-indexing (either via tabix -p vcf or bcftools index) produces a larger index that returns the correct number of variants from the previous command.

This seems to also occur if the input to concat is compressed, or with --write-index=tbi, so seems to be general issue rather than a specific combination of events.

This is with

bcftools 1.20-45-g5e7ea8a0-dirty
Using htslib 1.20-54-gfbe5ff6c-dirty

Best,
Alex

@whitwham
Copy link
Contributor

I see what it is doing. In this case it is writing out the VCF in the simplest way (vcf_write_line) which is good for speed but does not contain any index writing code. So all that is produced is the index header with no actual index.

I will look at making it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment