SureChEMBL: chemistry extracted from patents: sample notebook

A worked notebook for SureChEMBL: chemistry extracted from patents, with 4 code cells and the output each one printed. On Scigantic it opens in a hosted JupyterLab with the dataset already mounted, so nothing is downloaded first.

Provider
EMBL-EBI
License
See EMBL-EBI's SureChEMBL terms of use; code wrapper is MIT-0
Access
Free and public. No account with the data provider is needed.

The notebook

SureChEMBL: chemistry extracted from patents

EMBL-EBI automatically extracts chemical structures from the full text of patent documents: roughly 31 million distinct compounds found across about 45 million patents. There's no mount for this archive -- every call below is a live lookup against EBI's own servers (or, for similarity search, a local index downloaded once).

Resolve a compound and find the patents that disclose it

import scigantic_surechembl as sc

compound = sc.by_smiles("CC(=O)Oc1ccccc1C(=O)O")   # aspirin
print(compound)
# Aspirin alone shows up in 694,428 patent documents.
patents = sc.patents_for_compound(compound.id, max_results=10)
for p in patents:
    print(p.doc_id, p.title, p.publication_date, p.assignee)

Narrow to patents mentioning BOTH of two compounds

Passing more than one id intersects: only documents whose extracted chemistry contains all of them.

caffeine = sc.by_smiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")
both = sc.patents_for_compound([compound.id, caffeine.id], max_results=10)
print(f"{len(both)} patents mention both aspirin and caffeine")

Local similarity search

The first call on a fresh notebook downloads a ~1.4GB fingerprint file covering all 31M compounds (can take a minute); later calls in the same session are fast.

from scigantic_surechembl.fingerprints import FingerprintIndex

index = FingerprintIndex()
hits = index.top_k("CC(=O)Oc1ccccc1C(=O)O", k=10)
hits

Ask Scigantic AI

Open the panel (top right) and try:

> *"Find compounds similar to ibuprofen in SureChEMBL, then tell me which of the top hits show up in the most patents."*

Run it

Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.