Skip to main content

fibertools_rs/cli/
fire_opts.rs

1use crate::utils::input_bam::InputBam;
2use clap::Args;
3use std::fmt::Debug;
4
5#[derive(Args, Debug)]
6pub struct FireOptions {
7    #[clap(flatten)]
8    pub input: InputBam,
9    /// Output file (BAM by default, table of MSP features if `--feats-to-text` is used, and bed9 + if `--extract`` is used)
10    #[clap(default_value = "-")]
11    pub out: String,
12    /// Use a ONT heuristic adjustment for FIRE calling.
13    /// This adjusts the observed number of m6A counts by adding pseudo counts to account for the single stranded nature of ONT data.
14    #[clap(long, env)]
15    pub ont: bool,
16    /// Use a human model for FIRE calling
17    #[clap(hide = true, long, env)]
18    pub human: bool,
19    /// Use a yeast model for FIRE calling
20    #[clap(hide = true, long, env)]
21    pub yeast: bool,
22    /// Output just FIRE elements in bed9 format
23    #[clap(short, long)]
24    pub extract: bool,
25    /// When extracting bed9 format include all MSPs and nucleosomes
26    #[clap(long)]
27    pub all: bool,
28    /// Output FIREs features for training in a table format
29    #[clap(short, long)]
30    pub feats_to_text: bool,
31    /// Width of bin for feature collection
32    #[clap(short, long, default_value = "40", env, 
33        default_value_ifs([
34            ("human", "true", "40"),
35            ("yeast", "true", "100")
36        ])
37    )]
38    pub width_bin: i64,
39    /// Number of bins to collect
40    #[clap(short, long, default_value = "9", env)]
41    pub bin_num: i64,
42    /// Calculate stats for the highest X bp window within each MSP
43    /// Should be a fair amount higher than the expected linker length.
44    #[clap(long, default_value = "100", env)]
45    pub best_window_size: i64,
46    /// Use 5mC data in FIREs
47    #[clap(long, hide = true)]
48    pub use_5mc: bool,
49    /// Minium length of msp to call a FIRE
50    #[clap(long, default_value = "85", env)]
51    pub min_msp_length_for_positive_fire_call: i64,
52    /// Optional path to a model json file.
53    /// If not provided ft will use the default model (recommended).
54    #[clap(long, env = "FIRE_MODEL")]
55    pub model: Option<String>,
56    /// Optional path to a FDR table
57    #[clap(long, env)]
58    pub fdr_table: Option<String>,
59}
60
61impl Default for FireOptions {
62    fn default() -> Self {
63        Self {
64            input: Default::default(),
65            out: "-".to_string(),
66            ont: false,
67            human: false,
68            yeast: false,
69            extract: false,
70            all: false,
71            feats_to_text: false,
72            width_bin: 40,
73            bin_num: 9,
74            best_window_size: 100,
75            use_5mc: false,
76            min_msp_length_for_positive_fire_call: 85,
77            model: None,
78            fdr_table: None,
79        }
80    }
81}