@vitessce/sets-utils 3.4.14 → 3.5.0

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.
package/dist/index.js CHANGED
@@ -9119,7 +9119,8 @@ const ViewType$1 = {
9119
9119
  OBS_SET_FEATURE_VALUE_DISTRIBUTION: "obsSetFeatureValueDistribution",
9120
9120
  FEATURE_VALUE_HISTOGRAM: "featureValueHistogram",
9121
9121
  DOT_PLOT: "dotPlot",
9122
- FEATURE_BAR_PLOT: "featureBarPlot"
9122
+ FEATURE_BAR_PLOT: "featureBarPlot",
9123
+ BIOMARKER_SELECT: "biomarkerSelect"
9123
9124
  };
9124
9125
  const DataType$1 = {
9125
9126
  OBS_LABELS: "obsLabels",
@@ -17556,15 +17557,13 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
17556
17557
  }
17557
17558
  function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
17558
17559
  const result = new InternMap([], JSON.stringify);
17559
- if (stratifiedResult) {
17560
- Array.from(stratifiedResult.keys()).forEach((cellSetKey) => {
17561
- result.set(cellSetKey, new InternMap([], JSON.stringify));
17562
- Array.from(stratifiedResult.get(cellSetKey).keys()).forEach((sampleSetKey) => {
17563
- const values = stratifiedResult.get(cellSetKey).get(sampleSetKey).get(geneSelection[0]);
17564
- result.get(cellSetKey).set(sampleSetKey, values);
17565
- });
17560
+ Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
17561
+ result.set(cellSetKey, new InternMap([], JSON.stringify));
17562
+ Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
17563
+ const values = secondLevelInternMap.get(geneSelection[0]);
17564
+ result.get(cellSetKey).set(sampleSetKey, values);
17566
17565
  });
17567
- }
17566
+ });
17568
17567
  return result;
17569
17568
  }
17570
17569
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"expr-utils.d.ts","sourceRoot":"","sources":["../src/expr-utils.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,4CAbW,GAAC,wCACD,GAAC,sBACD,GAAC,YAED,GAAC,kBACD,GAAC,oBAED,GAAC,8BAoIX;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oDAbW,GAAC,cACD,GAAC,sBACD,GAAC,kBACD,GAAC,YACD,GAAC,kBACD,GAAC,iBACD,GAAC,oBACD,GAAC,gBACD,GAAC,yBACD,GAAC,oCACD,GAAC,SAiFX;AAED;;;;;;;;;;GAUG;AACH,oEAJW,GAAC,iBACD,GAAC,OAmBX"}
1
+ {"version":3,"file":"expr-utils.d.ts","sourceRoot":"","sources":["../src/expr-utils.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,4CAbW,GAAC,wCACD,GAAC,sBACD,GAAC,YAED,GAAC,kBACD,GAAC,oBAED,GAAC,8BAoIX;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oDAbW,GAAC,cACD,GAAC,sBACD,GAAC,kBACD,GAAC,YACD,GAAC,kBACD,GAAC,iBACD,GAAC,oBACD,GAAC,gBACD,GAAC,yBACD,GAAC,oCACD,GAAC,SAiFX;AAED;;;;;;;;;;GAUG;AACH,oEAJW,GAAC,iBACD,GAAC,OAiBX"}
@@ -225,16 +225,14 @@ featureValueTransform, featureValueTransformCoefficient) {
225
225
  */
226
226
  export function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
227
227
  const result = new InternMap([], JSON.stringify);
228
- if (stratifiedResult) {
229
- Array.from(stratifiedResult.keys()).forEach((cellSetKey) => {
230
- result.set(cellSetKey, new InternMap([], JSON.stringify));
231
- Array.from(stratifiedResult.get(cellSetKey).keys()).forEach((sampleSetKey) => {
232
- // For now, we just take the first gene.
233
- // TODO: support multiple genes via signature score method.
234
- const values = stratifiedResult.get(cellSetKey).get(sampleSetKey).get(geneSelection[0]);
235
- result.get(cellSetKey).set(sampleSetKey, values);
236
- });
228
+ Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
229
+ result.set(cellSetKey, new InternMap([], JSON.stringify));
230
+ Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
231
+ // For now, we just take the first gene.
232
+ // TODO: support multiple genes via signature score method.
233
+ const values = secondLevelInternMap.get(geneSelection[0]);
234
+ result.get(cellSetKey).set(sampleSetKey, values);
237
235
  });
238
- }
236
+ });
239
237
  return result;
240
238
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitessce/sets-utils",
3
- "version": "3.4.14",
4
- "author": "Gehlenborg Lab",
3
+ "version": "3.5.0",
4
+ "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,8 +25,8 @@
25
25
  "lodash-es": "^4.17.21",
26
26
  "tinycolor2": "^1.4.1",
27
27
  "uuid": "^9.0.0",
28
- "@vitessce/schemas": "3.4.14",
29
- "@vitessce/utils": "3.4.14"
28
+ "@vitessce/schemas": "3.5.0",
29
+ "@vitessce/utils": "3.5.0"
30
30
  },
31
31
  "scripts": {
32
32
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
package/src/expr-utils.js CHANGED
@@ -278,16 +278,14 @@ export function aggregateStratifiedExpressionData(
278
278
  stratifiedResult, geneSelection,
279
279
  ) {
280
280
  const result = new InternMap([], JSON.stringify);
281
- if (stratifiedResult) {
282
- Array.from(stratifiedResult.keys()).forEach((cellSetKey) => {
283
- result.set(cellSetKey, new InternMap([], JSON.stringify));
284
- Array.from(stratifiedResult.get(cellSetKey).keys()).forEach((sampleSetKey) => {
285
- // For now, we just take the first gene.
286
- // TODO: support multiple genes via signature score method.
287
- const values = stratifiedResult.get(cellSetKey).get(sampleSetKey).get(geneSelection[0]);
288
- result.get(cellSetKey).set(sampleSetKey, values);
289
- });
281
+ Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
282
+ result.set(cellSetKey, new InternMap([], JSON.stringify));
283
+ Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
284
+ // For now, we just take the first gene.
285
+ // TODO: support multiple genes via signature score method.
286
+ const values = secondLevelInternMap.get(geneSelection[0]);
287
+ result.get(cellSetKey).set(sampleSetKey, values);
290
288
  });
291
- }
289
+ });
292
290
  return result;
293
291
  }