htslib icon indicating copy to clipboard operation
htslib copied to clipboard

todo: Improve `--regions-overlap variant`

Open pd3 opened this issue 4 months ago • 0 comments

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.

pd3 avatar Feb 09 '24 13:02 pd3