Skip to main content

project_emg_over_events

Function project_emg_over_events 

Source
pub fn project_emg_over_events(
    event_intervals: &[(f64, f64)],
    mu: f64,
    sigma: f64,
    lambda: f64,
    target_p: f64,
    step_size: f64,
    n_steps: Option<usize>,
) -> Vec<(usize, f64)>
Expand description

Project an EMG retention-time profile onto an explicit event timeline (instrument-dispatch P2).

Each event carries its own [start, end] exposure interval (seconds), so unlike calculate_frame_abundance_emg — which integrates a fixed [time - rt_cycle_length, time] and is therefore wrong for unequal event durations / dead time — this integrates the EMG over each event’s true interval. Only events overlapping the analyte’s RT support (computed once via calculate_bounds_emg at target_p) are integrated, implementing the RT-support truncation policy. Returns (event_index, abundance) for events with positive abundance, in ascending event order.

§Arguments

  • event_intervals - per-event [start, end] exposure intervals (seconds), indexed by event position in the run timeline.
  • mu, sigma, lambda - EMG parameters of the analyte’s RT profile.
  • target_p - probability mass defining the RT support (e.g. 0.9999).
  • step_size - search step for the bounds binary search.
  • n_steps - integration steps for each interval CDF (defaults to 1000).