From bc073eaf20b807cb4c4be8a36f6b5c5eda069bc0 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:51:13 -0500 Subject: [PATCH] Add private reference base getter for Deletion --- src/SequenceVariation.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index 785384a..8ad2972 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -472,6 +472,14 @@ function _altbases(s::Substitution, reference::S, pos::UInt) where S <: BioSeque return S([s.x]) end +function _refbases(d::Deletion, reference::S, pos::UInt) where S <: BioSequence + if pos == 1 + return S(reference[UnitRange{Int}(pos, pos+length(d))]) + else + return S(reference[UnitRange{Int}(pos-1, pos+length(d)-1)]) + end +end + export Insertion, Deletion, Substitution,