Skip to content

Commit b99a40b

Browse files
committed
Release v0.0.27
1 parent ed86dd3 commit b99a40b

14 files changed

Lines changed: 79 additions & 56 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
echo '<meta http-equiv="refresh" content="0; url=zoe/index.html">' > target/doc/index.html
3737
3838
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v5.0.0
39+
uses: actions/upload-pages-artifact@v5
4040
with:
4141
path: ./target/doc
4242
- name: Deploy to GitHub Pages

CHANGELOG.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,44 @@ 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.27] - TBD
7+
## [0.0.27] - 2026-04-15
88

99
### Added
1010

11+
- Added `ByteMap` for defining and representing maps from `u8` values to other `u8` values (e.g., for sanitization/recoding), as well as many pre-defined maps
12+
- Added `ByteValidator` for defining alphabets or subsets of valid bytes
13+
- Added `SanitizeBase` extension trait for `u8` to perform DNA validation, recoding, and refinement on a single byte
14+
- Added `find_start_codon` as well as a modified string search routine supporting lazy transformations of the haystack (`find_mapped_match_simd`)
15+
- Added `to_aa_iter_exact` and `to_aa_iter_exact_with` for amino acid translation that does not include a partial codon for codons with less than 3 bases at the end of a sequence
16+
- Added `find_next_aa` and `find_next_aa_in_frame` to `RangeSearch`
17+
- Added `find_byte` to `ByteSubstring` (for searching strings and for use with `RangeSearch`)
1118
- Added `as_mut_vec` to `AlignmentStates`, `Nucleotides`, and `AminoAcids` to enable custom editing
1219
- Added `push`, `starts_with`, and `ends_with` to `Nucleotides` and `AminoAcids`
1320
- Implemented `Extend` for `Nucleotides` and `AminoAcids`
14-
- Added `to_aa_iter_exact` and `to_aa_iter_exact_with` for amino acid translation that does not include a partial codon for codons with less than 3 bases at the end of a sequence
15-
- Added `find_next_aa` and `find_next_aa_in_frame` to `RangeSearch`
16-
- Added `SanitizeBase` extension trait for `u8` to perform DNA validation, recoding, and refinement on a single byte
1721
- Added `AcgtNoGapsUc` strategy for retaining/recoding DNA
18-
- Added `find_start_codon` as well as a modified string search routine supporting lazy transformations of the haystack (`find_mapped_match_simd`)
19-
- Added `ByteMap` for defining and representing maps from `u8` values to other `u8` values (e.g., for sanitization/recoding)
20-
- Added many pre-defined `ByteMap`s for direct use or as a starting point for defining more custom maps
21-
- Added `find_byte` to `ByteSubstring` (for searching strings and for use with `RangeSearch`)
22-
- Added `ByteValidator` for defining alphabets or subsets of valid bytes
2322

2423
### Changed
2524

26-
- Implemented Copy for several immutable views
27-
- `RangeSearch` now contains a generic with the original type to allow search methods to restrict the types of data they are used on
28-
- `StdGeneticCode` now translates codons with mixed `-` and `.` bytes to `.`
29-
- `is_amino_acid` now behaves the same as `is_known_amino_acid`, and `is_known_amino_acid` is removed
30-
- Renamed `is_valid_codon` to `is_resolvable_codon` in `CodonExtension`
3125
- Renamed `from_filename` to `from_path` for *Zoe*'s readers, deprecating the old functions
3226
- Renamed `with_file_context` to `with_path_context` for errors, deprecating the old functions
27+
- Renamed `is_valid_codon` to `is_resolvable_codon` in `CodonExtension`
28+
- `is_amino_acid` now behaves the same as `is_known_amino_acid`, and `is_known_amino_acid` is removed
29+
- `RangeSearch` now contains a generic with the original type to allow search methods to restrict the types of data they are used on
30+
- `StdGeneticCode` now translates codons with mixed `-` and `.` bytes to `.`
3331
- `OrFail` is now only implemented on errors with a `'static` lifetime
32+
- `retain_by_recoding` now uses `ByteMap`, and `retain_by_validation` now uses `ByteValidator`
33+
- Implemented `Copy` for several immutable views
3434

3535
### Removed
3636

37-
- `itoa` is no longer a dependency of Zoe.
3837
- Removes `open_nonempty_file`, which produces incorrect results for piped inputs
38+
- `itoa` is no longer a dependency of Zoe.
3939

4040
### Fixes
4141

4242
- Fixes a bug where pipes are interpreted as empty files with `FastQReader::from_filename` (and similarly for `FastaReader` and `SAMReader`)
4343
- Fixes a bug in `p_distance_acgt` where longer sequences could be normalized incorrectly.
44+
- Fixes a bug in `physiochemical` distance to ensure invalid sequences are not comparable
4445

4546
## [0.0.26] - 2026-03-06
4647

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.27-dev"
4+
version = "0.0.27"
55
rust-version = "1.95"
66
description = "A nightly library for viral genomics"
77
license = "Apache-2.0"

src/alignment/types/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl AlignmentStates {
8989
self.0.as_mut_slice()
9090
}
9191

