From c334880123ad6e6d977a35f2521cb35196a3fe61 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 +++ src/bit-manipulation/bit-manipulation.jl | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) 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)) diff --git a/src/bit-manipulation/bit-manipulation.jl b/src/bit-manipulation/bit-manipulation.jl index 253bdfb0..f1d2f8ff 100644 --- a/src/bit-manipulation/bit-manipulation.jl +++ b/src/bit-manipulation/bit-manipulation.jl @@ -1,6 +1,4 @@ -include("bitindex.jl") - const BitUnsigned = Union{UInt8, UInt16, UInt32, UInt64, UInt128} @inline function reversebits(x::T, ::BitsPerSymbol{2}) where T <: BitUnsigned