Comments (4)
In a virtual environment of Python, amended by cirpy
(version 1.0.2 from pypi), I just run the following conversions with the CAS of the example here; your compound; glucose and fructose as reported by Wikipedia's property boxes. It could be a suitable tool to extend from here:
$ python
Python 3.11.7 (main, Dec 8 2023, 14:22:46) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cirpy
>>>
>>> data = ['108-95-2', '3586-12-7', '50-99-7', '57-48-7']
>>>
>>> for entry in data:
... cirpy.resolve(entry, 'smiles')
...
'Oc1ccccc1'
'Nc1cccc(Oc2ccccc2)c1'
'OCC1OC(O)C(O)C(O)C1O'
'OC[C@@H](O)[C@@H](O)[C@H](O)C(=O)CO'
>>>
from pubchempy.
Tried out CIRpy as recommended by nbehrnd above.
Whilst it was, for the most part, successful I still lack the SMILES of roughly 70 compounds. Is there anything else I can use, preferably with PubChemPy to get these SMILES?
from pubchempy.
Well, it depends a bit on the chemicals behind the CAS number.
-
some chemical suppliers equally provide a SMILES string, buried in the description of properties. This is practice is not consistent among all suppliers, the algorithm to assign a SMILES string can be a different one each time. See e.g., Sigma about one form of glucose:
-
the English edition of Wikipedia describes chemicals with their CAS number (property pox). If you have the chemical name of the structures (or the [sub]structure), you can tap into a set of about 22k chemicals (if I remember correctly); the Wikipedia Chemical Structure explorer can be of help here.
-
around/after Wikipedia and ACS/The American Chemical Society settled an agreement to use the CAS registry numbers in Wikipedia, ACS started a project "common chemistry". The summaries' web addresses follow a pattern like https://commonchemistry.cas.org/detail?cas_rn=50-99-7. Speculation: programmatic consultation and harvest of the SMILES from there could be automated (Python's beautifulsoup, or an other package of your preference). Coverage by the number of CAS entries is considerably larger (once advertised to include approx. 500k records) and still free.
-
chemspider by the Royal Society of Chemistry can be queried e.g., by a pattern like http://www.chemspider.com/Search.aspx?q=50-99-7, or with an API proper (link). As you see for the results on the example of glucose, there may be multiple structures per CAS (well, ...) but from a results page like this, below the icon of the floppy disc is a .mol file which can be processed further (vide infra). The database claims to store 100 million records.
- If you work for a university, or/and have access to a research library with a paid subscription to databases like chemical abstracts/SciFinder scholar (by ACS), or Reaxys (provided by Elsevier), you can perform an individual search by CAS number and request the output of a .mol/.sdf file. An application like RDKit, or openbabel can then convert (batches of) them into one form of SMILES.
from pubchempy.
@MathewGolding , I made something that lookup pubchem cid based on different identifier (CAS, smiles, inchi, inchi_key). Maybe you can draw to your application: https://github.com/khoivan88/pka_lookup/blob/9705117d70e9162fe4c410d5fa884d550f02bad2/src/pka_lookup_pubchem.py#L44
README: https://github.com/khoivan88/pka_lookup/tree/master
from pubchempy.
Related Issues (20)
- pubchempy missing results available on the pubchem web page HOT 2
- Using the search bar
- Errors in the encoding of some bits HOT 1
- Is it possible to calculate the PMI of the compounds?
- Is it possible to get 3D coordinates of ligand using CID or SID? HOT 1
- Is it possible to list the position of each functional group (atom number of key atom) in iupac name?
- obtaining compounds by property
- Timeout
- obtaining CCS values
- Assay.from_aid().to_dict() fails for multiple AIDs
- Minor python syntax problem
- Obtaining hazard classes and categories
- Certain compounds cannot be retrieved by name anymore
- Neither NAMES nor CAS hyphened numbers, verified on PubChem, seem to retrieve many compounds' SMILES
- Get compounds function is too slow HOT 9
- Ask for help about how to find Pubchem CID of many compounds by CAS numbers HOT 3
- Inconsistencies in Isomeric SMILES Data Retrieval Using PubChemPy Compared to Previous Data
- Questions about "Chemical and Physical Properties"
- SSLCertVerificationError while running the simplest of PubChemPy examples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubchempy.