BioAlignments.jl icon indicating copy to clipboard operation
BioAlignments.jl copied to clipboard

[Feature]: Add method to remove sequence match info from cigar

Open MillironX opened this issue 1 year ago • 1 comments

Expected Behavior

I would like a way to tell if the two alignments are the same regardless of sequence, such that

Alignment("1=1X") == Alignment("2M")

Current Behavior

Alignment("1=1X") == Alignment("2M")

# returns false

:point_up: This behavior is correct!

Possible Solution / Implementation

The current behavior is entirely correct, but it doesn't let me compare alignments that have matching against those that don't. I propose a new function

remove_match_ops(::T) where {T<:Union{String,Alignment,AlignedSequence,PairwiseAlignment,PairwiseAlignmentResult}}

that would remove the = (sequence match) and X (sequence mismatch) operations from the CIGAR of the alignment and return a T where those operations would be replaced by M (match) operations and adjacent match operations merged.

MillironX avatar Apr 09 '23 01:04 MillironX