Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add taxon constraints #2108

Merged
merged 5 commits into from
Oct 20, 2021
Merged

Add taxon constraints #2108

merged 5 commits into from
Oct 20, 2021

Conversation

rays22
Copy link
Collaborator

@rays22 rays22 commented Oct 19, 2021

This commit intends to

  1. add taxon constraint in taxon some Arthropoda to some terms
    using a ROBOT template,
  2. add taxon restriction annotation never in taxon Mammalia (NCBITaxon:40674) to some terms using another ROBOT template.

If applied, this commit will address #2050.

1.  add taxon constraint `in taxon` *some* **Arthropoda** to some terms
using a ROBOT template,
2. add taxon restriction annotation `never in taxon` **Mammalia** (NCBITaxon:40674) to some terms using another ROBOT template.

If applied, this commit will address #2050.
@rays22 rays22 self-assigned this Oct 19, 2021
@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

sh run.sh make tmp/materialized.owl
tail -100 tmp/materialized.owl.LOG | pbcopy
2021-10-19 14:36:46,475 ERROR org.obolibrary.robot.ReasonerHelper - There are 11 unsatisfiable classes in the ontology.
2021-10-19 14:36:46,476 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007260
2021-10-19 14:36:46,477 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0015853
2021-10-19 14:36:46,478 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007261
2021-10-19 14:36:46,479 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0015852
2021-10-19 14:36:46,480 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0016622
2021-10-19 14:36:46,481 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007262
2021-10-19 14:36:46,482 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007263
2021-10-19 14:36:46,483 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007264
2021-10-19 14:36:46,484 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0007265
2021-10-19 14:36:46,484 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0005083
2021-10-19 14:36:46,485 ERROR org.obolibrary.robot.ReasonerHelper -     unsatisfiable: http://purl.obolibrary.org/obo/UBERON_0003910

@rays22 rays22 mentioned this pull request Oct 19, 2021
@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

ROBOT report

robot reason --input uberon-edit.obo --output tmp/unsatisfiable.owl
robot explain -i tmp/unreasoned.owl -M unsatisfiability --unsatisfiable random:10 --explanation tmp/explain.md

explain.md

@dosumis
Copy link
Contributor

dosumis commented Oct 19, 2021

Will be much less confusing to work through this in Protege.

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

for debugging (explain.md --> explain.html)

intervertebral disk of axis SubClassOf Nothing

intervertebral disk of third cervical vertebra SubClassOf Nothing

intervertebral disk of seventh cervical vertebra SubClassOf Nothing

narwhal tusk SubClassOf Nothing

nipple sheath SubClassOf Nothing

dental pulp of median incisor tusk SubClassOf Nothing

splenic sinusoid SubClassOf Nothing

intervertebral disk of sixth cervical vertebra SubClassOf Nothing

intervertebral disk of fifth cervical vertebra SubClassOf Nothing

intervertebral disk of fourth cervical vertebra SubClassOf Nothing

Axiom Impact

Axioms used 10 times

Axioms used 6 times

Axioms used 3 times

Axioms used 2 times

Axioms used 1 times

