qurro
qurro copied to clipboard
Expose a configurable pseudocount value for replacing zeroes in data
Code for this used to be available in Qurro months ago, but I took it out because it was buggy and no one was using it.
...But now that more people are using this tool, this might actually be useful?
Thanks to Justin for discussion.
Checklist for completing this:
-
[ ] add a UI element (numerical input where users can specify a pseudocount value; defaults to 0, i.e. no pseudocount; has a hard lower limit of 0, but no set max limit I guess -- or
Number.MAX_SAFE_INTEGER
, maybe) -
[ ] Modify
getCount()
to take as input apseudocount
argument. In the branch where we return 0 if a count's value is falsy, instead return thepseudocount
.- The easiest thing to do here would be just having
getCount()
look at the DOM to get the pseudocount value. However: this is a bad idea in practice, since the user could theoretically change the pseudocount box halfway through Qurro computing log-ratios, ccausing inconsistent results. (Also, this'd be slow since it'd involve a lot of unnecessary DOM queries.) - A better solution would involve more work that just gets the
pseudocount
up front inupdateSamplePlotSingle()
orupdateSamplePlotMulti()
, and passes it tochangeSamplePlot()
(which passes it to theupdateBalance
func being used, which handles it accordingly when callinggetCount()
or calling another function that callsgetCount()
).
- The easiest thing to do here would be just having
-
test the following cases:
- [ ] invalid (non-numeric or negative, ...) input entered for pseudocount value (can mostly reuse infrastructure from the numeric feature filtering functionality)
- [ ] 0 pseudocount works normally
- [ ] 0.01 pseudocount works
- [ ] 0.5 pseudocount works
- [ ] 1 pseudocount works
- [ ] 5 pseudocount works (IDK why you would actually use this but might as well)