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

Validator: Handle formulas in brackets #391

Open
tsufz opened this issue Aug 13, 2023 · 3 comments
Open

Validator: Handle formulas in brackets #391

tsufz opened this issue Aug 13, 2023 · 3 comments
Assignees
Labels

Comments

@tsufz
Copy link
Member

tsufz commented Aug 13, 2023

@meier-rene,
In some cases, we need formulas in brackets, e.g. for charged compounds such as quaternary ammonia compounds. The validator needs to be fixed to handle such cases.

Formula from CH$IUPAC:   [C27H42NO2]+
Formula from CH$FORMULA: C27H42NO2

I suggest to check the inner formula only and to ignore the brackets.

Best wishes,
Tobias

@schymane
Copy link
Member

PubChem handle charged formulas differently, without the brackets, just the charge afterwards. I don't recall seeing a charged formula with square brackets before, how are you producing them?

@tsufz
Copy link
Member Author

tsufz commented Aug 14, 2023

RMassBank, well, I'll try with remove brackets and we should add the a handle in RMassBank to remove the brackets.

@meier-rene
Copy link
Contributor

The formulas are created by cdk that way. I think its smart. The syntax for charged molecules in cdk is [Formula]Charge. This is a non ambiguous notation. Just consider a sulfate ion: [SO4]2- compared to SO42-. This means we have a incompatibility between java(CDK) and R. How can we solve that?

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

No branches or pull requests

3 participants