Ontologies used:

  • ro_import.owl (http://purl.obolibrary.org/obo/uberon/imports/ro_import.owl)
  • ncbitaxon_import.owl (http://purl.obolibrary.org/obo/uberon/imports/ncbitaxon_import.owl)
  • go_import.owl (http://purl.obolibrary.org/obo/uberon/imports/go_import.owl)
  • core.owl (http://purl.obolibrary.org/obo/uberon/core.owl)
  • pato_import.owl (http://purl.obolibrary.org/obo/uberon/imports/pato_import.owl)
  • nbo_import.owl (http://purl.obolibrary.org/obo/uberon/imports/nbo_import.owl)
  • cl_import.owl (http://purl.obolibrary.org/obo/uberon/imports/cl_import.owl)
  • envo_import.owl (http://purl.obolibrary.org/obo/uberon/imports/envo_import.owl)

@dosumis
Copy link
Contributor

dosumis commented Oct 19, 2021

I think the robot reports are not very helpful in this case. The cases above are all indirect - inconsistency comes from referencing an inconsistent term. It's much easier to home in on the terms causing the problem when working in Protege. I just checked out out the branch and src/ontology/uberon-edit.obo. It doesn't appear to be inconsistent when reasoning using ELK. Any idea why?

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

  • nipple sheath SubClassOf Nothing
    • Nothing EquivalentTo external integument structure and (in taxon some Mammalia)

contradicts

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

  • narwhal tusk SubClassOf Nothing
  • dental pulp of median incisor tusk SubClassOf Nothing
    • Nothing EquivalentTo premaxillary tooth and (in taxon some Mammalia)

contradicts

http://purl.obolibrary.org/obo/UBERON_2001626 UBERON:2001626 'premaxillary tooth'
never_in_taxon Mammalia

@dosumis
Copy link
Contributor

dosumis commented Oct 19, 2021

That certainly looks wrong:

Display name http://purl.obolibrary.org/obo/UBERON_3000961 UBERON:3000961 'external integument structure'
never_in_taxon Mammalia. @paolaroncaglia - does this come from one of the sheets?

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

  • intervertebral disk of axis SubClassOf Nothing
  • intervertebral disk of third cervical vertebra SubClassOf Nothing
  • intervertebral disk of fourth cervical vertebra SubClassOf Nothing
  • intervertebral disk of fifth cervical vertebra SubClassOf Nothing
  • intervertebral disk of sixth cervical vertebra SubClassOf Nothing
  • intervertebral disk of seventh cervical vertebra SubClassOf Nothing
    • Nothing EquivalentTo postcranial axial cartilage and (in taxon some Mammalia)

contradicts

@cmungall
Copy link
Member

I think the robot reports are not very helpful in this case.

I find them v useful! I can find the problems right here without opening Protege

The cases above are all indirect - inconsistency comes from referencing an inconsistent term

Hmm, according to the spec in ontodev/robot#329 we should be finding minimal unsats "Bonus: in an ontology with multiple unsats, it can be useful to start with the one with the most minimal explanation, typically the MRCAs of all unsats in the asserted hierarchy. It may even be possible to combine explanations to find the most likely offending axiom"

In any case, maybe my brain is just too uberon-wired but I can mentally filter the redundant ones easily

  • narwhal tusk. This is a fun one. Even though narwhal's are not our priority, this is reveals what otherwise would have been a very bad cryptic error. Here the assumption that the TAO term "premaxillary tooth" is not in mammals is totally wrong. Humans have premaxillary teeth!

Are you blanket adding TCs for all TAO (UBERON:2x) terms? Or is there a fltered curated sheet? If so what is the link? It makes sense to review the unsats in light of the sheet. Ideally we would have some kind of report that integrates these. E.g. add one term at a time in the TSV and report errors in the sheet

@cmungall
Copy link
Member

And agreed, TCs on vague groupings like "external integument structure" are likely wrong. Do we even need this class?

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

  • splenic sinusoid SubClassOf Nothing
    • Nothing EquivalentTo fenestrated capillary and (in taxon some Mammalia)

contradicts

Display name http://purl.obolibrary.org/obo/UBERON_2005260 UBERON:2005260 'fenestrated capillary'
never_in_taxon Mammalia

@cmungall
Copy link
Member

The splenic sinusoid explanation seems incomplete?

In any case the proposed TC is obviously contradicting FMA:

id: UBERON:2005260
name: fenestrated capillary
def: "Capillary that has pores in the endothelial cells (60-80 nm in diameter) that are spanned by a diaphragm of radially oriented fibrils and allow small molecules and limited amounts of protein to diffuse." [Wikipedia:Capillary#Types, Wikipedia:Fenestra_(histology)]
synonym: "fenestrated blood vessel endothelium" BROAD [ZFA:0005260]
synonym: "fenestrated capillary vessel" EXACT [FMA:63196]
xref: FMA:63196
xref: NCIT:C32595
xref: TAO:0005260
xref: UMLS:C1179615 {source="ncithesaurus:Fenestrated_Capillary"}
xref: Wikipedia:Capillary#Types
xref: ZFA:0005260
is_a: UBERON:0001982 {source="FMA"} ! capillary
is_a: UBERON:0004638 {source="ZFA"} ! blood vessel endothelium
property_value: editor_note "the ZFA class from which this was derived is not explicitly classified as a capillary - need to verify for taxon histology differences" xsd:string
property_value: external_definition "Blood vessel endothelium that has pores that allow passage small molecules and proteins[ZFA]." xsd:string

before getting fancy with reasoning a sensible first pass check is to look at the ontologies that use them

Also are we asserting present-in-taxon axioms for mappings to FMA etc?

@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

never_in_taxon Mammalia. @paolaroncaglia - does this come from one of the sheets?

Yes, it does..
OK, I think I know how to fix this. I need to omit the 11 terms that cause the problems from the ROBOT template and then do a fresh merge.

This commit intends to avoid the
11 unsatisfiable classes from the previous commit by excluding these terms from the ROBOT template `uberon2x-3x_robot.tsv`:
UBERON:3000961 'external integument structure' -- 1
UBERON:2001626 'premaxillary tooth' -- 2
UBERON:2001457 'postcranial axial cartilage' -- 6
UBERON:2005260 'fenestrated capillary' -- 1
UBERON:2001995 'papilla' -- 1
If applied, this commit will address #2050.
@rays22
Copy link
Collaborator Author

rays22 commented Oct 19, 2021

Excluding

UBERON:3000961 'external integument structure'
UBERON:2001626 'premaxillary tooth'
UBERON:2001457 'postcranial axial cartilage'
UBERON:2005260 'fenestrated capillary'
UBERON:2001995 'papilla'

from the ROBOT template seems to fix the unsatisfiable classes problem.

@dosumis
Copy link
Contributor

dosumis commented Oct 19, 2021

Happy to approve if we can get a non-huge diff. Still too large to display.

@cmungall
Copy link
Member

I can see the diff if I click "load diff"

it's not optimal as sometimes the name is truncated, and there are many redundancies.

Coming up with the perfect entailment diff is not trivial (I am not sure if ontobot will work out the box here since we need to transform the APs to TBox axioms)

If it is not hard what about a query for all TCs in this batch:

  • only-in where there is not an only in to the same taxon or descendant taxon to the same term or an isa-partof-develops-from ancestor
  • never-in where there is not an never in to the same taxon or ancestor taxon to the same term or an isa-partof-develops-from ancestor

(I have prolog queries for all this but weaning us off them...)

If either the query or the review is too hard, I am OK to sign off on merging this, my intuition is that there will be very few false positives, and any such will be relatively low utility and can be added back later.

However, provenance must be added so that we aren't perplexed by these 3 years later...

Copy link
Member

@cmungall cmungall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add per axiom provenance. Can be to the issue.

Copy link
Contributor

@paolaroncaglia paolaroncaglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rays22 @dosumis
Thanks, lots of work! I can load the diff, but as Chris says it's not in an ideal format to interpret, and it'd be great to get "non-human-focused" eyes to review/approve this PR.

@dosumis
Copy link
Contributor

dosumis commented Oct 20, 2021

add per axiom provenance. Can be to the issue.

Let's have a go at doing this, but I don't want it to end up as rabbit hole that prevents us getting these out ASAP.

@rays22 this can be done with an additional column:

PROVENANCE
>AT rdfs:seeAlso^^xsd:anyURI
{ticket URL here}

See annotations doc at http://robot.obolibrary.org/template for explanation.

Not sure exactly what this will look like in OBO. If it ends up in the header, we might need to move the axioms to an OWL extension file.

@matentzn - I took the typing from Mondo - please let us know if this is not correct.

@matentzn
Copy link
Contributor

I think this is fine! I actually never thought about the difference between AT xsd:anyUri and AI..

This commit intends to
1.  add taxon constraint `in taxon` *some* **Arthropoda** to some terms
using a ROBOT template,
2. add taxon restriction annotation `never in taxon` **Mammalia** (NCBITaxon:40674) to some terms using another ROBOT template,
3. add provenance for the changes.

If applied, this commit will address #2050.
This commit intends to
1.  add taxon constraint `in taxon` *some* **Arthropoda** to some terms
using a ROBOT template,
2. add taxon restriction annotation `never in taxon` **Mammalia** (NCBITaxon:40674) to some terms using another ROBOT template,
3. add provenance for the changes.

If applied, this commit will address #2050.
@rays22
Copy link
Collaborator Author

rays22 commented Oct 20, 2021

add per axiom provenance. Can be to the issue.

Let's have a go at doing this, but I don't want it to end up as rabbit hole that prevents us getting these out ASAP.

@rays22 this can be done with an additional column:

PROVENANCE

AT rdfs:seeAlso^^xsd:anyURI
{ticket URL here}
See annotations doc at http://robot.obolibrary.org/template for explanation.

Not sure exactly what this will look like in OBO. If it ends up in the header, we might need to move the axioms to an OWL extension file.

@matentzn - I took the typing from Mondo - please let us know if this is not correct.

I have added per axiom provenance to the issue.

@matentzn
Copy link
Contributor

You have correctly addressed the @cmungall issue, so you don't need to wait for his approval again (just for QC to pass).

Note that I changed your provenance a bit to use the "Mondo way". Confusingly, the Mondo way is:

  1. we only use rdfs:seeAlso on term level, i.e. directly as annotation assertions on Terms
  2. on axiom or annotation level, like here, we use oio:source instead of rdfs:seeAlso, because it looks nicer in OBO format

we should not change that system now, if we do not like it, we can fix it in bulk when the time is right. @rays22 can you add a note to our CL/Uberon/RO board to discuss this at the next call

Once QC is passed, this is ready to be merged.

@rays22 rays22 merged commit 35ac965 into master Oct 20, 2021
@rays22 rays22 deleted the issue2050c branch October 20, 2021 16:01
@dosumis
Copy link
Contributor

dosumis commented Oct 22, 2021

Great to see this fixed

I'm curious about when this is generated:

Nothing EquivalentTo postcranial axial cartilage and (in taxon some Mammalia)

If I understand correctly, this is an expansion of a never in taxon AP, but I can't see where this expansion happens in Ray's Robot commands.

robot reason --input uberon-edit.obo --output tmp/unsatisfiable.owl
robot explain -i tmp/unreasoned.owl -M unsatisfiability --unsatisfiable random:10 --explanation tmp/explain.md

Maybe something other command has produced tmp/unreasoned.owl and this is doing the expansion? Would like to know so I can run these locally.

@matentzn
Copy link
Contributor

Yes, you will ahve to run

sh run.sh make  IMP=false PAT=false tmp/unreasoned

To get to this file.

The command is documented here:
https://github.com/obophenotype/uberon/blob/master/src/ontology/uberon.Makefile#L127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants