MassBank / MassBank-web

The web server application and directly connected components for a MassBank web server
13 stars 22 forks source link

Validator: Handle formulas in brackets #391

Open tsufz opened 10 months ago

tsufz commented 10 months ago

@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 commented 10 months ago

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 commented 10 months ago

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

meier-rene commented 10 months ago

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?