|
49 | 49 | //! _Syncmers_ are (in our notation) windows of length `l = w + k - 1` characters where the minimizer k-mer is a prefix or suffix. |
50 | 50 | //! (Or, in classical notation, `k`-mers with the smallest `s`-mer as prefix or suffix.) |
51 | 51 | //! These can be computed by using [`fn@syncmers`] or [`canonical_syncmers`] instead of [`minimizers`] or [`canonical_minimizers`]. |
| 52 | +//! To obtain their values via [`Output::values_u64`], `l` (rather than `k`) has to be at most 32. |
52 | 53 | //! |
53 | 54 | //! Note that canonical syncmers are chosen as the minimum of the forward and reverse-complement k-mer representation. |
54 | 55 | //! |
|
60 | 61 | //! |
61 | 62 | //! The main function provided by [`packed_seq`] is [`packed_seq::Seq::iter_bp`], which splits the input into 8 chunks and iterates them in parallel using SIMD. |
62 | 63 | //! |
63 | | -//! When dealing with ASCII input, use the `AsciiSeq` and `AsciiSeqVec` types. |
| 64 | +//! When the input is ASCII-encoded DNA, either use the `AsciiSeq` and `AsciiSeqVec` types, or (usually preferred) first convert to `PackedSeqVec`. |
64 | 65 | //! |
65 | 66 | //! ## Hash function |
66 | 67 | //! |
@@ -573,16 +574,22 @@ impl<'h, 'o2, const CANONICAL: bool, H: KmerHasher> |
573 | 574 |
|
574 | 575 | impl<'s, 'o, const CANONICAL: bool, SEQ: Seq<'s>> Output<'o, CANONICAL, SEQ> { |
575 | 576 | /// Iterator over (canonical) u64 kmer-values associated with all minimizer positions. |
| 577 | + /// |
| 578 | + /// For syncmers, this returns `l=w+k-1`-mers. |
576 | 579 | #[must_use] |
577 | 580 | pub fn values_u64(&self) -> impl ExactSizeIterator<Item = u64> { |
578 | 581 | self.pos_and_values_u64().map(|(_pos, val)| val) |
579 | 582 | } |
580 | 583 | /// Iterator over (canonical) u128 kmer-values associated with all minimizer positions. |
| 584 | + /// |
| 585 | + /// For syncmers, this returns `l=w+k-1`-mers. |
581 | 586 | #[must_use] |
582 | 587 | pub fn values_u128(&self) -> impl ExactSizeIterator<Item = u128> { |
583 | 588 | self.pos_and_values_u128().map(|(_pos, val)| val) |
584 | 589 | } |
585 | 590 | /// Iterator over positions and (canonical) u64 kmer-values associated with all minimizer positions. |
| 591 | + /// |
| 592 | + /// For syncmers, this returns `l=w+k-1`-mer values. |
586 | 593 | #[must_use] |
587 | 594 | pub fn pos_and_values_u64(&self) -> impl ExactSizeIterator<Item = (u32, u64)> { |
588 | 595 | self.min_pos.iter().map( |
|
0 commit comments