Code Monkey home page Code Monkey logo

Comments (2)

CalebBell avatar CalebBell commented on June 27, 2024

Hi Peter,
I always recommend strongly against searching by formula because formulas are NOT unique. If you really want to find a chemical by formula, you can do so as follows:

import chemicals
chemicals.identifiers.pubchem_db.search_formula('CO', autoload=True)

You will have to deal with potentially having a different chemical returned in the future though, although I'm not aware of another chemical with that formula in this case.

For example, C12H26 has 347 compounds in thermo.
Sincerely,
Caleb

from chemicals.

PeterKraus avatar PeterKraus commented on June 27, 2024

I completely understand the issues for higher alkanes etc. which have many isomers, and indeed there's no reasonable way of defining a cut-off.

I think it's worth considering whether the current priority of "formula after smiles" is a good one in general, especially given that one can already search by smiles explicitly using the smiles= prefix.

In my particular case (catalysis), nobody is going to call CO by the full name anywhere in their data tables. chemicals does a great job at disambiguating stuff like C3H6, propylene, propene to ensure it's the same molecule (smiles=CCC); however I'd argue that CO and methanol / MeOH should never both evaluate to smiles=CO as it's super unexpected (although technically correct).

Cheers!

from chemicals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.