From 6d7a93604a3f1c4ab5507b5f4f89ce861d29e6b1 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Wed, 15 Jun 2022 13:06:20 -0500 Subject: [PATCH] Add function to get variations from variant --- src/SequenceVariation.jl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index 92abb87..06c8aa7 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -456,12 +456,21 @@ function translate(var::Variation{S, T}, aln::PairwiseAlignment{S, S}) where {S, end end +function variations(v::Variant) + vs = Vector{Variation}(undef, length(edits(v))) + for (i, e) in enumerate(edits(v)) + vs[i] = Variation(reference(v), e) + end + return vs +end + export Insertion, Deletion, Substitution, Variant, Variation, reference, - mutation + mutation, + variations end # module