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 an --intermediates option to extract #436

Closed
wants to merge 7 commits into from

Conversation

beckyjackson
Copy link
Contributor

Intermediates

When extracting (especially with MIREOT), sometimes the hierarchy can have too many intermediate classes, making it difficult to identify relevant relationships. For example, you may end up with this after extracting adrenal gland:

 - material anatomical entity
   - anatomical structure
     - multicellular anatomical structure
       - organ
         - abdomen element
           - adrenal/interrenal gland
             - adrenal gland (*)
     - lateral structure
       - adrenal gland (*)

By specifying how to handle these intermediates, you can reduce unnecessary intermediate classes:

  • --intermediates all: default behavior, do not prune the ontology
  • --intermediates minimal: only include intermediate intermediates with more than one sibling (i.e. the parent class has another child)
  • --intermediates none: do not include any intermediates
    • For MIREOT, this will only include top and bottom level classes.
    • For any SLME method, this will only include the classes directly used in the logic of the input terms

The above example, with --intermediates minimal, would become:

- material anatomical entity
  - anatomical structure
    - adrenal gland (*)
    - organ
      - adrenal gland (*)

You can chain this output into reduce to further clean up the structure, as some redundant axioms may appear.

With --intermediates none:

- material anatomical entity
  - adrenal gland

Any term specified as an input term will not be pruned.

@beckyjackson
Copy link
Contributor Author

beckyjackson commented Feb 26, 2019

If you have a class that is asserted to be a subclass of itself, the remove (and filter) extract operation goes into an infinite loop and fails during spanning gaps (minimal intermediates).

EDIT: sorry, meant to say extract for this, not remove and filter. But the problem will be the same for remove and filter while spanning gaps when --preserve-structure true.

Ideally an ontology shouldn't have circular subclasses, but in case it does happen, do we want this operation to fail with an error? Or should we just log a WARN and remove that superclass from the next iteration of spanGapsHelper? @jamesaoverton

@cmungall
Copy link
Contributor

If redundant axioms are removed with reduce then there will be no cycles in the subclass graph

@beckyjackson
Copy link
Contributor Author

True. I can just make it throw a message that says something like:

CIRCULAR SUBCLASS ERROR your ontology contains a circular subclass definition, 
  see x for details

@balhoff
Copy link
Contributor

balhoff commented Feb 26, 2019

I don't think this is an error. It might be unusual, but I think the algorithm should just handle it. Maybe warn about it or provide an option to turn it into an error, but it is a valid situation.

@beckyjackson
Copy link
Contributor Author

Closed in favor of #441

@beckyjackson beckyjackson deleted the intermediates branch May 2, 2019 13:57
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.

3 participants