Closed vanaukenk closed 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
@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.
@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.
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
@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.
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.
@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.
Sounds good, thanks @azurebrd!
@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
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.
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.
@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.
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
Sure thing, @valearna mangolassi form looks at mangolassi OA code and your URL shows the transgene name.
Great, thanks @azurebrd!
Working well both on mangolassi and on AFP dev. thanks @azurebrd and @valearna ! @valearna feel free to close
Well, it's not live on tazendra yet, since all OA curators haven't approved it yet, but I imagine they will.
Live on tazendra.
If a user enters a transgene id in the add list, we display the id, but not also the name:
Like we do for gene, alleles, and strains, we'll also want to display the transgene name, e.g. ayIs6 (WBTransgene00000098).