forked from obophenotype/uberon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
1543 lines (1160 loc) · 68.3 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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
OBO=http://purl.obolibrary.org/obo
CATALOG=catalog-v001.xml
DC = http://purl.org/dc/elements/1.1
DATE = `date +%Y-%m-%d`
RELEASE = $(OBO)/uberon/releases/`date +%Y-%m-%d`
QELK = --silence-elk
UCAT = --use-catalog
ROBOT = ROBOT_JAVA_ARGS=-Xmx12G robot
PART_OF = BFO_0000050
all: uberon-qc
xxtest:
echo $(QELK)
# ----------------------------------------
# COMMANDS
# ----------------------------------------
##MAKEOBO= owltools $< --remove-axiom-annotations -o -f obo [email protected] && grep -v ^property_value: [email protected] | grep -v ^owl-axioms: > [email protected] && obo2obo [email protected] -o $@
MAKEOBO= owltools $< --add-obo-shorthand-to-properties -o -f obo --no-check [email protected] && grep -v ^property_value: [email protected] | perl -npe 's@relationship: dc-@property_value: dc-@' | grep -v ^owl-axioms: > [email protected] && mv [email protected] $@
MAKEJSON= owltools $(UCAT) $< --add-obo-shorthand-to-properties -o -f json [email protected] && mv [email protected] $@
MAKEYAML= owltools $(UCAT) $< --add-obo-shorthand-to-properties -o -f yaml [email protected] && mv [email protected] $@
# ----------------------------------------
# TRAVIS TOP LEVEL TARGETS
# ----------------------------------------
# This OWLTools call is designed for running in travis; does not clog stdout
ELKRUN= owltools $(UCAT) $< $(QELK) --run-reasoner -r elk -u > [email protected] || (tail -1000 [email protected] && exit -1) && (tail -1000 [email protected] && mv [email protected] $@)
# materialize takes too long on travis
#travis_test: ttest-uberon ttest-ext ttest-tax
travis_test: is_ok
ttest-uberon: uberon.owl bfo-check.txt
$(ELKRUN)
ttest-ext: ext.owl
$(ELKRUN)
ttest-tax: uberon_edit-plus-tax-equivs.owl
$(ELKRUN)
# ----------------------------------------
# PREP: catalog
# ----------------------------------------
$(CATALOG):
./util/make-catalog.pl uberon.owl ext.owl ncbitaxon.obo *_import.owl local-*owl bridge/*owl source-ontologies/allen-*.obo developmental-stage-ontologies/ssso-merged-uberon.obo > [email protected] && mv [email protected] $@
# ----------------------------------------
# STEP 0: checks
# ----------------------------------------
# NOTE: these are bypassed by travis for now, as some rely on ad-hoc perl
checks: uberon_edit-xp-check uberon_edit-obscheck.txt \
bfo-check.txt \
uberon.obo-OWL-check \
uberon-obscheck.txt \
uberon-orphans \
uberon-synclash
# ----------------------------------------
# STEP 1: pre-processing and quick validation
# ----------------------------------------
# make edit owl file from previous step, merge in contributors (derived from github API) and expand macros
uberon_edit.owl: uberon_edit.obo disjoint_union_over.ofn uberon_edit.obo-gocheck uberon_edit.obo-iconv
owltools $(UCAT) $< disjoint_union_over.ofn issues/contributor.owl --merge-support-ontologies --expand-macros -o [email protected] && ./util/expand-dbxref-literals.pl [email protected] > $@
roundtrip.obo: uberon_edit.obo
robot convert -i $< -o [email protected] && mv [email protected] $@ && diff -i $< $@
NORMALIZE.obo: uberon_edit.obo
robot convert -i $< -o [email protected] && mv [email protected] $@
# ----------------------------------------
# STEP 2: preparing core release, and merging with phenoscape edit file
# ----------------------------------------
# core.owl is imported by phenoscape-ext.owl; the two together make up the complete ontology
core.owl: uberon_edit.owl
owltools $(UCAT) $< -o -f ofn $@
# A portion of uberon is maintained in a separate github repo - we merge that in here
# as part of the release
phenoscape-ext.owl: uberon_edit.obo
wget --no-check-certificate https://raw.githubusercontent.com/obophenotype/uberon-phenoscape-ext/master/phenoscape-ext.owl -O $@ && touch $@
# including the imports would lead to circularity, so we remove these here
phenoscape-ext-noimports.owl: phenoscape-ext.owl core.owl
owltools $(UCAT) $< --remove-imports-declarations -o -f functional $@
## MERGED UNREASONED ONTOLOGY
##
## TODO - restore Disjoints
## TODO - get rid of declarations and inferred subclass axioms for other ontology classes
## TODO: omitting removal of DisjointClasses to see what happens
unreasoned.owl: uberon_edit.owl phenoscape-ext-noimports.owl bridge/uberon-bridge-to-bfo.owl
owltools $(UCAT) $^ --merge-support-ontologies -o -f functional $@
# owltools $(UCAT) $^ --merge-support-ontologies --remove-axioms --remove-axioms -t ObjectPropertyDomain --remove-axioms -t ObjectPropertyRange -o -f functional $@
# First pass at making base module
# Currently this will be missing the temporary reflexivity axioms.
# should this include downward-injected axioms, e.g on ZFA?
uberon-base.owl: unreasoned.owl
owltools $(UCAT) $< --remove-imports-declarations --remove-axioms -t Declaration --set-ontology-id -v $(RELEASE)/$@ $(OBO)/uberon/$@ -o [email protected] && mv [email protected] $@
# ----------------------------------------
# STEP 3: Perform reasoning and create release ext.owl file
# ----------------------------------------
# ext.owl is the release file that includes full imports and inter-ontology axioms
#ext.owl: unreasoned.owl
# $(ROBOT) reason -i $< -r elk relax reduce -r elk annotate -O $(OBO)/uberon/$@ -V $(RELEASE)/$@ -o $@
## TESTING - NEW
is_ok: unreasoned.owl
owltools $(UCAT) $< --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
materialized.owl: unreasoned.owl is_ok
$(ROBOT) relax -i $< materialize -T basic_properties.txt -r elk \
reason -r elk --exclude-duplicate-axioms true --equivalent-classes-allowed none \
annotate -O $(OBO)/uberon/$@ -V $(RELEASE)/$@ -o $@ >& [email protected]
.PRECIOUS: materialized.owl
# somewhat awkward: we temporarily inject reflexivity axioms
TMP_REFL=reflexivity_axioms.owl
ext.owl: materialized.owl $(TMP_REFL)
owltools --use-catalog $< $(TMP_REFL) --merge-support-ontologies -o m1.owl && \
$(ROBOT) reduce -i m1.owl -r elk \
unmerge -i $(TMP_REFL) \
annotate -O $(OBO)/uberon/$@ -V $(RELEASE)/$@ -o $@ >& [email protected]
RELSIM = BFO:0000050 RO:0002202 immediate_transformation_of
# ext.obo is a relation subset of this. TODO: use case?
ext.obo: ext.owl
owltools $(UCAT) $< --merge-import-closure -o -f obo --no-check [email protected] && mv [email protected] $@
# owltools $(UCAT) $< --merge-import-closure --make-subset-by-properties -f $(RELSLIM) // -o -f obo --no-check [email protected] && mv [email protected] $@
ext.json: ext.owl
$(MAKEJSON)
# ----------------------------------------
# STEP 4: Create uberon.owl and .obo
# ----------------------------------------
# merged.owl is now the flattening of ext.owl
# TODO: do we need this intermediate step? Used for subsets
merged.owl: ext.owl
owltools $(UCAT) $< --merge-import-closure --set-ontology-id -v $(RELEASE)/$@ $(OBO)/uberon/$@ -o $@
merged.obo: merged.owl
owltools $< -o -f obo --no-check [email protected] && mv [email protected] $@
# strip imports and dangling references
uberon.owl: ext.owl
owltools $(UCAT) $< --remove-imports-declarations --remove-dangling --set-ontology-id -v $(RELEASE)/$@ $(OBO)/$@ -o $@
# also do OE check here
uberon.obo: uberon.owl
$(MAKEOBO)
uberon.json: uberon.owl
$(MAKEJSON)
.PRECIOUS: uberon.json
uberon.yaml: uberon.owl
$(MAKEYAML)
.PRECIOUS: uberon.yaml
uberon.json.gz: uberon.json
gzip -c $< > [email protected] && mv [email protected] $@
# ----------------------------------------
# STEP 5: Create basic subset
# ----------------------------------------
BASICRELS = BFO:0000050 RO:0002202 immediate_transformation_of transformation_of
# remember to git mv - this replaces uberon-simple
# TODO: ensure relaxation is properly implemented; see for example craniofacial suture
basic.owl: uberon.owl
owltools $< --make-subset-by-properties -f $(BASICRELS) // --set-ontology-id -v $(RELEASE)/$@ $(OBO)/uberon/$@ -o $@
basic.obo: basic.owl
$(MAKEOBO)
subsets/efo-slim.owl: basic.owl
owltools $< --extract-ontology-subset --subset efo_slim --iri $(OBO)/uberon/$@ -o $@
subsets/efo-slim.obo: subsets/efo-slim.owl
$(MAKEOBO)
subsets/cumbo.owl: basic.owl
owltools $< --extract-ontology-subset --subset cumbo --iri $(OBO)/uberon/$@ -o $@
subsets/cumbo.obo: subsets/cumbo.owl
$(MAKEOBO)
#TEMPORARY - we will later
#supercheck.owl: unreasoned.owl
# owltools $(UCAT) $< phenoscape-ext-noimports.owl --merge-support-ontologies --expand-macros --assert-inferred-subclass-axioms --useIsInferred -o -f functional $@
# ----------------------------------------
# GENERIC CONVERSION
# ----------------------------------------
%.json: %.owl
$(MAKEJSON)
# ----------------------------------------
# IMPORTS
# ----------------------------------------
# imports can be built independently of the main release.
# (although pre-processing of the source is done first)
#
# The typical pipeline (see uberon-qc) is to first make imports, then the rest of the release
# todo - change to include phenoscape-ext
EDITSRC = uberon_edit.owl
IMP = $(OBO)/uberon
bspo.owl:
owltools $(OBO)/bspo.owl -o $@
# merge BSPO into RO
ro.owl: $(EDITSRC) bspo.owl
owltools $(OBO)/ro.owl bspo.owl --merge-support-ontologies --merge-imports-closure --add-obo-shorthand-to-properties -o $@ && touch $@
#seed.tsv: seed.owl
# owltools $(USECAT) --extract-
# Import module for RO
#
# No TBox; use an OP seed that is derived from a separate sparql query
ro_import.owl: ro.owl $(EDITSRC) reports/uberon_edit-object-properties.csv
$(ROBOT) extract -i $< -m STAR -T reports/uberon_edit-object-properties.csv annotate -O $(OBO)/uberon/$@ -a $(DC)/title "Relations Ontology Module for Uberon" -o [email protected] && owltools [email protected] --remove-tbox --remove-annotation-assertions -l -d -r -o $@
bless-mirrors:
touch go.owl chebi.owl ncbitaxon.obo
pato.owl: $(EDITSRC)
owltools $(OBO)/$@ --extract-mingraph --make-subset-by-properties -f BFO:0000050 // --set-ontology-id $(OBO)/$@ -o $@
pato_import.owl: pato.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
# TODO - logical definitions go->ubr,cl
go.owl: $(EDITSRC)
wget $(OBO)/$@ -O $@ && touch $@
go_import.owl: go.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
envo.owl: $(EDITSRC)
owltools $(OBO)/$@ --extract-mingraph --set-ontology-id $(OBO)/$@ -o $@
envo_import.owl: envo.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --make-subset-by-properties --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
nbo.owl: $(EDITSRC)
owltools $(OBO)/$@ --extract-mingraph --set-ontology-id $(OBO)/$@ -o $@
nbo_import.owl: nbo.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --make-subset-by-properties --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
chebi.obo: $(EDITSRC)
wget --no-check-certificate $(OBO)/chebi.obo -O [email protected] && mv [email protected] $@ && touch $@
chebi.owl: $(EDITSRC) chebi.obo
owltools chebi.obo --extract-mingraph --rename-entity $(OBO)/chebi#has_part $(OBO)/BFO_0000051 --make-subset-by-properties -f BFO:0000051 // --set-ontology-id -v $(RELEASE)/$@ $(OBO)/$@ -o $@ && touch $@
chebi_import.owl: chebi.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
# Do not rebuild: PR is now too big
#aminoacid.owl: $(EDITSRC)
# owltools $(OBO)/pr.owl --reasoner-query -r elk PR_000018263 --reasoner-dispose --make-ontology-from-results $(OBO)/uberon/$@ -o $@
pr.owl: aminoacid.owl
owltools $< --extract-mingraph --rename-entity $(OBO)/pr#has_part $(OBO)/BFO_0000051 --rename-entity $(OBO)/pr#part_of $(OBO)/BFO_0000050 --make-subset-by-properties -f BFO:0000050 BFO:0000051 // --split-ontology -d null -l snap --remove-imports-declarations --remove-dangling --set-ontology-id $(OBO)/$@ -o $@ && touch $@
pr_import.owl: pr.owl $(EDITSRC)
owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) --extract-module -s $(OBO)/$< -c --extract-mingraph --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
# TODO - use full taxonomy
#ncbitaxon.owl:
# OWLTOOLS_MEMORY=14G owltools $(OBO)/ncbitaxon.owl -o $@ && touch $@
## owltools $(OBO)/ncbitaxon/subsets/taxslim-disjoint-over-in-taxon.owl --merge-import-closure --make-subset-by-properties -f RO:0002162 // --split-ontology -d null -l cl go caro --remove-imports-declarations --set-ontology-id $(OBO)/$@ -o $@
ncbitaxon.obo:
wget $(OBO)/ncbitaxon.obo -O $@
ncbitaxon_import.owl: ncbitaxon.obo $(EDITSRC) composite-stages.obo
OWLTOOLS_MEMORY=14G owltools $(UCAT) --map-ontology-iri $(IMP)/$@ $< $(EDITSRC) composite-stages.obo --merge-support-ontologies --extract-module -s $(OBO)/ncbitaxon.owl -c --extract-mingraph --remove-dangling-annotations --create-taxon-disjoint-over-in-taxon -s -r NCBITaxon:2759 -m --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
# CL - take **everything**
cl_import.owl: cl-core.obo $(EDITSRC)
owltools $(UCAT) $< --set-ontology-id -v $(RELEASE)/$@ $(IMP)/$@ -o $@
%_import.obo: %_import.owl
owltools $< --add-obo-shorthand-to-properties -o -f obo --no-check $@
imports: pato_import.obo chebi_import.obo pr_import.obo ncbitaxon_import.obo cl_import.obo go_import.obo ro_import.obo
touch $@
# ----------------------------------------
# MARKDOWN EXPORT
# ----------------------------------------
markdown:
owltools ext.owl --merge-imports-closure --ontology-to-markdown md
# ----------------------------------------
# REPORTS
# ----------------------------------------
Drerio = NCBITaxon:7955
Xenopus = NCBITaxon:8353
Human = NCBITaxon:9606
Dmel = NCBITaxon:7227
##RPT_TAXA_ARGS = -gp BFO:0000050 -gf $(Drerio) $(Xenopus) $(Human) $(Dmel)
RPT_TAXA_ARGS =
#RPT_STAGE_RELS = RO:0002488 RO:0002492 RO:0002496 RO:0002497
RPT_STAGE_RELS = RO:0002496 RO:0002497
#%-classes.tsv: %.owl
# owljs-tableify -R "RO_0002202,transformation of,in taxon,existence starts during,existence ends during" -c -o $@ $<
## owljs-tableify -R "develops from,in taxon,existence_starts_during,existence ends during" -c -o $@ $<
#%-parents.tsv: %-part-parents.tsv %-dev-parents.tsv %-tax-parents.tsv %-stage-parents.tsv %-function-parents.tsv
# echo done
reports/%-part-of-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --log-error --export-parents -p BFO:0000050 $(RPT_TAXA_ARGS) -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-part-of-parents.tsv
reports/%-has-part-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --log-error --export-parents -p BFO:0000051 $(RPT_TAXA_ARGS) -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-has-part-parents.tsv
reports/%-dev-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --export-parents -p RO:0002202 RO:0002494 -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-dev-parents.tsv
reports/%-tax-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --export-parents -p RO:0002162 -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-tax-parents.tsv
reports/%-stage-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --log-error --export-parents -p $(RPT_STAGE_RELS) $(RPT_TAXA_ARGS) -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-stage-parents.tsv
reports/%-function-parents.tsv: %.owl
owltools $< --reasoner elk --reasoner mexr --export-parents -p RO:0002328 -o [email protected] && mv [email protected] $@
.PRECIOUS: reports/%-function-parents.tsv
reports/uberon-%.csv: uberon.owl sparql/%.sparql
robot query -i $< --query sparql/$*.sparql [email protected] && ./util/curiefy-purls.pl [email protected] > $@ && rm [email protected]
reports/uberon_edit-%.csv: uberon_edit.owl sparql/%.sparql
robot query -i $< --query sparql/$*.sparql [email protected] && ./util/curiefy-purls.pl [email protected] > $@ && rm [email protected]
# nh-% : no -homology relations
#
# match pattern for any relation to be filtered out
XSPECIES_RE = -m '/(RO_0002158|evolved_from)/'
nh-%.obo: composite-%.owl
owltools $< -o -f obo --no-check [email protected] && egrep -v 'relationship: (homologous_to|evolved_from)' [email protected] > $@
nh-%.owl: nh-%.obo
owltools $< -o [email protected] && mv [email protected] $@
#nh-human.owl: composite-human.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
#nh-mouse.owl: composite-mouse.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
#nh-zebrafish.owl: composite-zfa.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
#nh-xenopus.owl: composite-xenopus.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
#nh-drosophila.owl: composite-fbbt.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
#nh-nematode.owl: composite-wbbt.owl
# owljs-grep -v $(XSPECIES_RE) -o $@ $<
metazoan-view.owl: ext.owl
ln -s $< $@
# run the reasoner, set to remove unsatisfiable classes (ie those not in the species specified in the context)
subsets/%-view.owl: ext.owl contexts/context-%.owl
OWLTOOLS_MEMORY=14G owltools --use-catalog $< ext-taxon-axioms.owl contexts/context-$*.owl --merge-support-ontologies --merge-imports-closure $(QELK) --set-ontology-id $(OBO)/$@ --run-reasoner -r elk -x -o -f ofn $@
.PRECIOUS: subsets/%-view.owl
subsets/%-view.obo: %-view.owl
owltools --use-catalog $< -o -f obo --no-check [email protected] && grep -v ^owl [email protected] > $@
# note: drosophila too slow....
#RPT_SPECIES = human mouse zebrafish xenopus
RPT_SPECIES = human mouse xenopus metazoan
reports/stages: $(patsubst %,reports/stages-%-report.tsv,$(RPT_SPECIES))
echo done
reports/parts: $(patsubst %,reports/part-%-report.tsv,$(RPT_SPECIES))
echo done
reports/stages-%-report.tsv: %-view.owl
owltools --use-catalog $< --reasoner mexr --export-parents -p $(RPT_STAGE_RELS) -o [email protected] && mv [email protected] $@
# experimental....
branches: reports/branches-nerve.png reports/branches-artery.png
reports/branches-%.png:
blip -r uberon ontol-subset -query "class(R,$*),parent(ID,branching_part_of,_),subclassT(ID,R)" -rel branching_part_of -to png -cr branching_part_of > [email protected] && mv [email protected] $@
reports/circo-bones.dot:
blip -r uberon ontol-subset -query "class(R,'bone element'),subclassT(ID,R)" -rel connected_to -to dot > [email protected] && mv [email protected] $@
reports/circo-head-muscles.dot:
blip -r uberonp ontol-subset -query "class(R,'craniocervical muscle'),subclassT(ID,R)" -rel attaches_to -rel connected_to -down 1 -to dot > [email protected] && mv [email protected] $@
## blip -r uberonp ontol-subset -query "class(R,'muscle organ'),subclassT(ID,R),parent_over_nr(part_of,ID,'UBERON:0007811')" -rel attaches_to -rel connected_to -down 1 -to dot > [email protected] && mv [email protected] $@
reports/circo-%.png: reports/circo-%.dot
circo -o$@ -Tpng $<
# ----------------------------------------
# EXTRACT TCs
# ----------------------------------------
# experimental: for propagation to GO
uberon-taxon-constraints.obo: uberon_edit.obo
obo-filter-relationships.pl -t only_in_taxon -t never_in_taxon $< | obo-filter-tags.pl -t id -t name -t relationship - | obo-grep.pl --noheader -r relationship: - > [email protected] && cat [email protected] taxon-relations.obo > $@
uberon-taxon-constraints.owl: uberon-taxon-constraints.obo
owltools $< --expand-macros -o $@
# ----------------------------------------
# SYNTACTIC CHECKS
# ----------------------------------------
# mostly for checking OBO files
# the outputs of these targets are not consumed, used only for diagnostics
%.obo-allchecks: %.obo-OWL-check %.obo-gocheck %.obo-iconv
# check OBO-Edit can parse the .obo output
# @Deprecated
#%.obo-OE-check: %.obo
# obo2obo -o $@ $<
# check OWLAPI can parse the .obo output
%.obo-OWL-check: %.obo
owltools $<
# test any file for non UTF-8 characters
%-iconv: %
iconv -f UTF-8 -t ISO-8859-15 $< > $@
# run subset of syntax and structure checks used by GO
# (see .travis.yml for dependencies)
DISABLE= multiply-labeled-edge valid-id-space isa-incomplete ascii-check has-definition bad-pmid ontology-declaration-check referenced-id-syntax-check owl-axiom-check is-symmetric-check
%.obo-gocheck: %.obo GO.xrf_abbs
./util/check-obo-for-standard-release.pl --xref-abbs GO.xrf_abbs $(patsubst %,--disable-%,$(DISABLE)) $< > [email protected] && mv [email protected] $@
GO.xrf_abbs: uberon_edit.obo
wget http://geneontology.org/doc/GO.xrf_abbs -O $@ && touch $@
# ----------------------------------------
# Taxonomy and external AO validation
# ----------------------------------------
# first generate a merged ontology consisting of
# * core uberon
# * external-disjoints.owl
# * species anatomy bridge axioms
# This can be used to reveal both internal inconsistencies within uberon, and the improper linking of a species AO class to an uberon class with a taxon constraint
uberon_edit-plus-tax-equivs.owl: uberon_edit.owl external-disjoints.owl bridge/bridges
owltools --catalog-xml $(CATALOG) $< external-disjoints.owl `ls bridge/uberon-bridge-to-*.owl | grep -v emap.owl` --merge-support-ontologies -o -f ofn $@
.PRECIOUS: uberon_edit-plus-tax-equivs.owl
# see above
taxon-constraint-check.txt: uberon_edit-plus-tax-equivs.owl
owltools --no-debug --catalog-xml $(CATALOG) $< $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
# BRIDGE CHECKS.
# these can be used to validate on a per-bridge file basis. There are a variety of flavours:
#
# * quick bridge tests ignore the axioms in the external ontology (but include the bridge axioms themselves)
# * standard bridge tests use the logical axioms in the external ontology
# * full bridge tests do the above using the constructed ext ontology
# * extra full bridge tests also throw in the set of all pending disjoints. Only 'gold star' external ontologies will pass this.
#
# note at this time we don't expect all full-bridge tests to pass. This is because the disjointness axioms are
# very strong and even seemingly minor variations in representation across ontologies can lead to unsatisfiable classes
#
## CHECK_AO_LIST = ma emapa ehdaa2 zfa xao fbbt wbbt
## CHECK_AO_LIST = ma emapa zfa xao fbbt wbbt wbls
##### CHECK_AO_LIST = ma emapa zfa xao fbbt wbls : Add MA back to list when this is solved; https://sourceforge.net/p/obo/mouse-anatomy-requests/94/
# gold glub
EXTRA_FULL_CHECK_AO_LIST = caro
# silver club
FULL_CHECK_AO_LIST = $(EXTRA_FULL_CHECK_AO_LIST) wbls wbbt
# premier execs
CHECK_AO_LIST = $(FULL_CHECK_AO_LIST)
# economy
QUICK_CHECK_AO_LIST = $(CHECK_AO_LIST) fbbt zfa xao fma ma emapa bfo
quick-bridge-checks: $(patsubst %,quick-bridge-check-%.txt,$(FULL_CHECK_AO_LIST))
bridge-checks: $(patsubst %,bridge-check-%.txt,$(CHECK_AO_LIST))
full-bridge-checks: $(patsubst %,full-bridge-check-%.txt,$(CHECK_AO_LIST))
extra-full-bridge-checks: $(patsubst %,extra-full-bridge-check-%.txt,$(EXTRA_FULL_CHECK_AO_LIST))
##bfo-check.txt: uberon_edit-plus-tax-equivs.owl
bfo-check.txt: uberon_edit.owl
OWLTOOLS_MEMORY=14G owltools $(OBO)/bfo.owl $(OBO)/ro.owl --catalog-xml $(CATALOG) $< bridge/uberon-bridge-to-bfo.owl --merge-support-ontologies -o bfo-check.owl $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
bfo-basic-check.txt: basic.owl
OWLTOOLS_MEMORY=14G owltools $(OBO)/bfo.owl --catalog-xml $(CATALOG) $< bridge/uberon-bridge-to-bfo.owl --merge-support-ontologies $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
# A quick bridge check uses only uberon plus taxon constraints plus bridging axioms, *not* the axioms in the source ontology itself
quick-bridge-check-%.txt: uberon_edit-plus-tax-equivs.owl bridge/bridges external-disjoints.owl local-%.owl
owltools --catalog-xml $(CATALOG) $(OBO)/$*.owl bridge/uberon-bridge-to-$*.owl --merge-support-ontologies $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
# A bridge check uses uberon (no TCs) plus external ontology and the bridge
bridge-check-%.owl: uberon.owl bridge/bridges external-disjoints.owl local-%.owl
owltools --no-debug --catalog-xml $(CATALOG) $< local-$*.owl bridge/uberon-bridge-to-$*.owl external-disjoints.owl --merge-support-ontologies -o -f ofn $@
.PRECIOUS: bridge-check-%.owl
bridge-check-%.txt: bridge-check-%.owl
owltools --no-debug --catalog-xml $(CATALOG) $< $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
expl-bridge-check-%.txt: bridge-check-%.owl
owltools --catalog-xml $(CATALOG) $< $(QELK) --run-reasoner -r elk -u -e > [email protected] && mv [email protected] $@
# A full bridge check uses ext plus external ontology and the bridge
full-bridge-check-%.txt: ext.owl bridge/bridges external-disjoints.owl
OWLTOOLS_MEMORY=14G owltools --no-debug --catalog-xml $(CATALOG) $< $(OBO)/$*.owl bridge/uberon-bridge-to-$*.owl external-disjoints.owl --merge-support-ontologies $(QELK) --run-reasoner -r elk -u -m debug-full-bridge-check-$*.owl > [email protected] && mv [email protected] $@
# As above, but include pending disjoints. This is a very strict check and we don't expect this to pass for lots of ssAOs.
extra-full-bridge-check-%.txt: ext.owl local-%.owl bridge/uberon-bridge-to-%.owl pending-disjoints.obo external-disjoints.owl
owltools --no-debug --catalog-xml $(CATALOG) $^ --merge-support-ontologies $(QELK) --run-reasoner -r elk -u $(ROPTS) > [email protected] && mv [email protected] $@
# @Deprecated
core-bridge-check-%.txt: core.owl bridge/bridges external-disjoints.owl
owltools --no-debug --catalog-xml $(CATALOG) $< $(OBO)/$*.owl bridge/uberon-bridge-to-$*.owl external-disjoints.owl --merge-support-ontologies $(QELK) --run-reasoner -r elk -u > [email protected] && mv [email protected] $@
# for debugging:
ext-merged-%.owl: ext.owl bridge/bridges external-disjoints.owl
owltools --catalog-xml $(CATALOG) $< $(OBO)/$*.owl bridge/uberon-bridge-to-$*.owl external-disjoints.owl --merge-imports-closure --merge-support-ontologies -o $@
.PRECIOUS: ext-merged-%.owl
bridge-dv-check-%.txt: ext-merged-%.owl
owltools --no-debug $< --reasoner elk --check-disjointness-axioms > [email protected] && mv [email protected] $@
# check for dangling classes
# TODO: add to Oort
%-orphans: %.obo
obo-grep.pl --neg -r "(is_a|intersection_of|is_obsolete):" $< | obo-grep.pl -r Term - | obo-grep.pl --neg -r "id: UBERON:(0001062|0000000)" - | obo-grep.pl -r Term - > [email protected] && (egrep '^(id|name):' [email protected] > $@ || echo ok)
# TODO: add to Oort
%-xp-check: %.obo
obo-check-xps.pl $< > $@ 2> [email protected] || (echo "problems" && exit 1)
# See: http://douroucouli.wordpress.com/2012/07/03/45/
# TODO - make the OWL primary
depictions.omn: uberon_edit.obo
./util/mk-image-ont.pl $< > $@
depictions.owl: depictions.omn
owltools $< -o file://`pwd`/$@
quick-qc: core.owl uberon_edit-obscheck.txt
cat uberon_edit-obscheck.txt
QC_FILES = checks\
core.owl\
uberon.owl\
uberon.obo\
uberon.json\
external-disjoints.owl\
depictions.owl\
bridge/bridges\
quick-bridge-checks\
bridge-checks\
full-bridge-checks\
extra-full-bridge-checks\
taxon-constraint-check.txt\
uberon.owl\
uberon-base.owl\
basic.obo\
basic.json\
basic-allcycles\
basic-orphans\
merged-orphans\
ext.owl\
ext.obo\
ext.json\
ext-obscheck.txt\
subsets/efo-slim.obo\
subsets/cumbo.obo\
subsets/human-view.obo\
subsets/human-view.owl\
subsets/mouse-view.obo\
subsets/mouse-view.owl\
uberon-dv.txt\
uberon-discv.txt\
composites\
composite-metazoan-basic.obo\
composite-metazoan-dv.txt\
reports/stages\
all_taxmods\
# depictions.owl\
uberon-qc: imports $(QC_FILES) all_subsets
cat merged-orphans uberon_edit-obscheck.txt uberon_edit-xp-check.err uberon-orphans uberon-synclash uberon-dv.txt uberon-discv.txt uberon-simple-allcycles uberon-simple-orphans composite-metazoan-dv.txt
# Disjoint violations
%-dv.txt: %.owl
owltools --no-debug $< $(QELK) --run-reasoner -r elk -u > [email protected] && grep UNSAT [email protected] > $@
# TODO - need closure for taxslim too
%-obscheck.txt: %.obo
((obo-map-ids.pl --ignore-self-refs --use-consider --use-replaced_by $< $<) > /dev/null) >& $@
# ----------------------------------------
# SUBSETS
# ----------------------------------------
# System-specific subsets
#PA = phenoscape-vocab/phenoscape-anatomy.obo
TERM_nephron := UBERON:0001285
TERM_musculoskeletal := UBERON:0002204
TERM_excretory := UBERON:0001008
TERM_reproductive := UBERON:0000990
TERM_digestive := UBERON:0001007
TERM_nervous := UBERON:0001016
TERM_sensory := UBERON:0004456
TERM_immune := UBERON:0002405
TERM_circulatory := UBERON:0001009
TERM_pulmonary := UBERON:0001004
TERM_cranial := UBERON:0010323
TERM_renal := UBERON:0001008
TERM_appendicular := UBERON:0002091
SYSTEMS = musculoskeletal excretory nephron reproductive digestive nervous sensory immune circulatory pulmonary cranial renal appendicular
all_subsets: all_systems subsets/life-stages-composite.obo subsets/life-stages-core.obo subsets/life-stages-core.owl
all_systems: all_systems_obo all_systems_owl all_systems_json all_systems_tsv
all_systems_obo: $(patsubst %,subsets/%-minimal.obo,$(SYSTEMS))
all_systems_owl: $(patsubst %,subsets/%-minimal.owl,$(SYSTEMS))
all_systems_tsv: $(patsubst %,subsets/%-minimal.tsv,$(SYSTEMS))
all_systems_json: $(patsubst %,subsets/%-minimal.json,$(SYSTEMS))
subsets/merged-partonomy.owl: merged.owl
robot remove --input $< --axioms "equivalent disjoint type abox" \
remove --exclude-term BFO:0000050 --select "object-properties" \
-o $@
.PRECIOUS: subsets/merged-partonomy.owl
subsets/%-minimal.owl: subsets/merged-partonomy.owl
$(eval TERM_ID := $(TERM_$*))
owltools $< --reasoner-query -r elk -d "$(PART_OF) some $(TERM_ID)" --reasoner-query $(TERM_ID) --make-ontology-from-results $(OBO)/uberon/$@ -o $@ >& [email protected]
.PRECIOUS: subsets/%-minimal.owl
subsets/%-minimal.obo: subsets/%-minimal.owl
robot convert -i $< --check false -o [email protected] && mv [email protected] $@
subsets/%-minimal.json: subsets/%-minimal.owl
robot convert -i $< --check false -o [email protected] && mv [email protected] $@
subsets/%-minimal.tsv: subsets/%-minimal.owl
robot export -i $< -c "ID|label|SYNONYMS" -e [email protected] && mv [email protected] $@
# TODO: need to add subclass axioms for all intersections
subsets/musculoskeletal-full.obo: merged.owl
owltools $< --reasoner-query -r elk -d -c $(OBO)/uberon/$@ "$(PART_OF) some UBERON_0002204" -o -f obo file://`pwd`/$@ --reasoner-dispose
subsets/vertebrate-head.obo: composite-vertebrate.owl
owltools $< --reasoner-query -r elk -d "$(PART_OF) some UBERON_0000033" --make-ontology-from-results $(OBO)/uberon/$@ -o -f obo --no-check $@ --reasoner-dispose >& [email protected]
# TODO - switch to purls for OWL once released
subsets/subsets/life-stages-mammal.owl: subsets/life-stages-core.owl
owltools $< developmental-stage-ontologies/mmusdv/mmusdv.obo developmental-stage-ontologies/hsapdv/hsapdv.obo --merge-support-ontologies -o file://`pwd`/$@
#subsets/life-stages.obo: uberon.owl
#subsets/life-stages.obo: composite-metazoan.obo
subsets/life-stages-composite.obo: composite-metazoan.owl
owltools $< --reasoner-query -r elk -l 'life cycle stage' --make-ontology-from-results $(OBO)/uberon/$@ --add-ontology-annotation $(DC)/description "Life cycle stage subset of uberon composite-vertebrate ontology (includes species stage ontologies)" -o -f obo --no-check $@ --reasoner-dispose >& [email protected]
subsets/life-stages-core.obo: uberon.owl
owltools $< --reasoner-query -r elk -l 'life cycle stage' --make-ontology-from-results $(OBO)/uberon/$@ --add-ontology-annotation $(DC)/description "Life cycle stage subset of uberon core (generic stages only)" -o -f obo $@ --reasoner-dispose >& [email protected]
subsets/life-stages-core.owl: uberon.owl
owltools $< --reasoner-query -r elk -l 'life cycle stage' --make-ontology-from-results $(OBO)/uberon/$@ --add-ontology-annotation $(DC)/description "Life cycle stage subset of uberon core (generic stages only)" -o file://`pwd`/$@ --reasoner-dispose >& [email protected]
subsets/immaterial.obo: merged.owl
owltools $< --reasoner-query -r elk -d UBERON_0000466 --make-ontology-from-results $(OBO)/uberon/$@ -o -f obo $@ --reasoner-dispose >& [email protected]
subsets/%.owl: subsets/%.obo
owltools $< -o [email protected] && mv [email protected] $@
# ----------------------------------------
# HISTORIC/LEGACY, NEEDS PRESERVED
# ----------------------------------------
# get rid of non subclass xrefs
%-xf.obo: %.obo
egrep -v '^xref: (OpenCyc|http)' $< > $@
# used for (obsolete) disjointness checks
# historic
#%-with-isa.obo: %-xf.obo
# blip -i $*.obo -u ontol_manifest_has_subclass_from_xref io-convert -to obo -o $@
#.PRECIOUS: %-with-isa.obo
# for now we use a simplified set of relations, as this is geared towards analysis
subsets/uberon-with-isa-for-%.obo: uberon.obo
blip-ddb -i $< -u ontol_manifest_has_subclass_from_selected_xref -u ontol_management -goal "set_selected_idspaces('$*'),retractall(ontol_db:disjoint_from(_,_)),delete_relation_usage_except([develops_from,part_of,continuous_with,capable_of])" io-convert -to obo -o $@
.PRECIOUS: %-with-isa.obo
uberon-isa-to-%.obo: uberon.obo
obo-grep.pl -r '^id: $*' $< > $@
# @Dep
other-bridges: merged.owl
owltools $< --extract-bridge-ontologies -d tmp -s uberon -x -o -f obo tmp/minimal.obo
# ----------------------------------------
# CL (to be replaced)
# ----------------------------------------
# core: the full ontology, excluding external classes, but including references to these
# TODO: use --make-subset-by-properties
# note: requires symlink to cl directory
cl-core.obo: uberon_edit.obo
owltools $(OBO)/cl.owl --make-subset-by-properties -n BFO:0000050 BFO:0000051 RO:0002202 RO:0002215 --remove-external-classes -k CL --remove-axiom-annotations --remove-imports-declarations -o -f obo --no-check $@
#cl-core.obo: cell-ontology/cl.obo
# obo-grep.pl -r 'id: CL:' $< | grep -v ^intersection_of | grep -v ^disjoint | grep -v ^equivalent | grep -v ^owl-axioms | (obo-filter-relationships.pl -t part_of -t capable_of -t develops_from - && cat develops_from.obo part_of.obo has_part.obo capable_of.obo) > $@
# TODO - this may replace the above BUT need to preserve dangling axioms
cl-core-new.obo: cell-ontology/cl.obo
owltools $< --make-subset-by-properties BFO:0000050 RO:0002202 RO:0002215 // --remove-axioms -t DisjointClasses -o -f obo $@
# this is required for bridging axioms; ZFA inverts the usual directionality
cl-xrefs.obo:
blip-findall -r ZFA "entity_xref(Z,C),id_idspace(C,'CL')" -select C-Z -use_tabs -no_pred | tbl2obolinks.pl --rel xref > $@
cl-core.owl: cl-core.obo
$(MAKEOBO)
#obolib-obo2owl --allow-dangling $< -o $@
# ----------------------------------------
# OBO-BASIC CHECKS
# ----------------------------------------
%-allcycles: %.owl
owltools --no-debug $< --list-cycles -f > $@
# TODO: use ROBOT
#%-synclash: %.obo
# blip-findall -u query_obo -i $< "same_label_as(X,Y,A,B,C),X@<Y,class_refcount(X,XC),class_refcount(Y,YC)" -select "same_label_as(X,Y,A,B,C,XC,YC)" -label > $@
%-synclash: %.obo
touch $@ && echo TODO
# ----------------------------------------
# COMPOSITE STAGES
# ----------------------------------------
update-stages: $(EDITSRC)
(cd developmental-stage-ontologies && git pull) && touch $@
CSTAGES := $(filter-out %bridge-to-uberon.obo, $(wildcard developmental-stage-ontologies/*/*-uberon.obo))
#CSTAGES := $(wildcard developmental-stage-ontologies/*/*-uberon.obo)
#merged-stages.obo: $(EDITSRC)
# owltools $(filter-out %-uberon.obo, $(wildcard developmental-stage-ontologies/*/*.obo)) -o -f obo $@
# TODO: properly trigger this from changes
merged-stages-xrefs.obo: developmental-stage-ontologies/ssso-merged.obo
blip-findall -i $< "entity_xref_idspace(X,U,'UBERON')" -no_pred -label -select U-X | tbl2obolinks.pl -k --rel xref - > [email protected] && mv [email protected] $@
composite-stages.obo: update-stages merged-stages-xrefs.obo
owltools $(CSTAGES) merged-stages-xrefs.obo --merge-support-ontologies -o -f obo --no-check $@
# ----------------------------------------
# COMPOSITE ANATOMY: PREPROCESSING
# ----------------------------------------
composites: composite-metazoan.obo composite-vertebrate.obo
# Note: mirrors are now generated on demand
##mirror-%.owl: uberon_edit.obo
mirror-%.owl:
wget --no-check-certificate $(OBO)/$*.owl -O $@ && touch $@
.PRECIOUS: mirror-%.owl
# FEDERATED ONTOLOGY MIRRORING
local-poro.owl:
owltools $(OBO)/poro.owl --merge-imports-closure --remove-annotation-assertions -l -s -d -o $@
local-cteno.owl:
owltools $(OBO)/cteno.owl --remove-import-declaration $(OBO)/uberon/ext.owl --merge-imports-closure --remove-annotation-assertions -l -s -d -o $@
local-ceph.owl:
owltools $(OBO)/ceph.owl --remove-import-declaration $(OBO)/ceph/imports/uberon_import.owl --merge-imports-closure --remove-annotation-assertions -l -s -d -o $@
# NON-ORTHOGONAL ONTOLOGY MIRRORING
## Map legacy OBO-format ObjectProperties to their BFO/RO intended equivalent
## TODO: many ontologies may have fixed their legacy properties
local-%.owl: mirror-%.owl
owltools $< bridge/uberon-bridge-to-caro.owl bridge/cl-bridge-to-caro.owl --rename-entities-via-equivalent-classes --repair-relations \
--rename-entity $(OBO)/$*#develops_in $(OBO)/RO_0002203 \
--rename-entity $(OBO)/$*#develops_from $(OBO)/RO_0002202 \
--rename-entity $(OBO)/$*#preceded_by $(OBO)/RO_0002087 \
--rename-entity $(OBO)/$*#starts_at_end_of $(OBO)/RO_0002087 \
--rename-entity $(OBO)/$*#DESCENDENTOF $(OBO)/RO_0002476 \
--rename-entity $(OBO)/$*#DESCINMALE $(OBO)/RO_0002478 \
--rename-entity $(OBO)/$*#DESCINHERM $(OBO)/RO_0002477 \
--rename-entity $(OBO)/$*#connected_to $(OBO)/RO_0002170 \
--rename-entity $(OBO)/$*#start $(OBO)/RO_0002496 \
--rename-entity $(OBO)/$*#end $(OBO)/RO_0002497 \
--rename-entity $(OBO)/$*#start_stage $(OBO)/RO_0002496 \
--rename-entity $(OBO)/$*#end_stage $(OBO)/RO_0002497 \
--rename-entity $(OBO)/$*#releases_neurotransmitter $(OBO)/RO_0002111 \
--rename-entity $(OBO)/$*#develops_directly_from $(OBO)/RO_0002207 \
--rename-entity $(OBO)/$*#electrically_synapsed_to $(OBO)/RO_0002003 \
--rename-entity $(OBO)/$*#regional_part_of $(OBO)/BFO_0000050 \
--rename-entity $(OBO)/$*#systemic_part_of $(OBO)/BFO_0000050 \
--rename-entity $(OBO)/$*#constitutional_part_of $(OBO)/BFO_0000050\
--remove-axioms -t DisjointClasses --remove-axioms -t ObjectPropertyRange --remove-axioms -t ObjectPropertyDomain --remove-annotation-assertions -l -s -d -o -f ofn $@
local-%.obo: local-%.owl
owltools $< -o -f obo $@
#local-NIF_GrossAnatomy.obo: merged.obo
# wget http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-GrossAnatomy.owl -O [email protected] && perl -pi -ne 's@http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-GrossAnatomy.owl#@$(OBO)/NIF_GrossAnatomy_@g' [email protected] && owltools [email protected] -o -f obo $@
# We use the branch here: https://github.com/cmungall/human-developmental-anatomy-ontology/tree/uberon
# this has some necessary changes, e.g. https://github.com/cmungall/human-developmental-anatomy-ontology/issues/1
mirror-ehdaa2.owl:
owltools https://raw.githubusercontent.com/cmungall/human-developmental-anatomy-ontology/uberon/src/ontology/ehdaa2-edit.obo -o -f ofn $@
#mirror-ehdaa2.obo:
# wget $(OBO)/ehdaa2.obo -O $@
#fixed-ehdaa2.obo: mirror-ehdaa2.obo
# obo-grep.pl -r 'id: (EHDAA2|AEO)' $< | ./util/fix-ehdaa2-stages.pl | grep -v ^alt_id > $@
# stages must be mapped to MmusDv
fixed-emapa.obo: mirror-emapa.obo
obo-grep.pl -r 'id: EMAPA' $< | ./util/fix-emapa-stages.pl > $@
mirror-emapa.owl: fixed-emapa.obo developmental-stage-ontologies/mmusdv/mmusdv.obo
owltools $^ --merge-support-ontologies -o -f ofn $@
mirror-emapa.obo: uberon_edit.obo
wget --no-check-certificate $(OBO)/emapa.obo -O $@
.PRECIOUS: mirror-emapa.obo
# https://github.com/obophenotype/uberon/issues/423#issuecomment-43425949
fixed-zfa.obo: mirror-zfa.obo
perl -npe 's@RO:0002488@RO:0002496@;s@RO:0002492@RO:0002497@' $< > $@
mirror-zfa.owl: fixed-zfa.obo
owltools $< -o -f ofn $@
mirror-zfa.obo:
wget $(OBO)/zfa.obo -O $@
# ----------------------------------------
# COMPOSITE ANATOMY: BUILDING
# ----------------------------------------
# many external ontologies do not adhere to all uberon constraints
ext-weak.owl: ext.owl
owltools $(UCAT) $< --merge-imports-closure --remove-axioms -t DisjointClasses --remove-equivalent-to-nothing-axioms -o $@
MBASE = ext-weak.owl bridge/bridges
# A subset of OPs will be turned into taxon GCIs
TAXON_GCI_RELS = RO:0002202 RO:0002496 RO:0002497 BFO:0000051
MERGESPECIES =\
--merge-species-ontology -s 'mouse' -t NCBITaxon:10090 -q $(TAXON_GCI_RELS) \
--merge-species-ontology -s 'human' -t NCBITaxon:9606 -q $(TAXON_GCI_RELS) \
--merge-species-ontology -s 'primate' -t NCBITaxon:9443 \
--merge-species-ontology -s 'Xenopus' -t NCBITaxon:8353 \
--merge-species-ontology -s 'Danio' -t NCBITaxon:7954 \
--merge-species-ontology -s 'Drosophila' -t NCBITaxon:7227 \
--merge-species-ontology -s 'C elegans' -t NCBITaxon:6237 \
MERGE_EQSETS = --merge-equivalence-sets -s UBERON 10 -s CL 9 -s CARO 5 -l UBERON 10 -l CL 9 -d UBERON 10 -d CL 9
MAKESPMERGE= $(UCAT)\
--map-ontology-iri $(OBO)/uberon.owl ext-weak.owl\
--map-ontology-iri $(OBO)/fma.owl null.owl\
--map-ontology-iri $(OBO)/uberon/bridge/uberon-bridge-to-fma.owl null.owl\
$(OBO)/uberon/bridge/collected-$*.owl --merge-imports-closure
# bundled: collect all ontologies and do a basic (non-species) import closure merge
# primarily for testing: not released
bundled-%.owl: $(MBASE)
OWLTOOLS_MEMORY=12G owltools $(MAKESPMERGE) --merge-import-closure -o -f ofn $@
.PRECIOUS: unreasoned-composite-%.owl
# stage1 of composite build: do a species merge, but no additional reasoning
unreasoned-composite-%.owl: $(MBASE)
OWLTOOLS_MEMORY=12G owltools $(MAKESPMERGE) --reasoner elk $(MERGESPECIES) $(MERGE_EQSETS) -o -f ofn $@
.PRECIOUS: unreasoned-composite-%.owl
# stage 2 (final) of composite build: reason
composite-%.owl: unreasoned-composite-%.owl
$(ROBOT) reason -r ELK -i $< relax reduce -r ELK -o [email protected] && mv [email protected] $@
.PRECIOUS: composite-%.owl
# composute obo is made from owl
composite-%.obo: composite-%.owl
owltools $< --add-obo-shorthand-to-properties -o -f obo --no-check [email protected] && grep -v ^owl-axioms: [email protected] > $@
test-composite-%.owl: composite-%.owl
$(ELKRUN)
composite-metazoan-basic.obo: composite-metazoan.owl
owltools $< --extract-mingraph --remove-axiom-annotations --make-subset-by-properties -f $(BASICRELS) --set-ontology-id $(OBO)/uberon/composite-metazoan-basic.owl -o -f obo --no-check [email protected] && mv [email protected] [email protected] && grep -v '^owl-axioms:' [email protected] > $@
# ----------------------------------------
# TAXON MODULES
# ----------------------------------------
all_taxmods: uberon-taxmod-amniote.obo uberon-taxmod-euarchontoglires.obo
#all_taxmods: uberon-taxmod-amniote.obo uberon-taxmod-aves.obo uberon-taxmod-euarchontoglires.obo
# ELK DOES NOT COMPLETE
#uberon-taxmod-aves.owl: uberon-taxmod-8782.owl
# cp $< $@
uberon-taxmod-euarchontoglires.owl: uberon-taxmod-314146.owl
cp $< $@
uberon-taxmod-amniote.owl: uberon-taxmod-32524.owl
cp $< $@
uberon-taxmod-human.owl: uberon-taxmod-9606.owl
cp $< $@
#uberon-taxmod-annelid.owl: uberon-taxmod-6340.owl
# cp $< $@
uberon-taxmod-%.obo: uberon-taxmod-%.owl
OWLTOOLS_MEMORY=14G owltools $(UCAT) $< --remove-imports-declarations -o -f obo --no-check [email protected] && grep -v ^owl [email protected] > $@
# added --allowEquivalencies, see https://github.com/geneontology/go-ontology/issues/12926
uberon-taxmod-%.owl: ext.owl
owltools --use-catalog $< --reasoner elk --make-species-subset -t NCBITaxon:$* --assert-inferred-subclass-axioms --allowEquivalencies --useIsInferred --remove-dangling --set-ontology-id $(OBO)/uberon/subsets/$@ -o $@ >& [email protected]
#uberon-taxmod-%.owl: uberon-taxmod-%.ids
# blip-ddb -u ontol_db -r uberonp -format "tbl(ids)" -i $< -goal "forall((class(C),\+ids(C)),delete_class(C)),remove_dangling_facts" io-convert -to obo > $@
# blip ontol-query -r uberonp -format "tbl(ids)" -i $< -to obo -query "ids(ID)" > [email protected] && grep -v ^disjoint_from [email protected] | grep -v 'relationship: spatially_disjoint' > $@
.PRECIOUS: uberon-taxmod-%.owl
#taxtable.txt: uberon_edit.obo
# owltools $< --make-class-taxon-matrix --query-taxa external/ncbitaxon-subsets/taxslim.obo -o z NCBITaxon:9606 NCBITaxon:7955
# ----------------------------------------
# BRIDGES
# ----------------------------------------
# seed.owl is never released - it is used to seed module extraction
seed.owl: phenoscape-ext-noimports.owl uberon_edit.owl cl-core.obo
owltools $(UCAT) uberon_edit.owl $< cl-core.obo --merge-support-ontologies -o -f functional $@
# this is used for xrefs for bridge files
# TODO: investigate why this necessary: --add-support-from-imports --remove-imports-declarations
seed.obo: seed.owl
owltools $(UCAT) $< --add-support-from-imports --remove-imports-declarations -o -f obo --no-check [email protected] && obo-grep.pl --neg -r is_obsolete [email protected] > $@
BRIDGESRC_OBO = uberon_edit.obo cl-with-xrefs.obo
bridge/uberon-bridge-to-nifstd.obo: uberon_edit.obo
./util/xref-to-equiv.pl uberon/bridge/uberon-bridge-to-nifstd http://uri.neuinfo.org/nif/nifstd/ $< > [email protected] && mv [email protected] $@
bridge/%.owl: bridge/%.obo
owltools --use-catalog $< --remove-annotation-assertions -o $@
bridge/bridges: bridge/uberon-bridge-to-vhog.owl seed.obo cl-with-xrefs.obo bridge/uberon-bridge-to-nifstd.owl
cd ./bridge && ../make-bridge-ontologies-from-xrefs.pl ../seed.obo && ../make-bridge-ontologies-from-xrefs.pl -b cl ../cl-with-xrefs.obo ../cl-xrefs.obo && touch bridges
cl-with-xrefs.obo: cl-core.obo
egrep '^(idspace|treat-)' uberon_edit.obo > $@ && cat $< >> [email protected] && ./util/expand-idspaces.pl [email protected] > $@
bridge/uberon-bridge-to-vhog.owl: uberon_edit.obo