EBIvariation / trait-curation

A web application for manual curation of trait-to-ontology mappings, including provenance and integration with EBI SPOT stack.
Apache License 2.0
2 stars 2 forks source link

Add status computation for "needs_import" and "needs_creation" terms #71

Closed joj0s closed 4 years ago

joj0s commented 4 years ago

Ontology terms with a status of "needs_import" or "needs_creation" need to be automatically moved to "awaiting_import" and "awaiting_creation" status respectively, when their mappings are reviewed.

joj0s commented 4 years ago

@tskir This computation is proving kind of tricky with this package, because it depends on itself for the most part and I'm not sure if that is supported with the computed fields package. As far as I have seen, a field of that nature can only be a combination of other fields.

So I have found two other ways of doing that, both when submitting a review for a mapping:

  1. In the 'review' view in views.py: In the code that handles the post request to submit a review, we could add a check to see if the mapping that has just been reviewed, contains one of those statuses, and if the mapping now becomes reviewed, update the term status as well.

  2. In the 'Review" model in models.py via a custom save() function: Same logic, but the computation stays in the models.py file. Before saving an instance of the Review model, check whether the current number of reviews equals N -1 (where N is the necessary number of reviews to consider a trait mapped), and do the necessary status updates to the related ontology term.

tskir commented 4 years ago

Before we address any potential limitations of that package, I feel it's very important to point out that “needs (import/creation)” does not change to “awaiting (i/c)” after doing the review. Rather, it has to be a separate process where at some point we take all terms which are in the status “needs (i/c)” and have been already reviewed, and we submit those terms in batch via GitHub API for EFO maintainers to review.

I now realise that, actually, this has not yet been included in the project backlog. I have created the following issues:

tskir commented 4 years ago

Having said that, yes, in any way, the status of traits “awaiting” import or creation will not be automatically computable, and it would have to be changed explicitly when submitting the EFO feedback issue.