mscore::timstof::quadrupole

Function smooth_step

Source
pub fn smooth_step(x: &Vec<f64>, up_start: f64, up_end: f64, k: f64) -> Vec<f64>
Expand description

Sigmoid step function for quadrupole selection simulation

Arguments:

  • x - mz values
  • up_start - start of the step
  • up_end - end of the step
  • k - steepness of the step

Returns:

  • Vec<f64> - transmission probability for each mz value

ยงExamples

use mscore::timstof::quadrupole::smooth_step;

let mz = vec![100.0, 200.0, 300.0];
let transmission = smooth_step(&mz, 150.0, 250.0, 0.5).iter().map(
|&x| (x * 100.0).round() / 100.0).collect::<Vec<f64>>();
assert_eq!(transmission, vec![0.0, 0.5, 1.0]);