@vitessce/all 2.0.3-beta.0 → 3.0.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.
Files changed (45) hide show
  1. package/dist/deflate-f57b3163.js +13 -0
  2. package/dist/hglib-1422f224.js +138925 -0
  3. package/dist/index-3f1c1764.js +258272 -0
  4. package/dist/index.js +12 -2
  5. package/dist/jpeg-e740c9a5.js +840 -0
  6. package/dist/lerc-01e6c4d8.js +2006 -0
  7. package/dist/lzw-865bd058.js +128 -0
  8. package/dist/packbits-d4191efd.js +30 -0
  9. package/dist/pako.esm-68f84e2a.js +4022 -0
  10. package/dist/raw-3c693341.js +12 -0
  11. package/dist/webimage-83da2258.js +32 -0
  12. package/dist-tsc/Vitessce.d.ts +2 -0
  13. package/dist-tsc/Vitessce.d.ts.map +1 -0
  14. package/dist-tsc/Vitessce.js +41 -0
  15. package/dist-tsc/base-plugins.d.ts +854 -0
  16. package/dist-tsc/base-plugins.d.ts.map +1 -0
  17. package/dist-tsc/base-plugins.js +191 -0
  18. package/dist-tsc/index.d.ts +4 -0
  19. package/dist-tsc/index.d.ts.map +1 -0
  20. package/dist-tsc/index.js +3 -0
  21. package/dist-tsc/joint-file-types-legacy.d.ts +226 -0
  22. package/dist-tsc/joint-file-types-legacy.d.ts.map +1 -0
  23. package/dist-tsc/joint-file-types-legacy.js +266 -0
  24. package/dist-tsc/joint-file-types-legacy.test.d.ts +2 -0
  25. package/dist-tsc/joint-file-types-legacy.test.d.ts.map +1 -0
  26. package/dist-tsc/joint-file-types-legacy.test.js +401 -0
  27. package/dist-tsc/joint-file-types.d.ts +4 -0
  28. package/dist-tsc/joint-file-types.d.ts.map +1 -0
  29. package/dist-tsc/joint-file-types.js +127 -0
  30. package/dist-tsc/joint-file-types.test.d.ts +2 -0
  31. package/dist-tsc/joint-file-types.test.d.ts.map +1 -0
  32. package/dist-tsc/joint-file-types.test.js +128 -0
  33. package/dist-tsc/latest-config-schema.test.d.ts +2 -0
  34. package/dist-tsc/latest-config-schema.test.d.ts.map +1 -0
  35. package/dist-tsc/latest-config-schema.test.js +19 -0
  36. package/package.json +39 -21
  37. package/src/Vitessce.tsx +74 -0
  38. package/src/base-plugins.ts +362 -0
  39. package/src/index.ts +8 -0
  40. package/src/joint-file-types-legacy.test.ts +413 -0
  41. package/src/joint-file-types-legacy.ts +284 -0
  42. package/src/joint-file-types.test.ts +132 -0
  43. package/src/joint-file-types.ts +142 -0
  44. package/src/latest-config-schema.test.ts +26 -0
  45. package/dist/setup.js +0 -96
