Example 8.3 — Patent landscape in BindingDB¶

A reproducible record of an AI-assisted BindingDB analysis: each prompt, the BindingDB tool calls that answered it with their recorded results, the answer, and its figures. Run all cells to show the recorded results, or rerun every call on your own copy of the database and check each result against the recorded one.

  • Date: 2026-11-23
  • Model: claude-opus-5-5
  • Data: BindingDB release 202611 (BDB-mySQL_All_202611_dmp.zip, SHA-256 daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381)
  • Database build: 2026-11-21T01:08:15+00:00, DuckDB 1.5.6
  • Derived data: standard InChIKeys computed from SMILES by RDKit 2026.03.6; compound_property computed from SMILES (largest fragment) by RDKit 2026.03.6
  • Server: mcp-bindingdb v0.1.17, commit 79dae5d22c0f
  • Software: python 3.12.7, duckdb 1.5.6, rdkit 2026.03.6, mcp 2.3.0, gemmi 0.7.5
  • Notebook generated: 2026-11-24T04:56:27Z
  • Contents: 1 exchange · 16 tool calls · 4 figures · 1 code cell

How to run¶

Keep the notebook in its folder, which holds everything it needs: requirements.txt (mcp-bindingdb at its commit and the versions of the packages it needs), the recorded results in data/, the figures in figures/ and the analysis code the notebook imports (plot_patent_landscape.py). With uv, from that folder (replace the path with yours):

cd /path/to/8.3-patent-landscape-notebook
uv run --no-project --with-requirements requirements.txt --with jupyterlab jupyter lab 8.3-patent-landscape-notebook.ipynb

then choose Run → Run All Cells. The first start installs the packages, which takes a minute or two; the cells show the recorded results, so no database is needed. Without uv: pip install -r requirements.txt jupyterlab, then jupyter lab 8.3-patent-landscape-notebook.ipynb in the folder.

How to rerun the calls¶

To rerun every BindingDB call on your own copy of release 202611 and check each result against the recorded one, set RERUN = True in the setup cell and run all cells, or rerun the notebook without opening Jupyter, writing a copy with the new results:

cd /path/to/8.3-patent-landscape-notebook
BINDINGDB_RERUN=1 uv run --no-project --with-requirements requirements.txt --with nbconvert jupyter nbconvert --to notebook --execute --output 8.3-patent-landscape-notebook-rerun.ipynb 8.3-patent-landscape-notebook.ipynb

A rerun needs the database: the one BINDINGDB_DUCKDB=/path/to/bindingdb_202611.duckdb names (put it before uv run), else the newest one mcp-bindingdb built on this computer, for example for Claude Desktop. With neither, the first rerun builds one, which takes about half an hour and 2.4 GB. To build exactly release 202611, with a clone of mcp-bindingdb:

git clone https://github.com/sbl-sdsc/mcp-bindingdb.git
cd mcp-bindingdb
git checkout 79dae5d22c0f15b8ded9b49adc8b105f0463703a
scripts/build_duckdb.sh --release 202611

The setup cell checks the database's release and source checksum against the recorded ones.

Run as it is, each call cell shows its recorded result, read from data/ and checked against the SHA-256 digest recorded in the cell. Rerun, it shows the new result with ✅ when it matches the recorded one (floats to 10 significant digits, ids of viewers and files left out). Calls to PubChem, RCSB or PDBe depend on those services and may differ. The prose answers are the model's and are not recomputed. Code cells hold the analysis code the model wrote; they run as written (reading the results with replay.result(n), the result of Call n) and draw their figures again, which are not compared.

In [ ]:
# Shows the results recorded during the session (data/), so the notebook runs without a database. Set
# RERUN = True (or start Jupyter with BINDINGDB_RERUN=1) to rerun every BindingDB call on a local copy of
# the database instead and check it against its recorded result: see 'How to rerun the calls' above.
from mcp_bindingdb.notebook import Replay

RERUN = False
replay = Replay(release='202611', source_zip_sha256='daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381', rerun=RERUN)
Recorded with BindingDB release 202611, mcp-bindingdb v0.1.17 (commit 79dae5d22c0f)
python 3.12.7, duckdb 1.5.6, rdkit 2026.03.6, mcp 2.3.0, gemmi 0.7.5

Exchange 1¶

👤 User

Analyze the patent landscape in BindingDB.

