@jbrowse/wiggle-core 5.0.0-beta.1 → 5.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/esm/autoscale.js +16 -5
  2. package/package.json +6 -6
package/esm/autoscale.js CHANGED
@@ -116,16 +116,27 @@ export function computeScoreStats(summaryScoreMode, datasets) {
116
116
  !overlaps(featurePositions[i * 2], featurePositions[i * 2 + 1], visStart, visEnd)) {
117
117
  continue;
118
118
  }
119
- min = Math.min(min, minScores[i]);
120
- max = Math.max(max, maxScores[i]);
119
+ // Non-finite scores are skipped rather than folded in: a wig file may
120
+ // carry a NaN, and one of them poisons min/max and mean alike, collapsing
121
+ // the whole domain to the [0, 1] stub the callers fall back to.
122
+ const lo = minScores[i];
123
+ if (Number.isFinite(lo)) {
124
+ min = Math.min(min, lo);
125
+ }
126
+ const hi = maxScores[i];
127
+ if (Number.isFinite(hi)) {
128
+ max = Math.max(max, hi);
129
+ }
121
130
  // Mean/stddev always use featureScores (the average) regardless of
122
131
  // summaryScoreMode; min/max for the domain bounds come from the mode-
123
132
  // selected arrays above. Intentional: sd-based autoscale centers on the
124
133
  // average-value distribution even in whiskers/min/max summary modes.
125
134
  const avg = featureScores[i];
126
- sum += avg;
127
- sumSq += avg * avg;
128
- count++;
135
+ if (Number.isFinite(avg)) {
136
+ sum += avg;
137
+ sumSq += avg * avg;
138
+ count++;
139
+ }
129
140
  }
130
141
  }
131
142
  if (count === 0 || !Number.isFinite(min) || !Number.isFinite(max)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/wiggle-core",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "Shared scale and autoscale utilities for wiggle and coverage displays",
6
6
  "keywords": [
@@ -29,12 +29,12 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@jbrowse/mobx-state-tree": "^6.5.1",
32
- "@mui/icons-material": "^9.3.1",
33
- "@mui/material": "^9.3.1",
32
+ "@mui/icons-material": "^9.4.0",
33
+ "@mui/material": "^9.4.0",
34
34
  "mobx-react": "^10.0.2",
35
- "@jbrowse/display-kit": "^5.0.0-beta.1",
36
- "@jbrowse/core": "^5.0.0-beta.1",
37
- "@jbrowse/render-core": "^5.0.0-beta.1"
35
+ "@jbrowse/core": "^5.0.0-beta.2",
36
+ "@jbrowse/display-kit": "^5.0.0-beta.2",
37
+ "@jbrowse/render-core": "^5.0.0-beta.2"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=19.0.0"