@@ -0,0 +1,266 @@
1
+ import { FileType } from '@vitessce/constants-internal';
2
+ export function expandMoleculesJson(fileDef) {
3
+ const baseFileDef = {
4
+ ...fileDef,
5
+ coordinationValues: {
6
+ obsType: fileDef.coordinationValues?.obsType || 'molecule',
7
+ },
8
+ };
9
+ delete baseFileDef.type;
10
+ return [
11
+ {
12
+ ...baseFileDef,
13
+ fileType: FileType.OBS_LOCATIONS_MOLECULES_JSON,
14
+ },
15
+ {
16
+ ...baseFileDef,
17
+ fileType: FileType.OBS_LABELS_MOLECULES_JSON,
18
+ },
19
+ ];
20
+ }
21
+ export function expandExpressionMatrixZarr(fileDef) {
22
+ const baseFileDef = {
23
+ ...fileDef,
24
+ coordinationValues: {
25
+ obsType: fileDef.coordinationValues?.obsType || 'cell',
26
+ featureType: fileDef.coordinationValues?.featureType || 'gene',
27
+ featureValueType: fileDef.coordinationValues?.featureValueType || 'expression',
28
+ },
29
+ };
30
+ delete baseFileDef.type;
31
+ return [
32
+ {
33
+ ...baseFileDef,
34
+ fileType: FileType.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR,
35
+ },
36
+ ];
37
+ }
38
+ export function expandRasterJson(fileDef) {
39
+ // Validation already happens in the RasterJsonLoader.
40
+ const baseFileDef = { ...fileDef };
41
+ delete baseFileDef.type;
42
+ return [
43
+ {
44
+ ...baseFileDef,
45
+ fileType: FileType.IMAGE_RASTER_JSON,
46
+ },
47
+ {
48
+ ...baseFileDef,
49
+ fileType: FileType.OBS_SEGMENTATIONS_RASTER_JSON,
50
+ coordinationValues: {
51
+ obsType: baseFileDef.coordinationValues?.obsType || 'cell',
52
+ },
53
+ },
54
+ ];
55
+ }
56
+ export function expandRasterOmeZarr(fileDef) {
57
+ const baseFileDef = { ...fileDef };
58
+ delete baseFileDef.type;
59
+ return [
60
+ {
61
+ ...baseFileDef,
62
+ fileType: FileType.IMAGE_OME_ZARR,
63
+ },
64
+ ];
65
+ }
66
+ export function expandCellSetsJson(fileDef) {
67
+ const baseFileDef = { ...fileDef };
68
+ delete baseFileDef.type;
69
+ return [
70
+ {
71
+ ...baseFileDef,
72
+ fileType: FileType.OBS_SETS_CELL_SETS_JSON,
73
+ coordinationValues: {
74
+ obsType: baseFileDef.coordinationValues?.obsType || 'cell',
75
+ },
76
+ },
77
+ ];
78
+ }
79
+ export function expandCellsJson(fileDef) {
80
+ const baseFileDef = {
81
+ ...fileDef,
82
+ coordinationValues: {
83
+ obsType: fileDef.coordinationValues?.obsType || 'cell',
84
+ featureType: fileDef.coordinationValues?.featureType || 'gene',
85
+ },
86
+ };
87
+ delete baseFileDef.type;
88
+ delete baseFileDef.options;
89
+ return [
90
+ {
91
+ ...baseFileDef,
92
+ fileType: FileType.OBS_SEGMENTATIONS_CELLS_JSON,
93
+ coordinationValues: {
94
+ obsType: baseFileDef.coordinationValues.obsType,
95
+ },
96
+ },
97
+ {
98
+ ...baseFileDef,
99
+ fileType: FileType.OBS_LOCATIONS_CELLS_JSON,
100
+ coordinationValues: {
101
+ obsType: baseFileDef.coordinationValues.obsType,
102
+ },
103
+ },
104
+ ...(fileDef.options?.embeddingTypes ? fileDef.options.embeddingTypes.map((et) => ({
105
+ ...baseFileDef,
106
+ fileType: FileType.OBS_EMBEDDING_CELLS_JSON,
107
+ coordinationValues: {
108
+ obsType: baseFileDef.coordinationValues.obsType,
109
+ embeddingType: et,
110
+ },
111
+ })) : []),
112
+ ...(fileDef.options?.obsLabelsTypes ? fileDef.options.obsLabelsTypes.map((key) => ({
113
+ ...baseFileDef,
114
+ fileType: FileType.OBS_LABELS_CELLS_JSON,
115
+ coordinationValues: {
116
+ obsType: baseFileDef.coordinationValues.obsType,
117
+ obsLabelsType: key,
118
+ },
119
+ })) : []),
120
+ ];
121
+ }
122
+ export function expandClustersJson(fileDef) {
123
+ const baseFileDef = {
124
+ ...fileDef,
125
+ coordinationValues: {
126
+ obsType: fileDef.coordinationValues?.obsType || 'cell',
127
+ featureType: fileDef.coordinationValues?.featureType || 'gene',
128
+ featureValueType: fileDef.coordinationValues?.featureValueType || 'expression',
129
+ },
130
+ };
131
+ delete baseFileDef.type;
132
+ return [
133
+ {
134
+ ...baseFileDef,
135
+ fileType: FileType.OBS_FEATURE_MATRIX_CLUSTERS_JSON,
136
+ },
137
+ ];
138
+ }
139
+ export function expandGenesJson(fileDef) {
140
+ const baseFileDef = {
141
+ ...fileDef,
142
+ coordinationValues: {
143
+ obsType: fileDef.coordinationValues?.obsType || 'cell',
144
+ featureType: fileDef.coordinationValues?.featureType || 'gene',
145
+ featureValueType: fileDef.coordinationValues?.featureValueType || 'expression',
146
+ },
147
+ };
148
+ delete baseFileDef.type;
149
+ return [
150
+ {
151
+ ...baseFileDef,
152
+ fileType: FileType.OBS_FEATURE_MATRIX_GENES_JSON,
153
+ },
154
+ ];
155
+ }
156
+ function getAnndataBaseFileDef(fileDef) {
157
+ return {
158
+ url: fileDef.url,
159
+ requestInit: fileDef.requestInit,
160
+ coordinationValues: {
161
+ ...fileDef.coordinationValues,
162
+ obsType: fileDef.coordinationValues?.obsType || 'cell',
163
+ featureType: fileDef.coordinationValues?.featureType || 'gene',
164
+ featureValueType: fileDef.coordinationValues?.featureValueType || 'expression',
165
+ },
166
+ };
167
+ }
168
+ export function expandAnndataCellsZarr(fileDef) {
169
+ const baseFileDef = getAnndataBaseFileDef(fileDef);
170
+ const { options = {} } = fileDef;
171
+ const embeddingTypes = options.mappings ? Object.keys(options.mappings) : [];
172
+ const obsLabelsTypes = options.factors ? options.factors : [];
173
+ return [
174
+ ...(options.poly ? [{
175
+ ...baseFileDef,
176
+ fileType: FileType.OBS_SEGMENTATIONS_ANNDATA_ZARR,
177
+ options: {
178
+ path: options.poly,
179
+ },
180
+ coordinationValues: {
181
+ obsType: baseFileDef.coordinationValues.obsType,
182
+ },
183
+ }] : []),
184
+ ...(options.xy ? [{
185
+ ...baseFileDef,
186
+ fileType: FileType.OBS_LOCATIONS_ANNDATA_ZARR,
187
+ options: {
188
+ path: options.xy,
189
+ },
190
+ coordinationValues: {
191
+ obsType: baseFileDef.coordinationValues.obsType,
192
+ },
193
+ }] : []),
194
+ ...embeddingTypes.map(et => ({
195
+ ...baseFileDef,
196
+ fileType: FileType.OBS_EMBEDDING_ANNDATA_ZARR,
197
+ options: {
198
+ path: options.mappings[et].key,
199
+ dims: options.mappings[et].dims,
200
+ },
201
+ coordinationValues: {
202
+ obsType: baseFileDef.coordinationValues.obsType,
203
+ embeddingType: et,
204
+ },
205
+ })),
206
+ ...obsLabelsTypes.map((olt) => ({
207
+ ...baseFileDef,
208
+ fileType: FileType.OBS_LABELS_ANNDATA_ZARR,
209
+ options: {
210
+ path: olt,
211
+ },
212
+ coordinationValues: {
213
+ obsType: baseFileDef.coordinationValues.obsType,
214
+ obsLabelsType: olt.split('/').at(-1),
215
+ },
216
+ })),
217
+ ];
218
+ }
219
+ export function expandAnndataCellSetsZarr(fileDef) {
220
+ const baseFileDef = getAnndataBaseFileDef(fileDef);
221
+ const { options = [] } = fileDef;
222
+ return [
223
+ {
224
+ ...baseFileDef,
225
+ fileType: FileType.OBS_SETS_ANNDATA_ZARR,
226
+ options: options.map((option) => ({
227
+ name: option.groupName,
228
+ path: option.setName,
229
+ scorePath: option.scoreName,
230
+ })),
231
+ coordinationValues: {
232
+ obsType: baseFileDef.coordinationValues.obsType,
233
+ },
234
+ },
235
+ ];
236
+ }
237
+ export function expandAnndataExpressionMatrixZarr(fileDef) {
238
+ const baseFileDef = getAnndataBaseFileDef(fileDef);
239
+ const { options = {} } = fileDef;
240
+ return [
241
+ ...(options.geneAlias ? [{
242
+ ...baseFileDef,
243
+ fileType: FileType.FEATURE_LABELS_ANNDATA_ZARR,
244
+ options: {
245
+ path: options.geneAlias,
246
+ },
247
+ coordinationValues: {
248
+ featureType: baseFileDef.coordinationValues.featureType,
249
+ },
250
+ }] : []),
251
+ {
252
+ ...baseFileDef,
253
+ fileType: FileType.OBS_FEATURE_MATRIX_ANNDATA_ZARR,
254
+ options: {
255
+ path: options.matrix,
256
+ featureFilterPath: options.geneFilter,
257
+ initialFeatureFilterPath: options.matrixGeneFilter,
258
+ },
259
+ coordinationValues: {
260
+ obsType: baseFileDef.coordinationValues.obsType,
261
+ featureType: baseFileDef.coordinationValues.featureType,
262
+ featureValueType: baseFileDef.coordinationValues.featureValueType,
263
+ },
264
+ },
265
+ ];
266
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=joint-file-types-legacy.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joint-file-types-legacy.test.d.ts","sourceRoot":"","sources":["../src/joint-file-types-legacy.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,401 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { expandExpressionMatrixZarr, expandRasterJson, expandRasterOmeZarr, expandGenesJson, expandClustersJson, expandCellsJson, expandMoleculesJson, expandAnndataCellsZarr, expandAnndataCellSetsZarr, expandAnndataExpressionMatrixZarr, } from './joint-file-types-legacy.js';
3
+ describe('src/app/joint-file-types-legacy.js', () => {
4
+ describe('expandExpressionMatrixZarr', () => {
5
+ it('expands expression-matrix.zarr', () => {
6
+ expect(expandExpressionMatrixZarr({
7
+ fileType: 'expression-matrix.zarr',
8
+ url: 'http://localhost:8000/expression-matrix.zarr',
9
+ })).toEqual([
10
+ {
11
+ fileType: 'obsFeatureMatrix.expression-matrix.zarr',
12
+ url: 'http://localhost:8000/expression-matrix.zarr',
13
+ coordinationValues: {
14
+ obsType: 'cell',
15
+ featureType: 'gene',
16
+ featureValueType: 'expression',
17
+ },
18
+ },
19
+ ]);
20
+ });
21
+ });
22
+ describe('expandRasterJson', () => {
23
+ it('expands raster.json', () => {
24
+ expect(expandRasterJson({
25
+ fileType: 'raster.json',
26
+ url: 'http://localhost:8000/raster.json',
27
+ })).toEqual([
28
+ {
29
+ fileType: 'image.raster.json',
30
+ url: 'http://localhost:8000/raster.json',
31
+ },
32
+ {
33
+ fileType: 'obsSegmentations.raster.json',
34
+ url: 'http://localhost:8000/raster.json',
35
+ coordinationValues: {
36
+ obsType: 'cell',
37
+ },
38
+ },
39
+ ]);
40
+ });
41
+ });
42
+ describe('expandRasterOmeZarr', () => {
43
+ it('expands raster.ome-zarr', () => {
44
+ expect(expandRasterOmeZarr({
45
+ fileType: 'raster.ome-zarr',
46
+ url: 'http://localhost:8000/raster.zarr',
47
+ })).toEqual([
48
+ {
49
+ fileType: 'image.ome-zarr',
50
+ url: 'http://localhost:8000/raster.zarr',
51
+ },
52
+ ]);
53
+ });
54
+ });
55
+ describe('expandClustersJson', () => {
56
+ it('expands clusters.json', () => {
57
+ expect(expandClustersJson({
58
+ fileType: 'clusters.json',
59
+ url: 'http://localhost:8000/clusters.json',
60
+ })).toEqual([
61
+ {
62
+ fileType: 'obsFeatureMatrix.clusters.json',
63
+ url: 'http://localhost:8000/clusters.json',
64
+ coordinationValues: {
65
+ obsType: 'cell',
66
+ featureType: 'gene',
67
+ featureValueType: 'expression',
68
+ },
69
+ },
70
+ ]);
71
+ });
72
+ });
73
+ describe('expandGenesJson', () => {
74
+ it('expands', () => {
75
+ expect(expandGenesJson({
76
+ fileType: 'genes.json',
77
+ url: 'http://localhost:8000/genes.json',
78
+ })).toEqual([
79
+ {
80
+ fileType: 'obsFeatureMatrix.genes.json',
81
+ url: 'http://localhost:8000/genes.json',
82
+ coordinationValues: {
83
+ obsType: 'cell',
84
+ featureType: 'gene',
85
+ featureValueType: 'expression',
86
+ },
87
+ },
88
+ ]);
89
+ });
90
+ });
91
+ describe('expandMoleculesJson', () => {
92
+ it('expands when there are no options', () => {
93
+ expect(expandMoleculesJson({
94
+ fileType: 'molecules.json',
95
+ url: 'http://localhost:8000/molecules.json',
96
+ })).toEqual([
97
+ {
98
+ fileType: 'obsLocations.molecules.json',
99
+ url: 'http://localhost:8000/molecules.json',
100
+ coordinationValues: {
101
+ obsType: 'molecule',
102
+ },
103
+ },
104
+ {
105
+ fileType: 'obsLabels.molecules.json',
106
+ url: 'http://localhost:8000/molecules.json',
107
+ coordinationValues: {
108
+ obsType: 'molecule',
109
+ },
110
+ },
111
+ ]);
112
+ });
113
+ });
114
+ describe('expandCellsJson', () => {
115
+ it('expands when there are no options', () => {
116
+ expect(expandCellsJson({
117
+ fileType: 'cells.json',
118
+ url: 'http://localhost:8000/cells.json',
119
+ })).toEqual([
120
+ {
121
+ fileType: 'obsSegmentations.cells.json',
122
+ url: 'http://localhost:8000/cells.json',
123
+ coordinationValues: {
124
+ obsType: 'cell',
125
+ },
126
+ },
127
+ {
128
+ fileType: 'obsLocations.cells.json',
129
+ url: 'http://localhost:8000/cells.json',
130
+ coordinationValues: {
131
+ obsType: 'cell',
132
+ },
133
+ },
134
+ ]);
135
+ });
136
+ it('expands when there is an array of embedding types', () => {
137
+ expect(expandCellsJson({
138
+ fileType: 'cells.json',
139
+ url: 'http://localhost:8000/cells.json',
140
+ options: {
141
+ embeddingTypes: ['UMAP', 't-SNE'],
142
+ obsLabelsTypes: ['cluster', 'subcluster'],
143
+ },
144
+ })).toEqual([
145
+ {
146
+ fileType: 'obsSegmentations.cells.json',
147
+ url: 'http://localhost:8000/cells.json',
148
+ coordinationValues: {
149
+ obsType: 'cell',
150
+ },
151
+ },
152
+ {
153
+ fileType: 'obsLocations.cells.json',
154
+ url: 'http://localhost:8000/cells.json',
155
+ coordinationValues: {
156
+ obsType: 'cell',
157
+ },
158
+ },
159
+ {
160
+ fileType: 'obsEmbedding.cells.json',
161
+ url: 'http://localhost:8000/cells.json',
162
+ coordinationValues: {
163
+ obsType: 'cell',
164
+ embeddingType: 'UMAP',
165
+ },
166
+ },
167
+ {
168
+ fileType: 'obsEmbedding.cells.json',
169
+ url: 'http://localhost:8000/cells.json',
170
+ coordinationValues: {
171
+ obsType: 'cell',
172
+ embeddingType: 't-SNE',
173
+ },
174
+ },
175
+ {
176
+ fileType: 'obsLabels.cells.json',
177
+ url: 'http://localhost:8000/cells.json',
178
+ coordinationValues: {
179
+ obsType: 'cell',
180
+ obsLabelsType: 'cluster',
181
+ },
182
+ },
183
+ {
184
+ fileType: 'obsLabels.cells.json',
185
+ url: 'http://localhost:8000/cells.json',
186
+ coordinationValues: {
187
+ obsType: 'cell',
188
+ obsLabelsType: 'subcluster',
189
+ },
190
+ },
191
+ ]);
192
+ });
193
+ });
194
+ // cells
195
+ describe('expandAnndataCellsZarr', () => {
196
+ it('fails to expand when there are no options', () => {
197
+ expect(expandAnndataCellsZarr({
198
+ fileType: 'anndata-cells.zarr',
199
+ url: 'http://localhost:8000/anndata.zarr',
200
+ })).toEqual([]);
201
+ });
202
+ it('expands when there are lots of options', () => {
203
+ expect(expandAnndataCellsZarr({
204
+ fileType: 'anndata-cells.zarr',
205
+ url: 'http://localhost:8000/anndata.zarr',
206
+ options: {
207
+ mappings: {
208
+ 't-SNE': {
209
+ key: 'obsm/tsne',
210
+ },
211
+ PCA: {
212
+ dims: [2, 3],
213
+ key: 'obsm/pca',
214
+ },
215
+ },
216
+ xy: 'obsm/locations',
217
+ poly: 'obsm/segmentations',
218
+ factors: [
219
+ 'obs/cluster',
220
+ 'obs/subcluster',
221
+ ],
222
+ },
223
+ })).toEqual([
224
+ {
225
+ fileType: 'obsSegmentations.anndata.zarr',
226
+ url: 'http://localhost:8000/anndata.zarr',
227
+ options: {
228
+ path: 'obsm/segmentations',
229
+ },
230
+ coordinationValues: {
231
+ obsType: 'cell',
232
+ },
233
+ },
234
+ {
235
+ fileType: 'obsLocations.anndata.zarr',
236
+ url: 'http://localhost:8000/anndata.zarr',
237
+ options: {
238
+ path: 'obsm/locations',
239
+ },
240
+ coordinationValues: {
241
+ obsType: 'cell',
242
+ },
243
+ },
244
+ {
245
+ fileType: 'obsEmbedding.anndata.zarr',
246
+ url: 'http://localhost:8000/anndata.zarr',
247
+ options: {
248
+ path: 'obsm/tsne',
249
+ },
250
+ coordinationValues: {
251
+ obsType: 'cell',
252
+ embeddingType: 't-SNE',
253
+ },
254
+ },
255
+ {
256
+ fileType: 'obsEmbedding.anndata.zarr',
257
+ url: 'http://localhost:8000/anndata.zarr',
258
+ options: {
259
+ path: 'obsm/pca',
260
+ dims: [2, 3],
261
+ },
262
+ coordinationValues: {
263
+ obsType: 'cell',
264
+ embeddingType: 'PCA',
265
+ },
266
+ },
267
+ {
268
+ fileType: 'obsLabels.anndata.zarr',
269
+ url: 'http://localhost:8000/anndata.zarr',
270
+ options: {
271
+ path: 'obs/cluster',
272
+ },
273
+ coordinationValues: {
274
+ obsType: 'cell',
275
+ obsLabelsType: 'cluster',
276
+ },
277
+ },
278
+ {
279
+ fileType: 'obsLabels.anndata.zarr',
280
+ url: 'http://localhost:8000/anndata.zarr',
281
+ options: {
282
+ path: 'obs/subcluster',
283
+ },
284
+ coordinationValues: {
285
+ obsType: 'cell',
286
+ obsLabelsType: 'subcluster',
287
+ },
288
+ },
289
+ ]);
290
+ });
291
+ });
292
+ // cell sets
293
+ describe('expandAnndataCellSetsZarr', () => {
294
+ it('expands both flat and hierarchical cell sets', () => {
295
+ expect(expandAnndataCellSetsZarr({
296
+ fileType: 'anndata-cell-sets.zarr',
297
+ url: 'http://localhost:8000/anndata.zarr',
298
+ options: [
299
+ {
300
+ groupName: 'Leiden clustering',
301
+ setName: 'obs/leiden',
302
+ },
303
+ {
304
+ groupName: 'Predicted cell types',
305
+ setName: 'obs/pred_types',
306
+ scoreName: 'obs/pred_scores',
307
+ },
308
+ {
309
+ groupName: 'Cell type annotations',
310
+ setName: ['obs/l1', 'obs/l2', 'obs/l3'],
311
+ },
312
+ ],
313
+ })).toEqual([
314
+ {
315
+ fileType: 'obsSets.anndata.zarr',
316
+ url: 'http://localhost:8000/anndata.zarr',
317
+ options: [
318
+ {
319
+ name: 'Leiden clustering',
320
+ path: 'obs/leiden',
321
+ },
322
+ {
323
+ name: 'Predicted cell types',
324
+ path: 'obs/pred_types',
325
+ scorePath: 'obs/pred_scores',
326
+ },
327
+ {
328
+ name: 'Cell type annotations',
329
+ path: ['obs/l1', 'obs/l2', 'obs/l3'],
330
+ },
331
+ ],
332
+ coordinationValues: {
333
+ obsType: 'cell',
334
+ },
335
+ },
336
+ ]);
337
+ });
338
+ // expression-matrix
339
+ describe('expandAnndataExpressionMatrixZarr', () => {
340
+ it('expands when there are no options', () => {
341
+ expect(expandAnndataExpressionMatrixZarr({
342
+ fileType: 'anndata-expression-matrix.zarr',
343
+ url: 'http://localhost:8000/anndata.zarr',
344
+ options: {
345
+ matrix: 'X',
346
+ },
347
+ })).toEqual([
348
+ {
349
+ fileType: 'obsFeatureMatrix.anndata.zarr',
350
+ url: 'http://localhost:8000/anndata.zarr',
351
+ options: {
352
+ path: 'X',
353
+ },
354
+ coordinationValues: {
355
+ obsType: 'cell',
356
+ featureType: 'gene',
357
+ featureValueType: 'expression',
358
+ },
359
+ },
360
+ ]);
361
+ });
362
+ it('expands when there are lots of options', () => {
363
+ expect(expandAnndataExpressionMatrixZarr({
364
+ fileType: 'anndata-expression-matrix.zarr',
365
+ url: 'http://localhost:8000/anndata.zarr',
366
+ options: {
367
+ matrix: 'obsm/hvg_subset',
368
+ geneAlias: 'var/gene_symbol',
369
+ geneFilter: 'var/in_hvg_subset',
370
+ matrixGeneFilter: 'var/highly_variable',
371
+ },
372
+ })).toEqual([
373
+ {
374
+ fileType: 'featureLabels.anndata.zarr',
375
+ url: 'http://localhost:8000/anndata.zarr',
376
+ options: {
377
+ path: 'var/gene_symbol',
378
+ },
379
+ coordinationValues: {
380
+ featureType: 'gene',
381
+ },
382
+ },
383
+ {
384
+ fileType: 'obsFeatureMatrix.anndata.zarr',
385
+ url: 'http://localhost:8000/anndata.zarr',
386
+ options: {
387
+ path: 'obsm/hvg_subset',
388
+ featureFilterPath: 'var/in_hvg_subset',
389
+ initialFeatureFilterPath: 'var/highly_variable',
390
+ },
391
+ coordinationValues: {
392
+ obsType: 'cell',
393
+ featureType: 'gene',
394
+ featureValueType: 'expression',
395
+ },
396
+ },
397
+ ]);
398
+ });
399
+ });
400
+ });
401
+ });
@@ -0,0 +1,4 @@
1
+ import type { z } from 'zod';
2
+ import type { latestFileDefSchema } from '@vitessce/schemas';
3
+ export declare function expandAnndataZarr(fileDef: z.infer<typeof latestFileDefSchema>): any[];
4
+ //# sourceMappingURL=joint-file-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joint-file-types.d.ts","sourceRoot":"","sources":["../src/joint-file-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAS7D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,SAmI7E"}