Skip to content

Commit

Permalink
refactor(cli): initial branch commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jspaezp authored and lazear committed Dec 14, 2024
1 parent 73eaf49 commit bd5b12c
Show file tree
Hide file tree
Showing 7 changed files with 1,007 additions and 1,003 deletions.
8 changes: 6 additions & 2 deletions crates/sage-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
name = "sage_cli"
path = "src/lib.rs"

[[bin]]
name = "sage"
path = "src/main.rs"
Expand All @@ -20,7 +24,7 @@ sage-cloudpath = { path = "../sage-cloudpath", features = ["parquet"] }

anyhow = "1.0"
csv = "1"
clap = { version="4.0", features = ["cargo", "unicode"] }
clap = { version = "4.0", features = ["cargo", "unicode"] }
env_logger = "0.8.4"
fnv = "1.0"
log = "0.4.0"
Expand All @@ -29,6 +33,6 @@ num_cpus = "1.13"
rayon = "1.5"
regex = "1.0"
ryu = "1.0"
serde = { version="1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sysinfo = "0.29"
62 changes: 31 additions & 31 deletions crates/sage-cli/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,38 @@ pub struct Search {
#[derive(Deserialize)]
/// Input search parameters deserialized from JSON file
pub struct Input {
database: Builder,
precursor_tol: Tolerance,
fragment_tol: Tolerance,
report_psms: Option<usize>,
chimera: Option<bool>,
wide_window: Option<bool>,
min_peaks: Option<usize>,
max_peaks: Option<usize>,
max_fragment_charge: Option<u8>,
min_matched_peaks: Option<u16>,
precursor_charge: Option<(u8, u8)>,
override_precursor_charge: Option<bool>,
isotope_errors: Option<(i8, i8)>,
deisotope: Option<bool>,
quant: Option<QuantOptions>,
predict_rt: Option<bool>,
output_directory: Option<String>,
mzml_paths: Option<Vec<String>>,
bruker_spectrum_processor: Option<BrukerSpectrumProcessor>,

annotate_matches: Option<bool>,
write_pin: Option<bool>,
score_type: Option<ScoreType>,
pub database: Builder,
pub precursor_tol: Tolerance,
pub fragment_tol: Tolerance,
pub report_psms: Option<usize>,
pub chimera: Option<bool>,
pub wide_window: Option<bool>,
pub min_peaks: Option<usize>,
pub max_peaks: Option<usize>,
pub max_fragment_charge: Option<u8>,
pub min_matched_peaks: Option<u16>,
pub precursor_charge: Option<(u8, u8)>,
pub override_precursor_charge: Option<bool>,
pub isotope_errors: Option<(i8, i8)>,
pub deisotope: Option<bool>,
pub quant: Option<QuantOptions>,
pub predict_rt: Option<bool>,
pub output_directory: Option<String>,
pub mzml_paths: Option<Vec<String>>,
pub bruker_spectrum_processor: Option<BrukerSpectrumProcessor>,

pub annotate_matches: Option<bool>,
pub write_pin: Option<bool>,
pub score_type: Option<ScoreType>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct LfqOptions {
peak_scoring: Option<sage_core::lfq::PeakScoringStrategy>,
integration: Option<sage_core::lfq::IntegrationStrategy>,
spectral_angle: Option<f64>,
ppm_tolerance: Option<f32>,
combine_charge_states: Option<bool>,
pub peak_scoring: Option<sage_core::lfq::PeakScoringStrategy>,
pub integration: Option<sage_core::lfq::IntegrationStrategy>,
pub spectral_angle: Option<f64>,
pub ppm_tolerance: Option<f32>,
pub combine_charge_states: Option<bool>,
}

impl From<LfqOptions> for LfqSettings {
Expand Down Expand Up @@ -108,11 +108,11 @@ impl From<LfqOptions> for LfqSettings {

#[derive(Serialize, Deserialize, Debug)]
pub struct TmtOptions {
level: Option<u8>,
sn: Option<bool>,
pub level: Option<u8>,
pub sn: Option<bool>,
}

#[derive(Copy, Clone, Serialize)]
#[derive(Copy, Clone, Serialize, Debug)]
pub struct TmtSettings {
pub level: u8,
pub sn: bool,
Expand Down
4 changes: 4 additions & 0 deletions crates/sage-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pub mod input;
pub mod output;
pub mod runner;
pub mod telemetry;
Loading

0 comments on commit bd5b12c

Please sign in to comment.