Skip to content

Commit

Permalink
min kmer count now has to be >= 1 and not 5
Browse files Browse the repository at this point in the history
  • Loading branch information
jhellewell14 committed Jan 21, 2025
1 parent e2c734c commit 3da92ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
16 changes: 0 additions & 16 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,6 @@ pub fn check_threads(threads: usize) {
}
}

#[doc(hidden)]
fn valid_kmer_min(s: &str) -> Result<u16, String> {
if s.eq("auto") {
Ok(0)
} else {
let k: u16 = s
.parse()
.map_err(|_| format!("`{s}` isn't a valid minimum kmer count"))?;
if k.ge(&5) {
Ok(k)
} else {
Err("minimum kmer count must be >= 5".to_string())
}
}
}

/// Possible output file types
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum FileType {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,11 @@ pub fn main() {
// User has provided something other than auto, attempt to parse to u16
Some(s) => {
let k: u16 = s.parse().expect("Invalid minimum kmer count");
if k.ge(&5) {
if k.ge(&1) {
log::info!("Using provided minimum kmer value of {}", k);
k
} else {
panic!("Minimum kmer count must be >= 5");
panic!("Minimum kmer count must be >= 1");
}
}
// Value not provided, use default
Expand Down

0 comments on commit 3da92ff

Please sign in to comment.