Sundar,
What you do will depend on whether you have an SID or a CID number.  Read
https://pubchemblog.ncbi.nlm.nih.gov/2014/06/19/what-is-the-difference-between-a-substance-and-a-compound-in-pubchem/
for more info.

In PubChem terminology, a *substance* is a chemical sample description
> provided by a single source and a *compound* is a normalized chemical
> structure representation found in one or more contributed *substances*.


And looking at the pages for a few random substances, it doesn't list the
same kind of information that you'll find on a compound page.  So what you
need is to get a list of associated compounds for a given substance ID.

https://pubchem.ncbi.nlm.nih.gov/rest/pug/substance/sid/123061/cids/JSON?cids_type=all

Leave off the cids_type=all if you only want one compound.  For the SID in
your query, it doesn't even have a compound, so it returns a message
stating so.

Jason

Jason Biggs


On Fri, Dec 1, 2017 at 5:33 PM, Sundar <jubilantsun...@gmail.com> wrote:

> Hi Jason,
>
> This is great. I would really benefit from this.
> At present I am looking for a way to download smiles or mol data of a few
> compound which only have SIDs and CIDs.
> Can we do it? I failed after trying the following,
>
> https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/sid/144205334/property/
> CanonicalSMILES,IsomericSMILES,InChI/JSON
>
> Thanks,
>
>
> On Fri, Dec 1, 2017 at 1:11 PM, Jason Biggs <jasondbi...@gmail.com> wrote:
>
>> Pubchem has an easy to use rest API, described here:
>> https://pubchemdocs.ncbi.nlm.nih.gov/pug-rest
>>
>> If you have a compound ID, you can query properties via something
>>
>> https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/
>> property/CanonicalSMILES,IsomericSMILES,InChI/JSON
>>
>>
>> It comes back in JSON format, but you can have it return XML or plain
>> text.
>>
>> If you want an SDF file, something like
>>
>> https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/2244/
>> SDF?record_type=3d
>>
>> setting up a python function to query this shouldn't be difficult.
>>
>> Jason Biggs
>>
>>
>> On Fri, Dec 1, 2017 at 12:51 PM, Sundar <jubilantsun...@gmail.com> wrote:
>>
>>> I would like to download at least SMILES (great if I can also download
>>> mol files).
>>> And the same is true for Pubchem Compound ID or using Substance ID.
>>> Or even download the whole data set using an assay id. Anything could
>>> help.
>>>
>>> Thanks,
>>> Jubi
>>>
>>> On Fri, Dec 1, 2017 at 11:55 AM, Tim Dudgeon <tdudgeon...@gmail.com>
>>> wrote:
>>>
>>>> In what way? Given a single PubChem compound or substance ID you just
>>>> want to pull the smiles or molfile into RDKit?
>>>>
>>>> Tim
>>>> On 01/12/17 17:26, Sundar wrote:
>>>>
>>>> Hi RDkit users,
>>>>
>>>> I was wondering if RDkit has a means of downloading compounds from
>>>> Pubchem.
>>>> Also let me other ways that helps here.
>>>>
>>>> Thanks,
>>>> Jubi
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Rdkit-discuss mailing 
>>>> listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Rdkit-discuss mailing list
>>>> Rdkit-discuss@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>>
>>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Rdkit-discuss mailing list
>>> Rdkit-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to