Convert M/Z to Frequency
convert_mz_frequency.Rd
Given a data.frame of m/z, generate frequency values for the data.
Arguments
- mz_data
a data.frame with
mz
- keep_all
keep all the variables generated, or just the original + frequency?
Details
The M/Z values from FTMS data do not have constant spacing between them. This produces challenges in working with ranged intervals and windows. The solution for FTMS data then is to convert them to frequency space. This is done by:
taking subsequent M/Z points
averaging their M/Z
taking the difference to get an
offset
valuedividing averaged M/Z by offset to generate frequency
taking subsequent differences of frequency points
keep points with a difference in the supplied range as valid for modeling
After deciding on the valid points for modeling, each point gets an interpolated frequency value using the two averaged points to the left and right in M/Z.