KarrLab / datanator_frontend

Graphical web-based interface for the Datanator toolkit for discovering data for modeling cells
https://datanator.info
MIT License
1 stars 1 forks source link

Yosef dev3 #208

Closed yosefdroth closed 4 years ago

yosefdroth commented 4 years ago

Updates:

1) Added links to related reactions protein page. 2) Added metadata to reactions page 3) Added links to related metabolites and proteins in reactions page 4) reverted taxonomic filter to using a comparator, and implemented taxonomicProximity column using valueFormatter.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 998


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/scenes/BiochemicalEntityDetails/DataTable/DataTable.js 8 9 88.89%
src/scenes/BiochemicalEntityDetails/Reaction/RateConstantsDataTable.js 13 14 92.86%
src/scenes/BiochemicalEntityDetails/Reaction/MetadataSection.js 46 51 90.2%
src/scenes/BiochemicalEntityDetails/LoadContent.js 28 37 75.68%
src/scenes/BiochemicalEntityDetails/Protein/MetadataSection.js 8 34 23.53%
<!-- Total: 149 191 78.01% -->
Files with Coverage Reduction New Missed Lines %
src/components/SearchForm/SearchForm.js 1 95.71%
src/scenes/BiochemicalEntityDetails/Rna/Rna.js 1 56.25%
src/scenes/BiochemicalEntityDetails/Rna/HalfLifeDataTable.js 4 63.64%
src/scenes/BiochemicalEntityDetails/HtmlColumnHeader.js 7 35.0%
src/scenes/SearchResults/RnaSearchResultsList.js 12 48.57%
<!-- Total: 25 -->
Totals Coverage Status
Change from base Build 950: -3.9%
Covered Lines: 1239
Relevant Lines: 1361

💛 - Coveralls
yosefdroth commented 4 years ago

Change 1 - "formatData of RateConstantsDataTable.js needs to be updated to handle taxonomic ranks similar to the Metabolite and Protein methods." -- done. I have updated the method to take the length of the taxonRanks (instead of the taxonRanks themselves).

formatData of RateConstantsDataTable.js method needs to know the length of the taxonRanks (unlike formatData in Metabolite and Protein) for cases where the only common ancesor between the target organism and observed organism is cellular life. The API in this case treats it like there is no common ancestor and will return -1. However, on the frontend, cellular life is treated as the highest common ancestor (and should recieve a rank one higher than the domain). However, for this to be done, formatData needs to know the length of the taxonomicRanks.

Change 2: "Why does formatParticipantForUrl of ReactionSearchResultsLists.js replace , in metabolite names with %2 (encoding of &)? This could generate confusion when there are & in metabolite names. This causes errors such as below" - done, implemented with encodeURIComponent()

Change 3 & 4 - once the kegg_meta fields are finished filling on the backend, it should be start working on the frontend.

yosefdroth commented 4 years ago

(1) You are correct, I intented to have the value be a number. I just fixed it, and the value is a number now.

The other methods treat cellular life as the highest common ancestor. So if the experimental organism is a bacteria, and the target organism is a eukaryote, then the number recorded for taxonomicProximity will be the highest possible value for taxonomic_proximity (e.g. 8 for E. Coli)

However, by reactions, it does not treat cellular life as a common ancestor. So if if the experimental organism is a bacteria, and the target organism is a eukaryote, it will just record taxonomic_proximity as -1 (for no common ancestor).

The taxonomicProximity value for celluar life needs in the frontend needs to be the number that corresponds to the highest possible node (e.g. 8 in E coli), and not -1. But since the reactions API only returns -1, the RateConstantsDataTable.formatData method has no way to know what the highest possible rank is (that should correspond to Celluar life). Therefore it is using the length of the taxonomicRanks to figure it out.

Having taxonomicProximity as -1 be a problem in two cases 1) The way that the valueFormatter is implemented, it uses the value of taxonomicProximity as the index to figure out which string it should use (e.g. species - 0, genus - 1, etc.). Cellular life corresponds to the highest possible number for taxonomic proximity (e.g. in E coli, 7 is Domain, and 8 is Cellular life). But since the reactions API only returns -1, the formatData method has no way to know what the highest possible rank is (that should correspond to Celluar life).

2) The comparator in the taxonomicFilter assumes that the value for cellular life is the highest.

I think the simplest way to solve this is for RateConstantsDataTable.formatData to use the length of taxonomic ranks make the representation of taxonomicProximity consistent.