From 76d5b6059e922dc80f68ee0aca7fa384242576b4 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 14 Jun 2022 14:48:39 -0500 Subject: [PATCH] Add Variation constructor based on edit parsing --- src/SequenceVariation.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index b8a630a..902e63f 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -341,6 +341,13 @@ end Variation(ref::S, edit::Edit{S, T}) where {S, T} = Variation{S, T}(ref, edit) +function Variation(ref::S, edit::AbstractString) where {S<:BioSequence} + T = eltype(ref) + + e = parse(Edit{S,T}, edit) + return Variation{S,T}(ref, e) +end + function is_valid(v::Variation) isempty(v.ref) && return false op = v.edit.x