From cb1c429610e214de017cb57726ecc539669dc24b Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 3 Jan 2023 15:01:31 -0600 Subject: [PATCH] Update getter usage in translate function --- src/SequenceVariation.jl | 2 +- src/Variation.jl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index 10f0839..c3b476b 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -20,7 +20,7 @@ TODO now: * Add tests """ -using BioAlignments: BioAlignments, PairwiseAlignment, OP_SOFT_CLIP +using BioAlignments: BioAlignments, PairwiseAlignment, OP_SOFT_CLIP, sequence using BioGenerics: BioGenerics, leftposition, rightposition using BioSequences: BioSequences, BioSequence, NucleotideSeq, LongSequence, isgap using BioSymbols: BioSymbol diff --git a/src/Variation.jl b/src/Variation.jl index 9f0ac17..6f70e90 100644 --- a/src/Variation.jl +++ b/src/Variation.jl @@ -71,9 +71,10 @@ function Base.in(v::Variation, var::Variant) end function translate(var::Variation{S,T}, aln::PairwiseAlignment{S,S}) where {S,T} - kind = var.edit.x - pos = var.edit.pos - seq, ref = aln.seq, aln.b + kind = mutation(var) + pos = leftposition(var) + seq = sequence(aln) + ref = aln.b # Special case: Insertions may have a pos of 0, which cannot be mapped to # the seq using ref2seq