Update getter usage in translate function

This commit is contained in:
Thomas A. Christensen II 2023-01-03 15:01:31 -06:00
parent ef4460bbbf
commit cb1c429610
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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