WormBase / ACKnowledge

Author Curation to Knowledgebases
MIT License
1 stars 1 forks source link

Display name and id in autocomplete when user enters a transgene id in the list #221

Closed vanaukenk closed 3 years ago

vanaukenk commented 3 years ago

If a user enters a transgene id in the add list, we display the id, but not also the name:

image

Like we do for gene, alleles, and strains, we'll also want to display the transgene name, e.g. ayIs6 (WBTransgene00000098).

valearna commented 3 years ago

This seems to be an API related issue. @azurebrd can you take a look? This is the call to the endpoint as used by the AFP: http://mangolassi.caltech.edu/~azurebrd/cgi-bin/forms/datatype_objects.cgi?action=autocompleteXHR&objectType=transgene&userValue=WBTransgene00000098

azurebrd commented 3 years ago

@valearna @vanaukenk That's how it works in the OA, datatypes you type resolve to the object ID, not the object name. Since you're entering the object ID, it's resolving to itself. To get the name you'd have to parse through the object's Term Info, and figure out what you want to display for each different datatype. The Gene objects are handled differently because there's so many tables that data comes from, and there's different types of names. I'd have to look at the details, but it's certainly the same as Transgene for WBVariations, WBRNAi, and others. I guess, it's never been an issue in the OA.

valearna commented 3 years ago

@azurebrd Is the autocomplete API used only by the OA and the AFP? I thought that uPub used it as well and there may be the same issue there. In any case it would be better if the autocomplete could handle these cases. We could write our own autocomplete for the AFP by directly reading data from postgres but it sounds like it would be useful to have a single API for this shared by all projects.

draciti commented 3 years ago

Hi @azurebrd and @valearna , fwiw, besides gene names displayed when you enter an ID, we have the same mechanism for variation, e.g. if you paste WBVar00143673 in the Variation field in Expression OA (tab3), OA returns the Variation name alongside the ID in parenthesis. I hope this helps

azurebrd commented 3 years ago

@valearna I don't know what other things use the autocomplete.

@draciti @vanaukenk We've wanted to use the autocomplete system the OA uses so there's consistency in what curators see. It's worked fine for curators using the OA. In the OA, how often do you use an object ID ? Well, I guess, if you're using an object ID, don't you already know what the object is ? I could look into how Variation and Gene work differently from Transgene, but there's a lot of datatypes that could potentially need changes. In general we should get sign off from other curators if we're changing how stuff's going to work. Do you have a list of which datatypes you'd want to change ? If an author is entering an object ID, wouldn't they already know what the object is, why would they want to see the object name ; and depending on the datatype, you might also need to tell me which field to display. In general, the first value that comes up is what matches that the user typed. The second value in parenthesis is the object ID that matches.

@draciti Thanks, I see that Variation works that way, and that's helpful.

valearna commented 3 years ago

Thanks @azurebrd. The AFP uses the autocomplete API on genes, species, variations, strains, and transgenes. Transgene is the only data type showing this issue. We would like to have this feature because we are adding a new use case where authors can paste names and/or IDs in the autocomplete and get all the related names + IDs in the format required by the AFP system.

azurebrd commented 3 years ago

@valearna cool cool, so we only need to update Transgenes, that's good. Since we're having a meeting tomorrow, it might be good to ask other curators then whether this would be okay to change in the OA for Transgene only. I imagine they'll be fine with it.

valearna commented 3 years ago

Sounds good, thanks @azurebrd!

azurebrd commented 3 years ago

@draciti @vanaukenk I've changed the mangolassi OA Transgene Autocomplete to display the name in front instead of the object ID that matched. The obo tables map the object ID to the object names directly in one table, while the OA-based datatypes go through an OA joinkey, so it's a bit more complex of a query, but it seems fast enough to work well. If you test it out and it works well, and other curators are okay with this change, then we could make it live, so long as it works for @valearna

vanaukenk commented 3 years ago

Thanks @azurebrd I don't use the OA for curation any more, so can't speak for other curators who do, but the functionality that I tested on the exprpat OA on mangolassi seems to work fine.

valearna commented 3 years ago

Thanks @azurebrd. Are you also going to modify the following API? http://mangolassi.caltech.edu/~azurebrd/cgi-bin/forms/datatype_objects.cgi?action=autocompleteXHR&objectType=transgene&userValue=WBTransgene00000098

I'm still getting ID (ID) there.

azurebrd commented 3 years ago

@valearna Oh, that should work if it goes live. For whatever reason that script looks up data from the tazendra OA instead of the mangolassi OA. I guess it's for development changes of the lookup, but based on current data, while mangolassi has old data. If we want it to, I can change the code on mangolassi to look at the mangolassi OA.

valearna commented 3 years ago

Yes, it would be great if you could make the API on mangolassi look at the mangolassi OA. We use the mangolassi API for the AFP dev form and it would be better to test the new feature before deploying it to production

azurebrd commented 3 years ago

Sure thing, @valearna mangolassi form looks at mangolassi OA code and your URL shows the transgene name.

valearna commented 3 years ago

Great, thanks @azurebrd!

draciti commented 3 years ago

Working well both on mangolassi and on AFP dev. thanks @azurebrd and @valearna ! @valearna feel free to close

azurebrd commented 3 years ago

Well, it's not live on tazendra yet, since all OA curators haven't approved it yet, but I imagine they will.

azurebrd commented 3 years ago

Live on tazendra.