Skip to content

Commit 3bcc6b5

Browse files
committed
Add instrument method compatibility graph
1 parent abb4798 commit 3bcc6b5

10 files changed

Lines changed: 1089 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# deepevents.ai
22
deepevents.ai main codebase
3+
4+
- `instrument-method-compatibility-graph/` adds instrument, method, and dataset compatibility checks for scientific knowledge graphs.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Instrument Method Compatibility Graph
2+
3+
This module adds a focused knowledge graph slice for instrument, method, and dataset compatibility.
4+
5+
It covers:
6+
7+
- typed instrument, method, dataset, and experiment nodes
8+
- compatibility edges across instruments, methods, and datasets
9+
- modality, file format, resolution, calibration, and evidence checks
10+
- entity pages for instrument, method, and dataset navigation
11+
- candidate edge recommendations for graph discovery
12+
- curator actions, audit events, and deterministic digests
13+
14+
The implementation is dependency-free and uses synthetic sample data only.
15+
16+
## Run
17+
18+
```bash
19+
npm run check
20+
npm test
21+
npm run demo
22+
```
23+
24+
## Demo Assets
25+
26+
- short demo video: `docs/demo.webm`
27+
- `docs/demo.svg`
28+
29+
## API
30+
31+
```js
32+
import {
33+
evaluateInstrumentMethodCompatibility,
34+
renderInstrumentMethodCompatibilityReport
35+
} from "./src/instrument-method-compatibility-graph.js";
36+
37+
const result = evaluateInstrumentMethodCompatibility(input);
38+
console.log(renderInstrumentMethodCompatibilityReport(result));
39+
```
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"generatedAt": "2026-05-16T17:10:00Z",
3+
"project": {
4+
"id": "kg-neuroimmune-221",
5+
"title": "Neuroimmune Knowledge Map",
6+
"domain": "neuroscience"
7+
},
8+
"instruments": [
9+
{
10+
"id": "inst-confocal-7",
11+
"name": "Confocal Microscope 7",
12+
"modalities": ["imaging"],
13+
"supportedMethodIds": ["method-cell-segmentation", "method-colocalization"],
14+
"calibrationDate": "2026-04-22T00:00:00Z"
15+
},
16+
{
17+
"id": "inst-flow-alpha",
18+
"name": "Flow Cytometer Alpha",
19+
"modalities": ["single-cell"],
20+
"supportedMethodIds": ["method-cell-count"],
21+
"calibrationDate": "2025-11-15T00:00:00Z"
22+
}
23+
],
24+
"methods": [
25+
{
26+
"id": "method-cell-segmentation",
27+
"name": "Cell Segmentation",
28+
"status": "active",
29+
"requiredModalities": ["imaging"],
30+
"acceptedOutputs": ["ome-tiff", "tiff"],
31+
"maxResolutionMicrons": 0.8,
32+
"maxCalibrationAgeDays": 60
33+
},
34+
{
35+
"id": "method-legacy-clustering",
36+
"name": "Legacy Clustering",
37+
"status": "deprecated",
38+
"requiredModalities": ["single-cell"],
39+
"acceptedOutputs": ["fcs"],
40+
"maxCalibrationAgeDays": 120
41+
}
42+
],
43+
"datasets": [
44+
{
45+
"id": "data-glia-images",
46+
"name": "Glia marker image stack",
47+
"modality": "imaging",
48+
"format": "ome-tiff",
49+
"resolutionMicrons": 0.5
50+
},
51+
{
52+
"id": "data-cytokine-fcs",
53+
"name": "Cytokine panel FCS",
54+
"modality": "single-cell",
55+
"format": "fcs",
56+
"resolutionMicrons": 1.2
57+
}
58+
],
59+
"experiments": [
60+
{
61+
"id": "exp-segmentation-01",
62+
"instrumentId": "inst-confocal-7",
63+
"methodId": "method-cell-segmentation",
64+
"datasetId": "data-glia-images",
65+
"evidence": [
66+
{
67+
"id": "ev-segmentation-validation",
68+
"type": "validation",
69+
"status": "ready",
70+
"quality": 0.91
71+
}
72+
]
73+
},
74+
{
75+
"id": "exp-legacy-flow-02",
76+
"instrumentId": "inst-flow-alpha",
77+
"methodId": "method-legacy-clustering",
78+
"datasetId": "data-cytokine-fcs",
79+
"evidence": [
80+
{
81+
"id": "ev-flow-draft",
82+
"type": "notebook",
83+
"status": "draft",
84+
"quality": 0.44
85+
}
86+
]
87+
}
88+
]
89+
}
Lines changed: 20 additions & 0 deletions
Loading
144 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Requirement Map
2+
3+
This slice targets issue #17's graph navigation and recommendation requirements.
4+
5+
| Requirement | Coverage |
6+
| --- | --- |
7+
| Entity extraction / linked data | Models typed instrument, method, dataset, and experiment nodes with stable ids. |
8+
| Knowledge navigation | Builds entity pages and graph query labels for instrument-to-method-to-dataset traversal. |
9+
| Relationship quality | Scores compatibility edges and flags modality, format, resolution, calibration, evidence, and deprecated-method issues. |
10+
| Recommendations | Emits candidate graph edges when instrument, method, and dataset metadata are compatible. |
11+
| Tests | `npm test` covers ready edges, missing nodes, mismatch blockers, stale calibration, weak evidence, recommendations, digests, and reports. |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "instrument-method-compatibility-graph",
3+
"version": "1.0.0",
4+
"description": "Deterministic instrument and method compatibility graph checks for research projects.",
5+
"type": "module",
6+
"scripts": {
7+
"check": "node --check src/instrument-method-compatibility-graph.js && node --check scripts/demo.js && node --check test/instrument-method-compatibility-graph.test.js",
8+
"demo": "node scripts/demo.js",
9+
"test": "node --test test/*.test.js"
10+
},
11+
"engines": {
12+
"node": ">=18"
13+
},
14+
"license": "MIT"
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import {
5+
evaluateInstrumentMethodCompatibility,
6+
renderInstrumentMethodCompatibilityReport
7+
} from "../src/instrument-method-compatibility-graph.js";
8+
9+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
10+
const inputPath = path.join(__dirname, "..", "data", "sample-graph-input.json");
11+
const input = JSON.parse(fs.readFileSync(inputPath, "utf8"));
12+
13+
const result = evaluateInstrumentMethodCompatibility(input);
14+
console.log(renderInstrumentMethodCompatibilityReport(result));

0 commit comments

Comments
 (0)