Live data from Hacker News

Parsing Chemistry

re.factorcode.org

1–10 of 30 posts

Re: Parsing Chemistry

#3
Note: There are two standardized formats for this called SMILES and SELFIES. SMILES is much better supported, but SELFIES is more robust. I'm integrating them into some bio and chem software I'm working on.

You can do things like look up, using PubChem's API, similar molecules etc to a SMILES string.

I believe most molecule editors can load and save SMILES.

Re: Parsing Chemistry

#4

Note: There are two standardized formats for this called SMILES and SELFIES. SMILES is much better supported, but SELFIES is more robust. I'm integrating them into some bio and chem software I'm working on. You can do things like look up, using PubChem's API, similar molecules etc to a SMILES string. I believe most molecule editors can load and save SMILES.

What about inchi? Isn’t that a common way of describing molecules as well?

Re: Parsing Chemistry

#5

Note: There are two standardized formats for this called SMILES and SELFIES. SMILES is much better supported, but SELFIES is more robust. I'm integrating them into some bio and chem software I'm working on. You can do things like look up, using PubChem's API, similar molecules etc to a SMILES string. I believe most molecule editors can load and save SMILES.

What about inchi? Isn’t that a common way of describing molecules as well?

Good point!

Re: Parsing Chemistry

#6
Does this do structural formulae too?

Was thinking of InChI[0] but on Googling SMILES and SELFIES I found this[1] talk, this[2] paper and my goodness I've been down a few rabbit holes since...

[0] https://en.wikipedia.org/wiki/International_Chemical_Identif... [1] https://www.inchi-trust.org/wp/wp-content/uploads/2019/12/18... [2] https://pubs.rsc.org/en/content/articlehtml/2022/dd/d1dd0001...

Re: Parsing Chemistry

#8
post #6

Does this do structural formulae too? Was thinking of InChI[0] but on Googling SMILES and SELFIES I found this[1] talk, this[2] paper and my goodness I've been down a few rabbit holes since... [0] https://en.wikipedia.org/wiki/International_Chemical_Identif... [1] https://www.inchi-trust.org/wp/wp-content/uploads/2019/12/18... [2] https://pubs.rsc.org/en/content/articlehtml/2022/dd/d1dd0001...

No, in Python you can use rdkit (https://github.com/rdkit/rdkit) for that

Re: Parsing Chemistry

#9

Note: There are two standardized formats for this called SMILES and SELFIES. SMILES is much better supported, but SELFIES is more robust. I'm integrating them into some bio and chem software I'm working on. You can do things like look up, using PubChem's API, similar molecules etc to a SMILES string. I believe most molecule editors can load and save SMILES.

SMILES and SELFIES are molecular graph representations and aren't meant to solve the "parse this sum formula" problem.

SELFIES are for genAI. If you ask a VAE to generate SMILES, it will spit out some strings that are invalid - can't happen with SELFIES, that is the one application where they are robust.

Re: Parsing Chemistry

#10
Does this handle, e.g., water of hydration CaSO4 . 2H2O? states of matter H2O(g)? does it preserve subunit information, as in (C6H5)CH2COOH? Writing a parser for basic formulae is such a tiny tiny part of the actual problem... deciding the scope of what you want to handle and how is the real problem
Post reply on HN