refactor: Change Edit to abstract type

This commit is contained in:
Thomas A. Christensen II 2024-10-01 10:20:44 -05:00
parent 011651857f
commit 0b10b9ae7b
Signed by: millironx
GPG key ID: B7044A3432851F64

View file

@ -9,10 +9,7 @@ An edit of either `Substitution{T}`, `Insertion{S}` or `Deletion` at a position.
If deletion: Deletion of length L at ref pos `pos:pos+L-1` If deletion: Deletion of length L at ref pos `pos:pos+L-1`
If insertion: Insertion of length L b/w ref pos `pos:pos+1` If insertion: Insertion of length L b/w ref pos `pos:pos+1`
""" """
struct Edit{S<:BioSequence,T<:BioSymbol} abstract type Edit{S<:BioSequence,T<:BioSymbol} end
x::Union{Substitution{T},Deletion,Insertion{S}}
pos::UInt
end
Base.length(e::Edit) = length(_mutation(e)) Base.length(e::Edit) = length(_mutation(e))
Base.:(==)(e1::Edit, e2::Edit) = e1.pos == e2.pos && e1.x == e2.x Base.:(==)(e1::Edit, e2::Edit) = e1.pos == e2.pos && e1.x == e2.x