@vitessce/biomarker-select 3.5.10 → 3.5.12

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
@@ -1023,6 +1023,7 @@ const CoordinationType = {
1023
1023
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
1024
1024
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
1025
1025
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
1026
+ FEATURE_AGGREGATION_STRATEGY: "featureAggregationStrategy",
1026
1027
  OBS_COLOR_ENCODING: "obsColorEncoding",
1027
1028
  SPATIAL_IMAGE_LAYER: "spatialImageLayer",
1028
1029
  SPATIAL_SEGMENTATION_LAYER: "spatialSegmentationLayer",
@@ -1165,6 +1166,7 @@ const COMPONENT_COORDINATION_TYPES = {
1165
1166
  CoordinationType.FEATURE_SELECTION,
1166
1167
  CoordinationType.FEATURE_VALUE_COLORMAP,
1167
1168
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1169
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1168
1170
  CoordinationType.OBS_COLOR_ENCODING,
1169
1171
  CoordinationType.ADDITIONAL_OBS_SETS,
1170
1172
  CoordinationType.TOOLTIPS_VISIBLE,
@@ -1208,6 +1210,7 @@ const COMPONENT_COORDINATION_TYPES = {
1208
1210
  CoordinationType.FEATURE_SELECTION,
1209
1211
  CoordinationType.FEATURE_VALUE_COLORMAP,
1210
1212
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1213
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1211
1214
  CoordinationType.OBS_COLOR_ENCODING,
1212
1215
  CoordinationType.ADDITIONAL_OBS_SETS,
1213
1216
  CoordinationType.TOOLTIPS_VISIBLE,
@@ -1287,10 +1290,12 @@ const COMPONENT_COORDINATION_TYPES = {
1287
1290
  CoordinationType.FEATURE_SELECTION,
1288
1291
  CoordinationType.FEATURE_VALUE_COLORMAP,
1289
1292
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1293
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1290
1294
  CoordinationType.OBS_COLOR_ENCODING,
1291
1295
  CoordinationType.ADDITIONAL_OBS_SETS,
1292
1296
  CoordinationType.MOLECULE_HIGHLIGHT,
1293
- CoordinationType.TOOLTIPS_VISIBLE
1297
+ CoordinationType.TOOLTIPS_VISIBLE,
1298
+ CoordinationType.PHOTOMETRIC_INTERPRETATION
1294
1299
  ],
1295
1300
  [ViewType.SPATIAL_BETA]: [
1296
1301
  CoordinationType.META_COORDINATION_SCOPES,
@@ -1324,6 +1329,7 @@ const COMPONENT_COORDINATION_TYPES = {
1324
1329
  CoordinationType.FEATURE_SELECTION,
1325
1330
  CoordinationType.FEATURE_VALUE_COLORMAP,
1326
1331
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1332
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1327
1333
  CoordinationType.OBS_COLOR_ENCODING,
1328
1334
  CoordinationType.ADDITIONAL_OBS_SETS,
1329
1335
  CoordinationType.MOLECULE_HIGHLIGHT,
@@ -1362,7 +1368,8 @@ const COMPONENT_COORDINATION_TYPES = {
1362
1368
  CoordinationType.LEGEND_VISIBLE,
1363
1369
  CoordinationType.SPATIAL_CHANNEL_LABELS_VISIBLE,
1364
1370
  CoordinationType.SPATIAL_CHANNEL_LABELS_ORIENTATION,
1365
- CoordinationType.SPATIAL_CHANNEL_LABEL_SIZE
1371
+ CoordinationType.SPATIAL_CHANNEL_LABEL_SIZE,
1372
+ CoordinationType.PHOTOMETRIC_INTERPRETATION
1366
1373
  ],
1367
1374
  [ViewType.HEATMAP]: [
1368
1375
  CoordinationType.DATASET,
@@ -1437,6 +1444,7 @@ const COMPONENT_COORDINATION_TYPES = {
1437
1444
  CoordinationType.FEATURE_SELECTION,
1438
1445
  CoordinationType.FEATURE_VALUE_TRANSFORM,
1439
1446
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1447
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1440
1448
  CoordinationType.OBS_SET_SELECTION,
1441
1449
  CoordinationType.OBS_SET_FILTER,
1442
1450
  CoordinationType.OBS_SET_HIGHLIGHT,
@@ -1452,6 +1460,7 @@ const COMPONENT_COORDINATION_TYPES = {
1452
1460
  CoordinationType.FEATURE_TYPE,
1453
1461
  CoordinationType.FEATURE_VALUE_TYPE,
1454
1462
  CoordinationType.FEATURE_SELECTION,
1463
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1455
1464
  CoordinationType.ADDITIONAL_OBS_SETS,
1456
1465
  CoordinationType.OBS_SET_COLOR,
1457
1466
  CoordinationType.OBS_COLOR_ENCODING,
@@ -1475,7 +1484,8 @@ const COMPONENT_COORDINATION_TYPES = {
1475
1484
  CoordinationType.SPATIAL_ROTATION_Y,
1476
1485
  CoordinationType.SPATIAL_ROTATION_Z,
1477
1486
  CoordinationType.SPATIAL_ROTATION_ORBIT,
1478
- CoordinationType.SPATIAL_ORBIT_AXIS
1487
+ CoordinationType.SPATIAL_ORBIT_AXIS,
1488
+ CoordinationType.PHOTOMETRIC_INTERPRETATION
1479
1489
  ],
1480
1490
  [ViewType.LAYER_CONTROLLER_BETA]: [
1481
1491
  CoordinationType.META_COORDINATION_SCOPES,
@@ -1530,6 +1540,7 @@ const COMPONENT_COORDINATION_TYPES = {
1530
1540
  CoordinationType.FEATURE_VALUE_COLORMAP,
1531
1541
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1532
1542
  CoordinationType.FEATURE_SELECTION,
1543
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1533
1544
  CoordinationType.TOOLTIPS_VISIBLE,
1534
1545
  CoordinationType.TOOLTIP_CROSSHAIRS_VISIBLE,
1535
1546
  CoordinationType.LEGEND_VISIBLE,
@@ -1570,6 +1581,7 @@ const COMPONENT_COORDINATION_TYPES = {
1570
1581
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1571
1582
  CoordinationType.FEATURE_VALUE_POSITIVITY_THRESHOLD,
1572
1583
  CoordinationType.FEATURE_VALUE_COLORMAP,
1584
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1573
1585
  CoordinationType.OBS_SET_SELECTION,
1574
1586
  CoordinationType.OBS_SET_FILTER,
1575
1587
  CoordinationType.OBS_SET_HIGHLIGHT,
@@ -1598,6 +1610,7 @@ const COMPONENT_COORDINATION_TYPES = {
1598
1610
  CoordinationType.FEATURE_SELECTION,
1599
1611
  CoordinationType.FEATURE_VALUE_TRANSFORM,
1600
1612
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1613
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1601
1614
  CoordinationType.OBS_SET_SELECTION,
1602
1615
  CoordinationType.OBS_SET_HIGHLIGHT,
1603
1616
  CoordinationType.OBS_HIGHLIGHT,
@@ -1702,6 +1715,7 @@ const COMPONENT_COORDINATION_TYPES = {
1702
1715
  CoordinationType.OBS_TYPE,
1703
1716
  CoordinationType.SAMPLE_TYPE,
1704
1717
  CoordinationType.FEATURE_SELECTION,
1718
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1705
1719
  CoordinationType.SAMPLE_SET_SELECTION,
1706
1720
  CoordinationType.SAMPLE_SET_FILTER,
1707
1721
  CoordinationType.OBS_SET_SELECTION,
@@ -33366,7 +33380,7 @@ function loadPathwayNodes() {
33366
33380
  kgId: d.id,
33367
33381
  label: d.pathway,
33368
33382
  // For reactome
33369
- term: `reactome:${d.acc}`,
33383
+ term: `REACTOME:${d.acc}`,
33370
33384
  // For reactome
33371
33385
  // label: d.ontology_label, // For GO_BP
33372
33386
  // term: d.acc, // For GO_BP
@@ -33436,7 +33450,11 @@ async function loadPathwayToGeneEdges() {
33436
33450
  }));
33437
33451
  });
33438
33452
  }
33439
- async function transformFeature({ queryClient }, node, targetModality) {
33453
+ async function transformFeature({ queryClient }, nodeOrig, targetModality) {
33454
+ var _a2;
33455
+ const node = {
33456
+ ...nodeOrig
33457
+ };
33440
33458
  if (targetModality === node.nodeType) {
33441
33459
  return [node];
33442
33460
  }
@@ -33452,6 +33470,19 @@ async function transformFeature({ queryClient }, node, targetModality) {
33452
33470
  staleTime: Infinity,
33453
33471
  queryFn: loadPathwayToGeneEdges
33454
33472
  });
33473
+ if (!node.kgId) {
33474
+ const pathwayNodes = await queryClient.fetchQuery({
33475
+ queryKey: ["pathwayNodes"],
33476
+ staleTime: Infinity,
33477
+ queryFn: loadPathwayNodes
33478
+ });
33479
+ const foundId = (_a2 = pathwayNodes.find((n2) => n2.term === node.term)) == null ? void 0 : _a2.kgId;
33480
+ if (foundId) {
33481
+ node.kgId = foundId;
33482
+ } else {
33483
+ console.warn("Could not find matching pathway node based on term.");
33484
+ }
33485
+ }
33455
33486
  const matchingEdges = pathwayGeneEdges.filter((d) => d.source === node.kgId);
33456
33487
  const matchingGeneIds = matchingEdges.map((d) => d.target);
33457
33488
  const matchingGenes = geneNodes.filter((d) => matchingGeneIds.includes(d.kgId));
@@ -13,13 +13,13 @@ export function autocompleteFeature({ queryClient }: {
13
13
  * @satisfies {TransformFeatureFunc}
14
14
  * @param {object} ctx
15
15
  * @param {QueryClient} ctx.queryClient
16
- * @param {KgNode} node
16
+ * @param {KgNode} nodeOrig
17
17
  * @param {TargetModalityType} targetModality
18
18
  * @returns {Promise<KgNode[]>}
19
19
  */
20
20
  export function transformFeature({ queryClient }: {
21
21
  queryClient: QueryClient;
22
- }, node: KgNode, targetModality: TargetModalityType): Promise<KgNode[]>;
22
+ }, nodeOrig: KgNode, targetModality: TargetModalityType): Promise<KgNode[]>;
23
23
  /**
24
24
  * @satisfies {GetAlternativeTermsFunc}
25
25
  * @param {object} ctx
@@ -1 +1 @@
1
- {"version":3,"file":"default-async-functions.d.ts","sourceRoot":"","sources":["../src/default-async-functions.js"],"names":[],"mappings":"AAyHA;;;;;;;GAOG;AACH,qDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,WAAQ,MAAM,kBACN,IAAI,GAAG,kBAAkB,GACvB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiB7B;AAkBD;;;;;;;GAOG;AACH,kDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,QAAQ,MAAM,kBACN,kBAAkB,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAmC7B;AAED;;;;;;GAMG;AACH,qDAJG;IAAyB,WAAW,EAA5B,WAAW;CACnB,SAAQ,MAAM,GACJ,OAAO,CAAC,MAAM,EAAE,CAAC,CA2B7B;AAED;;;;;;;GAOG;AACH,gDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,kBAAQ,MAAM,kBACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBxC;iCAjQsD,uBAAuB;wCADsE,iBAAiB;4BAAjB,iBAAiB"}
1
+ {"version":3,"file":"default-async-functions.d.ts","sourceRoot":"","sources":["../src/default-async-functions.js"],"names":[],"mappings":"AAyHA;;;;;;;GAOG;AACH,qDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,WAAQ,MAAM,kBACN,IAAI,GAAG,kBAAkB,GACvB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiB7B;AAkBD;;;;;;;GAOG;AACH,kDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,YAAQ,MAAM,kBACN,kBAAkB,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAoD7B;AAED;;;;;;GAMG;AACH,qDAJG;IAAyB,WAAW,EAA5B,WAAW;CACnB,SAAQ,MAAM,GACJ,OAAO,CAAC,MAAM,EAAE,CAAC,CA2B7B;AAED;;;;;;;GAOG;AACH,gDALG;IAAyB,WAAW,EAA5B,WAAW;CACnB,kBAAQ,MAAM,kBACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBxC;iCAlRsD,uBAAuB;wCADsE,iBAAiB;4BAAjB,iBAAiB"}
@@ -53,7 +53,7 @@ function loadPathwayNodes() {
53
53
  return result.map((/** @type {any} */ d) => ({
54
54
  kgId: d.id,
55
55
  label: d.pathway, // For reactome
56
- term: `reactome:${d.acc}`, // For reactome
56
+ term: `REACTOME:${d.acc}`, // For reactome
57
57
  // label: d.ontology_label, // For GO_BP
58
58
  // term: d.acc, // For GO_BP
59
59
  nodeType: 'pathway',
@@ -146,11 +146,14 @@ async function loadPathwayToGeneEdges() {
146
146
  * @satisfies {TransformFeatureFunc}
147
147
  * @param {object} ctx
148
148
  * @param {QueryClient} ctx.queryClient
149
- * @param {KgNode} node
149
+ * @param {KgNode} nodeOrig
150
150
  * @param {TargetModalityType} targetModality
151
151
  * @returns {Promise<KgNode[]>}
152
152
  */
153
- export async function transformFeature({ queryClient }, node, targetModality) {
153
+ export async function transformFeature({ queryClient }, nodeOrig, targetModality) {
154
+ const node = {
155
+ ...nodeOrig,
156
+ };
154
157
  if (targetModality === node.nodeType) {
155
158
  // For example, if the target modality is gene and the node is already a gene node.
156
159
  return [node];
@@ -168,6 +171,20 @@ export async function transformFeature({ queryClient }, node, targetModality) {
168
171
  staleTime: Infinity,
169
172
  queryFn: loadPathwayToGeneEdges,
170
173
  });
174
+ if (!node.kgId) {
175
+ const pathwayNodes = await queryClient.fetchQuery({
176
+ queryKey: ['pathwayNodes'],
177
+ staleTime: Infinity,
178
+ queryFn: loadPathwayNodes,
179
+ });
180
+ const foundId = pathwayNodes.find(n => n.term === node.term)?.kgId;
181
+ if (foundId) {
182
+ node.kgId = foundId;
183
+ }
184
+ else {
185
+ console.warn('Could not find matching pathway node based on term.');
186
+ }
187
+ }
171
188
  // TODO: support matching using ontology term (rather than requiring kgId)?
172
189
  const matchingEdges = pathwayGeneEdges.filter((/** @type {KgEdge} */ d) => d.source === node.kgId);
173
190
  const matchingGeneIds = matchingEdges.map((/** @type {KgEdge} */ d) => d.target);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/biomarker-select",
3
- "version": "3.5.10",
3
+ "version": "3.5.12",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "fuse.js": "^7.0.0",
26
26
  "d3-dsv": "^1.1.1",
27
27
  "clsx": "^1.1.1",
28
- "@vitessce/constants-internal": "3.5.10",
29
- "@vitessce/vit-s": "3.5.10",
30
- "@vitessce/types": "3.5.10"
28
+ "@vitessce/constants-internal": "3.5.12",
29
+ "@vitessce/vit-s": "3.5.12",
30
+ "@vitessce/types": "3.5.12"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^5.16.4",
@@ -58,7 +58,7 @@ function loadPathwayNodes() {
58
58
  return result.map((/** @type {any} */ d) => ({
59
59
  kgId: d.id,
60
60
  label: d.pathway, // For reactome
61
- term: `reactome:${d.acc}`, // For reactome
61
+ term: `REACTOME:${d.acc}`, // For reactome
62
62
  // label: d.ontology_label, // For GO_BP
63
63
  // term: d.acc, // For GO_BP
64
64
  nodeType: 'pathway',
@@ -164,11 +164,14 @@ async function loadPathwayToGeneEdges() {
164
164
  * @satisfies {TransformFeatureFunc}
165
165
  * @param {object} ctx
166
166
  * @param {QueryClient} ctx.queryClient
167
- * @param {KgNode} node
167
+ * @param {KgNode} nodeOrig
168
168
  * @param {TargetModalityType} targetModality
169
169
  * @returns {Promise<KgNode[]>}
170
170
  */
171
- export async function transformFeature({ queryClient }, node, targetModality) {
171
+ export async function transformFeature({ queryClient }, nodeOrig, targetModality) {
172
+ const node = {
173
+ ...nodeOrig,
174
+ };
172
175
  if (targetModality === node.nodeType) {
173
176
  // For example, if the target modality is gene and the node is already a gene node.
174
177
  return [node];
@@ -187,6 +190,20 @@ export async function transformFeature({ queryClient }, node, targetModality) {
187
190
  queryFn: loadPathwayToGeneEdges,
188
191
  });
189
192
 
193
+ if (!node.kgId) {
194
+ const pathwayNodes = await queryClient.fetchQuery({
195
+ queryKey: ['pathwayNodes'],
196
+ staleTime: Infinity,
197
+ queryFn: loadPathwayNodes,
198
+ });
199
+ const foundId = pathwayNodes.find(n => n.term === node.term)?.kgId;
200
+ if (foundId) {
201
+ node.kgId = foundId;
202
+ } else {
203
+ console.warn('Could not find matching pathway node based on term.');
204
+ }
205
+ }
206
+
190
207
  // TODO: support matching using ontology term (rather than requiring kgId)?
191
208
  const matchingEdges = pathwayGeneEdges.filter((/** @type {KgEdge} */ d) => d.source === node.kgId);
192
209
  const matchingGeneIds = matchingEdges.map((/** @type {KgEdge} */ d) => d.target);