From 1f2b116518ebea297c71e69e026d25fc4efbbffc Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 31 Dec 2022 14:46:23 -0600 Subject: [PATCH] Mark is_valid(::Variation) as private function --- src/Variant.jl | 2 +- src/Variation.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Variant.jl b/src/Variant.jl index c3f1e8a..a0b1dfa 100644 --- a/src/Variant.jl +++ b/src/Variant.jl @@ -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 diff --git a/src/Variation.jl b/src/Variation.jl index 02794ad..ed25633 100644 --- a/src/Variation.jl +++ b/src/Variation.jl @@ -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