Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate.formula for charged species: window not correctly calculated? #132

Open
WBS-TW opened this issue Sep 12, 2022 · 0 comments
Open

Comments

@WBS-TW
Copy link

WBS-TW commented Sep 12, 2022


Hi,
I am using generate.formula to annotate masses with charge +1 from high resolution masss spectrometers within a small uncertainty specified by the windows parameter.
I am uncertain about how this window parameter is included in the calculations as it seems that the charge is added after the calculation of the molecular formula.
For instance, I have a mass of 69.03353 and a charge of +1

library(rcdk)
mass <- 69.03353
window <- 0.000345 # correspond to a 5 ppm mass error

# manual calculation of lower bound window range: mass - window = 69.03353 - 0.000345 = 69.033185
# manual calculation of upper bound window range: mass + window = 69.03353 + 0.000345 = 69.033875

element_range <- list(c('C', 0,4), c('H', 0,11), c('O', 0,2), c('P', 0,1))
match <- rcdk::generate.formula(
     mass,
      window = window,
      elements = element_range,
      validation = FALSE,
      charge = 1
    )

This does not give match for any formula with the specified element range.
However, the theoretical m/z of C4H5O+ is: 69.0335 which is within the window range. The neutral monoisotopic mass of C4H5O is 69.0340 and above the window range and I was wondering if the charge is added after the calculcations and therefore charged species cannot be correctly found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant