@vitessce/sets-utils 3.4.12 → 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 +30 -17
- package/dist-tsc/expr-utils.d.ts.map +1 -1
- package/dist-tsc/expr-utils.js +8 -10
- package/package.json +4 -4
- package/src/expr-utils.js +8 -10
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",
|
|
@@ -9158,6 +9159,9 @@ const FileType$1 = {
|
|
|
9158
9159
|
// OME-Zarr
|
|
9159
9160
|
IMAGE_OME_ZARR: "image.ome-zarr",
|
|
9160
9161
|
OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
|
|
9162
|
+
// OME-Zarr - Zipped
|
|
9163
|
+
IMAGE_OME_ZARR_ZIP: "image.ome-zarr.zip",
|
|
9164
|
+
OBS_SEGMENTATIONS_OME_ZARR_ZIP: "obsSegmentations.ome-zarr.zip",
|
|
9161
9165
|
// AnnData
|
|
9162
9166
|
OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
|
|
9163
9167
|
OBS_FEATURE_COLUMNS_ANNDATA_ZARR: "obsFeatureColumns.anndata.zarr",
|
|
@@ -9680,24 +9684,29 @@ const imageOmeZarrSchema = z.object({
|
|
|
9680
9684
|
imageOmeZarrSchema.extend({
|
|
9681
9685
|
obsTypesFromChannelNames: z.boolean().optional()
|
|
9682
9686
|
});
|
|
9683
|
-
const imageSpatialdataSchema =
|
|
9684
|
-
path: z.string()
|
|
9687
|
+
const imageSpatialdataSchema = z.object({
|
|
9688
|
+
path: z.string(),
|
|
9689
|
+
coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
|
|
9685
9690
|
});
|
|
9686
9691
|
const obsSegmentationsSpatialdataSchema = z.object({
|
|
9687
|
-
// TODO: should this also extend the imageOmeZarrSchema?
|
|
9688
9692
|
// TODO: should this be renamed labelsSpatialdataSchema?
|
|
9689
9693
|
// TODO: support obsTypesFromChannelNames?
|
|
9690
|
-
path: z.string()
|
|
9694
|
+
path: z.string(),
|
|
9695
|
+
tablePath: z.string().optional().describe("The path to a table which annotates the labels. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected."),
|
|
9696
|
+
coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
|
|
9691
9697
|
});
|
|
9692
9698
|
z.object({
|
|
9693
|
-
path: z.string()
|
|
9699
|
+
path: z.string(),
|
|
9700
|
+
coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the coordinates. If not provided, the "global" coordinate system is assumed.')
|
|
9694
9701
|
});
|
|
9695
9702
|
const obsSpotsSpatialdataSchema = z.object({
|
|
9696
9703
|
path: z.string(),
|
|
9697
|
-
tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected.")
|
|
9704
|
+
tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected."),
|
|
9705
|
+
coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the coordinates and radii. If not provided, the "global" coordinate system is assumed.')
|
|
9698
9706
|
});
|
|
9699
9707
|
const obsFeatureMatrixSpatialdataSchema = annDataObsFeatureMatrix.extend({
|
|
9700
|
-
region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional()
|
|
9708
|
+
region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
|
|
9709
|
+
coordinateSystem: z.string().optional().describe('The name of a coordinate transformation output used to transform the image. If not provided, the "global" coordinate system is assumed.')
|
|
9701
9710
|
});
|
|
9702
9711
|
const obsSetsSpatialdataSchema = z.object({
|
|
9703
9712
|
region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
|
|
@@ -9798,15 +9807,21 @@ anndataZarrSchema.extend({
|
|
|
9798
9807
|
z.object({
|
|
9799
9808
|
// TODO: should `image` be a special schema
|
|
9800
9809
|
// to allow specifying fileUid (like for embeddingType)?
|
|
9810
|
+
// TODO: allow multiple images
|
|
9801
9811
|
image: imageSpatialdataSchema,
|
|
9802
9812
|
// TODO: should this be a special schema
|
|
9803
9813
|
// to allow specifying fileUid (like for embeddingType)?
|
|
9814
|
+
// TODO: allow multiple labels
|
|
9804
9815
|
labels: obsSegmentationsSpatialdataSchema,
|
|
9805
9816
|
obsFeatureMatrix: obsFeatureMatrixSpatialdataSchema,
|
|
9806
9817
|
obsSpots: obsSpotsSpatialdataSchema,
|
|
9807
9818
|
// TODO: obsPoints
|
|
9808
9819
|
// TODO: obsLocations
|
|
9809
|
-
obsSets: obsSetsSpatialdataSchema
|
|
9820
|
+
obsSets: obsSetsSpatialdataSchema,
|
|
9821
|
+
// TODO: obsEmbedding
|
|
9822
|
+
// TODO: obsLabels
|
|
9823
|
+
// TODO: featureLabels
|
|
9824
|
+
coordinateSystem: z.string().optional().describe("The name of a coordinate transformation output used to transform all elements which lack a per-element coordinateSystem property.")
|
|
9810
9825
|
}).partial();
|
|
9811
9826
|
z.object({
|
|
9812
9827
|
obsLabelsTypes: z.array(z.string()).optional(),
|
|
@@ -17542,15 +17557,13 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
|
|
|
17542
17557
|
}
|
|
17543
17558
|
function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
|
|
17544
17559
|
const result = new InternMap([], JSON.stringify);
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
result.get(cellSetKey).set(sampleSetKey, values);
|
|
17551
|
-
});
|
|
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);
|
|
17552
17565
|
});
|
|
17553
|
-
}
|
|
17566
|
+
});
|
|
17554
17567
|
return result;
|
|
17555
17568
|
}
|
|
17556
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,
|
|
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"}
|
package/dist-tsc/expr-utils.js
CHANGED
|
@@ -225,16 +225,14 @@ featureValueTransform, featureValueTransformCoefficient) {
|
|
|
225
225
|
*/
|
|
226
226
|
export function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
|
|
227
227
|
const result = new InternMap([], JSON.stringify);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
"author": "
|
|
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.
|
|
29
|
-
"@vitessce/utils": "3.
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
}
|