File size: 5,146 Bytes
6d1bbc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# NegBioDB Pipeline Makefile

.PHONY: setup db test clean \
        ge-db ge-download-depmap ge-load-depmap ge-load-rnai ge-export ge-all ge-clean ge-test

# === Week 1: Scaffolding ===

setup:
	uv venv
	uv sync --all-extras
	mkdir -p data exports

db: setup
	uv run python -c "from negbiodb.db import create_database; create_database()"

test: setup
	uv run pytest tests/ -v

clean:
	rm -f data/negbiodb.db
	rm -rf exports/* __pycache__ .pytest_cache
	find . -name "*.pyc" -delete 2>/dev/null || true

# === Week 2: Data Download ===

.PHONY: download download-pubchem download-chembl download-bindingdb download-davis

download-pubchem: setup
	uv run python scripts/download_pubchem.py

download-chembl: setup
	uv run python scripts/download_chembl.py

download-bindingdb: setup
	uv run python scripts/download_bindingdb.py

download-davis: setup
	uv run python scripts/download_davis.py

download: download-pubchem download-chembl download-bindingdb download-davis

# === ETL: Load Sources ===

.PHONY: load-davis load-chembl load-pubchem load-bindingdb load-all

load-davis: db download-davis
	uv run python scripts/load_davis.py

load-chembl: db download-chembl
	uv run python scripts/load_chembl.py

load-pubchem: db download-pubchem
	uv run python scripts/load_pubchem.py

load-bindingdb: db download-bindingdb
	uv run python scripts/load_bindingdb.py

load-all: load-davis load-chembl load-pubchem load-bindingdb

# ============================================================
# Clinical Trial Failure Domain
# ============================================================

.PHONY: ct-db ct-download ct-load-aact ct-classify ct-resolve ct-outcomes ct-all ct-clean

ct-db: setup
	uv run python -c "from negbiodb_ct.ct_db import create_ct_database; create_ct_database()"

ct-download-aact: setup
	uv run python scripts_ct/download_aact.py

ct-download-opentargets: setup
	uv run python scripts_ct/download_opentargets.py

ct-download-cto: setup
	uv run python scripts_ct/download_cto.py

ct-download-shi-du: setup
	uv run python scripts_ct/download_shi_du.py

ct-download: ct-download-opentargets ct-download-cto ct-download-shi-du
	@echo "NOTE: AACT requires --url flag. Run: make ct-download-aact"

ct-load-aact: ct-db
	uv run python scripts_ct/load_aact.py

ct-classify: ct-load-aact
	uv run python scripts_ct/classify_failures.py

ct-resolve: ct-load-aact
	uv run python scripts_ct/resolve_drugs.py

ct-outcomes: ct-classify
	uv run python scripts_ct/load_outcomes.py

ct-all: ct-db ct-load-aact ct-classify ct-resolve ct-outcomes
	@echo "CT pipeline complete."

ct-clean:
	rm -f data/negbiodb_ct.db
	@echo "CT database removed."

ct-test: setup
	uv run pytest tests/test_ct_db.py tests/test_etl_aact.py tests/test_etl_classify.py tests/test_drug_resolver.py tests/test_etl_outcomes.py -v

# ============================================================
# Protein-Protein Interaction Negative Domain
# ============================================================

.PHONY: ppi-db ppi-download ppi-load-huri ppi-load-intact ppi-load-humap ppi-load-string ppi-all ppi-clean ppi-test

ppi-db: setup
	uv run python -c "from negbiodb_ppi.ppi_db import create_ppi_database; create_ppi_database()"

ppi-download-huri: setup
	uv run python scripts_ppi/download_huri.py

ppi-download-intact: setup
	uv run python scripts_ppi/download_intact.py

ppi-download-humap: setup
	uv run python scripts_ppi/download_humap.py

ppi-download-string: setup
	uv run python scripts_ppi/download_string.py

ppi-download-biogrid: setup
	uv run python scripts_ppi/download_biogrid.py

ppi-download: ppi-download-huri ppi-download-intact ppi-download-humap ppi-download-string ppi-download-biogrid

ppi-load-huri: ppi-db ppi-download-huri
	uv run python scripts_ppi/load_huri.py

ppi-load-intact: ppi-db ppi-download-intact
	uv run python scripts_ppi/load_intact.py

ppi-load-humap: ppi-db ppi-download-humap
	uv run python scripts_ppi/load_humap.py

ppi-load-string: ppi-db ppi-download-string
	uv run python scripts_ppi/load_string.py

ppi-all: ppi-db ppi-load-huri ppi-load-intact ppi-load-humap ppi-load-string
	@echo "PPI pipeline complete."

ppi-clean:
	rm -f data/negbiodb_ppi.db
	@echo "PPI database removed."

ppi-test: setup
	uv run pytest tests/test_ppi_db.py tests/test_protein_mapper.py tests/test_etl_huri.py tests/test_etl_intact.py tests/test_etl_humap.py tests/test_etl_string.py -v

# === GE/DepMap Domain ===

ge-db:
	uv run python -c "from negbiodb_depmap.depmap_db import init_db; init_db()"
	@echo "GE database initialized."

ge-download-depmap:
	uv run python scripts_depmap/download_depmap.py

ge-load-depmap: ge-db ge-download-depmap
	uv run python scripts_depmap/load_depmap.py

ge-load-rnai: ge-db ge-download-depmap
	uv run python scripts_depmap/load_rnai.py

ge-export: ge-db
	uv run python scripts_depmap/export_ge_ml_dataset.py

ge-all: ge-db ge-load-depmap ge-load-rnai ge-export
	@echo "GE pipeline complete."

ge-clean:
	rm -f data/negbiodb_depmap.db
	@echo "GE database removed."

ge-test: setup
	uv run pytest tests/test_ge_db.py tests/test_ge_features.py tests/test_etl_depmap.py tests/test_etl_rnai.py tests/test_ge_export.py -v