From 70965732cf7b9abcadaf247bd2caab661dfd9c2c Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 14 Jun 2022 16:34:36 -0500 Subject: [PATCH 1/2] Add equality function for Variation --- src/SequenceVariation.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index a5b256c..c00d210 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -356,6 +356,7 @@ reference(v::Variation) = v.reference edit(v::Variation) = v.edit mutation(v::Variation) = mutation(edit(v)) BioGenerics.leftposition(v::Variation) = leftposition(edit(v)) +Base.:(==)(x::Variation, y::Variation) = x.ref == y.ref && x.edit == y.edit function is_valid(v::Variation) isempty(v.ref) && return false From fe1bbcc0f37b02967e01957533a0022e9b9a3f0b Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 14 Jun 2022 16:34:50 -0500 Subject: [PATCH 2/2] Add hash function for Variation --- src/SequenceVariation.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SequenceVariation.jl b/src/SequenceVariation.jl index c00d210..a3847ba 100644 --- a/src/SequenceVariation.jl +++ b/src/SequenceVariation.jl @@ -357,6 +357,7 @@ edit(v::Variation) = v.edit mutation(v::Variation) = mutation(edit(v)) BioGenerics.leftposition(v::Variation) = leftposition(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) isempty(v.ref) && return false