In [ ]:
Call 1 · run_sql · ran 2026-11-24 04:56:26 UTC (17 lines)
# Call 1 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Patent documents by kind (a record is a patent when source_id starts with US or WO)
    WITH docs AS (
      SELECT DISTINCT source_id FROM activity
      WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%')
    SELECT CASE WHEN source_id LIKE 'WO%' THEN 'WO/PCT application'
                WHEN regexp_matches(source_id, '-B[12]$') THEN 'US granted (B1/B2)'
                WHEN regexp_matches(source_id, '-A1$') THEN 'US application (A1)'
                WHEN regexp_matches(source_id, '-E1?$') THEN 'US reissue (E)'
                ELSE 'other: ' || regexp_extract(source_id, '-([A-Z0-9]+)$', 1) END AS kind,
           count(*) AS patents
    FROM docs GROUP BY kind ORDER BY patents DESC
    
"""
await replay.call(1, 'run_sql', {'sql': sql},
                  sha256='068b6d0e7daa10fd7fe3abd964dc312858cef8a1796596d9d02b7f0fddb2e8be')

Call 1 · run_sql · recorded result · sha256 068b6d0e7daa…

6 rows

kind patents
US granted (B1/B2) 7262
US application (A1) 1631
WO/PCT application 78
US reissue (E) 24
other: A9 8
other: A2 1
In [ ]:
Call 2 · run_sql · ran 2026-11-24 04:56:26 UTC (22 lines)
# Call 2 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Scale of patent data, and how many patent compounds also appear in a non-patent source
    WITH a AS (
      SELECT monomerid, coalesce(polymerid::VARCHAR, 'c' || complexid) AS tgt,
             (source_id LIKE 'US%' OR source_id LIKE 'WO%') AS is_patent
      FROM activity),
    cpd AS (
      SELECT monomerid, bool_or(is_patent) AS in_patent, bool_or(NOT is_patent) AS in_other
      FROM a GROUP BY monomerid)
    SELECT
      (SELECT count(*) FROM a) AS all_measurements,
      (SELECT count(*) FROM a WHERE is_patent) AS patent_measurements,
      (SELECT count(*) FROM cpd) AS all_compounds,
      (SELECT count(*) FROM cpd WHERE in_patent) AS patent_compounds,
      (SELECT count(*) FROM cpd WHERE in_patent AND in_other) AS patent_compounds_also_elsewhere,
      (SELECT count(DISTINCT tgt) FROM a) AS all_targets,
      (SELECT count(DISTINCT tgt) FROM a WHERE is_patent) AS patent_targets
    
"""
await replay.call(2, 'run_sql', {'sql': sql},
                  sha256='296a0b402ef6b2260586729f81e08226f922e4593398dfdfe2007edd84edd83f')

Call 2 · run_sql · recorded result · sha256 296a0b402ef6…

1 row

all_measurements patent_measurements all_compounds patent_compounds patent_compounds_also_elsewhere all_targets patent_targets
3246372 1358065 1446839 699143 25192 12002 3224
In [ ]:
Call 3 · run_sql · ran 2026-11-24 04:56:26 UTC (14 lines)
# Call 3 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Source documents and distinct compounds per year, patents vs journal articles & other sources
    SELECT year,
           CASE WHEN source_id LIKE 'US%' OR source_id LIKE 'WO%' THEN 'patent' ELSE 'other' END AS source,
           count(DISTINCT source_id) AS documents,
           count(DISTINCT monomerid) AS compounds
    FROM activity
    WHERE year BETWEEN 2005 AND 2026
    GROUP BY ALL ORDER BY year, source
    
"""
await replay.call(3, 'run_sql', {'sql': sql},
                  sha256='f048cca71ead82848d28ef008ebffa603652520d8d9ef26979115125d7f2f217')

Call 3 · run_sql · recorded result · sha256 f048cca71ead…

38 rows

year source documents compounds
2005 other 1212 22666
2005 patent 1 61
2006 other 1280 23525
2006 patent 1 12
2007 other 1624 34152
2008 other 1948 45193
2009 other 1964 44496
2010 other 2299 51782
2011 other 2015 43623
2012 other 2088 44049
2012 patent 1 267
2013 other 1976 35941
2013 patent 234 13196
2014 other 1854 32371
2014 patent 395 28114
2015 other 1726 29379
2015 patent 665 47590
2016 other 1906 32962
2016 patent 662 51794
2017 other 1874 31685
2017 patent 796 82288
2018 other 1741 30198
2018 patent 603 57722
2019 other 1727 30402
2019 patent 773 83726
2020 other 1807 32676
2020 patent 719 74146
2021 other 1796 36145
2021 patent 729 74073
2022 other 1603 30209
2022 patent 643 67233
2023 other 1283 24404
2023 patent 679 68160
2024 other 165 2279
2024 patent 855 70616
2025 other 0 1
2025 patent 939 91482
2026 patent 309 31471
In [ ]:
Call 4 · run_sql · ran 2026-11-24 04:56:26 UTC (19 lines)
# Call 4 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Compounds and targets per patent
    WITH p AS (
      SELECT source_id, count(DISTINCT monomerid) AS compounds,
             count(DISTINCT coalesce(polymerid::VARCHAR, 'c' || complexid)) AS targets
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id)
    SELECT count(*) AS patents,
           median(compounds) AS median_compounds,
           quantile_disc(compounds, 0.9) AS p90_compounds,
           max(compounds) AS max_compounds,
           arg_max(source_id, compounds) AS largest_patent,
           round(100.0 * count(*) FILTER (WHERE targets = 1) / count(*), 1) AS pct_single_target
    FROM p
    
"""
await replay.call(4, 'run_sql', {'sql': sql},
                  sha256='d772e007c5f42d7439e09102254908484154224e14f639935cf88cb711077c96')

Call 4 · run_sql · recorded result · sha256 d772e007c5f4…

1 row

patents median_compounds p90_compounds max_compounds largest_patent pct_single_target
9004 42 247 2689 US12581252-B2 60
In [ ]:
Call 5 · run_sql · ran 2026-11-24 04:56:26 UTC (22 lines)
# Call 5 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Most-patented targets: as each patent's lead target, and counting every target measured
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    SELECT 'lead' AS ranking, min_by(target, (length(target), target)) AS target, tkey, count(*) AS patents
    FROM lead GROUP BY tkey QUALIFY row_number() OVER (ORDER BY patents DESC, tkey) <= 15
    UNION ALL
    SELECT 'any target', min_by(target, (length(target), target)), tkey, count(*) AS patents
    FROM pt GROUP BY tkey QUALIFY row_number() OVER (ORDER BY patents DESC, tkey) <= 15
    ORDER BY ranking DESC, patents DESC, tkey
    
"""
await replay.call(5, 'run_sql', {'sql': sql},
                  sha256='0d863103a6f8f55d85ff2b207a42f36561c9ad4a3128d4434b4585c9d7a9c71b')

Call 5 · run_sql · recorded result · sha256 0d863103a6f8…

30 rows

ranking target tkey patents
lead Tyrosine-protein kinase BTK Q06187 178
lead Tyrosine-protein kinase JAK2 O60674 163
lead Epidermal growth factor receptor P00533 104
lead Beta-secretase 1 P56817 103
lead Bromodomain-containing protein 4 O60885 96
lead Phosphatidylinositol 4,5-bisphosphate 3-kinase catalytic subunit delta isoform O00329 91
lead Lysine-specific histone demethylase 1A O60341 86
lead Nuclear receptor ROR-gamma P51449 82
lead Interleukin-1 receptor-associated kinase 4 Q9NWZ3 80
lead Sodium channel protein type 9 subunit alpha Q15858 74
lead Fibroblast growth factor receptor 1 P11362 68
lead Tyrosine-protein kinase JAK1 P23458 68
lead High affinity nerve growth factor receptor P04629 65
lead cAMP and cAMP-inhibited cGMP 3',5'-cyclic phosphodiesterase 10A Q9Y233 65
lead Mitogen-activated protein kinase kinase kinase kinase 1 Q92918 64
any target Tyrosine-protein kinase JAK2 O60674 246
any target Tyrosine-protein kinase JAK1 P23458 234
any target Tyrosine-protein kinase BTK Q06187 226
any target Tyrosine-protein kinase JAK3 P52333 195
any target Epidermal growth factor receptor P00533 156
any target Non-receptor tyrosine-protein kinase TYK2 P29597 152
any target Phosphatidylinositol 4,5-bisphosphate 3-kinase catalytic subunit delta isoform O00329 125
any target Vascular endothelial growth factor receptor 2 P35968 125
any target Beta-secretase 1 P56817 122
any target Potassium voltage-gated channel subfamily H member 2 Q12809 119
any target Bromodomain-containing protein 4 O60885 108
any target Cytochrome P450 3A4 P08684 108
any target Cytochrome P450 2D6 P10635 94
any target Histone deacetylase 1 Q13547 94
any target Interleukin-1 receptor-associated kinase 4 Q9NWZ3 94
In [ ]:
Call 6 · run_sql · ran 2026-11-24 04:56:26 UTC (18 lines)
# Call 6 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- How often is the lead target a tie (two or more targets with the same, highest compound count)?
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    ties AS (SELECT source_id, count(*) FILTER (WHERE n = top) AS n_top FROM (SELECT *, max(n) OVER (PARTITION BY source_id) AS top FROM pt) GROUP BY source_id),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    SELECT count(*) AS patents, count(*) FILTER (WHERE n_top > 1) AS patents_with_tied_lead FROM ties
    
"""
await replay.call(6, 'run_sql', {'sql': sql},
                  sha256='c1c0795f032af5802d122771a1c6574676035aff76925bf8312815e440ae5c09')

Call 6 · run_sql · recorded result · sha256 c1c0795f032a…

1 row

patents patents_with_tied_lead
9004 1760
In [ ]:
Call 7 · run_sql · ran 2026-11-24 04:56:26 UTC (34 lines)
# Call 7 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- The largest lead targets left in the 'Other' class
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m, lower(min(organism)) AS org
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n, org FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    ,
    classed AS (SELECT tkey, target, CASE
        WHEN regexp_matches(org, 'virus') OR regexp_matches(t, 'genome polyprotein|replicase polyprotein|gag-pol|reverse transcriptase|hemagglutinin|neuraminidase|3c-like proteinase') THEN 'Viral'
        WHEN regexp_matches(t, 'cytochrome p450') THEN 'CYP450'
        WHEN regexp_matches(t, 'cereblon|e3 ubiquitin|von hippel|ikaros|aiolos|zinc finger protein helios|gspt1|peptide chain release factor') THEN 'E3'
        WHEN regexp_matches(t, 'programmed cell death|pd-l1|indoleamine 2,3-dioxygenase|tryptophan 2,3-dioxygenase|stimulator of interferon|5''-nucleotidase|cyclic gmp-amp|nacht, lrr|nlrp3|toll-like receptor|interleukin-17|tumor necrosis factor$|arginase') THEN 'IO'
        WHEN regexp_matches(t, 'phosphatase') THEN 'Phosphatase'
        WHEN regexp_matches(t, 'phosphodiesterase') THEN 'PDE'
        WHEN regexp_matches(t, 'bromodomain|histone|demethylase|methyltransferase|deacetylase|sirtuin|menin|polycomb|wd repeat-containing protein 5|creb-binding|e1a binding|chromobox|set domain|atpase family aaa') THEN 'Epigenetic'
        WHEN regexp_matches(t, 'kinase|growth factor receptor|tgf-beta receptor|colony-stimulating factor 1 receptor|discoidin domain|ephrin type|insulin receptor|angiopoietin-1 receptor|alk tyrosine|macrophage-stimulating protein receptor|proto-oncogene tyrosine-protein|ufo|bmp receptor|activin receptor') THEN 'Kinase'
        WHEN regexp_matches(t, 'channel|transient receptor potential|p2x purinoceptor|glutamate receptor ionotropic|gamma-aminobutyric acid receptor subunit|acetylcholine receptor subunit|5-hydroxytryptamine receptor 3|cystic fibrosis transmembrane') THEN 'Ion'
        WHEN regexp_matches(t, 'nuclear receptor|estrogen receptor|androgen receptor|glucocorticoid receptor|mineralocorticoid receptor|progesterone receptor|peroxisome proliferator|retinoic acid receptor|thyroid hormone receptor|vitamin d3 receptor|oxysterols receptor|bile acid receptor|retinoid x receptor') THEN 'NR'
        WHEN regexp_matches(t, 'adrenergic|muscarinic|dopamine receptor|5-hydroxytryptamine receptor|histamine h|opioid receptor|cannabinoid receptor|orexin|hypocretin|chemokine receptor|adenosine receptor|melanocortin receptor|neuropeptide|somatostatin receptor|sphingosine 1-phosphate receptor|free fatty acid receptor|g-protein coupled|glucagon|calcitonin|metabotropic glutamate|prostaglandin e2 receptor|prostaglandin d2 receptor|endothelin|angiotensin ii receptor|bradykinin receptor|apelin receptor|ghrelin|lysophosphatidic acid receptor|leukotriene b4 receptor|cysteinyl leukotriene receptor|thromboxane a2 receptor|proteinase-activated receptor|gonadotropin|vasopressin|oxytocin receptor|neuromedin|substance-p receptor|neurokinin|melatonin receptor|galanin receptor|c5a anaphylatoxin|formyl peptide receptor|hydroxycarboxylic acid receptor|trace amine|smoothened|parathyroid hormone|corticotropin|thyrotropin|extracellular calcium-sensing|gamma-aminobutyric acid type b|nociceptin|urotensin|motilin|relaxin|kisspeptin|prokineticin|melanin-concentrating|succinate receptor|mas-related|bile acid receptor 1|g protein-coupled') THEN 'GPCR'
        WHEN regexp_matches(t, 'protease|proteinase|peptidase|secretase|caspase|cathepsin|thrombin|coagulation factor|elastase|trypsin|chymase|kallikrein|plasminogen|metalloproteinase|disintegrin|proteasome|calpain|^renin|furin|matriptase|granzyme|neprilysin|hepsin|complement factor|urokinase|tryptase|polyprotein pp1a|ubiquitin carboxyl-terminal hydrolase') THEN 'Protease'
        WHEN regexp_matches(t, 'transporter|solute carrier|cotransporter|multidrug resistance|atp-binding cassette|bile salt export|excitatory amino acid') THEN 'Transporter'
        ELSE 'Other' END
       AS class FROM (SELECT *, lower(target) AS t FROM lead))
    SELECT min_by(target, (length(target), target)) AS target, count(*) AS patents FROM classed WHERE class = 'Other' GROUP BY tkey ORDER BY patents DESC, tkey LIMIT 25
    
"""
await replay.call(7, 'run_sql', {'sql': sql},
                  sha256='f7d9fc4fc3c987034a700c59d812de06ebbf2116fc98224f0280dd4671c174fc')

Call 7 · run_sql · recorded result · sha256 f7d9fc4fc3c9…

25 rows

target patents
Autotaxin 55
Poly [ADP-ribose] polymerase 1 49
GTPase KRas 44
Isocitrate dehydrogenase [NADP] cytoplasmic 43
Apoptosis regulator Bcl-2 35
Protein O-GlcNAcase 33
Monoglyceride lipase 27
Egl nine homolog 1 26
Dihydroorotate dehydrogenase (quinone), mitochondrial 24
Diacylglycerol O-acyltransferase 2 24
Induced myeloid leukemia cell differentiation protein Mcl-1 23
Amine oxidase [copper-containing] 3 22
Acetyl-CoA carboxylase 2 20
Nicotinamide phosphoribosyltransferase 19
Glutaminyl-peptide cyclotransferase 18
Fatty-acid amide hydrolase 1 17
Heat shock protein HSP 90-alpha 17
Mucosa-associated lymphoid tissue lymphoma translocation protein 1 17
Diacylglycerol O-acyltransferase 1 15
Amyloid-beta precursor protein 15
11-beta-hydroxysteroid dehydrogenase 1 15
Glutaminase kidney isoform, mitochondrial 14
15-hydroxyprostaglandin dehydrogenase [NAD(+)] 14
DNA polymerase theta 13
Steroid 17-alpha-hydroxylase/17,20 lyase 13
In [ ]:
Call 8 · run_sql · ran 2026-11-24 04:56:26 UTC (34 lines)
# Call 8 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Patents per year by the class of their lead target (keyword rules on target names)
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m, lower(min(organism)) AS org
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n, org FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    ,
    classed AS (SELECT year, CASE
        WHEN regexp_matches(org, 'virus') OR regexp_matches(t, 'genome polyprotein|replicase polyprotein|gag-pol|reverse transcriptase|hemagglutinin|neuraminidase|3c-like proteinase') THEN 'Viral'
        WHEN regexp_matches(t, 'cytochrome p450') THEN 'CYP450'
        WHEN regexp_matches(t, 'cereblon|e3 ubiquitin|von hippel|ikaros|aiolos|zinc finger protein helios|gspt1|peptide chain release factor') THEN 'E3'
        WHEN regexp_matches(t, 'programmed cell death|pd-l1|indoleamine 2,3-dioxygenase|tryptophan 2,3-dioxygenase|stimulator of interferon|5''-nucleotidase|cyclic gmp-amp|nacht, lrr|nlrp3|toll-like receptor|interleukin-17|tumor necrosis factor$|arginase') THEN 'IO'
        WHEN regexp_matches(t, 'phosphatase') THEN 'Phosphatase'
        WHEN regexp_matches(t, 'phosphodiesterase') THEN 'PDE'
        WHEN regexp_matches(t, 'bromodomain|histone|demethylase|methyltransferase|deacetylase|sirtuin|menin|polycomb|wd repeat-containing protein 5|creb-binding|e1a binding|chromobox|set domain|atpase family aaa') THEN 'Epigenetic'
        WHEN regexp_matches(t, 'kinase|growth factor receptor|tgf-beta receptor|colony-stimulating factor 1 receptor|discoidin domain|ephrin type|insulin receptor|angiopoietin-1 receptor|alk tyrosine|macrophage-stimulating protein receptor|proto-oncogene tyrosine-protein|ufo|bmp receptor|activin receptor') THEN 'Kinase'
        WHEN regexp_matches(t, 'channel|transient receptor potential|p2x purinoceptor|glutamate receptor ionotropic|gamma-aminobutyric acid receptor subunit|acetylcholine receptor subunit|5-hydroxytryptamine receptor 3|cystic fibrosis transmembrane') THEN 'Ion'
        WHEN regexp_matches(t, 'nuclear receptor|estrogen receptor|androgen receptor|glucocorticoid receptor|mineralocorticoid receptor|progesterone receptor|peroxisome proliferator|retinoic acid receptor|thyroid hormone receptor|vitamin d3 receptor|oxysterols receptor|bile acid receptor|retinoid x receptor') THEN 'NR'
        WHEN regexp_matches(t, 'adrenergic|muscarinic|dopamine receptor|5-hydroxytryptamine receptor|histamine h|opioid receptor|cannabinoid receptor|orexin|hypocretin|chemokine receptor|adenosine receptor|melanocortin receptor|neuropeptide|somatostatin receptor|sphingosine 1-phosphate receptor|free fatty acid receptor|g-protein coupled|glucagon|calcitonin|metabotropic glutamate|prostaglandin e2 receptor|prostaglandin d2 receptor|endothelin|angiotensin ii receptor|bradykinin receptor|apelin receptor|ghrelin|lysophosphatidic acid receptor|leukotriene b4 receptor|cysteinyl leukotriene receptor|thromboxane a2 receptor|proteinase-activated receptor|gonadotropin|vasopressin|oxytocin receptor|neuromedin|substance-p receptor|neurokinin|melatonin receptor|galanin receptor|c5a anaphylatoxin|formyl peptide receptor|hydroxycarboxylic acid receptor|trace amine|smoothened|parathyroid hormone|corticotropin|thyrotropin|extracellular calcium-sensing|gamma-aminobutyric acid type b|nociceptin|urotensin|motilin|relaxin|kisspeptin|prokineticin|melanin-concentrating|succinate receptor|mas-related|bile acid receptor 1|g protein-coupled') THEN 'GPCR'
        WHEN regexp_matches(t, 'protease|proteinase|peptidase|secretase|caspase|cathepsin|thrombin|coagulation factor|elastase|trypsin|chymase|kallikrein|plasminogen|metalloproteinase|disintegrin|proteasome|calpain|^renin|furin|matriptase|granzyme|neprilysin|hepsin|complement factor|urokinase|tryptase|polyprotein pp1a|ubiquitin carboxyl-terminal hydrolase') THEN 'Protease'
        WHEN regexp_matches(t, 'transporter|solute carrier|cotransporter|multidrug resistance|atp-binding cassette|bile salt export|excitatory amino acid') THEN 'Transporter'
        ELSE 'Other' END
       AS class FROM (SELECT *, lower(target) AS t FROM lead))
    SELECT year, class, count(*) AS patents FROM classed WHERE year BETWEEN 2013 AND 2026 GROUP BY ALL ORDER BY year, class
    
"""
await replay.call(8, 'run_sql', {'sql': sql},
                  sha256='79153d3bd2167b7a3cde34e4cb416f8ffcd3fac5e8d0608107e88ec74f2e4be5')

Call 8 · run_sql · recorded result · sha256 79153d3bd216…

194 rows

year class patents
2013 CYP450 1
2013 E3 1
2013 Epigenetic 5
2013 GPCR 48
2013 IO 1
2013 Ion 5
2013 Kinase 74
2013 NR 2
2013 Other 52
2013 PDE 6
2013 Protease 23
2013 Transporter 7
2013 Viral 9
2014 CYP450 4
2014 E3 6
2014 Epigenetic 14
2014 GPCR 77
2014 Ion 13
2014 Kinase 112
2014 NR 6
2014 Other 80
2014 PDE 27
2014 Phosphatase 1
2014 Protease 40
2014 Transporter 7
2014 Viral 8
2015 CYP450 11
2015 E3 10
2015 Epigenetic 19
2015 GPCR 97
2015 IO 1
2015 Ion 54
2015 Kinase 171
2015 NR 15
2015 Other 166
2015 PDE 25
2015 Phosphatase 3
2015 Protease 64
2015 Transporter 17
2015 Viral 12
2016 CYP450 17
2016 E3 14
2016 Epigenetic 28
2016 GPCR 90
2016 IO 6
2016 Ion 39
2016 Kinase 198
2016 NR 13
2016 Other 126
2016 PDE 22
2016 Phosphatase 4
2016 Protease 73
2016 Transporter 12
2016 Viral 20
2017 CYP450 14
2017 E3 9
2017 Epigenetic 56
2017 GPCR 117
2017 IO 16
2017 Ion 58
2017 Kinase 246
2017 NR 39
2017 Other 131
2017 PDE 28
2017 Phosphatase 3
2017 Protease 65
2017 Transporter 8
2017 Viral 6
2018 CYP450 8
2018 E3 1
2018 Epigenetic 54
2018 GPCR 74
2018 IO 16
2018 Ion 37
2018 Kinase 198
2018 NR 20
2018 Other 93
2018 PDE 12
2018 Phosphatase 4
2018 Protease 49
2018 Transporter 11
2018 Viral 26
2019 CYP450 3
2019 E3 4
2019 Epigenetic 62
2019 GPCR 95
2019 IO 23
2019 Ion 43
2019 Kinase 225
2019 NR 42
2019 Other 169
2019 PDE 16
2019 Phosphatase 10
2019 Protease 48
2019 Transporter 12
2019 Viral 21
2020 CYP450 1
2020 E3 6
2020 Epigenetic 58
2020 GPCR 94
2020 IO 25
2020 Ion 42
2020 Kinase 230
2020 NR 27
2020 Other 148
2020 PDE 19
2020 Phosphatase 5
2020 Protease 42
2020 Transporter 10
2020 Viral 12
2021 CYP450 3
2021 E3 7
2021 Epigenetic 53
2021 GPCR 63
2021 IO 39
2021 Ion 29
2021 Kinase 241
2021 NR 30
2021 Other 163
2021 PDE 15
2021 Phosphatase 11
2021 Protease 53
2021 Transporter 7
2021 Viral 15
2022 CYP450 6
2022 E3 15
2022 Epigenetic 57
2022 GPCR 50
2022 IO 38
2022 Ion 20
2022 Kinase 208
2022 NR 13
2022 Other 139
2022 PDE 17
2022 Phosphatase 10
2022 Protease 28
2022 Transporter 2
2022 Viral 40
2023 CYP450 7
2023 E3 12
2023 Epigenetic 40
2023 GPCR 57
2023 IO 38
2023 Ion 25
2023 Kinase 228
2023 NR 12
2023 Other 162
2023 PDE 6
2023 Phosphatase 22
2023 Protease 50
2023 Transporter 7
2023 Viral 13
2024 CYP450 15
2024 E3 15
2024 Epigenetic 47
2024 GPCR 68
2024 IO 35
2024 Ion 45
2024 Kinase 254
2024 NR 12
2024 Other 257
2024 PDE 12
2024 Phosphatase 19
2024 Protease 31
2024 Transporter 11
2024 Viral 34
2025 CYP450 15
2025 E3 27
2025 Epigenetic 73
2025 GPCR 67
2025 IO 25
2025 Ion 41
2025 Kinase 312
2025 NR 14
2025 Other 253
2025 PDE 14
2025 Phosphatase 19
2025 Protease 46
2025 Transporter 8
2025 Viral 25
2026 CYP450 4
2026 E3 19
2026 Epigenetic 17
2026 GPCR 19
2026 IO 9
2026 Ion 10
2026 Kinase 108
2026 NR 1
2026 Other 94
2026 PDE 2
2026 Phosphatase 5
2026 Protease 12
2026 Transporter 1
2026 Viral 8
In [ ]:
Call 9 · run_sql · ran 2026-11-24 04:56:26 UTC (26 lines)
# Call 9 · run_sql · ran 2026-11-24 04:56:26 UTC
sql = """
    -- Lead targets gaining and losing patent share: 2013-17 vs 2022-26
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    ,
    w AS (SELECT *, CASE WHEN year BETWEEN 2013 AND 2017 THEN 'early' WHEN year BETWEEN 2022 AND 2026 THEN 'late' END AS win FROM lead),
    tot AS (SELECT count(*) FILTER (WHERE win = 'early') AS te, count(*) FILTER (WHERE win = 'late') AS tl FROM w),
    t AS (SELECT tkey, min_by(target, (length(target), target)) AS target,
                 count(*) FILTER (WHERE win = 'early') AS early, count(*) FILTER (WHERE win = 'late') AS late
          FROM w GROUP BY tkey)
    SELECT target, tkey, early, late, te AS early_total, tl AS late_total,
           round(100.0 * late / tl - 100.0 * early / te, 3) AS delta_pp
    FROM t, tot WHERE greatest(early, late) >= 15
    ORDER BY delta_pp DESC, tkey
    
"""
await replay.call(9, 'run_sql', {'sql': sql},
                  sha256='de9d1c71f11e4bf333d438e7a8aafe96720d9cc8d6d91861c000c25115ef3857')

Call 9 · run_sql · recorded result · sha256 de9d1c71f11e…

65 rows

target tkey early late early_total late_total delta_pp
Mitogen-activated protein kinase kinase kinase kinase 1 Q92918 0 44 2752 3425 1.285
GTPase KRas P01116 0 41 2752 3425 1.197
Replicase polyprotein 1a P0DTC1 0 41 2752 3425 1.197
Receptor-interacting serine/threonine-protein kinase 1 Q13546 1 35 2752 3425 0.986
Tyrosine-protein phosphatase non-receptor type 11 Q06124 3 35 2752 3425 0.913
Replicase polyprotein 1ab P0DTD1 0 31 2752 3425 0.905
Programmed cell death 1 ligand/protein 1 Programmed cell death 1 ligand/protein 1 0 31 2752 3425 0.905
Protein cereblon Q96SW2 0 29 2752 3425 0.847
5-hydroxytryptamine receptor 2A P28223 9 38 2752 3425 0.782
Stimulator of interferon genes protein Q86WV6 0 23 2752 3425 0.672
Proto-oncogene tyrosine-protein kinase receptor Ret P07949 2 25 2752 3425 0.657
Interleukin-1 receptor-associated kinase 4 Q9NWZ3 11 36 2752 3425 0.651
Diacylglycerol kinase alpha P23743 0 21 2752 3425 0.613
Adenosine receptor A2a P29274 5 27 2752 3425 0.607
Cyclin-dependent kinase 2/G1/S-specific cyclin-E1 Cyclin-dependent kinase 2/G1/S-specific cyclin-E1 1 21 2752 3425 0.577
DNA damage-binding protein 1/Protein cereblon DNA damage-binding protein 1/Protein cereblon 0 19 2752 3425 0.555
Monoglyceride lipase Q99685 1 20 2752 3425 0.548
Cytochrome P450 1A2 P05177 2 21 2752 3425 0.54
Potassium voltage-gated channel subfamily H member 2 Q12809 3 22 2752 3425 0.533
Non-receptor tyrosine-protein kinase TYK2 P29597 1 19 2752 3425 0.518
Tyrosine-protein kinase JAK1 P23458 11 31 2752 3425 0.505
Tyrosine-protein kinase JAK2 O60674 35 60 2752 3425 0.48
Epidermal growth factor receptor P00533 27 50 2752 3425 0.479
Ectonucleotide pyrophosphatase/phosphodiesterase family member 1 P22413 0 15 2752 3425 0.438
TGF-beta receptor type-1 P36897 4 17 2752 3425 0.351
Histone deacetylase 6 Q9UBN7 4 17 2752 3425 0.351
Macrophage colony-stimulating factor 1 receptor P07333 5 16 2752 3425 0.285
Dipeptidyl peptidase 1 P53634 8 19 2752 3425 0.264
D(2) dopamine receptor P14416 10 20 2752 3425 0.221
Poly [ADP-ribose] polymerase 1 P09874 15 26 2752 3425 0.214
Serine/threonine-protein kinase ATR Q13535 7 16 2752 3425 0.213
Bromodomain-containing protein 4 O60885 21 32 2752 3425 0.171
Leucine-rich repeat serine/threonine-protein kinase 2 Q5S007 15 24 2752 3425 0.156
Apoptosis regulator Bcl-2 P10415 13 19 2752 3425 0.082
Rho-associated protein kinase 2 O75116 14 18 2752 3425 0.017
Lysine-specific histone demethylase 1A O60341 18 19 2752 3425 -0.099
Fibroblast growth factor receptor 1 P11362 17 17 2752 3425 -0.121
Serine/threonine-protein kinase B-raf P15056 17 15 2752 3425 -0.18
Complement factor D P00746 15 10 2752 3425 -0.253
Protein O-GlcNAcase O60502 16 10 2752 3425 -0.289
Cannabinoid receptor 1 P21554 16 10 2752 3425 -0.289
Cytochrome P450 3A4 P08684 18 12 2752 3425 -0.304
Phosphatidylinositol 4,5-bisphosphate 3-kinase catalytic subunit alpha isoform P42336 19 12 2752 3425 -0.34
Mitogen-activated protein kinase 1 P28482 15 6 2752 3425 -0.37
Coagulation factor XI P03951 20 11 2752 3425 -0.406
High affinity nerve growth factor receptor P04629 23 14 2752 3425 -0.427
E3 ubiquitin-protein ligase Mdm2 Q00987 19 9 2752 3425 -0.428
RAC-alpha serine/threonine-protein kinase P31749 18 7 2752 3425 -0.45
Transient receptor potential cation channel subfamily V member 1 Q8NER1 15 2 2752 3425 -0.487
Orexin receptor type 2 O43614 19 6 2752 3425 -0.515
P2X purinoceptor 7 Q99572 16 2 2752 3425 -0.523
Dipeptidyl peptidase 4 P27487 18 4 2752 3425 -0.537
Prostaglandin D2 receptor 2 Q9Y5Y4 15 0 2752 3425 -0.545
Hepatocyte growth factor receptor P08581 22 8 2752 3425 -0.566
Vascular endothelial growth factor receptor 2 P35968 23 9 2752 3425 -0.573
Serine/threonine-protein kinase pim-1 P11309 19 4 2752 3425 -0.574
Tyrosine-protein kinase BTK Q06187 56 50 2752 3425 -0.575
Sphingosine 1-phosphate receptor 1 P21453 19 2 2752 3425 -0.632
Phosphatidylinositol 4,5-bisphosphate 3-kinase catalytic subunit delta isoform O00329 33 19 2752 3425 -0.644
Orexin/Hypocretin receptor type 1 O43613 24 5 2752 3425 -0.726
Nuclear receptor ROR-gamma P51449 29 9 2752 3425 -0.791
Tyrosine-protein kinase SYK P43405 28 6 2752 3425 -0.842
Sodium channel protein type 9 subunit alpha Q15858 40 8 2752 3425 -1.22
cAMP and cAMP-inhibited cGMP 3',5'-cyclic phosphodiesterase 10A Q9Y233 53 3 2752 3425 -1.838
Beta-secretase 1 P56817 80 1 2752 3425 -2.878
In [ ]:
Call 10 · run_sql · ran 2026-11-24 04:56:27 UTC (25 lines)
# Call 10 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Patent title and abstract keywords: 2013-17 vs 2022-26 (patents whose title matches each pattern)
    WITH p AS (
      SELECT DISTINCT a.source_id, a.year, lower(concat_ws(' ', ar.title, ar.abstract)) AS title
      FROM activity a JOIN article ar USING (articleid)
      WHERE (a.source_id LIKE 'US%' OR a.source_id LIKE 'WO%')),
    k(theme, pattern) AS (VALUES
      ('degrader / PROTAC', 'degrad|protac|proteolysis'),
      ('KRAS', 'kras|k-ras'),
      ('deuterated', 'deuter'),
      ('macrocycle', 'macrocycl'),
      ('COVID / coronavirus', 'covid|coronavirus|sars-cov'),
      ('pain', 'pain|analges|nocicept'),
      ('psychiatric', 'psychiatr|schizophren|depress|anxiety|bipolar'),
      ('oncology', 'cancer|tumor|tumour|oncolog|neoplas|proliferat'))
    SELECT theme,
           count(*) FILTER (WHERE year BETWEEN 2013 AND 2017) AS patents_2013_17,
           count(*) FILTER (WHERE year BETWEEN 2022 AND 2026) AS patents_2022_26
    FROM p JOIN k ON regexp_matches(p.title, k.pattern)
    GROUP BY theme ORDER BY patents_2022_26 DESC
    
"""
await replay.call(10, 'run_sql', {'sql': sql},
                  sha256='3939109c019cd0f8ec0c19c4dd710aeb3ce00037e6f942d32feff8983e9ca87c')

Call 10 · run_sql · recorded result · sha256 3939109c019c…

8 rows

theme patents_2013_17 patents_2022_26
oncology 741 1201
degrader / PROTAC 8 107
pain 198 97
psychiatric 197 96
COVID / coronavirus 0 80
deuterated 6 70
macrocycle 23 63
KRAS 0 53
In [ ]:
Call 11 · run_sql · ran 2026-11-24 04:56:27 UTC (19 lines)
# Call 11 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Share of each target's compounds that come from patents (targets with at least 3,000 compounds)
    WITH c AS (
      SELECT uniprot, monomerid, bool_or(source_id LIKE 'US%' OR source_id LIKE 'WO%') AS from_patent
      FROM activity WHERE uniprot IS NOT NULL GROUP BY uniprot, monomerid),
    t AS (
      SELECT uniprot, count(*) AS compounds, round(100.0 * count(*) FILTER (WHERE from_patent) / count(*), 1) AS pct_patent
      FROM c GROUP BY uniprot HAVING count(*) >= 3000),
    n AS (SELECT uniprot, min_by(target_name, (length(target_name), target_name)) AS target FROM activity
          WHERE uniprot IN (SELECT uniprot FROM t) GROUP BY uniprot),
    r AS (SELECT *, row_number() OVER (ORDER BY pct_patent DESC, uniprot) AS hi,
                 row_number() OVER (ORDER BY pct_patent, uniprot) AS lo FROM t)
    SELECT n.target, r.uniprot, r.compounds, r.pct_patent, (SELECT count(*) FROM t) AS targets_considered
    FROM r JOIN n USING (uniprot) WHERE hi <= 15 OR lo <= 10 ORDER BY pct_patent DESC, uniprot
    
"""
await replay.call(11, 'run_sql', {'sql': sql},
                  sha256='c8074036981651fcf49b8924106cb42ecec6e3e7e7a86dc3f5f83dbffa65a23d')

Call 11 · run_sql · recorded result · sha256 c80740369816…

25 rows

target uniprot compounds pct_patent targets_considered
Replicase polyprotein 1a P0DTC1 5185 100 171
Diacylglycerol kinase alpha P23743 4305 99.6 171
Diacylglycerol kinase zeta Q13574 3002 99.6 171
Complement factor D P00746 5177 97.9 171
Programmed cell death 1 ligand 1 Q9NZQ7 3332 95.7 171
Mitogen-activated protein kinase kinase kinase kinase 1 Q92918 9663 92.7 171
P2X purinoceptor 3 P56373 5395 91.9 171
Interleukin-1 receptor-associated kinase 4 Q9NWZ3 11996 91.3 171
Receptor-interacting serine/threonine-protein kinase 1 Q13546 7571 90.1 171
Plasma kallikrein P03952 5653 88.9 171
Toll-like receptor 9 Q9NR96 4377 88.7 171
Nicotinamide phosphoribosyltransferase P43490 7036 88.1 171
Acetyl-CoA carboxylase 2 O00763 4105 87.9 171
GTPase KRas P01116 6535 87.9 171
Non-receptor tyrosine-protein kinase TYK2 P29597 11096 87.6 171
D(2) dopamine receptor P61169 4936 2 171
Cholinesterase P06276 4868 1.8 171
Carbonic anhydrase 1 P00915 9531 1.5 171
Acetylcholinesterase P22303 7560 1.5 171
Mu-type opioid receptor P33535 3493 1.1 171
Acetylcholinesterase O42275 7118 0.5 171
Carbonic anhydrase 12 O43570 5369 0.5 171
Carbonic anhydrase 9 Q16790 6680 0.5 171
Adenosine receptor A1 P25099 3273 0 171
Cholinesterase P81908 5582 0 171
In [ ]:
Call 12 · run_sql · ran 2026-11-24 04:56:27 UTC (15 lines)
# Call 12 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Potency of patent vs non-patent measurements (exact values only, relation '=')
    SELECT affinity_type,
           CASE WHEN source_id LIKE 'US%' OR source_id LIKE 'WO%' THEN 'patent' ELSE 'other' END AS source,
           count(*) AS measurements,
           round(median(p_affinity), 2) AS median_p_affinity,
           round(100.0 * count(*) FILTER (WHERE value <= 10) / count(*), 1) AS pct_10nM_or_better
    FROM activity
    WHERE relation = '=' AND affinity_type IN ('Ki', 'Kd', 'IC50', 'EC50') AND p_affinity IS NOT NULL
    GROUP BY ALL ORDER BY affinity_type, source
    
"""
await replay.call(12, 'run_sql', {'sql': sql},
                  sha256='01c9452f43bf89a8b4c5059f4cb732c28d59e7bad8640a7ce2ef794ff4997c0b')

Call 12 · run_sql · recorded result · sha256 01c9452f43bf…

8 rows

affinity_type source measurements median_p_affinity pct_10nM_or_better
EC50 other 147576 6.42 16.8
EC50 patent 68909 7.16 27.4
IC50 other 943051 6.36 15.2
IC50 patent 808726 7.19 26.1
Kd other 60569 6.4 17.6
Kd patent 21429 7.67 45
Ki other 409939 7.01 25.8
Ki patent 131804 7.63 40.7
In [ ]:
Call 13 · run_sql · ran 2026-11-24 04:56:27 UTC (13 lines)
# Call 13 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Distribution of p_affinity (Ki, Kd, IC50, EC50; relation '=') in half-log bins, patent vs non-patent
    SELECT floor(p_affinity * 2) / 2 AS bin,
           count(*) FILTER (WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%') AS patent,
           count(*) FILTER (WHERE NOT (source_id LIKE 'US%' OR source_id LIKE 'WO%') OR source_id IS NULL) AS other
    FROM activity
    WHERE relation = '=' AND affinity_type IN ('Ki', 'Kd', 'IC50', 'EC50') AND p_affinity BETWEEN 2 AND 13.5
    GROUP BY bin ORDER BY bin
    
"""
await replay.call(13, 'run_sql', {'sql': sql},
                  sha256='3b75aca10c1b03516117fe79ad250b70b444c96add75f65de8d6d3c9494ec79e')

Call 13 · run_sql · recorded result · sha256 3b75aca10c1b…

23 rows

bin patent other
2 446 2653
2.5 666 4138
3 2707 11591
3.5 4139 26476
4 15112 76188
4.5 27255 110189
5 67720 169278
5.5 71289 167648
6 133830 192642
6.5 121151 178145
7 157565 186788
7.5 135156 147505
8 123190 127736
8.5 77645 74647
9 55272 48618
9.5 22173 19413
10 10949 8550
10.5 2846 3183
11 983 1652
11.5 283 444
12 118 185
12.5 26 34
13 2 18
In [ ]:
Call 14 · run_sql · ran 2026-11-24 04:56:27 UTC (14 lines)
# Call 14 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Molecular weight (RDKit, largest fragment) of compounds by year: patents vs other sources
    WITH c AS (
      SELECT DISTINCT a.year, CASE WHEN a.source_id LIKE 'US%' OR a.source_id LIKE 'WO%' THEN 'patent' ELSE 'other' END AS source, a.monomerid
      FROM activity a WHERE a.year BETWEEN 2013 AND 2026)
    SELECT year, source, count(*) AS compounds, round(median(p.mw), 1) AS median_mw,
           round(100.0 * count(*) FILTER (WHERE p.mw > 500) / count(*), 1) AS pct_mw_over_500
    FROM c JOIN compound_property p USING (monomerid)
    GROUP BY ALL ORDER BY source, year
    
"""
await replay.call(14, 'run_sql', {'sql': sql},
                  sha256='eeef0a22150de6c138b317bb374d41bebfeac3e54c9ae6600234fae87536d4f0')

Call 14 · run_sql · recorded result · sha256 eeef0a22150d…

27 rows

year source compounds median_mw pct_mw_over_500
2013 other 35925 399.5 18.6
2014 other 32340 408.9 21.5
2015 other 29366 412.6 22
2016 other 32954 409.4 22.4
2017 other 31666 411.9 23.9
2018 other 30190 425.5 25.4
2019 other 30397 424.5 25.7
2020 other 32658 429.5 28.9
2021 other 36139 430.9 29.3
2022 other 30199 433.5 29.3
2023 other 24401 431.6 28.2
2024 other 2279 442.5 31.7
2025 other 1 657.1 100
2013 patent 13194 447 27.6
2014 patent 28112 438.5 23.5
2015 patent 47492 448.4 29.1
2016 patent 51600 449.5 28.2
2017 patent 82078 464.6 34.3
2018 patent 57689 455.5 31.7
2019 patent 83708 462 32.9
2020 patent 74083 464.5 35.6
2021 patent 74047 466.6 37.1
2022 patent 67093 472.5 39
2023 patent 68022 471.9 38
2024 patent 70546 473.5 38.9
2025 patent 91421 481.6 42.8
2026 patent 31471 477.4 42.2
In [ ]:
Call 15 · run_sql · ran 2026-11-24 04:56:27 UTC (13 lines)
# Call 15 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- Median molecular weight of patent vs non-patent compounds, 2013-2023 (years both sources cover)
    WITH c AS (
      SELECT DISTINCT CASE WHEN source_id LIKE 'US%' OR source_id LIKE 'WO%' THEN 'patent' ELSE 'other' END AS source, monomerid
      FROM activity WHERE year BETWEEN 2013 AND 2023)
    SELECT source, count(*) AS compounds, round(median(p.mw), 1) AS median_mw,
           round(100.0 * count(*) FILTER (WHERE p.mw > 500) / count(*), 1) AS pct_mw_over_500
    FROM c JOIN compound_property p USING (monomerid) GROUP BY source ORDER BY source
    
"""
await replay.call(15, 'run_sql', {'sql': sql},
                  sha256='0685bd6b563c3c129aa72e3cec555ec726e2b82c22b8521c38072aa69a153f77')

Call 15 · run_sql · recorded result · sha256 0685bd6b563c…

2 rows

source compounds median_mw pct_mw_over_500
other 322640 421.5 25.4
patent 516552 461.7 34.2
In [ ]:
Call 16 · run_sql · ran 2026-11-24 04:56:27 UTC (19 lines)
# Call 16 · run_sql · ran 2026-11-24 04:56:27 UTC
sql = """
    -- The largest patent's lead target, and how many patents have a JAK-family lead target
    WITH pt AS (   -- one row per patent and target (UniProt accession, else target name)
      SELECT source_id, min(year) AS year, coalesce(uniprot, target_name) AS tkey,
             min_by(target_name, (length(target_name), target_name)) AS target,
             count(DISTINCT monomerid) AS n, count(*) AS m
      FROM activity WHERE source_id LIKE 'US%' OR source_id LIKE 'WO%'
      GROUP BY source_id, tkey),
    lead AS (      -- each patent's lead target: most compounds measured; ties broken by measurements, then key
      SELECT source_id, year, tkey, target, n FROM pt
      QUALIFY row_number() OVER (PARTITION BY source_id ORDER BY n DESC, m DESC, tkey) = 1)
    SELECT 'largest patent: ' || source_id AS item, target AS value, n AS count FROM lead WHERE source_id = 'US12581252-B2'
    UNION ALL
    SELECT 'JAK family (JAK1, JAK2, JAK3, TYK2) as lead', NULL, count(*) FROM lead WHERE tkey IN ('P23458', 'O60674', 'P52333', 'P29597')
    
"""
await replay.call(16, 'run_sql', {'sql': sql},
                  sha256='0a4e42c020994074755d626dbed962655e1ea25d224111315b0e270cb5cc42b3')

Call 16 · run_sql · recorded result · sha256 0a4e42c02099…

{
  "order_warning": "The query has no ORDER BY, so its 2 rows can come back in a different order. Add an ORDER BY that ends with a unique column (e.g. monomerid; ki_result_id, affinity_type for measurements) so the result is the same on every run and a notebook's rerun check passes."
}

2 rows

item value count
largest patent: US12581252-B2 Phosphatidylinositol 4,5-bisphosphate 3-kinase catalytic subunit alpha isoform 2689
JAK family (JAK1, JAK2, JAK3, TYK2) as lead 291
In [ ]:
# Code 1: Draw the four patent-landscape figures from the run_sql results
# The code is in plot_patent_landscape.py, next to this notebook (175 lines).
from plot_patent_landscape import *

fig1_growth(replay.result(3), '.')
fig2_class_share(replay.result(8), '.')
fig3_rise_fall(replay.result(9), '.')
fig4_potency_mw(replay.result(13), replay.result(14), replay.result(12), '.')

Figure 1: Patents vs. journal literature in BindingDB, 2005–2026. Source documents (left) and distinct compounds (right) per year. Patent curation starts in 2013 and has supplied more compounds per year than journal articles since 2015. The shaded area marks curation lag for articles; 2026 is a partial year. (as recorded; running this cell draws it again)

No description has been provided for this image

Figure 2: Target-class mix of patents over time. Share of patents per year by the class of each patent's lead target (the target with the most compounds measured in that patent). Classes were assigned by keyword rules on target names; each panel has its own y-scale. 2026 (partial) is left out. (as recorded; running this cell draws it again)

No description has been provided for this image

Figure 3: Lead targets gaining and losing patent share. Change in the share of patents (percentage points) between 2013–2017 (2,752 patents) and 2022–2026 (3,425 patents), for the 12 lead targets that gained most and the 12 that lost most among those with at least 15 patents in either window. The labels give the raw patent counts in each window. (as recorded; running this cell draws it again)

No description has been provided for this image

Figure 4: Potency and molecular weight of patent compounds. Left: pAffinity distributions (Ki, Kd, IC50, EC50; exact values only) for patent and non-patent measurements. Right: share of patent compounds with MW above 500 Da (RDKit, largest fragment), by patent year. (as recorded; running this cell draws it again)

No description has been provided for this image

🧠 Assistant

Data: BindingDB release 202611. A record counts as a patent when its source ID starts with US or WO.

Scale¶

  • 9,004 patents: 7,262 granted US patents (B1/B2), 1,640 US applications (1,631 A1, 8 A9, 1 A2), 24 US reissues and 78 WO/PCT applications. Almost all are US documents published from 2013 on, when BindingDB started curating patents.
  • 1.36 M measurements (42% of BindingDB) and 699 k distinct compounds (48% of the 1.45 M compounds with a measurement), covering 3,224 of the 12,002 targets with data.
  • Patent chemical space barely overlaps the literature. Only 25 k patent compounds (3.6%) also appear in a journal article or other non-patent source. In practice, patents are a separate, mostly unpublished chemistry collection.
  • Since 2015, patents add more compounds per year than journal articles do: 47–91 k per year against about 24–36 k (Figure 1). The drop in articles after 2023 is curation lag, not a real decline.
  • A typical patent reports 42 compounds (median; 90th percentile 247; maximum 2,689 in US12581252-B2, PI3Kα). 60% of patents report data on only one target.

What is being patented¶

For each patent I took its lead target (the one with the most compounds measured, pooling mutants and constructs by UniProt accession), so that safety-panel targets don't inflate the counts. hERG (119 patents) and CYP3A4 (108) appear in more than 100 patents each, but almost always as off-targets.

Most-patented lead targets overall: BTK (178), JAK2 (163), EGFR (104), BACE1 (103), BRD4 (96), PI3Kδ (91), LSD1 (86), RORγt (82), IRAK4 (80), Nav1.7 (74), FGFR1 and JAK1 (68 each). The JAK family as a whole (JAK1, JAK2, JAK3, TYK2) is the lead target of 291 patents. If every target measured counts, the JAK family leads (JAK2 246, JAK1 234, JAK3 195, TYK2 152), along with BTK (226) and EGFR (156).

A caution on the lead-target split: in 1,760 patents (20%) two or more targets tie for the most compounds, typically JAK panels that test every compound on JAK1, JAK2, JAK3 and TYK2. Ties go to the target with more measurements, then to the lower UniProt accession, which favours JAK2 (O60674) over JAK1 (P23458). So read JAK2 vs JAK1 as "JAK family", not as a real preference.

Class mix (Figure 2):

  • Kinases are the largest single class and steady to growing: 29% of patents in 2013–17, 32% in 2022–26 (33% in 2025).
  • GPCRs fell from 20% (2013) to 7% (2025), and proteases from about 10% to 4–5%.
  • Epigenetic targets rose from about 2% to 7–9% by 2017–2022 and are around 6–8% now.
  • Small but rising classes: E3 ligase / degrader patents (cereblon), phosphatases (almost all SHP2) and immuno-oncology targets. The immuno-oncology group (PD-L1, IDO1, STING, CD73) peaked at 5.9% in 2022 and has declined since (2.7% in 2025).

Rising and falling targets (Figure 3)¶

Comparing 2013–17 (2,752 patents) with 2022–26 (3,425 patents):

  • Newly crowded: HPK1/MAP4K1 (0 → 44 patents), SARS-CoV-2 pp1a/Mpro (0 → 41) and pp1ab (0 → 31), KRAS (0 → 41), RIPK1 (1 → 35), SHP2 (3 → 35), small-molecule PD-1/PD-L1 (0 → 31), cereblon (0 → 29, plus 19 for the DDB1–cereblon complex), 5-HT2A (9 → 38, largely psychedelic-derived agonists for CNS indications), STING (0 → 23), RET (2 → 25), IRAK4 (11 → 36), DGKα (0 → 21) and TYK2 (1 → 19).
  • Largely abandoned: BACE1 (80 → 1) and PDE10A (53 → 3) after their clinical failures, plus Nav1.7 (40 → 8), SYK (28 → 6), RORγt (29 → 9), OX1R (24 → 5) and OX2R (19 → 6), S1P1 (19 → 2), PIM1 (19 → 4), c-MET (22 → 8), VEGFR2 (23 → 9) and PI3Kδ (33 → 19). BTK is still the largest lead target but has lost share (56 → 50).

Title and abstract keyword trends (2013–17 → 2022–26): degrader/PROTAC 8 → 107, KRAS 0 → 53, deuterated compounds 6 → 70, macrocycles 23 → 63, COVID/coronavirus 0 → 80. Pain (198 → 97) and psychiatric (197 → 96) patents roughly halved, while oncology patents grew from 741 to 1,201.

Saturation by target. Among the 171 targets with at least 3,000 compounds, patents now hold almost all of the known chemistry for several: 93% of HPK1 compounds come from patents, 91% for IRAK4, 90% for RIPK1, 88% for KRAS and TYK2, and 96–100% for PD-L1, complement factor D, DGKα/ζ and SARS-CoV-2 pp1a. Classic academic targets are the opposite: acetylcholinesterase, butyrylcholinesterase, carbonic anhydrases I, IX and XII, the D2 dopamine, μ-opioid and adenosine A1 receptors are each 2% or less patent-derived.

Potency and molecular properties (Figure 4)¶

Patent data are about 0.6–1.3 log units more potent than literature data (exact values only): median pIC50 7.2 vs 6.4, pKi 7.6 vs 7.0, pKd 7.7 vs 6.4 and pEC50 7.2 vs 6.4. 26% of patent IC50 values are 10 nM or better, compared with 15% in the literature. This reflects the bias of optimized patent series and claim-supporting examples.

Patent molecules are getting larger. The share above 500 Da rose from 24% (2014) to 43% (2025), and the median MW from 438 to 482. Patent compounds are also larger than literature compounds from the same period (2013–2023: median MW 462 vs 422), though literature compounds are growing too (median 400 in 2013, 434 in 2022). Degraders, macrocycles and KRAS/PPI chemistry drive the increase.

Caveats¶

  • BindingDB holds no assignee data, only inventor names, so this analysis cannot rank companies.
  • Coverage is essentially US-only and selective: these are patents BindingDB chose to curate, not the full patent record.
  • Patent "year" is the publication or grant year, so trends lag filing by 2–4 years. 2026 is a partial year.
  • Target classes come from keyword rules on target names, which are approximate (about a fifth to a third of patents fall in "Other enzymes & proteins": autotaxin, PARP1, KRAS, IDH1, BCL-2 and the like). Lead targets are ambiguous in the 20% of patents with ties (see above).

What changed since the 202610 version of this example¶

The headline picture is the same (patents are 42% of measurements, a separate chemistry collection, more potent and larger molecules, kinases first, BACE1 and PDE10A abandoned, HPK1, KRAS, SHP2, cereblon and SARS-CoV-2 rising). Some numbers moved because of how they were computed here: lead targets now pool mutants and constructs by UniProt accession with a deterministic tie-break (which moves EGFR and JAK2 up the lead-target list, and FGFR1 and HDAC1 down), kinase classes now include receptor tyrosine kinases whose names lack the word "kinase" (EGFR, FGFR, VEGFR, c-MET, TRKA), so kinases are about 30% rather than 23–28%, and potency medians use exact values only, which narrows the patent-vs-literature gap from about 1 log unit to 0.6–0.8 for IC50 and Ki. KRAS (0 → 41 lead-target patents) now enters the rising list.

How this was answered¶

Sixteen run_sql queries on activity (with article for titles and abstracts and compound_property for molecular weight): patent kinds, scale and overlap, per-year documents and compounds, compounds per patent, lead targets (one row per patent and UniProt accession, then the top one per patent), class mix, rising and falling targets, keyword trends, patent share per target, potency and molecular weight. The figures were drawn with matplotlib from those results (plot_patent_landscape.py).

Try next

  • "Which compounds in HPK1 patents are the most potent?" — find_ligands_for_target on MAP4K1
  • "How selective are the TYK2 patent compounds over JAK1 and JAK2?" — selectivity_matrix
  • Example 8.4 looks at censored values ('>' and '<'), which this analysis left out of the potency comparison

Verification¶

How each rerun call compared with its recorded result.

In [ ]:
replay.summary()

Recorded: 16 tool calls. Run all cells to compare.

How to cite¶

Cite this notebook (for example deposited with a DOI) together with the data and software it ran on:

  • Data: BindingDB release 202611, https://www.bindingdb.org/rwd/bind/BDB-mySQL_All_202611_dmp.zip (SHA-256 daea9260d404919a183ce02d91bf4b9c49b410bea7eaaeba105c8e0280510381)
  • Software: mcp-bindingdb v0.1.17, commit 79dae5d22c0f15b8ded9b49adc8b105f0463703a, https://github.com/sbl-sdsc/mcp-bindingdb
  • Analysis: Example 8.3 — Patent landscape in BindingDB, 2026-11-23, with claude-opus-5-5
  • BindingDB: Liu T, Hwang L, Burley SK, Nitsche CI, Southan C, Walters WP, Gilson MK. BindingDB in 2024: a FAIR knowledgebase of protein-small molecule binding data. Nucleic Acids Research 53(D1):D1633-D1644, 2025. https://doi.org/10.1093/nar/gkae1075

As BibTeX, for this server, BindingDB and RDKit (used for structure search, properties and drawings):

@software{rose2026mcp-bindingdb,
  title={MCP BindingDB Server},
  author={Rose, P.W.},
  year={2026},
  url={https://github.com/sbl-sdsc/mcp-bindingdb}
}

@article{liu2025bindingdb,
  title={BindingDB in 2024: a FAIR knowledgebase of protein-small molecule binding data},
  author={Liu, T. and Hwang, L. and Burley, S.K. and Nitsche, C.I. and Southan, C. and Walters, W.P. and Gilson, M.K.},
  journal={Nucleic Acids Research},
  volume={53},
  number={D1},
  pages={D1633--D1644},
  year={2025},
  doi={10.1093/nar/gkae1075}
}

@software{rdkit,
  title={RDKit: Open-source cheminformatics},
  author={Landrum, G. and others},
  version={2026.03.6},
  url={https://www.rdkit.org},
  doi={10.5281/zenodo.591637}
}