npx skills add ...
npx skills add google-deepmind/science-skills --skill pubchem-database
Query PubChem, search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics. Use when a user asks about a specific chemical, drug, or molecule.
npx skills add google-deepmind/science-skills --skill pubchem-database
uv: Read the uv skill and follow its Setup instructions to ensure
uv is installed and on PATH.PubChem queries are executed via a robust Python wrapper script to respect terms-of-service and handle complex JSON parsing. This script allows safe multi-agent use of APIs.
Example: Resolve a chemical name to its Compound ID (CID)
1. Compound Resolution (Name or InChI to Identifiers) Convert chemical/trade names or InChI strings into PubChem CIDs, SMILES, and InChIKeys.
2. Physical & Chemical Property Retrieval Fetch computed properties (e.g., MolecularWeight, XLogP, TPSA).
3. Synonyms and Trade Names Find alternative names and brand names.
4. Safety and Hazard Information (GHS) Retrieve Global Harmonized System hazard statements and handling precautions (uses PUG-View).
5. Drug and Medication Information Fetch FDA pharmacology data, mechanism of action, and therapeutic uses (uses PUG-View).
6. Custom Heading (PUG-View) Retrieve any specific heading from the PUG-View system (e.g., 'Geometry', 'Crystal Structures').
7. Image Generation Retrieve 2D chemical structure images. The script returns a Markdown-formatted image link.
8. Structure-Based Searching (Similarity & Substructure) Find molecules similar to a SMILES string or containing a specific substructure.
and
9. BioAssay & Target Interactions Identify genes or proteins a chemical interacts with.
10. Cross-references (Xrefs) Fetch identifiers cross-referenced with a CID (e.g., PatentID, PubMedID).
11. Property Range Search Find CIDs within a specific property range.
Supported features include: molecular_weight, heavy_atom_count, xlogp,
tpsa, h_bond_donor_count, h_bond_acceptor_count, rotatable_bond_count,
exact_mass, monoisotopic_mass, and complexity.
12. Custom PUG-REST Query Execute a raw path against the PUG-REST API.
If direct resolution by name or formula fails (e.g., for complex compounds or specific ions):
uv run scripts/pubchem_api.py properties --cid 2244 --output result.jsonuv run scripts/pubchem_api.py synonyms --cid 2244 --output result.jsonuv run scripts/pubchem_api.py safety --cid 2244 --output result.jsonuv run scripts/pubchem_api.py pharmacology --cid 2244 --output result.jsonuv run scripts/pubchem_api.py view --cid 3939 --heading "Crystal Structures" --output result.jsonuv run scripts/pubchem_api.py image --cid 2244 --output result.jsonuv run scripts/pubchem_api.py similarity --smiles "CC(=O)OC1=CC=CC=C1C(=O)O" --output result.jsonuv run scripts/pubchem_api.py substructure --smiles "C1=CC=CC=C1" --output result.jsonuv run scripts/pubchem_api.py assays --cid 2244 --output result.jsonuv run scripts/pubchem_api.py xrefs --cid 2244 --type "PatentID" --output result.jsonuv run scripts/pubchem_api.py range --feature molecular_weight --min 400.0 --max 400.05 --output result.jsonuv run scripts/pubchem_api.py query --path "compound/cid/2244/xrefs/PatentID/JSON" --output result.json