-
Notifications
You must be signed in to change notification settings - Fork 72
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
Provide access to index stats #294
Comments
Yes, this sounds completely doable and in scope. |
Great! I'll have a crack at it. The code will definitely need some close review as I'm not that familiar with htslib internals - I hope that's OK. |
Certainly! |
I'm having a go, but have hit a wall with accessing additional symbols from htslib. I want to use, e.g.,
I can't see any difference between the way I'm using this vs things like |
You can add the definition of |
🤦♂️ Thanks @brentp! |
It would be super useful to be able to find out the number of variants in a file, like
bcftools index -n
provides. The code used in bcftools index is here and looks relatively straightforward. I think there's access to thetbx
and/orhts_idx
already in the VCF class, so it should be possible to port this code into a new method with no other changes?I guess ideally this would return a dictionary mapping contig names to the number of records (which is the raw information from the index, if I'm reading the bcftools code correctly)?
I guess a simple
num_records
property would also be a useful thing to have, with the proviso that it raises an error or returns None if there is no index, or the required information isn't in the index.Does this sound doable?
The text was updated successfully, but these errors were encountered: