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