-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
97 lines (76 loc) · 4.65 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
GPMLS := ${shell cat pathways.txt | sed -e 's/\(.*\)/gpml\/\1.gpml/' }
WPRDFS := ${shell cat pathways.txt | sed -e 's/\(.*\)/wp\/Human\/\1.ttl/' }
GPMLRDFS := ${shell cat pathways.txt | sed -e 's/\(.*\)/wp\/gpml\/Human\/\1.ttl/' }
REPORTS := ${shell cat pathways.txt | sed -e 's/\(.*\)/reports\/\1.md/' }
SBMLS := ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.sbml/' } ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.txt/' }
SVGS := ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.svg/' }
all: wikipathways-SARS-CoV-2-rdf-authors.zip wikipathways-SARS-CoV-2-rdf-wp.zip \
wikipathways-SARS-CoV-2-rdf-gpml.zip
rdf: ${WPRDFS} ${GPMLRDFS}
sbml: ${SBMLS}
svg: ${SVGS}
fetch:clean ${GPMLS}
clean:
@rm -f ${GPMLS}
gpml/%.gpml:
@echo "Git fetching $@ ..."
@echo '$@' | sed -e 's/gpml\/\(.*\)\.gpml/\1/' | xargs bash getPathway.sh
wikipathways-SARS-CoV-2-rdf-authors.zip: authors/*
@rm -f wikipathways-SARS-CoV-2-rdf-authors.zip
@zip wikipathways-SARS-CoV-2-rdf-authors.zip authors/*
wikipathways-SARS-CoV-2-rdf-wp.zip: ${WPRDFS}
@rm -f wikipathways-SARS-CoV-2-rdf-wp.zip
@zip wikipathways-SARS-CoV-2-rdf-wp.zip wp/Human/*
wikipathways-SARS-CoV-2-rdf-gpml.zip: ${GPMLRDFS}
@rm -f wikipathways-SARS-CoV-2-rdf-gpml.zip
@zip wikipathways-SARS-CoV-2-rdf-gpml.zip wp/gpml/Human/*
sbml/%.sbml: gpml/%.gpml
@mkdir -p sbml
@echo "Fetching SBML for $< ..."
curl -H "Content-Type: application/octet-stream" -X POST --data-binary @$< https://minerva-service.lcsb.uni.lu/minerva/api/convert/GPML:SBML > $@
@sleep 1
sbml/%.txt: sbml/%.sbml
@echo "Extracting notes for $@ ..."
@xpath -e "/sbml/model/notes/body/p/text()" $< > $@ || :
sbml/%.svg: sbml/%.sbml
@echo "Fetching SVG for $@ ..."
@curl -H "Content-Type: application/octet-stream" -X POST --data-binary @$< https://minerva-service.lcsb.uni.lu/minerva/api/convert/image/SBML:svg > $@
wp/Human/%.ttl: gpml/%.gpml src/java/main/org/wikipathways/covid/CreateRDF.class
@mkdir -p wp/Human
@cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateRDF $< $@
wp/gpml/Human/%.ttl: gpml/%.gpml src/java/main/org/wikipathways/covid/CreateGPMLRDF.class
@mkdir -p wp/gpml/Human
cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateGPMLRDF $< $@
src/java/main/org/wikipathways/covid/CreateRDF.class: src/java/main/org/wikipathways/covid/CreateRDF.java
@echo "Compiling $@ ..."
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT.jar src/java/main/org/wikipathways/covid/CreateRDF.java
src/java/main/org/wikipathways/covid/CreateGPMLRDF.class: src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
@echo "Compiling $@ ..."
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT.jar src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
src/java/main/org/wikipathways/covid/CheckRDF.class: src/java/main/org/wikipathways/covid/CheckRDF.java libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar
@echo "Compiling $@ ..."
@javac -cp libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar src/java/main/org/wikipathways/covid/CheckRDF.java
check: ${REPORTS} index.md
reports/%.md: wp/Human/%.ttl wp/gpml/Human/%.ttl src/java/main/org/wikipathways/covid/CheckRDF.class
@echo "Detection curation events for $@ ..."
@mkdir -p reports
@java -cp src/java/main/:libs/slf4j-simple-1.7.32.jar:libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar org.wikipathways.covid.CheckRDF $< $@
index.md: ${REPORTS}
@echo "<img style=\"float: right; width: 200px\" src=\"logo.png\" />" > index.md
@echo "# Validation Reports\n" >> index.md
@echo "\nThe pathways evaluated here are part of the [COVID-19 Disease Map](https://www.embopress.org/doi/full/10.15252/msb.202110387).\n" >> index.md
@for report in $(REPORTS) ; do \
echo -n "* [$$report]($$report) " >> index.md ; \
echo -n "<img alt=\"pathway status\" src=\"https://img.shields.io/endpoint?url=https://wikipathways.org/SARS-CoV-2-WikiPathways/reports/" >> index.md ; \
echo -n "`echo "$$report" | sed -e 's/.md//; s/reports\///'`" >> index.md ; \
echo ".json\">" >> index.md ; \
done
update:
@wget -O src/java/main/org/wikipathways/covid/CheckRDF.java https://raw.githubusercontent.com/wikipathways/wikipathways-curation-template/main/src/java/main/org/wikipathways/covid/CheckRDF.java
updateTests:
@jar tf libs/wikipathways.curator-1-SNAPSHOT.jar | grep '.class' \
| grep 'nl.unimaas.bigcat.wikipathways.curator.tests' | tr / . \
| sed 's/\.class//' | xargs javap -public -cp libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar \
> tests.tmp
@groovy extractTests.groovy > tests.tmp2
@mv tests.tmp2 tests.txt