rustms::chemistry::formula

Function calculate_mz

Source
pub fn calculate_mz(monoisotopic_mass: f64, charge: i32) -> f64
Expand description

calculate the m/z of an ion

Arguments:

  • mono_mass - monoisotopic mass of the ion
  • charge - charge state of the ion

Returns:

  • mz - mass-over-charge of the ion

ยงExamples

use rustms::chemistry::formula::calculate_mz;

let mz = calculate_mz(1000.0, 2);
assert_eq!(mz, 501.007276466621);