@vitessce/biomarker-select 3.5.10 → 3.5.11

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,6 +1290,7 @@ 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,
@@ -1324,6 +1328,7 @@ const COMPONENT_COORDINATION_TYPES = {
1324
1328
  CoordinationType.FEATURE_SELECTION,
1325
1329
  CoordinationType.FEATURE_VALUE_COLORMAP,
1326
1330
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1331
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1327
1332
  CoordinationType.OBS_COLOR_ENCODING,
1328
1333
  CoordinationType.ADDITIONAL_OBS_SETS,
1329
1334
  CoordinationType.MOLECULE_HIGHLIGHT,
@@ -1437,6 +1442,7 @@ const COMPONENT_COORDINATION_TYPES = {
1437
1442
  CoordinationType.FEATURE_SELECTION,
1438
1443
  CoordinationType.FEATURE_VALUE_TRANSFORM,
1439
1444
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1445
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1440
1446
  CoordinationType.OBS_SET_SELECTION,
1441
1447
  CoordinationType.OBS_SET_FILTER,
1442
1448
  CoordinationType.OBS_SET_HIGHLIGHT,
@@ -1452,6 +1458,7 @@ const COMPONENT_COORDINATION_TYPES = {
1452
1458
  CoordinationType.FEATURE_TYPE,
1453
1459
  CoordinationType.FEATURE_VALUE_TYPE,
1454
1460
  CoordinationType.FEATURE_SELECTION,
1461
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1455
1462
  CoordinationType.ADDITIONAL_OBS_SETS,
1456
1463
  CoordinationType.OBS_SET_COLOR,
1457
1464
  CoordinationType.OBS_COLOR_ENCODING,
@@ -1530,6 +1537,7 @@ const COMPONENT_COORDINATION_TYPES = {
1530
1537
  CoordinationType.FEATURE_VALUE_COLORMAP,
1531
1538
  CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
1532
1539
  CoordinationType.FEATURE_SELECTION,
1540
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1533
1541
  CoordinationType.TOOLTIPS_VISIBLE,
1534
1542
  CoordinationType.TOOLTIP_CROSSHAIRS_VISIBLE,
1535
1543
  CoordinationType.LEGEND_VISIBLE,
@@ -1570,6 +1578,7 @@ const COMPONENT_COORDINATION_TYPES = {
1570
1578
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1571
1579
  CoordinationType.FEATURE_VALUE_POSITIVITY_THRESHOLD,
1572
1580
  CoordinationType.FEATURE_VALUE_COLORMAP,
1581
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1573
1582
  CoordinationType.OBS_SET_SELECTION,
1574
1583
  CoordinationType.OBS_SET_FILTER,
1575
1584
  CoordinationType.OBS_SET_HIGHLIGHT,
@@ -1598,6 +1607,7 @@ const COMPONENT_COORDINATION_TYPES = {
1598
1607
  CoordinationType.FEATURE_SELECTION,
1599
1608
  CoordinationType.FEATURE_VALUE_TRANSFORM,
1600
1609
  CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1610
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1601
1611
  CoordinationType.OBS_SET_SELECTION,
1602
1612
  CoordinationType.OBS_SET_HIGHLIGHT,
1603
1613
  CoordinationType.OBS_HIGHLIGHT,
@@ -1702,6 +1712,7 @@ const COMPONENT_COORDINATION_TYPES = {
1702
1712
  CoordinationType.OBS_TYPE,
1703
1713
  CoordinationType.SAMPLE_TYPE,
1704
1714
  CoordinationType.FEATURE_SELECTION,
1715
+ CoordinationType.FEATURE_AGGREGATION_STRATEGY,
1705
1716
  CoordinationType.SAMPLE_SET_SELECTION,
1706
1717
  CoordinationType.SAMPLE_SET_FILTER,
1707
1718
  CoordinationType.OBS_SET_SELECTION,
@@ -33366,7 +33377,7 @@ function loadPathwayNodes() {
33366
33377
  kgId: d.id,
33367
33378
  label: d.pathway,
33368
33379
  // For reactome
33369
- term: `reactome:${d.acc}`,
33380
+ term: `REACTOME:${d.acc}`,
33370
33381
  // For reactome
33371
33382
  // label: d.ontology_label, // For GO_BP
33372
33383
  // term: d.acc, // For GO_BP
@@ -33436,7 +33447,11 @@ async function loadPathwayToGeneEdges() {
33436
33447
  }));
33437
33448
  });
33438
33449
  }
33439
- async function transformFeature({ queryClient }, node, targetModality) {
33450
+ async function transformFeature({ queryClient }, nodeOrig, targetModality) {
33451
+ var _a2;
33452
+ const node = {
33453
+ ...nodeOrig
33454
+ };
33440
33455
  if (targetModality === node.nodeType) {
33441
33456
  return [node];
33442
33457
  }
@@ -33452,6 +33467,19 @@ async function transformFeature({ queryClient }, node, targetModality) {
33452
33467
  staleTime: Infinity,
33453
33468
  queryFn: loadPathwayToGeneEdges
33454
33469
  });
33470
+ if (!node.kgId) {
33471
+ const pathwayNodes = await queryClient.fetchQuery({
33472
+ queryKey: ["pathwayNodes"],
33473
+ staleTime: Infinity,
33474
+ queryFn: loadPathwayNodes
33475
+ });
33476
+ const foundId = (_a2 = pathwayNodes.find((n2) => n2.term === node.term)) == null ? void 0 : _a2.kgId;
33477
+ if (foundId) {
33478
+ node.kgId = foundId;
33479
+ } else {
33480
+ console.warn("Could not find matching pathway node based on term.");
33481
+ }
33482
+ }
33455
33483
  const matchingEdges = pathwayGeneEdges.filter((d) => d.source === node.kgId);
33456
33484
  const matchingGeneIds = matchingEdges.map((d) => d.target);
33457
33485
  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.11",
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.11",
29
+ "@vitessce/vit-s": "3.5.11",
30
+ "@vitessce/types": "3.5.11"
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);