biocore / biocore/empress

Remove sID2Idx and fID2Idx in the JS BiomTable class

Open
#335 4 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
JavaScript
Stars
56
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Based on discussion with @ElDeveloper this morning. These variables (which map sample / feature IDs in the BIOM table to their 0-based indices in the sample ID / feature ID array) could be computed in JS (decreasing the amount of data needed to be loaded when opening Empress)...

https://github.com/biocore/empress/blob/6a7b9c4701e7fb203a793c1b445308775eaa01a7/empress/support_files/js/biom-table.js#L10-L13

... and/or not used at all in favor of finding indices of IDs "on the fly". (This would be pretty simple to do, since all that'd be needed would be modifying `BiomTable._getSampleIndexFromID()` and `BiomTable._getFeatureIndexFromID()`.)

https://github.com/biocore/empress/blob/6a7b9c4701e7fb203a793c1b445308775eaa01a7/empress/support_files/js/biom-table.js#L91-L123

Contributor guide

Open the contributing guide

Research direction

Start in empress/support_files/js/biom-table.js, especially the sID2Idx and fID2Idx definitions and BiomTable._getSampleIndexFromID() and _getFeatureIndexFromID(). Trace how those methods are used when opening an Empress BIOM table, then remove the redundant index maps while preserving correct sample and feature index lookup and reducing the data loaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.