diff --git a/CHANGELOG.md b/CHANGELOG.md index 03822b5..798faa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v0.15.0-alpha] (unreleased) ### Added - Initial support for searching diaPASEF data +- `override_precursor_charge` setting that forces multiple charge states to be searched ### Breaking Changes - `precursor_ppm` field reports the non-absoluted average mass error, rather than the absoluted average mass error. - Don't deisotope reporter ion regions if MS2-based TMT/iTRAQ is used diff --git a/Cargo.lock b/Cargo.lock index 2937d57..3be8b8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2259,7 +2259,7 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sage-cli" -version = "0.14.7" +version = "0.15.0-alpha" dependencies = [ "anyhow", "clap", diff --git a/crates/sage-cli/src/input.rs b/crates/sage-cli/src/input.rs index 4576103..f17dd03 100644 --- a/crates/sage-cli/src/input.rs +++ b/crates/sage-cli/src/input.rs @@ -18,6 +18,7 @@ pub struct Search { pub precursor_tol: Tolerance, pub fragment_tol: Tolerance, pub precursor_charge: (u8, u8), + pub override_precursor_charge: bool, pub isotope_errors: (i8, i8), pub deisotope: bool, pub chimera: bool, @@ -55,6 +56,7 @@ pub struct Input { max_fragment_charge: Option, min_matched_peaks: Option, precursor_charge: Option<(u8, u8)>, + override_precursor_charge: Option, isotope_errors: Option<(i8, i8)>, deisotope: Option, quant: Option, @@ -298,6 +300,7 @@ impl Input { max_fragment_charge: self.max_fragment_charge, annotate_matches: self.annotate_matches.unwrap_or(false), precursor_charge: self.precursor_charge.unwrap_or((2, 4)), + override_precursor_charge: self.override_precursor_charge.unwrap_or(false), isotope_errors: self.isotope_errors.unwrap_or((0, 0)), deisotope: self.deisotope.unwrap_or(true), chimera: self.chimera.unwrap_or(false), diff --git a/crates/sage-cli/src/main.rs b/crates/sage-cli/src/main.rs index 980573a..a87d3bf 100644 --- a/crates/sage-cli/src/main.rs +++ b/crates/sage-cli/src/main.rs @@ -262,6 +262,7 @@ impl Runner { max_isotope_err: self.parameters.isotope_errors.1, min_precursor_charge: self.parameters.precursor_charge.0, max_precursor_charge: self.parameters.precursor_charge.1, + override_precursor_charge: self.parameters.override_precursor_charge, max_fragment_charge: self.parameters.max_fragment_charge, chimera: self.parameters.chimera, report_psms: self.parameters.report_psms, diff --git a/crates/sage-cli/tests/integration.rs b/crates/sage-cli/tests/integration.rs index a22bcd2..018337b 100644 --- a/crates/sage-cli/tests/integration.rs +++ b/crates/sage-cli/tests/integration.rs @@ -26,6 +26,7 @@ fn integration() -> anyhow::Result<()> { max_isotope_err: 3, min_precursor_charge: 2, max_precursor_charge: 4, + override_precursor_charge: false, max_fragment_charge: Some(1), chimera: false, report_psms: 1, diff --git a/crates/sage/src/scoring.rs b/crates/sage/src/scoring.rs index 9bc0bdf..e2d0c0e 100644 --- a/crates/sage/src/scoring.rs +++ b/crates/sage/src/scoring.rs @@ -182,6 +182,7 @@ pub struct Scorer<'db> { pub max_isotope_err: i8, pub min_precursor_charge: u8, pub max_precursor_charge: u8, + pub override_precursor_charge: bool, pub max_fragment_charge: Option, pub chimera: bool, pub report_psms: usize, @@ -346,12 +347,14 @@ impl<'db> Scorer<'db> { ); self.trim_hits(&mut hits); hits - } else if let Some(charge) = precursor.charge { + } else if precursor.charge.is_some() && self.override_precursor_charge == false { + let charge = precursor.charge.unwrap(); // Charge state is already annotated for this precusor, only search once let precursor_mass = mz * charge as f32; self.matched_peaks(query, precursor_mass, charge, self.precursor_tol) } else { - // Not all selected ion precursors have charge states annotated - + // Not all selected ion precursors have charge states annotated (or user has set + // `override_precursor_charge`) // assume it could be z=2, z=3, z=4 and search all three let mut hits = (self.min_precursor_charge..=self.max_precursor_charge).fold( InitialHits::default(),