Add hash function for Variation

This commit is contained in:
Thomas A. Christensen II 2022-06-14 16:34:50 -05:00
parent 70965732cf
commit fe1bbcc0f3
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -357,6 +357,7 @@ edit(v::Variation) = v.edit
mutation(v::Variation) = mutation(edit(v)) mutation(v::Variation) = mutation(edit(v))
BioGenerics.leftposition(v::Variation) = leftposition(edit(v)) BioGenerics.leftposition(v::Variation) = leftposition(edit(v))
Base.:(==)(x::Variation, y::Variation) = x.ref == y.ref && x.edit == y.edit 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 isempty(v.ref) && return false