From 476cc25044b9acf6cfb6eac46fa9dae1d719eb25 Mon Sep 17 00:00:00 2001 From: Jakob Nybo Nissen Date: Sun, 21 Jan 2024 17:10:28 +0100 Subject: [PATCH] WIP: firstbitindex --- src/biosequence/indexing.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/biosequence/indexing.jl b/src/biosequence/indexing.jl index 4a87059c..c2634965 100644 --- a/src/biosequence/indexing.jl +++ b/src/biosequence/indexing.jl @@ -11,6 +11,9 @@ (i % UInt) - 1 < (lastindex(seq) % UInt) ? (@inbounds seq[i], i + 1) : nothing end +lastbitindex(x::BioSequence) = bitindex(x, lastindex(x)) +firstbitindex(x::BioSequence) = bitindex(x, firstindex(x)) + ## Bounds checking function Base.checkbounds(x::BioSequence, i::Integer) firstindex(x) ≤ i ≤ lastindex(x) || throw(BoundsError(x, i))