@vitessce/sets-utils 3.4.9 → 3.4.10

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/dist/index.js +73 -10
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -6466,6 +6466,9 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
6466
6466
  coordinationScopesBy: componentCoordinationScopesBy.optional()
6467
6467
  }))
6468
6468
  });
6469
+ const configSchema1_0_17 = configSchema1_0_16.extend({
6470
+ version: z.literal("1.0.17")
6471
+ });
6469
6472
  configSchema1_0_0.shape.coordinationSpace.unwrap();
6470
6473
  configSchema1_0_0.shape.layout.element.shape.coordinationScopes.unwrap();
6471
6474
  function upgradeReplaceViewProp(prefix, view, coordinationSpace) {
@@ -6937,7 +6940,43 @@ function upgradeFrom1_0_15(config) {
6937
6940
  version: "1.0.16"
6938
6941
  };
6939
6942
  }
6940
- const latestConfigSchema = configSchema1_0_16;
6943
+ function upgradeFrom1_0_16(config) {
6944
+ const newConfig = cloneDeep(config);
6945
+ const { datasets } = newConfig;
6946
+ const newDatasets = datasets.map((datasetDef) => {
6947
+ const { files } = datasetDef;
6948
+ const newFiles = files.map((fileDef) => {
6949
+ const { fileType, options } = fileDef;
6950
+ if (fileType === "obsSets.anndata.zarr") {
6951
+ return {
6952
+ ...fileDef,
6953
+ options: {
6954
+ obsSets: options
6955
+ }
6956
+ };
6957
+ }
6958
+ if (fileType === "obsFeatureColumns.anndata.zarr") {
6959
+ return {
6960
+ ...fileDef,
6961
+ options: {
6962
+ obsFeatureColumns: options
6963
+ }
6964
+ };
6965
+ }
6966
+ return fileDef;
6967
+ });
6968
+ return {
6969
+ ...datasetDef,
6970
+ files: newFiles
6971
+ };
6972
+ });
6973
+ return {
6974
+ ...newConfig,
6975
+ datasets: newDatasets,
6976
+ version: "1.0.17"
6977
+ };
6978
+ }
6979
+ const latestConfigSchema = configSchema1_0_17;
6941
6980
  const SCHEMA_HANDLERS = [
6942
6981
  [configSchema0_1_0, upgradeFrom0_1_0],
6943
6982
  [configSchema1_0_0, upgradeFrom1_0_0],
@@ -6955,7 +6994,8 @@ const SCHEMA_HANDLERS = [
6955
6994
  [configSchema1_0_12, upgradeFrom1_0_12],
6956
6995
  [configSchema1_0_13, upgradeFrom1_0_13],
6957
6996
  [configSchema1_0_14, upgradeFrom1_0_14],
6958
- [configSchema1_0_15, upgradeFrom1_0_15]
6997
+ [configSchema1_0_15, upgradeFrom1_0_15],
6998
+ [configSchema1_0_16, upgradeFrom1_0_16]
6959
6999
  ];
6960
7000
  var re$3 = { exports: {} };
6961
7001
  const SEMVER_SPEC_VERSION = "2.0.0";
@@ -9101,6 +9141,7 @@ const FileType$1 = {
9101
9141
  // Joint file types
9102
9142
  ANNDATA_ZARR: "anndata.zarr",
9103
9143
  ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
9144
+ ANNDATA_H5AD: "anndata.h5ad",
9104
9145
  SPATIALDATA_ZARR: "spatialdata.zarr",
9105
9146
  // Atomic file types
9106
9147
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
@@ -9141,6 +9182,18 @@ const FileType$1 = {
9141
9182
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
9142
9183
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
9143
9184
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
9185
+ // AnnData - h5ad via reference spec
9186
+ OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
9187
+ OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
9188
+ OBS_SETS_ANNDATA_H5AD: "obsSets.anndata.h5ad",
9189
+ OBS_EMBEDDING_ANNDATA_H5AD: "obsEmbedding.anndata.h5ad",
9190
+ OBS_SPOTS_ANNDATA_H5AD: "obsSpots.anndata.h5ad",
9191
+ OBS_POINTS_ANNDATA_H5AD: "obsPoints.anndata.h5ad",
9192
+ OBS_LOCATIONS_ANNDATA_H5AD: "obsLocations.anndata.h5ad",
9193
+ OBS_SEGMENTATIONS_ANNDATA_H5AD: "obsSegmentations.anndata.h5ad",
9194
+ OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
9195
+ FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
9196
+ SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
9144
9197
  // SpatialData
9145
9198
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
9146
9199
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -9489,10 +9542,11 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
9489
9542
  const handler = {
9490
9543
  get(obj, prop) {
9491
9544
  const oldKeys = Object.keys(oldObj);
9492
- if (oldKeys.includes(prop)) {
9493
- console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':
9494
- ${oldObj[prop][1]}`);
9495
- return oldObj[prop];
9545
+ const propKey = String(prop);
9546
+ if (oldKeys.includes(propKey)) {
9547
+ console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
9548
+ ${oldObj[propKey][1]}`);
9549
+ return oldObj[propKey];
9496
9550
  }
9497
9551
  return obj[prop];
9498
9552
  }
@@ -9577,7 +9631,7 @@ const annDataObsFeatureMatrix = z.object({
9577
9631
  featureFilterPath: z.string().optional().describe("If the feature index should be filtered, put a boolean column here (analogous to the previous geneFilter option). e.g., var/in_obsm_X_small_matrix"),
9578
9632
  initialFeatureFilterPath: z.string().optional().describe("If only a subset of the matrix should be loaded initially, put a boolean column along the feature axis here (analogous to the previous matrixGeneFilter option). e.g., var/highly_variable")
9579
9633
  });
9580
- const annDataObsSets = z.array(z.object({
9634
+ const annDataObsSetsArr = z.array(z.object({
9581
9635
  name: z.string().describe("The display name for the set, like 'Cell Type' or 'Louvain.'"),
9582
9636
  path: z.union([
9583
9637
  z.string().describe("The location in the AnnData store for the set, like 'obs/louvain' or 'obs/celltype.'"),
@@ -9585,9 +9639,15 @@ const annDataObsSets = z.array(z.object({
9585
9639
  ]),
9586
9640
  scorePath: z.string().optional().describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'")
9587
9641
  }));
9588
- z.array(z.object({
9642
+ const annDataObsSets = z.object({
9643
+ obsSets: annDataObsSetsArr
9644
+ });
9645
+ const annDataObsFeatureColumnsArr = z.array(z.object({
9589
9646
  path: z.string()
9590
9647
  }));
9648
+ z.object({
9649
+ obsFeatureColumns: annDataObsFeatureColumnsArr
9650
+ });
9591
9651
  const annDataObsSpots = annDataObsm;
9592
9652
  const annDataObsPoints = annDataObsm;
9593
9653
  const annDataObsLocations = annDataObsm;
@@ -9710,7 +9770,7 @@ z.object({
9710
9770
  scoreColumn: z.string().optional()
9711
9771
  }))
9712
9772
  });
9713
- z.object({
9773
+ const anndataZarrSchema = z.object({
9714
9774
  obsLabels: z.union([
9715
9775
  annDataObsLabels,
9716
9776
  z.array(annDataConvenienceObsLabelsItem)
@@ -9720,7 +9780,7 @@ z.object({
9720
9780
  z.array(annDataConvenienceFeatureLabelsItem)
9721
9781
  ]),
9722
9782
  obsFeatureMatrix: annDataObsFeatureMatrix,
9723
- obsSets: annDataObsSets,
9783
+ obsSets: annDataObsSetsArr,
9724
9784
  obsSpots: annDataObsSpots,
9725
9785
  obsPoints: annDataObsPoints,
9726
9786
  obsLocations: annDataObsLocations,
@@ -9731,6 +9791,9 @@ z.object({
9731
9791
  ]),
9732
9792
  sampleEdges: annDataSampleEdges
9733
9793
  }).partial();
9794
+ anndataZarrSchema.extend({
9795
+ refSpecUrl: z.string()
9796
+ });
9734
9797
  z.object({
9735
9798
  // TODO: should `image` be a special schema
9736
9799
  // to allow specifying fileUid (like for embeddingType)?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/sets-utils",
3
- "version": "3.4.9",
3
+ "version": "3.4.10",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -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.9",
29
- "@vitessce/utils": "3.4.9"
28
+ "@vitessce/schemas": "3.4.10",
29
+ "@vitessce/utils": "3.4.10"
30
30
  },
31
31
  "scripts": {
32
32
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",