-
Notifications
You must be signed in to change notification settings - Fork 77
Add a collapse command #578
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
Conversation
@ontodev/robot-team Anyone have any thoughts on this implementation? Do you have code that does something similar? |
Before merging this, I'd like @beckyjackson to do a comparison with OntoFox computed intermediates for some reasonably fancy ontology. |
@jamesaoverton I think the Lower terms:
ROBOT method:
OntoFox file:
These two methods produce the exact same hierarchy: Using
Once you set the threshold up to |
@ontodev/robot-team We're planning to merge this soon. Any feedback would be appreciated! |
I don't have strong opinions. I don't really understand the motivation. I am always suspicious about counting levels as they are not often meaningful. Can you give an example of where this is to be used? I worry a bit that it uses a quite general term |
I'm OK with changing the name, but I just want to make sure it correctly conveys that we are removing intermediate nodes, not any bottom or top-level things. Our original use case for this was to minimize the ChEBI tree for IEDB. We have a set of "precious" terms that are the terms that we care about for the IEDB, but there are too many intermediate nodes to get there. It does indiscriminately remove terms, although if there are important intermediate terms (e.g., carbohydrate in ChEBI) you can add them to the "precious" terms and they won't be removed. |
Ah I get it now, for some reason I was reading OK, so I can see how this is useful for certain kinds of ontology structures where there are lots of single children. I expect ncbitaxon too. But IMO this is really just poor ontology design to have this orphan pattern (ncbitaxon ok as it's really a species taxonomy, and doesn't generally include extinct taxa). So I don't see it being used outside a handful of odd ontologies? Not to say that doesn't mean we shouldn't have it, just observing. I don't really see a use case for values other than |
We'll look for a more specific name. When building simplified trees to show to users, we are using thresholds higher than 2. @beckyjackson will check whether the code for the existing |
What about |
+1 collapse
…On Thu, Jan 9, 2020 at 12:58 PM Becky Jackson ***@***.***> wrote:
What about collapse?
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#578?email_source=notifications&email_token=AAYJ7TTO3KNFICBE6AFUL73Q456XJA5CNFSM4I77PAEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIRSR5I#issuecomment-572729589>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYJ7TUYB7WKI7VA4NYLQBTQ456XJANCNFSM4I77PAEA>
.
|
+1 to collapse! |
I changed the method to |
We renamed this command and plan to merge it in the next few days. Last chance to comment! |
What about a default |
That makes sense to me. I just added it. |
Collapse
Sometimes, a class hierarchy can contain more intermediate classes than necessary, especially when extracting modules. ROBOT includes
collapse
to remove intermediate classes based on a minimal number of subclasses, using the--threshold
option.Any intermediate class (has one or more subclasses) that has less than the threshold number of subclasses will be removed. Top-level classes (do not have a named superclass) and bottom-level classes (do not have any subclasses) will not be removed.
For example, given
--threshold 2
:Becomes:
class:C
andclass:D
are removed because they each only have one subclass.class:F
is kept because it has two subclasses, which is the threshold.If there are any classes that you don't want removed, you can keep them regardless of the number of subclasses using
--precious <IRI/CURIE>
(for a set of terms in a file, use--precious-terms <term-file>
).For example, given
--threshold 2
and--precious class:D
, that same example from above would become: