-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (69 loc) · 2.16 KB
/
Makefile
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
# MDAnalysis fork to use
MDA_VERSION ?= 2.4.3
# Use conda or mamba
CONDA ?= conda
# Number of threads to use in parallel
N_WORKERS ?= -1
# Min number of heavy atoms for a molecule
MIN_ATOMS ?= 2
# Max number of heavy atoms for a molecule
MAX_ATOMS ?= 50
.ONESHELL:
SHELL := /bin/bash
SET_CONDA_ENV := source $$(conda info --base)/etc/profile.d/conda.sh && conda activate && conda activate rdkitconverter
CHEMBL_SDF := ftp://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/releases/chembl_33/chembl_33.sdf.gz
fetch := data/chembl_33.sdf.gz
process := data/chembl_processed_unique.smi.gz
benchmark := data/chembl_failed.smi
report := results/failed_molecules.html
all: report
help:
@echo 'usage: make <target>'
@echo
@echo 'targets:'
@echo ' help Show this help'
@echo ' install Install dependencies'
@echo ' fetch Fetch ChEMBL 33'
@echo ' process Filter, standardize and remove duplicate molecules'
@echo ' benchmark Run the benchmark'
@echo ' report Generate the report'
@echo ' clean Clean all data'
@echo ' restart Clean the benchmark data and report'
@echo
@echo 'default behavior: make fetch process benchmark report'
install:
$(CONDA) env create -f environment.yaml
@$(SET_CONDA_ENV)
@$(CONDA) install 'mdanalysis==$(MDA_VERSION)'
$(fetch):
@export CHEMBL_SDF=$(CHEMBL_SDF)
@bash scripts/fetch_chembl.sh
$(process): $(fetch)
@$(SET_CONDA_ENV)
@export N_WORKERS=$(N_WORKERS) MIN_ATOMS=$(MIN_ATOMS) MAX_ATOMS=$(MAX_ATOMS)
@python scripts/process_molecules.py || exit 1
@bash scripts/drop_duplicates.sh
$(benchmark): $(process)
@$(SET_CONDA_ENV)
@export N_WORKERS=$(N_WORKERS)
@python scripts/benchmark.py
$(report): $(benchmark)
@$(SET_CONDA_ENV)
@export N_WORKERS=$(N_WORKERS)
@python scripts/report.py
clean:
@rm -rf data/ results/
restart:
@rm -f data/chembl_failed.smi \
data/.failed_count \
data/.timing \
data/.timestamp
@rm -rf results/
.PHONY: fetch
fetch: $(fetch)
.PHONY: process
process: $(process)
.PHONY: benchmark
benchmark: $(benchmark)
.PHONY: report
report: $(report)