mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-26 07:09:55 +00:00
Add Variation constructor based on edit parsing
This commit is contained in:
parent
ade9b7e41d
commit
76d5b6059e
1 changed files with 7 additions and 0 deletions
|
@ -341,6 +341,13 @@ end
|
||||||
|
|
||||||
Variation(ref::S, edit::Edit{S, T}) where {S, T} = Variation{S, T}(ref, edit)
|
Variation(ref::S, edit::Edit{S, T}) where {S, T} = Variation{S, T}(ref, edit)
|
||||||
|
|
||||||
|
function Variation(ref::S, edit::AbstractString) where {S<:BioSequence}
|
||||||
|
T = eltype(ref)
|
||||||
|
|
||||||
|
e = parse(Edit{S,T}, edit)
|
||||||
|
return Variation{S,T}(ref, e)
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue