@holoscript/structural-biology-plugin 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,657 @@
1
+ /**
2
+ * @holoscript/structural-biology-plugin — AutoDock binding affinity bridge.
3
+ *
4
+ * Provides configuration, result, and trait interfaces for molecular docking
5
+ * via AutoDock-GPU / AutoDock Vina. Wires into core's existing `auto_dock`
6
+ * and `binding_affinity` scientific-computing traits.
7
+ *
8
+ * Architecture follows the qm-bridge pattern: each docking backend implements
9
+ * DockingSolver (which extends the SimSolver contract for steady-state
10
+ * molecular docking), and participates in the same SimulationContract / CAEL
11
+ * recording / Brittney dispatch pipeline.
12
+ *
13
+ * @module docking
14
+ */
15
+ type DockingBackend = 'autodock-gpu' | 'autodock-vina' | 'gnina';
16
+ interface DockingConfig {
17
+ /** Docking engine backend */
18
+ backend: DockingBackend;
19
+ /** Receptor protein (PDB data or PDBQT string) */
20
+ receptor: string;
21
+ /** Ligand (SMILES, PDBQT, or SDF) */
22
+ ligand: string;
23
+ /** Search space center x */
24
+ centerX: number;
25
+ /** Search space center y */
26
+ centerY: number;
27
+ /** Search space center z */
28
+ centerZ: number;
29
+ /** Search space size x (Angstroms) */
30
+ sizeX: number;
31
+ /** Search space size y (Angstroms) */
32
+ sizeY: number;
33
+ /** Search space size z (Angstroms) */
34
+ sizeZ: number;
35
+ /** Number of docking runs (exhaustiveness in Vina terms) */
36
+ numRuns?: number;
37
+ /** Energy range for Vina: max energy difference from best mode (kcal/mol) */
38
+ energyRange?: number;
39
+ /** Maximum number of binding modes to output */
40
+ maxModes?: number;
41
+ /** Flexible receptor residues (for induced-fit docking) */
42
+ flexibleResidues?: string[];
43
+ /** Scoring function variant */
44
+ scoringFunction?: 'vina' | 'ad4' | 'vinardo' | 'gnina_default';
45
+ /** GPU device index for AutoDock-GPU (-1 for CPU fallback) */
46
+ gpuDevice?: number;
47
+ /** Number of LGA runs for AutoDock-GPU */
48
+ lgaRuns?: number;
49
+ /** Population size for AutoDock-GPU LGA */
50
+ popSize?: number;
51
+ }
52
+ interface DockingPose {
53
+ /** Binding affinity in kcal/mol */
54
+ affinity: number;
55
+ /** Root-mean-square deviation from reference (lower bound) */
56
+ rmsdLb: number;
57
+ /** Root-mean-square deviation from reference (upper bound) */
58
+ rmsdUb: number;
59
+ /** Pose PDBQT data */
60
+ poseData: string;
61
+ /** Intermolecular energy (kcal/mol) */
62
+ intermolEnergy?: number;
63
+ /** Internal energy (kcal/mol) */
64
+ internalEnergy?: number;
65
+ /** Torsional energy (kcal/mol) */
66
+ torsionalEnergy?: number;
67
+ }
68
+ interface DockingResult {
69
+ status: 'success' | 'failed';
70
+ /** Best binding affinity (kcal/mol, most negative = strongest binding) */
71
+ bestAffinity?: number;
72
+ /** All poses from the docking run, sorted by affinity */
73
+ poses: DockingPose[];
74
+ /** Receptor identifier */
75
+ receptorId: string;
76
+ /** Ligand identifier (SMILES or name) */
77
+ ligandId: string;
78
+ /** Backend used */
79
+ backend: DockingBackend;
80
+ /** Execution time in milliseconds */
81
+ executionTimeMs?: number;
82
+ /** AutoDock-GPU specific: number of LGA runs completed */
83
+ lgaRunsCompleted?: number;
84
+ /** Error message if status is 'failed' */
85
+ error?: string;
86
+ }
87
+ /**
88
+ * @auto_dock trait — Automated molecular docking configuration.
89
+ * Wires to core's existing `auto_dock` scientific-computing trait.
90
+ */
91
+ interface AutoDockTrait {
92
+ trait: 'auto_dock';
93
+ /** Docking backend */
94
+ backend: DockingBackend;
95
+ /** Receptor PDBQT or PDB data */
96
+ receptor: string;
97
+ /** Ligand SMILES, PDBQT, or SDF */
98
+ ligand: string;
99
+ /** Search box center {x, y, z} in Angstroms */
100
+ searchCenter: {
101
+ x: number;
102
+ y: number;
103
+ z: number;
104
+ };
105
+ /** Search box dimensions {x, y, z} in Angstroms */
106
+ searchSize: {
107
+ x: number;
108
+ y: number;
109
+ z: number;
110
+ };
111
+ /** Number of docking runs */
112
+ numRuns?: number;
113
+ /** Scoring function variant */
114
+ scoringFunction?: 'vina' | 'ad4' | 'vinardo' | 'gnina_default';
115
+ }
116
+ /**
117
+ * @binding_affinity trait — Binding affinity metrics result.
118
+ * Wires to core's existing `binding_affinity` scientific-computing trait.
119
+ */
120
+ interface BindingAffinityTrait {
121
+ trait: 'binding_affinity';
122
+ /** Best binding affinity (kcal/mol) */
123
+ bestAffinity: number;
124
+ /** Number of poses */
125
+ poseCount: number;
126
+ /** RMSD range (lower, upper) for best pose */
127
+ bestRmsdRange: [number, number];
128
+ /** Backend used */
129
+ backend: DockingBackend;
130
+ /** Ki (inhibition constant) in nM, derived from affinity */
131
+ ki_nm?: number;
132
+ /** Percentage of poses below threshold affinity */
133
+ hitRate?: number;
134
+ }
135
+ /**
136
+ * DockingSolver — steady-state SimSolver for molecular docking.
137
+ *
138
+ * Extends the core SimSolver contract for docking workloads. `solve()`
139
+ * executes the docking run and returns the result. `step()` is a no-op
140
+ * (docking is steady-state, not transient). Output fields are accessible
141
+ * via `getField()` after `solve()` completes.
142
+ *
143
+ * Follows the qm-bridge factory pattern: `createDockingSolver(config)`
144
+ * returns a backend-specific instance.
145
+ */
146
+ interface DockingSolver {
147
+ /** Docking is always steady-state */
148
+ readonly mode: 'steady-state';
149
+ /** Available output field names */
150
+ readonly fieldNames: readonly string[];
151
+ /** Backend identifier */
152
+ readonly backend: DockingBackend;
153
+ /** Execute the docking computation */
154
+ solve(): Promise<DockingResult>;
155
+ /** Retrieve a named output field after solve() */
156
+ getField(name: string): Float32Array | Float64Array | null;
157
+ /** Solver statistics (run count, timing, convergence) */
158
+ getStats(): Record<string, unknown>;
159
+ /** Release resources */
160
+ dispose(): void;
161
+ }
162
+ /**
163
+ * Convert an AutoDockTrait (domain-level) to a DockingConfig (solver-level).
164
+ * This bridges the plugin trait vocabulary to the solver configuration format.
165
+ */
166
+ declare function traitToConfig(trait: AutoDockTrait): DockingConfig;
167
+ /**
168
+ * Compute a provenance anchor for a docking result, linking it back to the
169
+ * structural-biology plugin identity and the specific receptor-ligand pair.
170
+ */
171
+ declare function dockingProvenance(result: DockingResult): string;
172
+ /**
173
+ * Select the appropriate docking backend based on a question or use case.
174
+ *
175
+ * - 'autodock-gpu': High-throughput screening, large grid searches, GPU-accelerated
176
+ * - 'autodock-vina': Standard docking, widely validated, good default
177
+ * - 'gnina': CNN scoring, pose prediction with ML re-scoring
178
+ */
179
+ declare function selectDockingBackend(questionType: string): DockingBackend;
180
+ type DockingCompileFormat = 'pdbqt' | 'sdf' | 'csv' | 'holo';
181
+ interface DockingCompileOptions {
182
+ format?: DockingCompileFormat;
183
+ }
184
+ /**
185
+ * Compile AutoDock and BindingAffinity traits into a target representation.
186
+ *
187
+ * - `pdbqt` — PDBQT with REMARK lines (default, AutoDock-native)
188
+ * - `sdf` — MDL MOL/SDF with docking annotations
189
+ * - `csv` — CSV table of pose affinities and RMSD values
190
+ * - `holo` — HoloScript .holo composition
191
+ */
192
+ declare function compileDocking(traits: Array<AutoDockTrait | BindingAffinityTrait>, opts?: DockingCompileOptions): string;
193
+
194
+ /**
195
+ * @holoscript/structural-biology-plugin — ADMET prediction bridge.
196
+ *
197
+ * Absorption, Distribution, Metabolism, Excretion, and Toxicity (ADMET)
198
+ * prediction traits and interfaces. Extends the structural-biology plugin
199
+ * from structure (AlphaFold) to function (drug-likeness and safety).
200
+ *
201
+ * ADMET models predict whether a molecule is likely to be a viable drug
202
+ * candidate BEFORE expensive synthesis and testing. This bridge wires into
203
+ * the provenance chain so that ADMET predictions carry the same plugin-identity
204
+ * provenance as protein/ligand objects.
205
+ *
206
+ * Backend options:
207
+ * - 'rdkit': Rule-based and ML models via RDKit (Python, fast, well-validated)
208
+ * - 'admetlab': ADMETlab 3.0 web service (comprehensive, 47 endpoints)
209
+ * - 'local-ml': On-device ONNX/Rust ML models (offline, latency-critical)
210
+ *
211
+ * @module admet
212
+ */
213
+ declare const ADMET_PROPERTIES: readonly ["caco2_permeability", "hia", "pgp_substrate", "pgp_inhibitor", "bbb_permeability", "cns_permeability", "vdss", "fraction_unbound", "ppb", "cyp2d6_substrate", "cyp3a4_substrate", "cyp1a2_inhibitor", "cyp2c19_inhibitor", "cyp2c9_inhibitor", "cyp2d6_inhibitor", "cyp3a4_inhibitor", "cyp2d6_inhibitor_v2", "half_life", "clearance", "hht", "ames", "dili", "skin_sensitization", "carcinogenesis", "rat_oral_ld50"];
214
+ type AdmetProperty = (typeof ADMET_PROPERTIES)[number];
215
+ type AdmetBackend = 'rdkit' | 'admetlab' | 'local-ml';
216
+ interface AdmetConfig {
217
+ /** Prediction backend */
218
+ backend: AdmetBackend;
219
+ /** Molecule in SMILES notation */
220
+ smiles: string;
221
+ /** Which ADMET properties to predict (empty = all) */
222
+ properties?: AdmetProperty[];
223
+ /** Confidence threshold for binary predictions (0.0-1.0) */
224
+ confidenceThreshold?: number;
225
+ /** Include uncertainty estimates */
226
+ includeUncertainty?: boolean;
227
+ }
228
+ interface AdmetPrediction {
229
+ /** ADMET property name */
230
+ property: AdmetProperty;
231
+ /** Predicted value (numeric) or probability (binary) */
232
+ value: number;
233
+ /** Unit of measurement (e.g., 'logPapp', '%', 'binary', 'L/kg') */
234
+ unit: string;
235
+ /** Prediction confidence (0.0-1.0) */
236
+ confidence: number;
237
+ /** Lower bound of 95% CI (if includeUncertainty) */
238
+ lower?: number;
239
+ /** Upper bound of 95% CI (if includeUncertainty) */
240
+ upper?: number;
241
+ /** Model version */
242
+ modelVersion: string;
243
+ }
244
+ interface AdmetResult {
245
+ status: 'success' | 'failed';
246
+ /** Input SMILES */
247
+ smiles: string;
248
+ /** Backend used */
249
+ backend: AdmetBackend;
250
+ /** Individual property predictions */
251
+ predictions: AdmetPrediction[];
252
+ /** Overall drug-likeness score (0.0-1.0, heuristic composite) */
253
+ drugLikenessScore?: number;
254
+ /** Lipinski Rule of 5 compliance */
255
+ lipinskiViolations?: number;
256
+ /** Execution time in milliseconds */
257
+ executionTimeMs?: number;
258
+ /** Error message if status is 'failed' */
259
+ error?: string;
260
+ }
261
+ /**
262
+ * @admet_prediction trait — Predict ADMET properties for a molecule.
263
+ *
264
+ * This trait connects to core's scientific-computing trait namespace and
265
+ * represents a request to compute absorption, distribution, metabolism,
266
+ * excretion, and toxicity properties from a molecular structure.
267
+ */
268
+ interface AdmetPredictionTrait {
269
+ trait: 'admet_prediction';
270
+ /** Molecule in SMILES notation */
271
+ smiles: string;
272
+ /** Which properties to predict (empty = all) */
273
+ properties?: AdmetProperty[];
274
+ /** Backend to use */
275
+ backend?: AdmetBackend;
276
+ /** Confidence threshold for binary predictions */
277
+ confidenceThreshold?: number;
278
+ }
279
+ /**
280
+ * @admet_result trait — ADMET prediction result for provenance tracking.
281
+ *
282
+ * Carries the predicted ADMET properties alongside plugin identity so that
283
+ * downstream consumers can verify which plugin produced the prediction.
284
+ */
285
+ interface AdmetResultTrait {
286
+ trait: 'admet_result';
287
+ /** Input SMILES */
288
+ smiles: string;
289
+ /** Drug-likeness composite score */
290
+ drugLikenessScore: number;
291
+ /** Number of Lipinski violations */
292
+ lipinskiViolations: number;
293
+ /** Number of properties predicted */
294
+ propertyCount: number;
295
+ /** Backend used */
296
+ backend: AdmetBackend;
297
+ /** Pass/fail summary — true if drug-likeness > 0.5 and lipinskiViolations <= 1 */
298
+ passes: boolean;
299
+ }
300
+ /**
301
+ * Compute Lipinski Rule of 5 violations for a SMILES string.
302
+ *
303
+ * This is a simplified heuristic count. A full implementation would use
304
+ * RDKit to compute exact molecular weight, logP, HBD, HBA from the SMILES.
305
+ * Here we count violations based on estimated properties.
306
+ *
307
+ * Lipinski rules:
308
+ * 1. MW <= 500 Da
309
+ * 2. logP <= 5
310
+ * 3. HBD <= 5
311
+ * 4. HBA <= 10
312
+ *
313
+ * Returns the number of rules violated (0-4).
314
+ */
315
+ declare function countLipinskiViolations(smiles: string): number;
316
+ /**
317
+ * Compute a heuristic drug-likeness score (0.0-1.0) from ADMET predictions.
318
+ *
319
+ * Weighted composite of:
320
+ * - Lipinski compliance (0 violations → 1.0, each violation → -0.2)
321
+ * - BBB permeability (if predicted, favorable → +0.15)
322
+ * - HIA (if predicted, >80% → +0.1)
323
+ * - Toxicity flags (any positive → -0.25 per flag)
324
+ * - Half-life in therapeutic range (5-24h → +0.1)
325
+ */
326
+ declare function computeDrugLikeness(predictions: AdmetPrediction[], lipinskiViolations: number): number;
327
+ /**
328
+ * Select the appropriate ADMET backend based on question type.
329
+ *
330
+ * - 'rdkit': Fast, rule-based + ML, good for screening
331
+ * - 'admetlab': Comprehensive 47-endpoint prediction, web service
332
+ * - 'local-ml': On-device, offline, latency-critical
333
+ */
334
+ declare function selectAdmetBackend(questionType: string): AdmetBackend;
335
+ /**
336
+ * Compute a provenance anchor for an ADMET prediction, linking it back to the
337
+ * structural-biology plugin identity and the input SMILES.
338
+ */
339
+ declare function admetProvenance(result: AdmetResult): string;
340
+ type AdmetCompileFormat = 'csv' | 'json' | 'sdf' | 'holo';
341
+ interface AdmetCompileOptions {
342
+ format?: AdmetCompileFormat;
343
+ }
344
+ /**
345
+ * Compile ADMET traits into a target representation.
346
+ *
347
+ * - `csv` — CSV table of property predictions (default)
348
+ * - `json` — JSON payload for API consumption
349
+ * - `sdf` — MDL SDF with ADMET annotations
350
+ * - `holo` — HoloScript .holo composition
351
+ */
352
+ declare function compileAdmet(traits: Array<AdmetPredictionTrait | AdmetResultTrait>, opts?: AdmetCompileOptions): string;
353
+
354
+ /**
355
+ * @holoscript/structural-biology-plugin — SimulationContract receipt bridge.
356
+ *
357
+ * Connects docking and ADMET results to the HoloScript SimulationContract system.
358
+ * Each docking run and ADMET prediction produces a verifiable receipt that ties
359
+ * the result back to the structural-biology plugin identity and the input
360
+ * parameters, enabling provenance tracking across the drug-discovery pipeline.
361
+ *
362
+ * ## Architecture
363
+ *
364
+ * The docking/ADMET pipeline is steady-state (solve once, not per-frame), so
365
+ * the receipt pattern follows the ContractedSimulation Route 2d convention:
366
+ * a single terminal state digest after solve() completes, rather than per-step
367
+ * digests. The receipt carries:
368
+ *
369
+ * - Plugin identity (structural-biology@version)
370
+ * - Input parameters (receptor, ligand, search box, backend)
371
+ * - Result summary (best affinity, pose count, drug-likeness)
372
+ * - Provenance hash chain (docking provenance + ADMET provenance)
373
+ * - Simulation scale tag ('atomistic' for docking, 'empirical-surrogate' for ADMET)
374
+ *
375
+ * ## Drug-discovery pipeline
376
+ *
377
+ * AlphaFold (structure) → Docking (affinity) → ADMET (safety) → Receipt (provenance)
378
+ *
379
+ * The receipt is the 6th component of the SimContract pattern (per W.058):
380
+ * Config → Solver → Solve → Result → Provenance → Receipt
381
+ *
382
+ * @module receipt
383
+ */
384
+
385
+ /**
386
+ * Simulation scale tags for drug-discovery pipeline stages.
387
+ *
388
+ * - 'atomistic': Molecular docking operates at the atomic scale
389
+ * (inter-atomic potentials, protein-ligand geometry)
390
+ * - 'empirical-surrogate': ADMET prediction uses ML/rule-based models
391
+ * trained on experimental data — empirical surrogates by definition
392
+ */
393
+ type DrugDiscoveryScale = 'atomistic' | 'empirical-surrogate';
394
+ /**
395
+ * Receipt for a molecular docking simulation run.
396
+ *
397
+ * Follows the SimulationContract pattern: config → solver → solve → result →
398
+ * provenance → receipt. The receipt ties the docking result to the input
399
+ * parameters and plugin identity, enabling reproducible provenance tracking.
400
+ *
401
+ * Scale: 'atomistic' — docking operates at inter-atomic potential scale.
402
+ */
403
+ interface DockingReceipt {
404
+ /** Unique receipt ID for this docking run */
405
+ receiptId: string;
406
+ /** ISO-8601 timestamp when this receipt was generated */
407
+ issuedAt: string;
408
+ /** Plugin identity (structural-biology@version) */
409
+ pluginId: string;
410
+ /** Simulation scale — always 'atomistic' for docking */
411
+ scale: 'atomistic';
412
+ /** Docking backend used */
413
+ backend: DockingBackend;
414
+ /** Input configuration (receptor, ligand, search box) */
415
+ config: DockingConfig;
416
+ /** Docking result (best affinity, poses) */
417
+ result: DockingResult;
418
+ /** Provenance hash from dockingProvenance() */
419
+ provenanceHash: string;
420
+ /** Execution time in milliseconds (if available) */
421
+ executionTimeMs?: number;
422
+ /** Whether the docking run succeeded */
423
+ verified: boolean;
424
+ }
425
+ /**
426
+ * Receipt for an ADMET prediction run.
427
+ *
428
+ * Scale: 'empirical-surrogate' — ADMET predictions use ML/rule-based models.
429
+ */
430
+ interface AdmetReceipt {
431
+ /** Unique receipt ID for this ADMET prediction run */
432
+ receiptId: string;
433
+ /** ISO-8601 timestamp when this receipt was generated */
434
+ issuedAt: string;
435
+ /** Plugin identity (structural-biology@version) */
436
+ pluginId: string;
437
+ /** Simulation scale — always 'empirical-surrogate' for ADMET */
438
+ scale: 'empirical-surrogate';
439
+ /** ADMET backend used */
440
+ backend: AdmetBackend;
441
+ /** Input configuration (SMILES, properties) */
442
+ config: AdmetConfig;
443
+ /** ADMET result (predictions, drug-likeness) */
444
+ result: AdmetResult;
445
+ /** Provenance hash from admetProvenance() */
446
+ provenanceHash: string;
447
+ /** Execution time in milliseconds (if available) */
448
+ executionTimeMs?: number;
449
+ /** Whether the ADMET prediction succeeded */
450
+ verified: boolean;
451
+ }
452
+ /**
453
+ * Combined receipt for the full drug-discovery pipeline:
454
+ * AlphaFold structure → Docking → ADMET → Drug-likeness assessment.
455
+ *
456
+ * This is the top-level receipt that chains the three stages together
457
+ * with a composite provenance hash, enabling end-to-end verification
458
+ * from protein structure prediction through drug-likeness assessment.
459
+ */
460
+ interface DrugDiscoveryReceipt {
461
+ /** Unique receipt ID for this pipeline run */
462
+ receiptId: string;
463
+ /** ISO-8601 timestamp when this receipt was generated */
464
+ issuedAt: string;
465
+ /** Plugin identity (structural-biology@version) */
466
+ pluginId: string;
467
+ /** Docking receipt (affinity stage) */
468
+ docking: DockingReceipt;
469
+ /** ADMET receipt (safety stage) */
470
+ admet: AdmetReceipt;
471
+ /** Composite provenance hash (docking + ADMET) */
472
+ compositeProvenanceHash: string;
473
+ /**
474
+ * Overall drug-likeness assessment combining docking affinity
475
+ * and ADMET safety profile.
476
+ */
477
+ assessment: DrugLikenessAssessment;
478
+ }
479
+ /**
480
+ * Drug-likeness assessment combining docking affinity and ADMET safety.
481
+ *
482
+ * This is the "so what" of the pipeline: does the molecule bind well
483
+ * AND pass safety screening? A strong binder that fails ADMET is not
484
+ * a viable drug candidate.
485
+ */
486
+ interface DrugLikenessAssessment {
487
+ /** Best binding affinity (kcal/mol) — more negative = stronger binding */
488
+ bestAffinity: number;
489
+ /** Drug-likeness score (0.0-1.0) from computeDrugLikeness() */
490
+ drugLikenessScore: number;
491
+ /** Number of Lipinski Rule of 5 violations */
492
+ lipinskiViolations: number;
493
+ /** Number of ADMET properties predicted */
494
+ propertyCount: number;
495
+ /** Whether the molecule passes drug-likeness threshold (>0.5 score, <=1 Lipinski violation) */
496
+ passes: boolean;
497
+ /** Ki (inhibition constant) in nM, derived from best affinity */
498
+ ki_nm?: number;
499
+ /** Percentage of docking poses below threshold affinity */
500
+ hitRate?: number;
501
+ /** Human-readable summary */
502
+ summary: string;
503
+ }
504
+ /**
505
+ * Create a receipt for a docking simulation run.
506
+ *
507
+ * This is the primary receipt-emission point for the docking stage.
508
+ * Each docking run produces exactly one receipt that ties the result
509
+ * to the input configuration and plugin identity.
510
+ */
511
+ declare function createDockingReceipt(config: DockingConfig, result: DockingResult): DockingReceipt;
512
+ /**
513
+ * Create a receipt for an ADMET prediction run.
514
+ *
515
+ * Each ADMET prediction produces exactly one receipt that ties the result
516
+ * to the input SMILES and plugin identity.
517
+ */
518
+ declare function createAdmetReceipt(config: AdmetConfig, result: AdmetResult): AdmetReceipt;
519
+ /**
520
+ * Create a composite receipt for the full drug-discovery pipeline.
521
+ *
522
+ * Chains docking receipt + ADMET receipt into a single provenance chain.
523
+ * The composite hash ties both stages together so the pipeline is
524
+ * end-to-end verifiable.
525
+ */
526
+ declare function createDrugDiscoveryReceipt(dockingReceipt: DockingReceipt, admetReceipt: AdmetReceipt): DrugDiscoveryReceipt;
527
+ /**
528
+ * Run the full drug-discovery pipeline: docking → ADMET → receipt.
529
+ *
530
+ * This is the top-level entry point that chains all three stages together.
531
+ * Each stage produces its own receipt, and the composite receipt ties them
532
+ * together for end-to-end provenance.
533
+ *
534
+ * @param dockingConfig - Docking configuration (receptor, ligand, search box)
535
+ * @param dockingResult - Docking result from a DockingSolver
536
+ * @param admetConfig - ADMET configuration (SMILES, properties)
537
+ * @param admetResult - ADMET prediction result
538
+ * @returns Combined drug-discovery receipt
539
+ */
540
+ declare function runDrugDiscoveryPipeline(dockingConfig: DockingConfig, dockingResult: DockingResult, admetConfig: AdmetConfig, admetResult: AdmetResult): DrugDiscoveryReceipt;
541
+ /**
542
+ * Compile a DockingReceipt to HoloScript .holo format.
543
+ */
544
+ declare function compileDockingReceiptToHolo(receipt: DockingReceipt): string;
545
+ /**
546
+ * Compile an AdmetReceipt to HoloScript .holo format.
547
+ */
548
+ declare function compileAdmetReceiptToHolo(receipt: AdmetReceipt): string;
549
+ /**
550
+ * Compile a DrugDiscoveryReceipt to HoloScript .holo format.
551
+ *
552
+ * This is the canonical output format for the drug-discovery pipeline:
553
+ * a .holo composition that chains docking + ADMET + assessment into a
554
+ * single verifiable artifact.
555
+ */
556
+ declare function compileDrugDiscoveryReceiptToHolo(receipt: DrugDiscoveryReceipt): string;
557
+
558
+ /**
559
+ * @holoscript/structural-biology-plugin — protein/ligand/chain + docking + ADMET.
560
+ *
561
+ * Implements the canonical structural-biology vocabulary referenced by
562
+ * paper-12 (HoloLand I3D) §"Comparison with OpenUSD Schema Plugins": three
563
+ * domain object types (`protein`, `ligand`, `chain`) plus annotation traits
564
+ * (`foldable`, `helix`, `sheet`, `residue_anchor`) that compose with the
565
+ * 28 scientific-computing traits in @holoscript/core.
566
+ *
567
+ * v0.2.0 extends the bridge from AlphaFold structure prediction toward
568
+ * binding affinity (AutoDock-GPU / Vina / GNINA) and ADMET prediction
569
+ * (RDKit / ADMETlab / local-ML). This connects "structure" to "function" —
570
+ * the founder direction for quarter-horizon expansion.
571
+ *
572
+ * ## New in v0.2.0 (AlphaFold → Binding/ADMET bridge)
573
+ *
574
+ * - Docking configuration and result types (AutoDock-GPU, Vina, GNINA)
575
+ * - ADMET property prediction types (25 endpoints across A/D/M/E/T)
576
+ * - `auto_dock`, `binding_affinity`, `admet_prediction`, `admet_result` traits
577
+ * wired to core's existing scientific-computing trait namespace
578
+ * - Provenance chain integration for docking and ADMET results
579
+ * - Compile targets: PDBQT, SDF, CSV, JSON, HoloScript .holo
580
+ * - Drug-likeness heuristics (Lipinski Rule of 5, composite score)
581
+ * - Backend selection functions for docking and ADMET
582
+ *
583
+ * @module @holoscript/structural-biology-plugin
584
+ */
585
+ declare const STRUCTURAL_BIOLOGY_OBJECT_TYPES: readonly ["protein", "ligand", "chain"];
586
+ type StructuralBiologyObjectType = (typeof STRUCTURAL_BIOLOGY_OBJECT_TYPES)[number];
587
+ declare const STRUCTURAL_BIOLOGY_TRAITS: readonly ["foldable", "helix", "sheet", "residue_anchor"];
588
+ type StructuralBiologyTraitName = (typeof STRUCTURAL_BIOLOGY_TRAITS)[number];
589
+ /**
590
+ * Bridge traits this plugin contributes that wire into core's existing
591
+ * scientific-computing trait namespace. These are NOT redeclared — they
592
+ * reference `auto_dock`, `binding_affinity` from core's
593
+ * `SCIENTIFIC_COMPUTING_TRAITS` and add `admet_prediction`, `admet_result`
594
+ * as new domain traits.
595
+ */
596
+ declare const BRIDGE_TRAITS: readonly ["auto_dock", "binding_affinity", "admet_prediction", "admet_result"];
597
+ type BridgeTraitName = (typeof BRIDGE_TRAITS)[number];
598
+ interface StructuralBiologyPluginDescriptor {
599
+ /** Stable plugin identity used in the provenance hash chain. */
600
+ id: 'structural-biology';
601
+ version: string;
602
+ objectTypes: readonly StructuralBiologyObjectType[];
603
+ traits: readonly StructuralBiologyTraitName[];
604
+ bridgeTraits: readonly BridgeTraitName[];
605
+ }
606
+ declare const PLUGIN_DESCRIPTOR: StructuralBiologyPluginDescriptor;
607
+ interface PluginHostRegistry {
608
+ registerObjectType(name: string, descriptor: {
609
+ plugin: string;
610
+ }): void;
611
+ registerTrait(name: string, descriptor: {
612
+ plugin: string;
613
+ }): void;
614
+ }
615
+ /**
616
+ * Single registration entry point. Paper-12 §"Comparison with OpenUSD Schema
617
+ * Plugins" claims `register()` is the entire effort on the HoloScript side
618
+ * — this function IS that claim, evaluated for LOC by the comparison harness.
619
+ *
620
+ * v0.2.0: Also registers the 4 bridge traits (auto_dock, binding_affinity,
621
+ * admet_prediction, admet_result) alongside the original annotation traits.
622
+ */
623
+ declare function register(host: PluginHostRegistry): StructuralBiologyPluginDescriptor;
624
+ interface Residue {
625
+ chain: string;
626
+ index: number;
627
+ resname: string;
628
+ secondary?: 'helix' | 'sheet' | 'loop';
629
+ }
630
+ interface ProteinObject {
631
+ type: 'protein';
632
+ name: string;
633
+ uniprot?: string;
634
+ residues: Residue[];
635
+ traits: StructuralBiologyTraitName[];
636
+ }
637
+ interface LigandObject {
638
+ type: 'ligand';
639
+ name: string;
640
+ smiles?: string;
641
+ traits: StructuralBiologyTraitName[];
642
+ }
643
+ interface ChainObject {
644
+ type: 'chain';
645
+ name: string;
646
+ parentProtein: string;
647
+ residueCount: number;
648
+ traits: StructuralBiologyTraitName[];
649
+ }
650
+ type StructuralBiologyObject = ProteinObject | LigandObject | ChainObject;
651
+ declare function residueAnchor(residue: Residue): string;
652
+ declare function chainHash(obj: StructuralBiologyObject): string;
653
+ declare function verifyChain(obj: StructuralBiologyObject, expected: string): boolean;
654
+
655
+ declare const VERSION = "0.2.0";
656
+
657
+ export { ADMET_PROPERTIES, type AdmetBackend, type AdmetCompileFormat, type AdmetCompileOptions, type AdmetConfig, type AdmetPrediction, type AdmetPredictionTrait, type AdmetProperty, type AdmetReceipt, type AdmetResult, type AdmetResultTrait, type AutoDockTrait, BRIDGE_TRAITS, type BindingAffinityTrait, type BridgeTraitName, type ChainObject, type DockingBackend, type DockingCompileFormat, type DockingCompileOptions, type DockingConfig, type DockingPose, type DockingReceipt, type DockingResult, type DockingSolver, type DrugDiscoveryReceipt, type DrugDiscoveryScale, type DrugLikenessAssessment, type LigandObject, PLUGIN_DESCRIPTOR, type PluginHostRegistry, type ProteinObject, type Residue, STRUCTURAL_BIOLOGY_OBJECT_TYPES, STRUCTURAL_BIOLOGY_TRAITS, type StructuralBiologyObject, type StructuralBiologyObjectType, type StructuralBiologyPluginDescriptor, type StructuralBiologyTraitName, VERSION, admetProvenance, chainHash, compileAdmet, compileAdmetReceiptToHolo, compileDocking, compileDockingReceiptToHolo, compileDrugDiscoveryReceiptToHolo, computeDrugLikeness, countLipinskiViolations, createAdmetReceipt, createDockingReceipt, createDrugDiscoveryReceipt, dockingProvenance, register, residueAnchor, runDrugDiscoveryPipeline, selectAdmetBackend, selectDockingBackend, traitToConfig, verifyChain };