Queries the ZINC database of 230M+ purchasable compounds via the CartBlanche22 API. Searches by ZINC ID or SMILES, performs similarity searches, and downloads 3D-ready structures for virtual screening and drug discovery.
ZINC is a freely accessible repository of 230M+ purchasable compounds maintained by UCSF. Search by ZINC ID or SMILES, perform similarity searches, download 3D-ready structures for docking, discover analogs for virtual screening and drug discovery.
scripts/query_zinc.py — query the ZINC22 CartBlanche API via form-encoded POST (stdlib only, JSON to stdout):
python scripts/query_zinc.py id ZINC000019632618 --wait # ZINC-ID lookup, rows as JSON
python scripts/query_zinc.py random --count 100 --subset lead-like # returns a task id
python scripts/query_zinc.py result <task-id> # fetch that task's rows later
Every CartBlanche search is asynchronous. Each call returns a JSON task handle
({"task": "<uuid>"}). Poll GET https://cartblanche22.docking.org/search/result/<task>:
it returns {"status": "PENDING", "progress": ...} while the job runs and
{"status": "SUCCESS", "result": {...}} when done, with rows grouped by source
(zinc22, zinc20) and unmatched queries under missing / zinc22_missing
(--wait does the polling). ID lookups finish in seconds; random samples can stay
PENDING for minutes.
Known issue (verified 2026-09-23): smiles.txt jobs finish immediately with
"zinc22_missing": [""] — the server does not receive the query, whether the SMILES
is sent inline, as a form upload, or as a file. Until that is fixed, run similarity
searches in the CartBlanche22 web UI or in SmallWorld (https://sw.docking.org, which
indexes ZINC20/ZINC22 builds) or Arthor (https://arthor.docking.org), and say so
rather than reporting "no analogs found".
This skill should be used when:
| Scenario | Use Instead |
|---|---|
| Compound properties, synonyms, and bioassays for a known molecule | alterlab-pubchem |
| Measured potency (IC50/Ki) for a target | alterlab-chembl |
| Docking ligands into a protein pocket | alterlab-diffdock |
| Computing descriptors, filters, or fingerprints locally | alterlab-rdkit |
| Medicinal-chemistry filters (PAINS, rules of thumb) on a library | alterlab-medchem |
| Experimental protein or protein–ligand structures (PDB coordinates, resolution, binding-site setup) | alterlab-pdb |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-pubchem) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
ZINC has evolved through multiple versions:
This skill primarily focuses on ZINC22, the most current and comprehensive version.
Primary access point: https://cartblanche22.docking.org/ (zinc22.docking.org redirects here) Legacy ZINC20/ZINC15 pages (zinc.docking.org, zinc20.docking.org, zinc15.docking.org) now answer scripted requests with a captcha redirect — use them interactively only.
All ZINC22 searches can be performed programmatically via the CartBlanche22 API:
Base URL: https://cartblanche22.docking.org/
Searches are submitted as form-encoded POST requests (the scripts/query_zinc.py
helper does this) or as curl -F form-field uploads. Endpoints accept either an inline
value or an @file upload, and every search returns a JSON task handle
({"task": "<uuid>"}) — results are then rendered in the web UI. Pass the desired
columns via the output_fields form field.
The older "colon URL" form (
/substances.txt:zinc_id=...) does not work against the current CartBlanche22 service; use form fields as shown below.
Retrieve specific compounds using their ZINC identifiers.
Web interface: https://cartblanche22.docking.org/search/zincid
API endpoint (form field is zinc_ids, plural — the singular zinc_id returns HTTP 400):
# Inline list of IDs
curl -X GET "https://cartblanche22.docking.org/substances.txt" \
-F zinc_ids="ZINC000019632618,ZINC000000000001" \
-F output_fields="zinc_id,smiles,catalogs"
# Or upload a file of IDs (one per line)
curl -X GET "https://cartblanche22.docking.org/substances.txt" \
-F zinc_ids=@zinc_ids.txt \
-F output_fields="zinc_id,smiles,tranche"
Both return a task handle; open the printed UI task URL to view rows.
Response fields: zinc_id, smiles, sub_id, supplier_code, catalogs, tranche (heavy-atom count and logP bin; see Tranche System)
Find compounds by chemical structure using SMILES notation, with optional distance parameters for analog searching.
Web interface: https://cartblanche22.docking.org/search/smiles
API endpoint:
curl -X GET "https://cartblanche22.docking.org/smiles.txt" \
-F smiles="c1ccccc1" -F dist=3 -F adist=3 \
-F output_fields="zinc_id,smiles,tranche"
Parameters (each passed as a -F form field):
smiles: Query SMILES string (inline, or @file for a batch of queries)dist: Tanimoto distance threshold (default: 0 for exact match)adist: Anonymous (graph-topology) distance for broader searches (default: 0)output_fields: Comma-separated list of desired output fieldsExample - Exact match (dist/adist default to 0):
curl -X GET "https://cartblanche22.docking.org/smiles.txt" -F smiles="c1ccccc1"
Query compounds from specific chemical suppliers or retrieve all molecules from particular catalogs.
Web interface: https://cartblanche22.docking.org/search/catitems
API endpoint (form field is supplier_codes):
curl -X GET "https://cartblanche22.docking.org/catitems.txt" \
-F supplier_codes="SUPPLIER-CODE-123" \
-F output_fields="zinc_id,smiles,supplier_code,catalogs"
Use cases:
Generate random compound sets for screening or benchmarking purposes.
Web interface: https://cartblanche22.docking.org/search/random
API endpoint:
curl "https://cartblanche22.docking.org/substance/random.txt" -F count=100
Parameters (each passed as a -F form field):
count: Number of random compounds to retrieve (default: 100)subset: Filter by subset (e.g., 'lead-like', 'drug-like', 'fragment')output_fields: Customize returned data fieldsExample - Random lead-like molecules:
curl "https://cartblanche22.docking.org/substance/random.txt" \
-F count=1000 -F subset="lead-like" -F output_fields="zinc_id,smiles,tranche"
Define search criteria based on target properties or desired chemical space
Submit the search with the appropriate method:
# Example: random drug-like compounds; returns a task handle for the web UI
python scripts/query_zinc.py random --count 10000 --subset drug-like \
--fields zinc_id,smiles,tranche
Retrieve and parse rows (python scripts/query_zinc.py result <task>, export
from the UI task view, or pull tranche files from the bulk repository) into a
DataFrame and filter on tranche properties:
import pandas as pd
df = pd.read_csv('docking_library.tsv', sep='\t')
# Tranche code, e.g. H17P050: H = heavy-atom count, P/M = logP bin
# (P positive, M negative, x100). See "Tranche System" below.
Download 3D structures for docking from the file repository (see below)
Obtain SMILES of the hit compound:
hit_smiles = "CC(C)Cc1ccc(cc1)C(C)C(=O)O" # Example: Ibuprofen
Perform similarity search with a distance threshold — while the smiles.txt
API issue above persists, do this in the CartBlanche22 UI or SmallWorld
(https://sw.docking.org) and export the hits; once fixed, the script form is:
python scripts/query_zinc.py smiles "CC(C)Cc1ccc(cc1)C(C)C(=O)O" \
--dist 5 --fields zinc_id,smiles,catalogs --wait
Analyze results to identify purchasable analogs (after exporting the task rows):
import pandas as pd
analogs = pd.read_csv('analogs.tsv', sep='\t')
print(f"Found {len(analogs)} analogs")
print(analogs[['zinc_id', 'smiles', 'catalogs']].head(10))
Retrieve 3D structures for the most promising analogs
Compile list of ZINC IDs from literature, databases, or previous screens:
zinc_ids = [
"ZINC000000000001",
"ZINC000000000002",
"ZINC000000000003"
]
zinc_ids_str = ",".join(zinc_ids)
Query ZINC22 API (one batch request, zinc_ids plural):
curl -X GET "https://cartblanche22.docking.org/substances.txt" \
-F zinc_ids="ZINC000000000001,ZINC000000000002" \
-F output_fields="zinc_id,smiles,supplier_code,catalogs"
Process results for downstream analysis or purchasing
Select subset parameters based on screening goals:
Generate random sample:
python scripts/query_zinc.py random --count 5000 --subset lead-like \
--fields zinc_id,smiles,tranche
Analyze chemical diversity and prepare for virtual screening
Customize API responses with the output_fields parameter:
Available fields:
zinc_id: ZINC identifiersmiles: SMILES string representationsub_id: Internal substance IDsupplier_code: Vendor catalog numbercatalogs: List of suppliers offering the compoundtranche: The tranche the compound sits in (heavy-atom count × logP bin)Example:
curl -X GET "https://cartblanche22.docking.org/substances.txt" \
-F zinc_ids="ZINC000000000001" \
-F output_fields="zinc_id,smiles,catalogs,tranche"
ZINC-22 bins molecules on two axes, heavy-atom count and calculated logP, both computed with RDKit (Tingle et al. 2023, J. Chem. Inf. Model. 63:1166, "Database Subset Selection Using the Tranche Browser"). A tranche name joins the two bin codes:
| Part | Meaning | Example |
|---|---|---|
H## | heavy-atom count | H17 = 17 heavy atoms |
P### / M### | logP bin: P = positive, M = negative (minus), value × 100 | P050 = logP 0.50 bin; M100 = logP −1.00 bin |
So H17P050 is "17 heavy atoms, logP bin 0.50". H is not H-bond donors and M is
not molecular weight. The ZINC-22 2D fragment subset, for example, spans H08–H16 ×
M500–P240. ZINC15/20 used different, letter-coded tranches; do not decode those this way.
A ZINC-22 ID also carries its tranche: IDs are 16 characters, ZINC + two tranche
characters + two source characters (00 for the commercial catalogs) + an 8-character
radix-62 serial (Tingle et al. 2023). Legacy IDs such as ZINC000019632618 do not, so look
them up first. For MW, H-bond donors/acceptors or TPSA, compute them from the SMILES
(alterlab-rdkit) instead of reading them off the tranche.
ZINC-22's 3D builds are served from https://files.docking.org/zinc22/ (and through Globus and the AWS / Oracle OCI open-data buckets), organised by tranche, in four ready-to-dock formats: DB2, MOL2, SDF and PDBQT (Tingle et al. 2023).
aria2c -i urls.txt -x 8 -j 4, or xargs -n1 -P8 wget -q < urls.txt).query_zinc.py id ...) and download
their 3D files from the CartBlanche22 results/cart view instead of whole tranches.| Format | Docking program | Notes |
|---|---|---|
| DB2 | UCSF DOCK 3.7/3.8 | Multi-conformer, protonated, charged. DOCK 6 does not read it and Open Babel has no DB2 reader, so it cannot be converted |
| MOL2 / SDF | DOCK 6, Glide, GOLD, RDKit-based tools | 3D coordinates as built by ZINC |
| PDBQT | AutoDock Vina / AutoDock-GPU | Ready for Vina |
Check protonation and stereochemistry before docking: ZINC builds them but does not guarantee them. Batch-access details: https://wiki.docking.org (the ZINC22 pages).
Use the bundled scripts/query_zinc.py (stdlib only) rather than hand-rolling URLs —
it sends the correct form-encoded POST and returns the JSON task handle:
import json, subprocess
def submit(*args):
"""Run query_zinc.py and return the parsed JSON (task handle or rows)."""
out = subprocess.run(
["python", "scripts/query_zinc.py", *args],
capture_output=True, text=True, check=True,
).stdout
return json.loads(out)
state = submit("id", "ZINC000019632618", "--fields", "zinc_id,smiles,catalogs", "--wait")
rows = state["result"].get("zinc22") or state["result"].get("zinc20") or []
Once you have result rows (a tranche column, exported from the UI or read from the
file repository), decode the heavy-atom and logP bins:
import re
def parse_tranche(code):
"""'H17P050' -> {'heavy_atoms': 17, 'logp_bin': 0.5}; 'H12M100' -> logp_bin -1.0."""
m = re.search(r"H(\d{2})([PM])(\d{3})", code or "")
if not m:
return None
sign = 1 if m.group(2) == "P" else -1
return {"heavy_atoms": int(m.group(1)), "logp_bin": sign * int(m.group(3)) / 100.0}
# df["tranche_props"] = df["tranche"].apply(parse_tranche)
Comprehensive documentation including:
Consult this document for detailed technical information and advanced usage patterns.
ZINC explicitly states: "We do not guarantee the quality of any molecule for any purpose and take no responsibility for errors arising from the use of this database."
When using ZINC in publications, cite the appropriate version:
ZINC22: Tingle, B. I.; Tang, K. G.; Castanon, M.; Gutierrez, J. J.; Khurelbaatar, M.; Dandarchuluun, C.; Moroz, Y. S.; Irwin, J. J. "ZINC-22─A Free Multi-Billion-Scale Database of Tangible Compounds for Ligand Discovery." Journal of Chemical Information and Modeling 2023, 63(4), 1166–1176. DOI: 10.1021/acs.jcim.2c01253.
ZINC20: Irwin, J. J.; Tang, K. G.; Young, J.; et al. "ZINC20—A Free Ultralarge-Scale Chemical Database for Ligand Discovery." Journal of Chemical Information and Modeling 2020, 60(12), 6065–6073. DOI: 10.1021/acs.jcim.0c00675.
ZINC15: Sterling, T.; Irwin, J. J. "ZINC 15 – Ligand Discovery for Everyone." Journal of Chemical Information and Modeling 2015, 55, 2324–2337. DOI: 10.1021/acs.jcim.5b00559.
What SKILL.md sets; muted values are Claude Code's defaults
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job