mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-22 21:39:55 +00:00
Add accessor functions for Variation properties
This commit is contained in:
parent
1e6f6ea075
commit
2d05b233a9
1 changed files with 10 additions and 2 deletions
|
@ -20,9 +20,10 @@ TODO now:
|
||||||
* Add tests
|
* Add tests
|
||||||
"""
|
"""
|
||||||
|
|
||||||
using BioSymbols: BioSymbol
|
|
||||||
using BioAlignments: BioAlignments, PairwiseAlignment
|
using BioAlignments: BioAlignments, PairwiseAlignment
|
||||||
|
using BioGenerics: BioGenerics, leftposition
|
||||||
using BioSequences: BioSequences, BioSequence, NucleotideSeq, AminoAcidSeq, LongSequence, isgap
|
using BioSequences: BioSequences, BioSequence, NucleotideSeq, AminoAcidSeq, LongSequence, isgap
|
||||||
|
using BioSymbols: BioSymbol
|
||||||
|
|
||||||
const BA = BioAlignments
|
const BA = BioAlignments
|
||||||
const BS = BioSequences
|
const BS = BioSequences
|
||||||
|
@ -351,6 +352,11 @@ function Variation(ref::S, edit::AbstractString) where {S<:BioSequence}
|
||||||
return Variation{S,T}(ref, e)
|
return Variation{S,T}(ref, e)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
reference(v::Variation) = v.reference
|
||||||
|
edit(v::Variation) = v.edit
|
||||||
|
mutation(v::Variation) = mutation(edit(v))
|
||||||
|
BioGenerics.leftposition(v::Variation) = leftposition(edit(v))
|
||||||
|
|
||||||
function is_valid(v::Variation)
|
function is_valid(v::Variation)
|
||||||
isempty(v.ref) && return false
|
isempty(v.ref) && return false
|
||||||
op = v.edit.x
|
op = v.edit.x
|
||||||
|
@ -436,6 +442,8 @@ export Insertion,
|
||||||
Deletion,
|
Deletion,
|
||||||
Substitution,
|
Substitution,
|
||||||
Variant,
|
Variant,
|
||||||
Variation
|
Variation,
|
||||||
|
reference,
|
||||||
|
mutation
|
||||||
|
|
||||||
end # module
|
end # module
|
||||||
|
|
Loading…
Reference in a new issue