Git Product home page Git Product logo

pubchempy's Introduction

Convert between molecular names and SMILES

Search the smiles by name or search the name by smiles using pubchempy. For more information: http://pubchempy.readthedocs.io

1.Install the Pubchempy

Pubchempy is a python wrapper for the PubChem PUG REST API. The original codes are placed in the directory named "pubchempy" Two simple ways to install the pubchempy:

>>> pip install pubchempy
>>> conda install -c mcs07 pubchempy

2.Search the SMILES by name/CAS

Search the SMILES of Glucose

>>> from pubchempy import get_compounds
>>> results = get_compounds('Glucose', 'name')
>>> print(results)
[Compound(79025), Compound(5793), Compound(64689), Compound(206)]
>>> print(results[0].isomeric_smiles)
>>> C([C@@H]1[C@H]([C@@H]([C@H]([C@H](O1)O)O)O)O)O

Search by CAS

>>> results = get_compounds('81982-32-3', 'name')
>>> results
[Compound(71253)]
>>> print(results[0].isomeric_smiles)
'CNS(=O)(=O)C1=C(C=C(C(=C1)C(=O)NCC2CCCN2CC=C)OC)N'

3.Search the synonyms/iupac_name by SMILES

>>> c = get_compounds('C1=CC2=C(C3=C(C=CC=N3)C=C2)N=C1', 'smiles')
>>> c
[Compound(1318)]
>>> c[0].iupac_name
'1,10-phenanthroline'
>>> c[0].synonyms
['1,10-phenanthroline',
 'o-phenanthroline',
 '66-71-7',...]

3.Search by cid

>>> from pubchempy import Compound
>>> c = Compound.from_cid(5090)
>>> print(c.isomeric_smiles)
CS(=O)(=O)C1=CC=C(C=C1)C2=C(C(=O)OC2)C3=CC=CC=C3

Other ways to convert between molecular names and SMILES

PubChem Identifier Exchange Service:

ID exchange service support by pubchem.

ChemPy:

A package written in Python.

openmolecules:

This page lets you easily convert compound names, IUPAC names, SMILES codes and CAS numbers into chemical structures.

ChemAxon:

Convert name to structure by toolkits of ChemAxon.

chemspipy:

Python wrapper for the ChemSpider API.

pubchempy's People

Contributors

bjodah avatar dreadlesss avatar ekaakurniawan avatar hsiaoyi0504 avatar llazzaro avatar mcs07 avatar rickardsjogren avatar

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.