1use clap::{Args, Parser, Subcommand};
2
3use crate::{ordering::OrderingMethod, weights::active_set_weights::NNLSParams};
4
5#[derive(Parser, Debug)]
6#[command(version, about, long_about = None)]
7pub struct ProgramArgs {
8 #[command(subcommand)]
9 pub subcommand: ProgramSubcommand,
10 #[arg(
11 short,
12 long,
13 default_value = "1",
14 global = true,
15 help = "Number of threads to use."
16 )]
17 pub threads: usize,
18 #[arg(
19 short,
20 long,
21 default_value = "false",
22 conflicts_with = "quiet",
23 global = true
24 )]
25 pub verbose: bool,
26 #[arg(
27 short,
28 long,
29 default_value = "false",
30 conflicts_with = "verbose",
31 global = true
32 )]
33 pub quiet: bool,
34 #[arg(
35 short = 'd',
36 long,
37 default_value = "output",
38 global = true,
39 help = "Output directory"
40 )]
41 pub output_directory: String,
42}
43
44#[derive(Subcommand, Debug)]
45pub enum ProgramSubcommand {
46 #[clap(
47 name = "neighbour_net",
48 about = "Run the SplitsTree NeighborNet algorithm"
49 )]
50 NeighborNet(NeighbourNetArgs),
51}
52
53#[derive(Args, Debug)]
54pub struct NeighbourNetArgs {
55 #[arg(short, long, help = "Input distance matrix file path", required = true)]
57 pub input: String,
58 #[arg(
59 short,
60 long,
61 help = "Output prefix for result files",
62 default_value = "output"
63 )]
64 pub output_prefix: String,
65 #[arg(
66 short = 'O',
67 long,
68 help = "The ordering algorithm to use to get splits cycle",
69 default_value = "splits-tree4"
70 )]
71 pub ordering: OrderingMethod,
72 #[clap(flatten)]
73 pub nnls_params: NNLSParams,
74}
75
76impl NeighbourNetArgs {
77 pub fn default() -> Self {
78 Self {
79 input: String::new(),
80 output_prefix: String::from("output"),
81 ordering: OrderingMethod::SplitsTree4,
82 nnls_params: NNLSParams::default(),
83 }
84 }
85}