1use std::path::Path;
2
3use super::IbuInput;
4
5#[derive(clap::Parser, Debug)]
6pub struct ArgsCount {
7 #[clap(flatten)]
8 pub input: IbuInput,
9
10 #[clap(short, long)]
12 pub output: Option<String>,
13
14 #[clap(long, requires = "output", requires = "features")]
21 pub mtx: bool,
22
23 #[clap(short = 't', long, default_value = "1")]
25 pub num_threads: usize,
26
27 #[clap(short = 'e', long = "compressed")]
29 pub compressed: bool,
30
31 #[clap(short = 'f', long)]
35 pub features: Option<String>,
36
37 #[clap(short = 'C', long, default_value_t = 1)]
39 pub feature_col: usize,
40
41 #[clap(short = 's', long, requires = "features")]
45 pub suffix: Option<String>,
46}
47impl ArgsCount {
48 pub fn from_wf_path<P: AsRef<Path>>(
49 sort_path: &str,
50 out_path: P,
51 features_path: P,
52 num_threads: usize,
53 mtx: bool,
54 suffix: Option<String>,
55 ) -> Self {
56 Self {
57 input: IbuInput::from_path(sort_path),
58 output: Some(out_path.as_ref().to_str().unwrap().to_string()),
59 features: Some(features_path.as_ref().to_str().unwrap().to_string()),
60 mtx,
61 compressed: false,
62 feature_col: 1,
63 num_threads,
64 suffix,
65 }
66 }
67}