Documentation request

Open
#816 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Domain
documentation

Research direction

Start with the bcftools index entry point and the CSI specification, then trace how tbx_load_index handles CSI, TBI, and VCF.gz indexes. Compare the supported formats and the CSI auxiliary block across relevant tools, and document which index choices are portable, implementation-specific, and required for VCF files.

Written by the indexing model from the issue text.

Description

Through experimentation I've discovered that the way Bcftools indexes VCF.gz is via a joint tabix / csi format index.

The magic number is CSI, but it uses the aux data in the header to store a TBX configuration. If I modify this is fails to load the index, and debugging it shows it is indeed using tbx_load_index to load the CSI index.

This is all very confusing, especially given bcftools index has the option of producing either CSI or TBI indices for text files. I'm not sure which I should use and why, given they appear to be the same thing under different guises.

Perhaps this is a spec issue too. The CSI specification has nothing to say about the aux block at all, however clearly it is mandatory for VCFs, at least in this implementation. How does this compare with other tools? Ideally the documentation should clearly state which formats and indices are universally supported and which are bcftools only.

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.