Fix log scale for some types of signal tracks #4495
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we apply the log scale, we change the minimum value to 1 in some cases
This helps avoid performing log(0) which is undefined (or...-Infinity in javascript)
The current check applies well to "count data" but less well for "fractional data"
I found that there are ENCODE bigwigs return fractional values between 0-maxval so there are things like 0.02 and 34.8 and 24.5 etc.
The 0.02 causes the log scale to go negative though, in a way that is not super informative. Therefore, we try to make the logscale again snap to 1 with this PR
The caveat is that if the min and max are just between 0-1 then we do not perform this operation, because in that case, the values might be raw p-values, and then just not transforming it gives someone something similar to -log(p), a common unit for graphing, but just without the negative.