CSIv2

Open
#148 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

Start by reviewing the linked CSIv2 implementation branch and hts-specs change, then inspect the existing indexing and query APIs and the tabix entry point. Clarify whether to support record-range queries, chunk generation, or both, including their proposed syntax. Done means an agreed API and command-line behavior with tests covering the selected use cases.

Written by the indexing model from the issue text.

Description

I created a new branch (https://github.com/samtools/htslib/commit/9b117953a312e7abca55a9820f8c0bc656522e9d) which supports reading and writing of the CSIv2 index (https://github.com/samtools/hts-specs/commit/b131ffc8b905e4e1c147134dc04912e0e72af4d2). There is currently no API to use it. The motivation for the extension was to allow queries like:

  1. get N-th to M-th record
  2. create a list of regions with N records each (possibly with optional overlaps). This is useful in pipelines which split BCF/BAM in smaller chunks and process them in parallel

Shane suggested that the first type could be easily integrated with existing tools by using "::" instead of ":". Then chr::N-M would be interpreted as record indexes, while chr:from-to as genomic coordinates.

For the second, I was thinking of adding a new switch to tabix, one could do something like:
tabix --new-switch CHUNK_SIZE[,OVERLAP_SIZE] file.bcf [REGION]

What do you think? Comments and feedback is welcome.

Dominant language
C
Stars
950
Forks
475
Avg merge
3d 13h
Merged PRs (30d)
11

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/htslib

All issues in samtools/htslib

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.