LigASeqLigB_v2_potency

Potency ranking model, version 2. 1,024-bit Morgan baseline. Built and measured 10 August 2026.

Revision 1.2, 13 August 2026. Limitations and the novelty stratification of this test set: kinasefoundationmodel.com/v2/limitations.html. Removed a binomial standard-error statement: the comparisons share compounds and are drawn with replacement, so they are not independent observations and no such interval applies. Treat pooled figures as descriptive.

What the model does

Given two ligands and one protein sequence, it predicts which of the two ligands is more potent against that sequence. It is used to rank order molecules against a single target. No protein structure and no docked pose are used; the protein enters only as a sequence embedding.

How the model works

Two ligands and one kinase sequence enter a random forest, which returns which ligand binds more tightly
Ligand A, the protein sequence, and ligand B enter as one row, in that order. Each ligand becomes a 1,024-bit Morgan count fingerprint plus 14 descriptors; the sequence becomes 480 ESM2 numbers. The forest returns the probability that ligand A is the more potent of the two. The worked case shown is the one in the next section: bosutinib against a pyrazolo[3,4-d]pyrimidine on ABL1, where the model returns 0.846 for bosutinib, correctly.

Input — one row of 2,556 numbers, in this exact order

BlockPositionContentsWidth
1firstLigand A — Morgan count fingerprint, radius 2, 1,024 bits, followed by 14 descriptors1,038
2middleProtein sequence — ESM2-t12-35M, mean-pooled over residues, first 480 dimensions480
3lastLigand B — identical encoder to block 11,038
Total2,556
row = [ ligand A (1038) | sequence (480) | ligand B (1038) ]

The 14 descriptors follow the fingerprint in this fixed order: MolWt, HeavyAtomCount, NumBonds, NumRotatableBonds, RingCount, then the atom counts of C, N, O, S, F, Cl, Br, I, P. Blocks 1 and 3 use the same encoder, so a ligand produces the same 1,038 numbers wherever it appears.

Output

A RandomForestClassifier with two classes. predict_proba returns two values that sum to 1, in the order [p(0), p(1)].

ValueMeaning
1Ligand A is more potent than ligand B against that sequence
0Ligand B is more potent than ligand A against that sequence

Swapping the two ligands reverses the answer. Measured on the output values, the mean departure from exact reversal is 0.0271.

Training set

Source: the Eidogen-Sertanty Kinase Knowledgebase, Q2-2026 release (data/kkb_classifier_train_full.csv). No ChEMBL, no BindingDB, no other source. Targets are keyed by sequence, so a mutant is a target in its own right.

QuantityCount
KKB rows in the pull841,187
Distinct (sequence, ligand) measurements841,123
Measurements retained after featurisation840,692
  measurements lost in total431
    because the sequence had no ESM2 vector9 sequences
    because RDKit could not parse the SMILES291 ligands
Distinct targets733
  of those, with 2 or more ligands700
Distinct ligands302,999
Ligand pairs that exist on a shared target2,229,954,204
Distinct triples actually trained on15,256,017
Training rows after the A/B swap40,056,452
Ligands that reached the model302,863 of 302,999 (100.0%)
Targets that reached the model695 of 700 (99.3%)

Every training comparison is entered twice, once as given and once with the two ligands and the label both reversed. Pairs whose two measurements are identical exact values are entered with the same label in both orders, so the model returns about 0.5 for them.

Test set

Source: ChEMBL, chembl_kkb_kinase_activities.csv, pulled 4 August 2026, 865,549 rows over 534 accessions. Structures for every compound were resolved from the ChEMBL API at 100% coverage.

Exclusion rule. A ChEMBL comparison is removed only if that exact ligand-target-ligand triple was actually drawn into training. Nothing else is withheld. A ligand is never excluded on its own account, and a comparison is kept even when both of its ligands appear elsewhere in KKB.

QuantityCount
ChEMBL measurements on our panel, exact relation, with a pChEMBL value379,587
  targets494
  compounds221,641
ChEMBL comparisons available786,926,015
Comparisons scored1,836,100
  targets covered477
  removed because the exact triple was trained on163,900

The scored set is drawn on an even quota per target so that heavily studied kinases do not dominate.

A note on aggregation, so no number here is misread. Every figure in this report is measured with single-order scoring, which is how the evaluation script scores each comparison. The shipped predict.py averages both ligand orders and measures 0.6928 on the identical 1,836,100 comparisons. The numbers below are therefore a conservative floor for what the deployed model does, never an overstatement. Same model, same weights, same test set; only the inference-time aggregation differs.

Results

Training set
0.888
pairs the model was fitted on
ChEMBL test set
0.690
1,836,100 comparisons, 477 targets
Reversal error
0.027
on the output values
Potency gap between the two ligandsComparisonsAccuracy
under 0.5 log517,0170.565
0.5 to 1 log430,8940.653
1 to 2 logs548,6920.744
over 2 logs339,4970.838
all1,836,1000.690
How many of the two ligands are new to KKBComparisonsAccuracy
neither1,029,9410.726
one541,0310.673
both265,1280.582

Methods — how a model this size was trained

The full training set cannot be fitted in one pass. There are 2,229,954,204 ligand pairs on a shared target, and one row of 2,556 float32 values is 10,224 bytes, so even a single million rows is 10.2 GB. Fitting all of it at once would need terabytes.

The model was therefore trained incrementally, in chunks, and the resulting forests were pooled into one. A random forest is an ensemble of independently grown trees, so forests fitted on different samples can be merged by concatenating their trees. The merged model predicts by averaging votes over every tree it holds. This is ordinary bagging, with the bags drawn from a pool larger than memory rather than from a table that fits in it.

