Rothamsted / knetminer

KnetMiner - webapp to search and visualize genome-scale knowledge graphs
https://knetminer.com
MIT License
25 stars 16 forks source link

Errors with API calls about the evidence table #748

Closed marco-brandizi closed 1 year ago

marco-brandizi commented 1 year ago

Currently, the evidence table shows that user genes are ignored: 'Gene List' column is always 0, the 'Genes' column has too big counts, and p-values are always N/A, as shown in the figure below.

Apparently, that happens because the API call to /genome in data-utils.js:handleViewCreation(), which is used to get that table, is not passing the user genes (the list parameter).

A simple fix could be adding that parameter to that call at that point. However, there might be a deeper problem here: is that API called twice, unnecessarily?

If the sequence is:

  1. User hits search to send the search form parameters
  2. /genome is called a first-time to get the data needed for the gene table
  3. The user then clicks on the 'evidence table' button
  4. /genome is called again to get data for the evidence table (from handleViewCreation(), as mentioned above)

Then, the last API call is not necessary and it just wastes time. That's because the first/genome already returns all of the fields: geneTable, evidenceTable and gviewer (the chromosome data for the corresponding view). So, the first API call should keep the data ready for the other views, as they are triggered. The new isSortedEvidenceTable to sort the evidence view should be passed to the first call (it affects the evidence table only).

evidence-table-without-genes

Arnedeklerk commented 1 year ago

Lawal now calls this once in the new code, issues are also resloved.