-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (48 loc) · 2.93 KB
/
Makefile
File metadata and controls
62 lines (48 loc) · 2.93 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
# Requirements for this Makefile
# * owltools script is in the PATH
# * full NCBI taxononmy in OBO is in the parent folder
TODAY ?= $(shell date +%Y-%m-%d)
VERSION= $(TODAY)
ONTBASE= http://purl.obolibrary.org/obo/ncbitaxon
# Per-target timing/memory log (mirrors ODK convention).
# Run with: ODK_DEBUG=yes ./odk.sh bash -c "cd subsets && make <target>"
# odk.sh sets ODK_DEBUG_FILE in the env to a single absolute path so
# this Makefile and the root Makefile both append to the same log.
SCRIPTSDIR = ../src/scripts
ifeq ($(ODK_DEBUG),yes)
SHELL = $(SCRIPTSDIR)/run-command.sh
endif
all: taxslim taxslim-disjoint-over-in-taxon.owl taxslim-disjoint-diff.md
taxslim: taxon-subset-ids.txt
wget http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.obo -O current_taxslim.obo
OWLTOOLS_MEMORY=8G owltools ../ncbitaxon.obo --create-slim --output-owl taxslim.owl --output-obo taxslim.obo --old-obo current_taxslim.obo --iri $(ONTBASE)/subsets/taxslim.owl --ids taxon-subset-ids.txt
robot annotate -i taxslim.owl --ontology-iri $(ONTBASE)/subsets/taxslim.owl annotate -V $(ONTBASE)/releases/$(VERSION)/subsets/taxslim.owl --annotation owl:versionInfo $(VERSION) -o taxslim.owl
robot annotate -i taxslim.obo --ontology-iri $(ONTBASE)/subsets/taxslim.obo annotate -V $(ONTBASE)/releases/$(VERSION)/subsets/taxslim.obo --annotation owl:versionInfo $(VERSION) -o taxslim.obo
robot convert -i taxslim.owl -f json -o taxslim.json
taxslim-disjoint-over-in-taxon.owl: taxslim
owltools taxslim.owl --create-taxon-disjoint-over-in-taxon --root NCBITaxon:1
robot query --input taxslim.owl --format ttl --query add-taxon-disjoints.ru $@.tmp.ttl
robot merge --input $@ --input $@.tmp.ttl --collapse-import-closure false \
annotate -V $(ONTBASE)/releases/$(VERSION)/subsets/$@ --annotation owl:versionInfo $(VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@
rm $@.tmp.ttl
taxslim-disjoint-diff.md: taxslim-disjoint-over-in-taxon.owl
wget http://purl.obolibrary.org/obo/ncbitaxon/subsets/$< -O current_taxslim-disjoint.owl
robot diff --labels true --left current_taxslim-disjoint.owl --right $< -f markdown -o $@
## The following should not be run as part of CI job.
## Admin for this project should run and check in results.
##
## make new-taxon-subset-ids.txt
## cp new-taxon-subset-ids.txt taxon-subset-ids.txt
## git commit -m 'regenerated'
# reference proteome
rp-README.txt:
wget ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/reference_proteomes/README -O $@
rp-subset.obo: rp-README.txt
./util/rpreadme2obo.pl $< > $@
rpids.txt: rp-subset.obo
gene_association.goa_uniprot_noiea.gz:
wget http://www.geneontology.org/gene-associations/$@ -O $@
go-tax-ids.txt: gene_association.goa_uniprot_noiea.gz
gzip -dc $< | cut -f13 | grep ^taxon: | sort -u | perl -npe 's@^taxon:@NCBITaxon:@g;s@\|@\n@' > $@.tmp && sort -u $@.tmp > $@
new-taxon-subset-ids.txt: taxon-subset-ids.txt rpids.txt go-tax-ids.txt
sort -u $^ > $@