refactor: Replace BioGenerics functions for Edit with stubs

This commit is contained in:
Thomas A. Christensen II 2024-10-01 11:01:43 -05:00
parent d702de31b6
commit be731665bc
Signed by: millironx
GPG key ID: B7044A3432851F64

View file

@ -23,6 +23,13 @@ function Base.isless(x::Edit, y::Edit)
return leftposition(x) < leftposition(y)
end
function BioGenerics.leftposition(e::Edit)
return error("leftposition not implemented for type $(typeof(e))")
end
function BioGenerics.rightposition(e::Edit)
return error("rightposition not implemented for type $(typeof(e))")
end
struct DeletionEdit{S<:BioSequence,T<:BioSymbol} <: Edit{S,T}
position::UInt
length::UInt
@ -108,19 +115,6 @@ function Base.parse(::Type{<:Edit{Se,Sy}}, s::Union{String,SubString{String}}) w
end
end
BioGenerics.leftposition(e::Edit) = e.pos
function BioGenerics.rightposition(e::Edit)
if _mutation(e) isa Substitution
return leftposition(e)
elseif _mutation(e) isa Insertion
return leftposition(e) + 1
elseif _mutation(e) isa Deletion
return leftposition(e) + length(e) - 1
else
error("Unknown mutation type $(typeof(_mutation(e)))")
end
end
"""
_lendiff(edit::Edit)