Extracted `inverser_chaine` into a reusable utility function with docstring and added unit test to ensure correctness.
25 lines
603 B
Rust
25 lines
603 B
Rust
use clap::Args;
|
|
use obikpartitionner::KmerPartition;
|
|
use std::path::PathBuf;
|
|
use tracing::info;
|
|
|
|
#[derive(Args)]
|
|
pub struct CountArgs {
|
|
/// Partition directory produced by the `partition` command
|
|
#[arg(short, long)]
|
|
pub partition: PathBuf,
|
|
}
|
|
|
|
pub fn run(args: CountArgs) {
|
|
let kp = KmerPartition::open(&args.partition).unwrap_or_else(|e| {
|
|
eprintln!("error: {e}");
|
|
std::process::exit(1)
|
|
});
|
|
|
|
info!("counting kmers in {}", args.partition.display());
|
|
kp.count_kmer().unwrap_or_else(|e| {
|
|
eprintln!("error: {e}");
|
|
std::process::exit(1)
|
|
});
|
|
}
|