-
Notifications
You must be signed in to change notification settings - Fork 6
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
calculateMass
: clarify or enhance behaviour for charged formulas
#59
Comments
Not out of scope. We can add changes for this. In my opion charged formulas should be supplied exactly in the format you mentioned, e.g. |
IMHO it would be best if maybe best to have one function
happy for a PR :) |
I can fiddle around a bit, but what do we want as input?
I would prefer the first option |
I would also say the first option (i.e. |
The way I think it through now, |
we also have isotope detection/parsing in there ( |
don't know if the previous comment made sense... what I mean: put that into the same function that does already the parsing to avoid needing to parse the input twice (once e.g. counting elements and once getting the charge). but this will also depend a bit how complicated it would be - if it's too difficult or blows up the code we could do it in two separate steps (i.e. a dedicated function that retrieves the charge from a |
Currently
calculateMass("[C6H12]+") == calculateMass("C6H12")
Strictly, this should be
calculateMass("[C6H12]+") == calculateMass("C6H12") - .emass
where.emass == 0.0005485799
Questions:
calculateMass("[C6H12]+")
out-of-scope for this function, and should this throw a warning or error?calculateMass(x, charge)
?Note: the
rcdk
equivalent isget.formula(formula, charge)@mass
. Notably, get.formula("[C6H6]+") also does not account for the charge (but creates the neutral formula). However here the user can specify the charge manually.The text was updated successfully, but these errors were encountered: