pub struct IsotopeModel {
pub residue_mass: f64,
pub c: f64,
pub h: f64,
pub n: f64,
pub o: f64,
pub s: f64,
}Expand description
Average residue composition of an analyte class, expressed as element counts
per residue_mass Da of neutral mass. Scaling these by
neutral_mass / residue_mass and rounding gives the composition whose exact
isotopologue distribution super::elements convolves.
Fields§
§residue_mass: f64Mass of one average residue, in Da. The denominator of every ratio.
c: f64Carbon atoms per residue.
h: f64Hydrogen atoms per residue.
n: f64Nitrogen atoms per residue.
o: f64Oxygen atoms per residue.
s: f64Sulfur atoms per residue. Zero for the nucleic-acid models, which
disables sulfur-aware scoring (see IsotopeModel::has_sulfur).
Implementations§
Source§impl IsotopeModel
impl IsotopeModel
Sourcepub fn counts(&self, neutral_mass: f64) -> (u32, u32, u32, u32, u32)
pub fn counts(&self, neutral_mass: f64) -> (u32, u32, u32, u32, u32)
Integer element counts (C, H, N, O, S) at neutral_mass. Half-up
rounding from the scaled floats.
Sourcepub fn distribution(&self, neutral_mass: f64) -> [f64; 10]
pub fn distribution(&self, neutral_mass: f64) -> [f64; 10]
Theoretical isotope distribution at neutral_mass, normalized
[p0, …, p9].
Sourcepub fn distribution_with_sulfur(&self, neutral_mass: f64, n_s: u32) -> [f64; 10]
pub fn distribution_with_sulfur(&self, neutral_mass: f64, n_s: u32) -> [f64; 10]
As Self::distribution with the sulfur count overridden: C/H/N/O held
at their scaled values, S set to n_s.
Sourcepub fn sulfur_ceil(&self, neutral_mass: f64) -> u32
pub fn sulfur_ceil(&self, neutral_mass: f64) -> u32
Expected sulfur count rounded up rather than half-up. Only the sulfur
term changes; C/H/N/O keep Self::counts’ rounding. For the peptide
model (s = 0.0417, i.e. 3.7524e-4·M) the ceiling steps at M ≈ 2665 /
5330 / 7995 Da.
Sourcepub fn has_sulfur(&self) -> bool
pub fn has_sulfur(&self) -> bool
Whether the model contains sulfur at all. A model that does not (RNA,
DNA) is scored against one template regardless of sulfur_offsets:
varying a count that is structurally zero would only hand every
candidate, decoys included, a free maximum over templates.
Trait Implementations§
Source§impl Clone for IsotopeModel
impl Clone for IsotopeModel
impl Copy for IsotopeModel
Source§impl Debug for IsotopeModel
impl Debug for IsotopeModel
Source§impl Default for IsotopeModel
impl Default for IsotopeModel
Source§impl<'de> Deserialize<'de> for IsotopeModel
impl<'de> Deserialize<'de> for IsotopeModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IsotopeModel
impl PartialEq for IsotopeModel
Source§impl Serialize for IsotopeModel
impl Serialize for IsotopeModel
impl StructuralPartialEq for IsotopeModel
Auto Trait Implementations§
impl Freeze for IsotopeModel
impl RefUnwindSafe for IsotopeModel
impl Send for IsotopeModel
impl Sync for IsotopeModel
impl Unpin for IsotopeModel
impl UnsafeUnpin for IsotopeModel
impl UnwindSafe for IsotopeModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more