obophenotype / uberon

An ontology of gross anatomy covering metazoa. Works in concert with https://github.com/obophenotype/cell-ontology
http://obophenotype.github.io/uberon/
Other
134 stars 29 forks source link

How to debug unsat in composite? #1799

Closed matentzn closed 3 years ago

matentzn commented 3 years ago
MBASE = $(TMPDIR)/ext-weak.owl $(BRIDGEDIR)/bridges $(TMPDIR)/local-ma.owl $(TMPDIR)/local-ehdaa2.owl $(TMPDIR)/local-emapa.owl $(TMPDIR)/local-xao.owl \
    $(TMPDIR)/local-zfa.owl $(TMPDIR)/local-fbbt.owl $(TMPDIR)/local-fbdv.owl \
    $(TMPDIR)/local-wbbt.owl $(TMPDIR)/local-wbls.owl $(TMPDIR)/local-ceph.owl \
    $(TMPDIR)/local-cteno.owl $(TMPDIR)/local-poro.owl $(TMPDIR)/allen-mba.obo $(TMPDIR)/allen-pba.obo $(TMPDIR)/allen-hba.obo \
    $(TMPDIR)/allen-dmba.obo $(TMPDIR)/allen-dhba.obo \
    dependencies

# 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 $(URIBASE)/uberon.owl $(TMPDIR)/ext-weak.owl\
  --map-ontology-iri $(URIBASE)/fma.owl $(COMPONENTSDIR)/null.owl\
  --map-ontology-iri $(URIBASE)/uberon/bridge/uberon-bridge-to-fma.owl $(COMPONENTSDIR)/null.owl\
 $(URIBASE)/uberon/$(BRIDGEDIR)/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

This whole block is very hard for me to understand - What should I do if unreasoned-composite-%.owl fails because of an unsatisfiable class?

For example, I get:

Exception in thread "main" owltools.mooncat.SpeciesMergeUtil$UnmergeableOntologyException: unsatisfiable class: <http://purl.obolibrary.org/obo/DHBA_146035008>
    at owltools.mooncat.SpeciesMergeUtil.merge(SpeciesMergeUtil.java:228)
    at owltools.cli.CommandRunner.runSingleIteration(CommandRunner.java:823)
    at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:76)
    at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:68)
    at owltools.cli.CommandLineInterface.main(CommandLineInterface.java:12)
uberon.Makefile:999: recipe for target 'unreasoned-composite-metazoan.owl' failed
make: *** [unreasoned-composite-metazoan.owl] Error 1

Now because SpeciesMergeUtil needs the reasoner, I cant dump an intermediate ontology that I can look and debug. Whats the best way to inspect this problem?

matentzn commented 3 years ago

Found a way to debug:

xxz:
    robot merge --catalog $(CATALOG) -i tmp/ext-weak.owl -i bridge/collected-metazoan.owl -i tmp/allen-dhba.obo -o tmp/debugme.owl

xxx:
    robot explain -i tmp/debugme.owl -M unsatisfiability  --unsatisfiable random:3 --explanation tmp/debug_unsat_dhba.md -o tmp/debug_unsat.owl
matentzn commented 3 years ago

If anyone can see any obvious problems here, please let me know @cmungall @balhoff @dosumis

pulmonary valve leaflet mesenchyme SubClassOf Nothing

trachea basement membrane SubClassOf Nothing

outflow tract cardiac jelly SubClassOf Nothing

trachea reticular lamina SubClassOf Nothing

aortico-pulmonary spiral septum mesenchyme SubClassOf Nothing

aortic valve leaflet mesenchyme SubClassOf Nothing

bronchus basement membrane SubClassOf Nothing

outflow tract neural crest SubClassOf Nothing

membranous interventricular septum mesenchyme SubClassOf Nothing

trachea basal lamina SubClassOf Nothing

Axiom Impact

Axioms used 10 times

Axioms used 6 times

Axioms used 5 times

Axioms used 4 times

Axioms used 3 times

Axioms used 2 times

Axioms used 1 times

Ontologies used:

Ontologies used:

matentzn commented 3 years ago

Ignore this ticket. Found the proble I think.

matentzn commented 3 years ago

Update to self: seems poro carries in disjoint axioms.

dosumis commented 3 years ago

This doesn't look right to me:

brain SubClassOf part of some neural tube [ext.owl]

matentzn commented 3 years ago

@dosumis where did you see this? I don't see that axiom (anymore?) it was there in the first version of the ticket, but I have corrected that since.

matentzn commented 3 years ago

Superceded.