Skip to content

SigmanGroup/QueryPubChemVendors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QueryPubChemVendors

Reaxys → PubChem enrichment (CID, SMILES, vendor availability)

This repository contains a Jupyter notebook workflow that takes a Reaxys search results CSV, cleans/deduplicates InChI Keys, and enriches each unique compound using PubChem with:

  • CID (PubChem compound identifier)
  • SMILES (single SMILES field)
  • Vendor availability (PubChem “Chemical Vendors” source category)

The notebook is written to be practical on larger datasets by deduplicating keys up front, using retries/backoff for PubChem requests, and caching results so reruns are much faster.


Files in this repo

Typical layout (adjust to match your repo):

  • notebooks/query_pubchem.ipynb — main workflow
  • README.md
  • environment.yml — dependencies
  • .gitignore — ignore cache files / large inputs

Input: Reaxys CSV requirements

Your Reaxys export CSV must contain these columns (exact names):

  • Reaxys Registry Number
  • CAS Registry Number
  • Chemical Name
  • InChI Key

The workflow will:

  • strip whitespace from InChI Key
  • drop empty / missing keys
  • (optionally) create a row-deduplicated table with one row per unique key

Output

The final table contains the original Reaxys columns plus:

  • CID
  • SMILES
  • VendorCount — number of unique PubChem vendor source names
  • Vendors — semicolon-separated preview of vendor names (first N; configurable)

Quickstart

1) Clone this repo

git clone https://github.com/saramccormack/QueryPubChemVendors.git
cd QueryPubChemVendors

2) Create an environment

Using conda (recommended)
conda env create -f environment.yml
conda activate <env-name>

3) Launch Jupyter and run the notebook

jupyter lab

Open notebooks/query_pubchem.ipynb and run cells top-to-bottom.

Performance notes (important for big datasets)

This workflow is network-bound (PubChem API calls). It is faster and more reliable when you:

Deduplicate InChI Keys before querying (major speedup if the CSV has repeats)

Use retry/backoff to handle transient connection drops or rate limiting

Use caching so reruns don’t re-query keys that already succeeded

If you run in parallel (threaded), typical tuning knobs are:

MAX_WORKERS: reduce if you see disconnects; increase cautiously if stable

request throttling/sleep: increase if you see many retries

How vendor availability is determined

Vendor information is pulled from PubChem PUG-View categories for each CID and filtered to the category:

Category == "Chemical Vendors"

Vendor “labels” are taken from SourceName entries in that category.

Note: PubChem vendor listings can change over time and the ordering is not guaranteed. This workflow reports a count and an optional preview list for convenience.

License

MIT License © 2026 Sara McCormack. See the LICENSE file for details.

About

Acquires vendor information and SMILES from PubChem by matching InChI Key

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors