@vitessce/all 3.1.3 → 3.2.1

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.
@@ -8,6 +8,12 @@ type BaseFileDef = {
8
8
  coordinationValues: Record<string, string>;
9
9
  };
10
10
 
11
+ const expectedCoordinationTypes = [
12
+ 'obsType', 'featureType', 'featureValueType',
13
+ 'featureLabelsType', 'obsLabelsType',
14
+ 'embeddingType',
15
+ ];
16
+
11
17
  export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>) {
12
18
  const baseFileDef: BaseFileDef = {
13
19
  url: fileDef.url,
@@ -19,6 +25,12 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
19
25
  featureValueType: fileDef.coordinationValues?.featureValueType || 'expression',
20
26
  },
21
27
  };
28
+ const extraCoordinationValues: Record<string, any> = {};
29
+ Object.entries(baseFileDef.coordinationValues).forEach(([key, value]) => {
30
+ if (!expectedCoordinationTypes.includes(key)) {
31
+ extraCoordinationValues[key] = value;
32
+ }
33
+ });
22
34
  const { options = {} } = fileDef;
23
35
  return [
24
36
  // obsFeatureMatrix
@@ -27,6 +39,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
27
39
  fileType: FileType.OBS_FEATURE_MATRIX_ANNDATA_ZARR,
28
40
  options: options.obsFeatureMatrix,
29
41
  coordinationValues: {
42
+ ...extraCoordinationValues,
30
43
  obsType: baseFileDef.coordinationValues.obsType,
31
44
  featureType: baseFileDef.coordinationValues.featureType,
32
45
  featureValueType: baseFileDef.coordinationValues.featureValueType,
@@ -38,6 +51,27 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
38
51
  fileType: FileType.OBS_SETS_ANNDATA_ZARR,
39
52
  options: options.obsSets,
40
53
  coordinationValues: {
54
+ ...extraCoordinationValues,
55
+ obsType: baseFileDef.coordinationValues.obsType,
56
+ },
57
+ }] : []),
58
+ // obsSpots
59
+ ...(options.obsSpots ? [{
60
+ ...baseFileDef,
61
+ fileType: FileType.OBS_SPOTS_ANNDATA_ZARR,
62
+ options: options.obsSpots,
63
+ coordinationValues: {
64
+ ...extraCoordinationValues,
65
+ obsType: baseFileDef.coordinationValues.obsType,
66
+ },
67
+ }] : []),
68
+ // obsPoints
69
+ ...(options.obsPoints ? [{
70
+ ...baseFileDef,
71
+ fileType: FileType.OBS_POINTS_ANNDATA_ZARR,
72
+ options: options.obsPoints,
73
+ coordinationValues: {
74
+ ...extraCoordinationValues,
41
75
  obsType: baseFileDef.coordinationValues.obsType,
42
76
  },
43
77
  }] : []),
@@ -47,6 +81,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
47
81
  fileType: FileType.OBS_LOCATIONS_ANNDATA_ZARR,
48
82
  options: options.obsLocations,
49
83
  coordinationValues: {
84
+ ...extraCoordinationValues,
50
85
  obsType: baseFileDef.coordinationValues.obsType,
51
86
  },
52
87
  }] : []),
@@ -56,6 +91,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
56
91
  fileType: FileType.OBS_SEGMENTATIONS_ANNDATA_ZARR,
57
92
  options: options.obsSegmentations,
58
93
  coordinationValues: {
94
+ ...extraCoordinationValues,
59
95
  obsType: baseFileDef.coordinationValues.obsType,
60
96
  },
61
97
  }] : []),
@@ -71,6 +107,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
71
107
  dims: oe.dims,
72
108
  },
73
109
  coordinationValues: {
110
+ ...extraCoordinationValues,
74
111
  obsType: baseFileDef.coordinationValues.obsType,
75
112
  // Move embedding type property out of options and into coordinationValues.
76
113
  embeddingType: oe.embeddingType,
@@ -81,6 +118,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
81
118
  fileType: FileType.OBS_EMBEDDING_ANNDATA_ZARR,
82
119
  options: options.obsEmbedding,
83
120
  coordinationValues: {
121
+ ...extraCoordinationValues,
84
122
  obsType: baseFileDef.coordinationValues.obsType,
85
123
  embeddingType: baseFileDef.coordinationValues.embeddingType,
86
124
  },
@@ -97,6 +135,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
97
135
  path: ol.path,
98
136
  },
99
137
  coordinationValues: {
138
+ ...extraCoordinationValues,
100
139
  obsType: baseFileDef.coordinationValues.obsType,
101
140
  // Move obsLabels type property out of options and into coordinationValues.
102
141
  obsLabelsType: ol.obsLabelsType,
@@ -107,6 +146,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
107
146
  fileType: FileType.OBS_LABELS_ANNDATA_ZARR,
108
147
  options: options.obsLabels,
109
148
  coordinationValues: {
149
+ ...extraCoordinationValues,
110
150
  obsType: baseFileDef.coordinationValues.obsType,
111
151
  obsLabelsType: baseFileDef.coordinationValues.obsLabelsType,
112
152
  },
@@ -123,6 +163,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
123
163
  path: fl.path,
124
164
  },
125
165
  coordinationValues: {
166
+ ...extraCoordinationValues,
126
167
  featureType: baseFileDef.coordinationValues.featureType,
127
168
  // Move featureLabels type property out of options and into coordinationValues.
128
169
  featureLabelsType: fl.featureLabelsType,
@@ -133,6 +174,7 @@ export function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>)
133
174
  fileType: FileType.FEATURE_LABELS_ANNDATA_ZARR,
134
175
  options: options.featureLabels,
135
176
  coordinationValues: {
177
+ ...extraCoordinationValues,
136
178
  featureType: baseFileDef.coordinationValues.featureType,
137
179
  featureLabelsType: baseFileDef.coordinationValues.featureLabelsType,
138
180
  },