pub struct SeqHashBuilder { /* private fields */ }Expand description
Builder for constructing a SeqHash index with custom configuration.
§Example
use seqhash::SeqHashBuilder;
let parents: Vec<&[u8]> = vec![b"ACGTACGT", b"GGGGCCCC"];
// Build with default settings (allows 1 mismatch, allows N bases, normalizes case)
let index = SeqHashBuilder::default().build(&parents).unwrap();
// Build with exact match only (no mismatch tolerance)
let exact_only = SeqHashBuilder::default()
.exact()
.build(&parents)
.unwrap();
// Build rejecting N bases in sequences
let no_n = SeqHashBuilder::default()
.exclude_n()
.build(&parents)
.unwrap();
// Build preserving lowercase bases (useful when case has special meaning)
let keep_case = SeqHashBuilder::default()
.keep_case()
.build(&parents)
.unwrap();Implementations§
Source§impl SeqHashBuilder
impl SeqHashBuilder
Sourcepub fn exact(self) -> Self
pub fn exact(self) -> Self
Configure for exact matching only (no mismatch tolerance).
When set, the index will only match sequences that exactly match a parent. This reduces memory usage since no mutation entries are generated.
Sourcepub fn exclude_n(self) -> Self
pub fn exclude_n(self) -> Self
Reject N bases in sequences.
By default, sequences containing N are accepted (N positions are skipped
when generating mismatch entries). When this is set, sequences containing
N will be rejected with an InvalidBase error.
Sourcepub fn keep_case(self) -> Self
pub fn keep_case(self) -> Self
Preserve the case of input sequences.
By default, sequences are converted to uppercase before indexing. When this is set, sequences are kept as-is, preserving lowercase bases. This is useful when lowercase bases have special meaning in your data.
Sourcepub fn threads(self, num_threads: usize) -> Self
pub fn threads(self, num_threads: usize) -> Self
Number of threads to use when building the index.
By default, uses a single thread. Setting this to 0 will use all available threads.
Parallel construction is most beneficial for large parent sets (>100,000 sequences) or long sequences. The number of threads is automatically capped by the number of available CPU cores and the number of parent sequences.
§Example
use seqhash::SeqHashBuilder;
let parents: Vec<&[u8]> = vec![b"ACGTACGT", b"GGGGCCCC"];
// Use 4 threads
let index = SeqHashBuilder::default()
.threads(4)
.build(&parents)
.unwrap();
// Use all available CPU cores
let index = SeqHashBuilder::default()
.threads(0)
.build(&parents)
.unwrap();Trait Implementations§
Source§impl Clone for SeqHashBuilder
impl Clone for SeqHashBuilder
Source§fn clone(&self) -> SeqHashBuilder
fn clone(&self) -> SeqHashBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more