mirror of
https://github.com/MillironX/SequenceVariation.jl.git
synced 2024-11-25 14:49:55 +00:00
Add isless
function for Variation
This commit is contained in:
parent
6119368af3
commit
0b2879b78c
1 changed files with 5 additions and 0 deletions
|
@ -75,6 +75,11 @@ BioGenerics.leftposition(v::Variation) = leftposition(_edit(v))
|
|||
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 Base.isless(x::Variation, y::Variation)
|
||||
reference(x) == reference(y) ||
|
||||
error("Variations cannot be compared if their reference sequences aren't equal")
|
||||
return leftposition(x) < leftposition(y)
|
||||
end
|
||||
|
||||
"""
|
||||
_is_valid(v::Variation)
|
||||
|
|
Loading…
Reference in a new issue