Skip to content

Commit d3fcc72

Browse files
committed
Release v0.0.28
1 parent 0fee31c commit d3fcc72

12 files changed

Lines changed: 68 additions & 49 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,30 @@ All notable changes to this project will be documented in this file. The format
44
is roughly based on [Keep a Changelog], and this project tries to adheres to
55
[Semantic Versioning].
66

7-
## [0.0.28] - TBD
7+
## [0.0.28] - 2026-04-29
88

99
### Added
1010

11-
- `Nucleotides` and `AminoAcids` (and view types) can now be converted into `Vec`, slices, and `Cow` using `From`
12-
- `NucleotidesView`, `AminoAcidsView`, and `QualityScoresView` now have inherent `slice` methods offering a longer lifetime of the returned view
13-
- Added `as_map` accessor to convert `ByteIndexMap` to `ByteMap`
1411
- Similar to the `OrFail` trait for `Result`, a `Fail` trait has been introduced to handle errors directly
1512
- Added `*_mapped` versions for many string/byte search functions, which search a lazily-mapped haystack
13+
- Added `as_map` accessor to convert `ByteIndexMap` to `ByteMap`
14+
- `Nucleotides` and `AminoAcids` (and view types) can now be converted into `Vec`, slices, and `Cow` using `From`
15+
- `NucleotidesView`, `AminoAcidsView`, and `QualityScoresView` now have inherent `slice` methods offering a longer lifetime of the returned view
1616

1717
### Changed
1818

1919
- `LocalProfiles` and `SharedProfiles` now can hold either a borrowed or an owned sequence, enabling sequences and profiles to be stored in the same struct without becoming self-referential
2020
- `CigletIterator` now yields empty ciglets when a CIGAR string contains an explicit increment that is 0. A missing increment field ends the iterator early
21-
- `find_mapped_match_simd` now only supports lane counts greater than 2
21+
- `find_mapped_match_simd` better handles needles with a single repeating byte, but now only supports lane counts greater than 2
2222

2323
### Fixed
2424

25-
- Subsequent calls to `next_back` in `CigletIterator` now properly return `None` after invalid state is reached
25+
- Fixed incorrect ranges returned by `Alignment::to_reverse` and `Alignment::make_reverse`
2626
- Methods in `StatesSequence` and `StatesSequenceMut` now properly skip empty `Ciglet`s (with an increment of 0)
2727
- Pre-alignment filter `sneaky_snake` now properly handles inputs with length differences greater than provided threshold.
28+
- Subsequent calls to `next_back` in `CigletIterator` now properly return `None` after invalid state is reached
29+
- Equality comparisons between `Cigar` and `AlignmentStates` now properly return false for an overflowing increment
30+
- Fixes the potential of overflow in `hamming`
2831

2932
## [0.0.27] - 2026-04-15
3033

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2024"
33
name = "zoe"
4-
version = "0.0.28-dev"
4+
version = "0.0.28"
55
rust-version = "1.95"
66
description = "A nightly library for viral genomics"
77
license = "Apache-2.0"

