-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (81 loc) · 2.06 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# Need the hatch tool to run this Makefile.
#
# pipx install hatch
#
# Default OBO file.
OBO_URL = http://current.geneontology.org/ontology/go-basic.obo
OBO = obo/go-basic.obo.gz
# The gene association file.
GAF_URL = https://current.geneontology.org/annotations/goa_human.gaf.gz
GAF = obo/goa_human.gaf.gz
# The index file.
IDX = genescape.index.gz
# Makefile customizations
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# Usage information.
usage:
@echo "#"
@echo "# Use the source, Luke!"
@echo "#"
# Performs the testing.
web:
shiny run --reload genescape.shiny.tree.app:app
# Tag and push to repository.
tag: test
python src/genescape/exe.py --tag
# Generate images for the documentation
docimg:
genescape tree -o docs/images/gs_output_1.png docs/genelist_1.txt
genescape tree -o docs/images/gs_output_2.png docs/genelist_2.txt --mincov 1
genescape tree -m lipid --mincov 2 -o docs/images/gs_output_3.png docs/genelist_2.txt
pdf:
(cd docs && pandoc paper.md -o paper.pdf)
# Runs a linter.
lint:
hatch run lint:style
# Fix linting errors.
fix:
hatch run lint:fmt
# Save work.
push:
git commit -am 'saving work' && git push
build: clean
rm -rf build dist
hatch build
ls -lh dist
publish: build
hatch publish
# Download the gene ontology file
${OBO}:
mkdir -p $(dir ${OBO})
curl -L ${OBO_URL} | gzip -c > ${OBO}
${GAF}:
mkdir -p $(dir ${GAF})
curl -L ${GAF_URL} > ${GAF}
${IDX}: ${OBO} ${GAF}
hatch run genescape build --obo ${OBO} --gaf ${GAF} --index ${IDX}
obo: ${OBO}
ls -lh ${OBO}
gaf: ${GAF}
ls -lh ${GAF}
index: ${IDX}
ls -lh ${IDX}
genescape build --obo ${OBO} --gaf ${GAF} --idx ${IDX}
# Performs a python-only test.
test:
hatch run test
clean:
rm -rf build dist ${IDX}
env:
micromamba create -n shiny python=3.11 rsconnect-python graphviz make -y
shiny:
rsconnect deploy shiny src/genescape/shiny/tree --name biostar --title GeneScape
install:
pip install rsconnect-python
.PHONY: test lint fix push clean build publish obo docimg web