From be731665bc8112bd932d8dffe1bb1b7b59ba7498 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:01:43 -0500 Subject: [PATCH] refactor: Replace BioGenerics functions for Edit with stubs --- src/Edit.jl | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Edit.jl b/src/Edit.jl index a295621..df203f4 100644 --- a/src/Edit.jl +++ b/src/Edit.jl @@ -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)