Skip to main content

cyto_cli/ibu/
reads.rs

1use std::path::Path;
2
3use crate::ibu::IbuInput;
4
5#[derive(clap::Parser, Debug)]
6pub struct ArgsReads {
7    #[clap(flatten)]
8    pub input: IbuInput,
9
10    #[clap(flatten)]
11    pub options: OptionsReads,
12}
13impl ArgsReads {
14    pub fn from_wf_path<P: AsRef<Path>>(input_path: &str, output_path: P) -> Self {
15        let outpath = output_path.as_ref().to_string_lossy().to_string();
16        Self {
17            input: IbuInput::from_path(input_path),
18            options: OptionsReads {
19                output: Some(outpath),
20                whitelist: None,
21                encoded: false,
22                no_header: false,
23            },
24        }
25    }
26}
27
28#[derive(clap::Parser, Debug)]
29pub struct OptionsReads {
30    /// Output file path to write to [default=stdout]
31    #[clap(short, long)]
32    pub output: Option<String>,
33
34    /// A whitelist of barcodes to keep [default=all]
35    #[clap(short, long)]
36    pub whitelist: Option<String>,
37
38    /// Keep the barcode as an encoded u64
39    #[clap(long)]
40    pub encoded: bool,
41
42    /// Do not write a header to the output file
43    #[clap(long)]
44    pub no_header: bool,
45}