Skip to content

skearnes/pubchem-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pubchem-utils

Utilities for interacting with PubChem

Note: sometimes one or more of the tests fail but then pass when re-run. Until I can write better tests to capture this behavior, I have taken down the Travis indicator so as not to give a false impression. Please double-check your results when using this code in case of sporadic failures.

Quick Start

from pubchem_utils import PubChem
pc = PubChem()

Download 3D structures for a batch of CIDs:

pc.get_records([2244, 3672], filename='painkillers.sdf.gz', use_3d=True)

Retrieve SIDs active in a PubChem BioAssay experiment:

sids = pc.get_ids_from_assay(466, sids=True, activity_outcome='active')

Download the data table for a PubChem BioAssay experiment:

pc.get_assay_data(466, filename='AID466.csv.gz')

Get the PubChem CID for a compound in ChEMBL:

id_map = pc.id_exchange('CHEMBL25')  # source is inferred from ID string

Search PubChem for the CID matching a SMILES string:

cid = pc.structure_search('CC(=O)OC1=CC=CC=C1C(=O)O')

About

Utilities for interacting with PubChem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages