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

Validate InChI et al. with an online database #23

Open
bryanwweber opened this issue Sep 17, 2016 · 5 comments
Open

Validate InChI et al. with an online database #23

bryanwweber opened this issue Sep 17, 2016 · 5 comments
Milestone

Comments

@bryanwweber
Copy link
Member

See comments on #8

@bryanwweber bryanwweber added this to the v1.0 milestone Sep 17, 2016
@shsymoen
Copy link

shsymoen commented Jul 7, 2017

Maybe the RDKit package (http://www.rdkit.org/docs/GettingStartedInPython.html) can help for InChI and Smiles validation. The package can be installed via anaconda:

conda install -c rdkit rdkit

Something like this should work:

from rdkit import Chem
methane_smiles = Chem.MolFromSmiles('C')
methane_converted_inchi = Chem.MolToInchi(methane_smiles)
methane_converted_inchi == 'InChI=1S/CH4/h1H4'

@bryanwweber
Copy link
Member Author

That's an interesting idea... then we wouldn't need to call out to the internet to do the validation. RDKit is a pretty heavy dependency though, so we should think about which road to go. Thanks!

@bryanwweber
Copy link
Member Author

Another option, if we decide to go with the online lookup, is ChemSpiPy, a Python interface to the ChemSpider API: http://chemspipy.readthedocs.io/en/latest/

@bryanwweber
Copy link
Member Author

From @rwest

For ChemKED folks: extracting chemical formula from InChI is trivial - it is the only sublayer that must exist in every InChI, and is always the first eg. InChI=1/C2H6O/...... For converting from SMILES, I withdraw my offer to write a simple pure python implementation that does this (it looks like a pain, beyond the simplest things), and strongly suggest using existing frameworks. You could quite easily write something that tries a few in sequence to see what the user has installed, and I could help with this if you need - I’m familiar with OpenBabel, RDKit, and cirpy.

https://kincodecon.slack.com/archives/C34N5PML2/p1513028041000049

@bryanwweber
Copy link
Member Author

ECNet seems to have figured out how to get molecules from SMILES: ecrl/ecnet#21

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

No branches or pull requests

2 participants