-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
214 lines (176 loc) · 7.02 KB
/
Copy pathMakefile
File metadata and controls
214 lines (176 loc) · 7.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Organoid Protocol Atlas — developer convenience targets
# All targets are safe to run locally and in CI. No network required for 'test'.
# Targets that call external services (SRI, EuropePMC) require internet access.
#
# Usage:
# make test — run full offline test suite (used by CI)
# make status — system status: which analytics outputs exist
# make all-analytics — regenerate all pre-computed analytics artifacts
# make serve — start Datasette on localhost:8001
# make kgx — regenerate KGX nodes/edges from public exports
PYTHON ?= python3
PYTEST ?= $(PYTHON) -m pytest
PIPELINE = pipeline
TESTS = tests
# --------------------------------------------------------------------------- #
# Testing (offline, no network)
# --------------------------------------------------------------------------- #
.PHONY: test
test:
$(PYTEST) -q
.PHONY: test-verbose
test-verbose:
$(PYTEST) -v
.PHONY: test-cov
test-cov:
$(PYTEST) -q --cov=$(PIPELINE) --cov-report=term-missing
# --------------------------------------------------------------------------- #
# System status
# --------------------------------------------------------------------------- #
.PHONY: status
status:
$(PYTHON) $(PIPELINE)/system_status.py
.PHONY: status-json
status-json:
$(PYTHON) $(PIPELINE)/system_status.py --json
# --------------------------------------------------------------------------- #
# Analytics pipeline (all pre-computed outputs)
# --------------------------------------------------------------------------- #
.PHONY: failure-modes
failure-modes:
$(PYTHON) $(PIPELINE)/aggregate_failure_modes.py
.PHONY: lineage
lineage:
$(PYTHON) $(PIPELINE)/build_lineage.py
.PHONY: coverage-report
coverage-report:
$(PYTHON) $(PIPELINE)/generate_coverage_report.py
.PHONY: assay-endpoints
assay-endpoints:
$(PYTHON) $(PIPELINE)/aggregate_assay_endpoints.py
.PHONY: quality
quality:
$(PYTHON) $(PIPELINE)/score_protocol_quality.py
.PHONY: mior
mior:
$(PYTHON) $(PIPELINE)/score_mior.py
.PHONY: consistency
consistency:
$(PYTHON) $(PIPELINE)/check_concentration_consistency.py
.PHONY: audit-units
audit-units:
$(PYTHON) $(PIPELINE)/audit_units.py
.PHONY: consensus
consensus:
$(PYTHON) $(PIPELINE)/compute_consensus.py --all
# Run the whole analytics pipeline in dependency order
.PHONY: all-analytics
all-analytics: failure-modes lineage coverage-report assay-endpoints quality mior consistency audit-units consensus
@echo "Analytics pipeline complete — run 'make status' to verify"
# --------------------------------------------------------------------------- #
# KGX (Biolink knowledge graph export)
# --------------------------------------------------------------------------- #
.PHONY: kgx
kgx:
$(PYTHON) $(PIPELINE)/export_kgx.py
# Validate KGX with kgx CLI if installed (optional)
.PHONY: validate-kgx
validate-kgx:
@command -v kgx >/dev/null 2>&1 || { echo "kgx not installed — skipping (pip install kgx)"; exit 0; }
kgx validate exports/kgx/
# --------------------------------------------------------------------------- #
# TRAPI
# --------------------------------------------------------------------------- #
.PHONY: trapi-meta
trapi-meta:
$(PYTHON) $(PIPELINE)/trapi.py --meta
.PHONY: trapi-examples
trapi-examples:
@for f in $(PIPELINE)/trapi_examples/*.json; do \
echo "--- $$f ---"; \
$(PYTHON) $(PIPELINE)/trapi.py --query $$f | python3 -m json.tool --no-ensure-ascii | head -30; \
done
# --------------------------------------------------------------------------- #
# Batch PR validation (run before opening a corpus batch PR)
# --------------------------------------------------------------------------- #
.PHONY: validate-batch
validate-batch:
@echo "=== 1/3 Offline test suite ==="
$(PYTEST) -q
@echo "=== 2/3 Prediction file schema check ==="
$(PYTHON) $(PIPELINE)/validate_predictions.py || true
@echo "=== 3/3 Evidence fidelity sample (structural) ==="
$(PYTHON) $(PIPELINE)/validate_evidence.py --n 0 2>/dev/null || true
@echo "validate-batch complete"
.PHONY: validate-predictions
validate-predictions:
$(PYTHON) $(PIPELINE)/validate_predictions.py
# --------------------------------------------------------------------------- #
# Serve (Datasette)
# --------------------------------------------------------------------------- #
.PHONY: serve
serve:
bash serve/run.sh
# --------------------------------------------------------------------------- #
# Public export
# --------------------------------------------------------------------------- #
.PHONY: export
export:
$(PYTHON) $(PIPELINE)/export_public.py
# --------------------------------------------------------------------------- #
# Dev setup
# --------------------------------------------------------------------------- #
.PHONY: install
install:
pip install -r requirements-dev.txt
.PHONY: install-extras
install-extras:
pip install -r requirements-dev.txt sentence-transformers scikit-learn kgx
# --------------------------------------------------------------------------- #
# Convenience
# --------------------------------------------------------------------------- #
.PHONY: clean-cache
clean-cache:
find . -type d -name __pycache__ -not -path './.git/*' -exec rm -rf {} + 2>/dev/null || true
find . -name '*.pyc' -not -path './.git/*' -delete 2>/dev/null || true
.PHONY: help
help:
@echo "Organoid Protocol Atlas — Makefile targets"
@echo ""
@echo " Testing:"
@echo " test Run full offline test suite"
@echo " test-verbose Run tests with verbose output"
@echo " test-cov Run tests with coverage report"
@echo ""
@echo " Analytics pipeline:"
@echo " all-analytics Regenerate all pre-computed outputs"
@echo " quality Protocol quality scores"
@echo " mior MIOR completeness report"
@echo " consistency Cross-paper concentration consistency"
@echo " audit-units Concentration unit validity audit"
@echo " consensus Cross-paper reagent consensus"
@echo " failure-modes Failure mode aggregation"
@echo " lineage Protocol lineage graph"
@echo " coverage-report Corpus coverage report"
@echo " assay-endpoints Assay endpoint summary"
@echo ""
@echo " Knowledge graph:"
@echo " kgx Export Biolink KGX nodes/edges"
@echo " validate-kgx Validate KGX with kgx CLI"
@echo " trapi-meta Show TRAPI responder meta info"
@echo " trapi-examples Run all canned TRAPI query examples"
@echo ""
@echo " Server:"
@echo " serve Start Datasette on localhost:8001"
@echo ""
@echo " Batch PR validation:"
@echo " validate-batch Full pre-PR check (tests + schema + evidence)"
@echo " validate-predictions Prediction file schema check only"
@echo ""
@echo " Status:"
@echo " status System status (which artifacts exist)"
@echo " status-json System status as JSON"
@echo ""
@echo " Setup:"
@echo " install Install dev dependencies"
@echo " install-extras Install dev + sentence-transformers + kgx"