todo: Improve `--regions-overlap variant`

Open
#1,746 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start in synced_bcf_reader.c at the current --regions-overlap variant|2 implementation around line 569. Examine how left trimming handles variants such as ACGA > A--A and where the API would need to represent left- versus right-trimming choices. Done means the mode recognizes the actual affected bases without spurious overlaps, or a documented opposite-overlap mode is added.

Written by the indexing model from the issue text.

Description

The mode --regions-overlap variant|2 is supposed to recognize the actual bases affected by the variant. This is trickier than currently implemented in https://github.com/samtools/htslib/blob/develop/synced_bcf_reader.c#L569.

The existing code trims variants from the left, but does not take into account cases like ACGA > A--A, which can be trimmed from both ends.

In addition, the API does not give the choice to trim from the left or right in ambiguous cases. For many use cases, the desired behavior is to trim in such a way to prevent spurious overlaps. Alternatively, a new mode 3 can be added which acts the opposite way and reports an overlap whenever possible.

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.