This function removes noisy fragments from a given spectrum. Fragments with m/z values too close to each other, determined by a ppm threshold, are considered noisy. Among such close fragments, the one with the lower intensity is removed.

removeNoise(spec, ppm.ms2match = 30, mz.ppm.thr = 400)

Arguments

spec

A data frame representing the spectrum with columns for m/z and intensity.

ppm.ms2match

A numeric value specifying the ppm threshold for identifying close fragments. Default is 30.

mz.ppm.thr

A numeric value for the m/z threshold below which the m/z is set to this threshold. Default is 400.

Value

A data frame representing the cleaned spectrum after removing noisy fragments.

Details

For a given spectrum, the function identifies fragments whose m/z values are too close to each other, based on the specified ppm threshold. Among such close fragments, the one with the lower intensity is removed from the spectrum.

Note

This function is deprecated. Use `remove_noise()` instead.

Examples

exp.spectrum <- data.frame(mz = 1:10, intensity = 1:10)
removeNoise(exp.spectrum)
#> Warning: `removeNoise()` was deprecated in masstools 0.99.9.
#>  Please use `remove_noise()` instead.
#>    mz intensity
#> 1   1         1
#> 2   2         2
#> 3   3         3
#> 4   4         4
#> 5   5         5
#> 6   6         6
#> 7   7         7
#> 8   8         8
#> 9   9         9
#> 10 10        10