src/alignment/profile.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ pub(crate) fn validate_profile_args(seq: &[u8], gap_open: i8, gap_extend: i8) ->
4949
/// in an alignment. The API mirrors that of [`StripedProfile`], but this
5050
/// profile does not use SIMD or create a striped layout.
5151
///
52-
/// ## Type Parameters
52+
/// ## Parameters
5353
///
54-
/// `S` - The size of the alphabet (usually 5 for DNA including *N*)
54+
/// `S`: The size of the alphabet (usually 5 for DNA including *N*)
5555
#[derive(Clone, Eq, PartialEq, Debug)]
5656
pub struct ScalarProfile<'a, const S: usize> {
5757
pub(crate) seq: Cow<'a, [u8]>,
@@ -186,13 +186,14 @@ impl<'a, const S: usize> ScalarProfile<'a, S> {
186186
/// specified mapping, arranged in a striped pattern to optimize SIMD operations
187187
/// during alignment.
188188
///
189-
/// ## Type Parameters
189+
/// ## Parameters
190190
///
191-
/// - `T` - The numeric type used for scores. `i8`, `i16`, `i32`, and `i64` use
191+
/// - `'a`: The lifetime of the alphabet ([`ByteIndexMap`]).
192+
/// - `T`: The numeric type used for scores. `i8`, `i16`, `i32`, and `i64` use
192193
/// the signed algorithm, which is the most common. `u8`, `u16`, `u32`, and
193194
/// `u64` use the unsigned algorithm.
194-
/// - `N` - The number of SIMD lanes (usually 16, 32 or 64).
195-
/// - `S` - The size of the alphabet (usually 5 for DNA including `N`).
195+
/// - `N`: The number of SIMD lanes (usually 16, 32 or 64).
196+
/// - `S`: The size of the alphabet (usually 5 for DNA including `N`).
196197
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
197198
pub struct StripedProfile<'a, T, const N: usize, const S: usize>
198199
where

src/alignment/profile_set.rs

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use std::{borrow::Cow, cell::OnceCell, sync::OnceLock};
1010
/// convenience methods for automatically increasing the integer width and
1111
/// rerunning the alignment when overflow occurs.
1212
///
13-
/// ## Type Parameters
13+
/// ## Parameters
1414
///
15-
/// - `M` - The number of SIMD lanes for `i8` profiles.
16-
/// - `N` - The number of SIMD lanes for `i16` profiles.
17-
/// - `O` - The number of SIMD lanes for `i32` profiles.
18-
/// - `S` - The size of the alphabet (usually 5 for DNA including `N`).
15+
/// - `M`: The number of SIMD lanes for `i8` profiles.
16+
/// - `N`: The number of SIMD lanes for `i16` profiles.
17+
/// - `O`: The number of SIMD lanes for `i32` profiles.
18+
/// - `S`: The size of the alphabet (usually 5 for DNA including `N`).
1919
pub trait ProfileSets<'a, const M: usize, const N: usize, const O: usize, const S: usize>: Sized {
2020
/// Gets or initializes [`StripedProfile`] with elements of `i8` and `M`
2121
/// SIMD lanes and returns a reference to the field.
@@ -368,12 +368,16 @@ pub trait ProfileSets<'a, const M: usize, const N: usize, const O: usize, const
368368
/// If it is necessary to share between multiple threads, consider using
369369
/// [`SharedProfiles`].
370370
///
371-
/// ## Type Parameters
371+
/// ## Parameters
372372
///
373-
/// - `M` - The number of SIMD lanes for `i8` profiles.
374-
/// - `N` - The number of SIMD lanes for `i16` profiles.
375-
/// - `O` - The number of SIMD lanes for `i32` profiles.
376-
/// - `S` - The size of the alphabet (usually 5 for DNA including `N`).
373+
/// - `'a`: The lifetime of the stored sequence, the [`WeightMatrix`], and the
374+
/// alphabet ([`ByteIndexMap`]). An owned sequence can also be stored.
375+
/// - `M`: The number of SIMD lanes for `i8` profiles.
376+
/// - `N`: The number of SIMD lanes for `i16` profiles.
377+
/// - `O`: The number of SIMD lanes for `i32` profiles.
378+
/// - `S`: The size of the alphabet (usually 5 for DNA including `N`).
379+
///
380+
/// [`ByteIndexMap`]: crate::data::ByteIndexMap
377381
#[derive(Debug, Clone)]
378382
pub struct LocalProfiles<'a, const M: usize, const N: usize, const O: usize, const S: usize> {
379383
pub(crate) seq: Cow<'a, [u8]>,
@@ -534,12 +538,16 @@ impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Profile
534538
/// When sharing between threads is not needed, consider using [`LocalProfiles`]
535539
/// instead.
536540
///
537-
/// ## Type Parameters
541+
/// ## Parameters
542+
///
543+
/// - `'a`: The lifetime of the stored sequence, the [`WeightMatrix`], and the
544+
/// alphabet ([`ByteIndexMap`]). An owned sequence can also be stored.
545+
/// - `M`: The number of SIMD lanes for `i8` profiles
546+
/// - `N`: The number of SIMD lanes for `i16` profiles
547+
/// - `O`: The number of SIMD lanes for `i32` profiles
548+
/// - `S`: The size of the alphabet (usually 5 for DNA including *N*)
538549
///
539-
/// - `M` - The number of SIMD lanes for `i8` profiles
540-
/// - `N` - The number of SIMD lanes for `i16` profiles
541-
/// - `O` - The number of SIMD lanes for `i32` profiles
542-
/// - `S` - The size of the alphabet (usually 5 for DNA including *N*)
550+
/// [`ByteIndexMap`]: crate::data::ByteIndexMap
543551
#[derive(Debug, Clone)]
544552
pub struct SharedProfiles<'a, const M: usize, const N: usize, const O: usize, const S: usize> {
545553
pub(crate) seq: Cow<'a, [u8]>,

src/alignment/sw/striped.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,10 @@ where
637637
///
638638
/// ## Parameters
639639
///
640-
/// - `T` - The integer type whose max score is being computed.
641-
/// - `U` - The integer type used in the [`WeightMatrix`], which must be of the
640+
/// - `T`: The integer type whose max score is being computed.
641+
/// - `U`: The integer type used in the [`WeightMatrix`], which must be of the
642642
/// same sign as `T`.
643-
/// - `S` - The alphabet size.
643+
/// - `S`: The alphabet size.
644644
///
645645
/// <div class="warning note">
646646
///

src/data/constants/mappings/byte_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl ByteMap {
212212
/// For example, this could be a map from DNA bases to profile indices, such as
213213
/// [`DNA_PROFILE_MAP`].
214214
///
215-
/// ## Type Parameters
215+
/// ## Parameters
216216
///
217217
/// `S`: The number of unique indices in the output of the mapping (such as 5
218218
/// for DNA including *N*)

src/distance/dna/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub(crate) use tabulation::{hamming_dist_from_sub_matrix, total_and_frequencies}
2626
///
2727
/// `None` is returned if no valid positions are found to compare.
2828
///
29-
/// ## Type Parameters
29+
/// ## Parameters
3030
///
31-
/// `N` - SIMD lane count, must be a supported lane count
31+
/// `N`: SIMD lane count, must be a supported lane count
3232
///
3333
/// ## Example
3434
///

src/search/bytes/search.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'a, const N: usize> Iterator for SplitByByte2<'a, N> {
8484
///
8585
/// ## Parameters
8686
///
87-
/// `N` - The number of SIMD lanes to use.
87+
/// `N`: The number of SIMD lanes to use.
8888
#[inline]
8989
#[must_use]
9090
#[cfg_attr(feature = "multiversion", multiversion::multiversion(targets = "simd"))]
@@ -99,7 +99,9 @@ pub fn position_by_byte<const N: usize>(haystack: &[u8], b: u8) -> Option<usize>
9999
///
100100
/// ## Parameters
101101
///
102-
/// `N` - The number of SIMD lanes to use.
102+
/// - `N`: The number of SIMD lanes to use.
103+
/// - `S`: The SIMD-vectorized mapping to lazily apply to the `haystack`.
104+
/// - `B`: The non-vectorized mapping to lazily apply to the `haystack`.
103105
#[inline]
104106
#[must_use]
105107
#[cfg_attr(feature = "multiversion", multiversion::multiversion(targets = "simd"))]
@@ -151,7 +153,7 @@ where
151153
///
152154
/// ## Parameters
153155
///
154-
/// `N` - The number of SIMD lanes to use.
156+
/// `N`: The number of SIMD lanes to use.
155157
#[inline]
156158
#[must_use]
157159
#[cfg_attr(feature = "multiversion", multiversion::multiversion(targets = "simd"))]
@@ -166,7 +168,9 @@ pub fn position_by_byte2<const N: usize>(haystack: &[u8], b1: u8, b2: u8) -> Opt
166168
///
167169
/// ## Parameters
168170
///
169-
/// `N` - The number of SIMD lanes to use.
171+
/// - `N`: The number of SIMD lanes to use.
172+
/// - `S`: The SIMD-vectorized mapping to lazily apply to the `haystack`.
173+
/// - `B`: The non-vectorized mapping to lazily apply to the `haystack`.
170174
#[inline]
171175
#[must_use]
172176
#[cfg_attr(feature = "multiversion", multiversion::multiversion(targets = "simd"))]
@@ -221,7 +225,7 @@ where
221225
///
222226
/// ## Parameters
223227
///
224-
/// `N` - The number of SIMD lanes to use.
228+
/// `N`: The number of SIMD lanes to use.
225229
#[inline]
226230
#[must_use]
227231
#[cfg_attr(feature = "multiversion", multiversion::multiversion(targets = "simd"))]
@@ -253,8 +257,9 @@ pub fn position_by_byte3<const N: usize>(haystack: &[u8], b1: u8, b2: u8, b3: u8
253257
///
254258
/// The following parameters can be used to adjust performance characteristics:
255259
///
256-
/// - `N` - The number of SIMD lanes to use.
257-
/// - `UF` - The unroll factor, which must be non-zero.
260+
/// - `N`: The number of SIMD lanes to use.
261+
/// - `UF`: The unroll factor, which must be non-zero.
262+
/// - `P`: The SIMD-vectorized predicate for identifying matching bytes.
258263
#[inline]
259264
#[must_use]
260265
#[allow(clippy::needless_range_loop)]

src/search/inexact.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const fn create_masks<const N: usize>() -> [Simd<u8, N>; 256] {
7171
///
7272
/// ## Parameters
7373
///
74-
/// - `N` - The number of SIMD lanes to use.
75-
/// - `K` - The number of differences allowed.
74+
/// - `N`: The number of SIMD lanes to use.
75+
/// - `K`: The number of differences allowed.
7676
///
7777
/// ## Limitations
7878
///

0 commit comments

Comments
 (0)