mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-12-23 00:38:17 +00:00
Mark is_valid(::Variation) as private function
This commit is contained in:
parent
386acba8ab
commit
1f2b116518
2 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ function _is_valid(v::Variant)
|
|||
op = edit.x
|
||||
# Sanity check: for this to be a valid variant, it must be comprised of valid
|
||||
# variations
|
||||
is_valid(Variation(v.ref, edit)) || return false
|
||||
_is_valid(Variation(v.ref, edit)) || return false
|
||||
|
||||
# For substitutions we simply do not allow another modification of the same base
|
||||
if op isa Substitution
|
||||
|
|
|
@ -11,7 +11,7 @@ end
|
|||
|
||||
function Variation{S,T}(ref::S, e::Edit{S,T}) where {S<:BioSequence,T<:BioSymbol}
|
||||
v = Variation{S,T}(ref, e, Unsafe())
|
||||
return is_valid(v) ? v : throw(ArgumentError("Invalid variant"))
|
||||
return _is_valid(v) ? v : throw(ArgumentError("Invalid variant"))
|
||||
end
|
||||
|
||||
Variation(ref::S, edit::Edit{S,T}) where {S,T} = Variation{S,T}(ref, edit)
|
||||
|
@ -36,7 +36,7 @@ BioGenerics.rightposition(v::Variation) = rightposition(_edit(v))
|
|||
Base.:(==)(x::Variation, y::Variation) = x.ref == y.ref && x.edit == y.edit
|
||||
Base.hash(x::Variation, h::UInt) = hash(Variation, hash((x.ref, x.edit), h))
|
||||
|
||||
function is_valid(v::Variation)
|
||||
function _is_valid(v::Variation)
|
||||
isempty(v.ref) && return false
|
||||
op = v.edit.x
|
||||
pos = v.edit.pos
|
||||
|
|
Loading…
Reference in a new issue