Skip to content

Commit aef54af

Browse files
syncmer docs
1 parent 320f33c commit aef54af

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ let minimizer_vals: Vec<u64> = canonical_minimizers(k, w)
5757
.run(packed_seq.as_slice(), &mut minimizer_positions)
5858
.values_u64()
5959
.collect();
60+
61+
// Compute _syncmers_ positions and values instead:
62+
let mut syncmer_positions = Vec::new();
63+
// List of (k+w-1)-mer values.
64+
let syncmer_vals: Vec<u64> = canonical_syncmers(k, w)
65+
.run(packed_seq.as_slice(), &mut syncmer_positions)
66+
.values_u64()
67+
.collect();
6068
```
6169

6270
## Benchmarks

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
//! 3. Compute the 'preferred' strand of the current window as the one with more `TG` characters. This requires `l=w+k-1` to be odd for proper tie-breaking.
4545
//! 4. Return either the leftmost or rightmost smallest k-mer, depending on the preferred strand.
4646
//!
47+
//! ## Syncmers
48+
//!
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+
//! (Or, in classical notation, `k`-mers with the smallest `s`-mer as prefix or suffix.)
51+
//! These can be computed by using [`syncmers`] or [`canonical_syncmers`] instead of [`minimizers`] or [`canonical_minimizers`].
52+
//!
53+
//! Note that canonical syncmers are chosen as the minimum of the forward and reverse-complement k-mer representation.
54+
//!
4755
//! ## Input types
4856
//!
4957
//! This crate depends on [`packed-seq`] to handle generic types of input sequences.

0 commit comments

Comments
 (0)