92-
/// Returns the [`Ciglet`] elements as a mutable reference to a vector.
92+
/// Returns a mutable reference to the vector of [`Ciglet`] elements.
9393
///
9494
/// ## Validity
9595
///

src/data/constants/mappings/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro_rules! fill_std_gc {
1212
/// If a codon involving ambiguous IUPAC letters translates to the same amino
1313
/// acid in all cases, then it is also included in the hashmap. Stop codons are
1414
/// translated to `*`, and the codons `...`, `---`, and `NNN` are translated to
15-
/// `.`, `-`, and `X` respectively.
15+
/// `.`, `-`, and `X` respectively. A mix of `.` and `-` is translated to `.`.
1616
#[derive(Debug)]
1717
pub struct StdGeneticCode;
1818

src/data/extension/byte_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl IsBase for u8 {
5252
/// [`RetainNucleotides`]: crate::data::types::nucleotides::RetainNucleotides
5353
pub trait SanitizeBase: Sized + Copy {
5454
/// Checks whether a single byte is valid under the given validation
55-
/// strategy
55+
/// strategy.
5656
#[must_use]
5757
fn is_valid(self, strategy: IsValidDNA) -> bool;
5858

src/data/records/sam/merge_pairs.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ impl SamAligned {
134134
}
135135

136136
impl From<&SamData> for SamAligned {
137+
/// Builds a [`SamAligned`] from [`SamData`].
138+
///
139+
/// ## Panics
140+
///
141+
/// Currently panics on invalid cigar states. To be removed in the future
142+
/// for either a `Result` or type-state validated CIGAR strings.
143+
///
144+
/// This also has a chance of panicking in debug mode if an insertion
145+
/// appears at the start of the alignment.
137146
#[inline]
138147
fn from(row: &SamData) -> Self {
139148
row.get_aligned()
@@ -265,7 +274,10 @@ impl SamData {
265274
/// ## Panics
266275
///
267276
/// Currently panics on invalid cigar states. To be removed in the future
268-
/// for either a `Result` or type-state validated Cigars.
277+
/// for either a `Result` or type-state validated CIGAR strings.
278+
///
279+
/// This also has a chance of panicking in debug mode if an insertion
280+
/// appears at the start of the alignment.
269281
///
270282
/// [`Cigar`]: crate::data::types::cigar::Cigar
271283
#[must_use]
@@ -346,12 +358,20 @@ impl SamData {
346358
}
347359

348360
/// Merges SAM read pairs using the reference alignment to parsimoniously
349-
/// detect and correct errors. Based on the work by **Shepard et al. 2016** for
350-
/// IRMA.
361+
/// detect and correct errors. Based on the work by **Shepard et al. 2016**
362+
/// for IRMA.
351363
///
352364
/// ## Notes
353365
///
354366
/// This algorithm is designed for local alignment.
367+
///
368+
/// ## Panics
369+
///
370+
/// Currently panics on invalid cigar states. To be removed in the future
371+
/// for either a `Result` or type-state validated CIGAR strings.
372+
///
373+
/// This also has a chance of panicking in debug mode if an insertion
374+
/// appears at the start of the alignment.
355375
#[allow(clippy::too_many_lines)]
356376
#[must_use]
357377
pub fn merge_pair_using_reference(

src/data/types/cigar/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,13 @@ impl TryFrom<&str> for Cigar {
258258
}
259259
}
260260

261+
/// An extension trait for `Vec<u8>` allowing a ciglet to be formatted into the
262+
/// buffer.
261263
pub(crate) trait FormatCigletForCigarVec {
264+
/// Extends the buffer with the formatted `ciglet`.
262265
fn push_formatted_ciglet(&mut self, ciglet: Ciglet);
263266
}
267+
264268
impl FormatCigletForCigarVec for Vec<u8> {
265269
#[inline]
266270
fn push_formatted_ciglet(&mut self, ciglet: Ciglet) {
@@ -348,13 +352,19 @@ impl ExpandedCigar {
348352
if previous == op {
349353
count += 1;
350354
} else {
351-
condensed.push_formatted_ciglet(Ciglet { inc: count, op: previous });
355+
condensed.push_formatted_ciglet(Ciglet {
356+
inc: count,
357+
op: previous,
358+
});
352359
previous = op;
353360
count = 1;
354361
}
355362
}
356363

357-
condensed.push_formatted_ciglet(Ciglet { inc: count, op: previous });
364+
condensed.push_formatted_ciglet(Ciglet {
365+
inc: count,
366+
op: previous,
367+
});
358368

359369
Cigar(condensed)
360370
}

src/data/types/nucleotides/sanitize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub enum RefineDNAStrat {
167167
/// Retains and recodes to uppercase ACGTN bases with standard gaps (`-`)
168168
AcgtnStdGapsUc,
169169

170-
// Retains and recodes to uppercase ACGT bases without gaps
170+
/// Retains and recodes to uppercase ACGT bases without gaps
171171
AcgtNoGapsUc,
172172
}
173173

0 commit comments

Comments
 (0)