The procedure, run exactly as follows:

  1. Draw about 1.33 million ligand pairs, on an even quota per target so that heavily screened kinases do not crowd out the rest. A target that cannot fill its quota contributes every pair it has, and the remainder is redistributed to targets that can.
  2. Enter each pair twice, once as ligand A against ligand B and once reversed with the label reversed with it. That gives about 2.67 million rows, a design matrix of 25.4 GB.
  3. Fit a 20-tree forest on that chunk, using every core, and write it to disk.
  4. Discard the chunk from memory and repeat with a fresh draw under a new seed.
  5. After 15 chunks, pool the 15 forests into a single 300-tree model.

Chunks were run sequentially, each using all cores. A single random forest fit already parallelises across cores, so running several fits concurrently would not have been faster and would have risked memory contention. Every chunk was checkpointed as it completed, so an interruption would have cost one chunk rather than the run. The 15 checkpoints are retained alongside the pooled model as evidence that it is the sum of the runs described.

The minimum leaf size of 20 is what keeps the artifact deliverable. Tree size grows as roughly twice the row count divided by the leaf floor, so the leaf size of 2 used in version 1.1 would have produced a pooled model in the tens of gigabytes rather than 0.76 GB.

Across the 15 chunks the model saw 15,256,017 distinct triples, which is 0.684% of the pairs that exist, but 302,863 of 302,999 ligands and 695 of 700 usable targets reached it. What is sampled is which pairings are used, not which ligands or which targets.

Prediction strength and accuracy

Prediction strength is the larger of the two output probabilities, so it runs from 0.5, a coin flip, to 1.0. Accuracy rises with it on both sets.

Prediction strengthTraining setChEMBL test set
ComparisonsShareAccuracyComparisonsShareAccuracy
0.5 to 0.6100,69625.2%0.671905,43352.7%0.584
0.6 to 0.795,48723.9%0.900462,74526.9%0.746
0.7 to 0.894,98623.8%0.980209,10512.2%0.832
0.8 to 0.977,94619.5%0.99690,3635.3%0.850
0.9 to 1.030,8857.7%0.99851,4503.0%0.872

Acting only on predictions at or above a threshold. The point of this table is the trade: accuracy rises as the threshold rises, but the number of comparisons you can still answer falls away. The right cutoff is where the accuracy is worth the predictions you give up.

Act only at strengthTraining set (of 400,000)ChEMBL test set (of 1,719,096)
Predictions keptShareAccuracyPredictions keptShareAccuracy
0.50 — answer everything400,000100.0%0.8881,719,096100.0%0.680
0.60299,30474.8%0.961813,66347.3%0.788
0.70203,81750.9%0.989350,91820.4%0.842
0.80108,83127.2%0.997141,8138.2%0.858
0.9030,8857.7%0.99851,4503.0%0.872

On the test set the accuracy gained per prediction surrendered falls off sharply after 0.70. Going from 0.50 to 0.70 buys 16 accuracy points and costs 80% of the answers. Going from 0.70 to 0.90 buys only 3 more points and costs 85% of what remained. On that reading 0.70 is the useful operating point: a fifth of all comparisons answered at 0.842 against a 0.680 baseline.

The relationship holds on unseen ChEMBL data: acting only on predictions at 0.7 or above covers a fifth of comparisons at 0.842 accuracy, against 0.680 across the board. Note that the strength value does not mean the same thing on the two sets. On the training pairs a 0.7 prediction is right 98% of the time; on ChEMBL the same 0.7 is right 84% of the time. The ordering is reliable, the absolute number is not transferable.

Test figures here are computed over 1,719,096 comparisons drawn under the same even-quota rule; the headline 0.690 is over the 1,836,100-comparison draw in the Results section. The two draws differ only by sampling.

Worked example

One comparison, end to end, drawn from the training set. The target is ABL1; the RCSB entry 3UE4 is the ABL1 kinase domain in complex with bosutinib, which is ligand A here. The classic ABL1 structure 2HYY, the kinase domain with imatinib, is an alternative reference for the same protein.

Ligand ALigand B
SMILESCOc1cc(Nc2c(cnc3cc(OCCCN4CCN(C)CC4)c(OC)cc23)C#N)c(Cl)cc1ClCC(C)n1nc(c2cccnc2)c3c(N)ncnc13
Identitybosutinibpyrazolo[3,4-d]pyrimidine, PP1-type scaffold
Measured pIC50 against ABL18.9594.495

The two molecules share almost no substructure: Tanimoto similarity 0.075 on Morgan radius-2 fingerprints. The measured potency gap is 4.46 log units.

QueryModel output
p(ligand A more potent), order A then B0.846
p(ligand A more potent), order B then A0.151

The model picks bosutinib, which is correct. Swapping the two ligands moves the output from 0.846 to 0.151; the two sum to 0.997 against an ideal 1.000, so the answer reverses as the architecture requires.

Model

PropertyValue
EstimatorRandomForestClassifier
Trees300, pooled from 15 fits of 20 trees
Minimum samples per leaf20
Features considered per splitsqrt, about 50 of 2,556
Seeds0 through 14, one per chunk
Filemodels/LigASeqLigB_v2_potency/LigASeqLigB_v2_potency.joblib, 0.76 GB

Each fit used about 1.33 million pairs, 2.67 million rows after the swap. The 15 forests were then merged into one by pooling their trees, so the single delivered model averages votes over all 300.

Authority

Every number above comes from data/LigASeqLigB_v2_potency_results.json, data/LigASeqLigB_v2_potency_insample_and_exclusion.json and the audit in scripts/235_ligaseqligb_v2_potency_data_audit.py. The specification is LIGASEQLIGB_SPEC.md.