@vitessce/schemas 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.
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/index.js +16360 -0
- package/dist-tsc/file-def-options-legacy.d.ts +72 -0
- package/dist-tsc/file-def-options-legacy.d.ts.map +1 -0
- package/dist-tsc/file-def-options-legacy.js +28 -0
- package/dist-tsc/file-def-options.d.ts +417 -0
- package/dist-tsc/file-def-options.d.ts.map +1 -0
- package/dist-tsc/file-def-options.js +139 -0
- package/dist-tsc/index.d.ts +11 -0
- package/dist-tsc/index.d.ts.map +1 -0
- package/dist-tsc/index.js +10 -0
- package/dist-tsc/previous-config-meta.d.ts +251 -0
- package/dist-tsc/previous-config-meta.d.ts.map +1 -0
- package/dist-tsc/previous-config-meta.js +22 -0
- package/dist-tsc/previous-config-schemas.d.ts +4053 -0
- package/dist-tsc/previous-config-schemas.d.ts.map +1 -0
- package/dist-tsc/previous-config-schemas.js +204 -0
- package/dist-tsc/previous-config-upgraders.d.ts +25 -0
- package/dist-tsc/previous-config-upgraders.d.ts.map +1 -0
- package/dist-tsc/previous-config-upgraders.js +589 -0
- package/dist-tsc/raster-json.d.ts +274 -0
- package/dist-tsc/raster-json.d.ts.map +1 -0
- package/dist-tsc/raster-json.js +36 -0
- package/dist-tsc/schema-builders.d.ts +465 -0
- package/dist-tsc/schema-builders.d.ts.map +1 -0
- package/dist-tsc/schema-builders.js +127 -0
- package/dist-tsc/shared.d.ts +145 -0
- package/dist-tsc/shared.d.ts.map +1 -0
- package/dist-tsc/shared.js +100 -0
- package/dist-tsc/spatial-layers.d.ts +112 -0
- package/dist-tsc/spatial-layers.d.ts.map +1 -0
- package/dist-tsc/spatial-layers.js +81 -0
- package/dist-tsc/view-config-utils.test.d.ts +2 -0
- package/dist-tsc/view-config-utils.test.d.ts.map +1 -0
- package/dist-tsc/view-config-utils.test.fixtures.d.ts +495 -0
- package/dist-tsc/view-config-utils.test.fixtures.d.ts.map +1 -0
- package/dist-tsc/view-config-utils.test.fixtures.js +881 -0
- package/dist-tsc/view-config-utils.test.js +23 -0
- package/dist-tsc/view-config-versions.d.ts +6 -0
- package/dist-tsc/view-config-versions.d.ts.map +1 -0
- package/dist-tsc/view-config-versions.js +78 -0
- package/package.json +49 -0
- package/src/file-def-options-legacy.js +34 -0
- package/src/file-def-options.ts +158 -0
- package/src/index.ts +41 -0
- package/src/missing-types.d.ts +1 -0
- package/src/previous-config-meta.ts +85 -0
- package/src/previous-config-schemas.ts +259 -0
- package/src/previous-config-upgraders.ts +739 -0
- package/src/raster-json.ts +38 -0
- package/src/schema-builders.ts +179 -0
- package/src/shared.ts +158 -0
- package/src/spatial-layers.ts +103 -0
- package/src/view-config-utils.test.fixtures.ts +901 -0
- package/src/view-config-utils.test.ts +39 -0
- package/src/view-config-versions.ts +87 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const cellsJsonSchema: z.ZodOptional<z.ZodObject<{
|
|
2
|
+
obsLabelsTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3
|
+
embeddingTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
obsLabelsTypes?: string[] | undefined;
|
|
6
|
+
embeddingTypes?: string[] | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
obsLabelsTypes?: string[] | undefined;
|
|
9
|
+
embeddingTypes?: string[] | undefined;
|
|
10
|
+
}>>;
|
|
11
|
+
export const anndataCellsZarrSchema: z.ZodObject<{
|
|
12
|
+
xy: z.ZodOptional<z.ZodString>;
|
|
13
|
+
poly: z.ZodOptional<z.ZodString>;
|
|
14
|
+
factors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
mappings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
16
|
+
key: z.ZodString;
|
|
17
|
+
dims: z.ZodArray<z.ZodNumber, "many">;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
key: string;
|
|
20
|
+
dims: number[];
|
|
21
|
+
}, {
|
|
22
|
+
key: string;
|
|
23
|
+
dims: number[];
|
|
24
|
+
}>>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
xy?: string | undefined;
|
|
27
|
+
poly?: string | undefined;
|
|
28
|
+
factors?: string[] | undefined;
|
|
29
|
+
mappings?: Record<string, {
|
|
30
|
+
key: string;
|
|
31
|
+
dims: number[];
|
|
32
|
+
}> | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
xy?: string | undefined;
|
|
35
|
+
poly?: string | undefined;
|
|
36
|
+
factors?: string[] | undefined;
|
|
37
|
+
mappings?: Record<string, {
|
|
38
|
+
key: string;
|
|
39
|
+
dims: number[];
|
|
40
|
+
}> | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export const anndataCellSetsZarrSchema: z.ZodArray<z.ZodObject<{
|
|
43
|
+
groupName: z.ZodString;
|
|
44
|
+
setName: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
45
|
+
scoreName: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
groupName: string;
|
|
48
|
+
setName: (string | string[]) & (string | string[] | undefined);
|
|
49
|
+
scoreName?: string | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
groupName: string;
|
|
52
|
+
setName: (string | string[]) & (string | string[] | undefined);
|
|
53
|
+
scoreName?: string | undefined;
|
|
54
|
+
}>, "many">;
|
|
55
|
+
export const anndataExpressionMatrixZarrSchema: z.ZodObject<{
|
|
56
|
+
matrix: z.ZodString;
|
|
57
|
+
geneFilter: z.ZodOptional<z.ZodString>;
|
|
58
|
+
matrixGeneFilter: z.ZodOptional<z.ZodString>;
|
|
59
|
+
geneAlias: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
matrix: string;
|
|
62
|
+
geneFilter?: string | undefined;
|
|
63
|
+
matrixGeneFilter?: string | undefined;
|
|
64
|
+
geneAlias?: string | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
matrix: string;
|
|
67
|
+
geneFilter?: string | undefined;
|
|
68
|
+
matrixGeneFilter?: string | undefined;
|
|
69
|
+
geneAlias?: string | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
import { z } from "zod/lib";
|
|
72
|
+
//# sourceMappingURL=file-def-options-legacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-def-options-legacy.d.ts","sourceRoot":"","sources":["../src/file-def-options-legacy.js"],"names":[],"mappings":"AAEA;;;;;;;;;IAGc;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;YAOI;AAEJ;;;;;;;;;;;;;;;GAKG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const cellsJsonSchema = z.object({
|
|
3
|
+
obsLabelsTypes: z.array(z.string()).optional(),
|
|
4
|
+
embeddingTypes: z.array(z.string()).optional(),
|
|
5
|
+
}).optional();
|
|
6
|
+
export const anndataCellsZarrSchema = z.object({
|
|
7
|
+
xy: z.string().optional(),
|
|
8
|
+
poly: z.string().optional(),
|
|
9
|
+
factors: z.array(z.string()).optional(),
|
|
10
|
+
mappings: z.record(z.object({
|
|
11
|
+
key: z.string(),
|
|
12
|
+
dims: z.array(z.number()).length(2),
|
|
13
|
+
})).optional(),
|
|
14
|
+
});
|
|
15
|
+
export const anndataCellSetsZarrSchema = z.array(z.object({
|
|
16
|
+
groupName: z.string(),
|
|
17
|
+
setName: z.union([
|
|
18
|
+
z.string(),
|
|
19
|
+
z.array(z.string()),
|
|
20
|
+
]),
|
|
21
|
+
scoreName: z.string().optional(),
|
|
22
|
+
}));
|
|
23
|
+
export const anndataExpressionMatrixZarrSchema = z.object({
|
|
24
|
+
matrix: z.string(),
|
|
25
|
+
geneFilter: z.string().optional(),
|
|
26
|
+
matrixGeneFilter: z.string().optional(),
|
|
27
|
+
geneAlias: z.string().optional(),
|
|
28
|
+
});
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const imageOmeTiffSchema: z.ZodObject<{
|
|
3
|
+
offsetsUrl: z.ZodOptional<z.ZodString>;
|
|
4
|
+
coordinateTransformations: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"identity">;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
type: "identity";
|
|
8
|
+
}, {
|
|
9
|
+
type: "identity";
|
|
10
|
+
}>, z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"translation">;
|
|
12
|
+
translation: z.ZodArray<z.ZodNumber, "many">;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
type: "translation";
|
|
15
|
+
translation: number[];
|
|
16
|
+
}, {
|
|
17
|
+
type: "translation";
|
|
18
|
+
translation: number[];
|
|
19
|
+
}>, z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"scale">;
|
|
21
|
+
scale: z.ZodArray<z.ZodNumber, "many">;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
type: "scale";
|
|
24
|
+
scale: number[];
|
|
25
|
+
}, {
|
|
26
|
+
type: "scale";
|
|
27
|
+
scale: number[];
|
|
28
|
+
}>]>, "many">>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
offsetsUrl?: string | undefined;
|
|
31
|
+
coordinateTransformations?: ({
|
|
32
|
+
type: "identity";
|
|
33
|
+
} | {
|
|
34
|
+
type: "translation";
|
|
35
|
+
translation: number[];
|
|
36
|
+
} | {
|
|
37
|
+
type: "scale";
|
|
38
|
+
scale: number[];
|
|
39
|
+
})[] | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
offsetsUrl?: string | undefined;
|
|
42
|
+
coordinateTransformations?: ({
|
|
43
|
+
type: "identity";
|
|
44
|
+
} | {
|
|
45
|
+
type: "translation";
|
|
46
|
+
translation: number[];
|
|
47
|
+
} | {
|
|
48
|
+
type: "scale";
|
|
49
|
+
scale: number[];
|
|
50
|
+
})[] | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const imageOmeZarrSchema: z.ZodObject<{
|
|
53
|
+
coordinateTransformations: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"identity">;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
type: "identity";
|
|
57
|
+
}, {
|
|
58
|
+
type: "identity";
|
|
59
|
+
}>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"translation">;
|
|
61
|
+
translation: z.ZodArray<z.ZodNumber, "many">;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
type: "translation";
|
|
64
|
+
translation: number[];
|
|
65
|
+
}, {
|
|
66
|
+
type: "translation";
|
|
67
|
+
translation: number[];
|
|
68
|
+
}>, z.ZodObject<{
|
|
69
|
+
type: z.ZodLiteral<"scale">;
|
|
70
|
+
scale: z.ZodArray<z.ZodNumber, "many">;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
type: "scale";
|
|
73
|
+
scale: number[];
|
|
74
|
+
}, {
|
|
75
|
+
type: "scale";
|
|
76
|
+
scale: number[];
|
|
77
|
+
}>]>, "many">>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
coordinateTransformations?: ({
|
|
80
|
+
type: "identity";
|
|
81
|
+
} | {
|
|
82
|
+
type: "translation";
|
|
83
|
+
translation: number[];
|
|
84
|
+
} | {
|
|
85
|
+
type: "scale";
|
|
86
|
+
scale: number[];
|
|
87
|
+
})[] | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
coordinateTransformations?: ({
|
|
90
|
+
type: "identity";
|
|
91
|
+
} | {
|
|
92
|
+
type: "translation";
|
|
93
|
+
translation: number[];
|
|
94
|
+
} | {
|
|
95
|
+
type: "scale";
|
|
96
|
+
scale: number[];
|
|
97
|
+
})[] | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Options schemas for atomic file types.
|
|
101
|
+
*/
|
|
102
|
+
export declare const obsEmbeddingAnndataSchema: z.ZodObject<{
|
|
103
|
+
path: z.ZodString;
|
|
104
|
+
dims: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
path: string;
|
|
107
|
+
dims?: number[] | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
path: string;
|
|
110
|
+
dims?: number[] | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
export declare const obsLocationsAnndataSchema: z.ZodObject<{
|
|
113
|
+
path: z.ZodString;
|
|
114
|
+
dims: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
path: string;
|
|
117
|
+
dims?: number[] | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
path: string;
|
|
120
|
+
dims?: number[] | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const obsSegmentationsAnndataSchema: z.ZodObject<{
|
|
123
|
+
path: z.ZodString;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
path: string;
|
|
126
|
+
}, {
|
|
127
|
+
path: string;
|
|
128
|
+
}>;
|
|
129
|
+
export declare const obsSetsAnndataSchema: z.ZodArray<z.ZodObject<{
|
|
130
|
+
name: z.ZodString;
|
|
131
|
+
path: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
132
|
+
scorePath: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
135
|
+
name: string;
|
|
136
|
+
scorePath?: string | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
139
|
+
name: string;
|
|
140
|
+
scorePath?: string | undefined;
|
|
141
|
+
}>, "many">;
|
|
142
|
+
export declare const obsFeatureMatrixAnndataSchema: z.ZodObject<{
|
|
143
|
+
path: z.ZodString;
|
|
144
|
+
featureFilterPath: z.ZodOptional<z.ZodString>;
|
|
145
|
+
initialFeatureFilterPath: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
path: string;
|
|
148
|
+
featureFilterPath?: string | undefined;
|
|
149
|
+
initialFeatureFilterPath?: string | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
path: string;
|
|
152
|
+
featureFilterPath?: string | undefined;
|
|
153
|
+
initialFeatureFilterPath?: string | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
export declare const obsLabelsAnndataSchema: z.ZodObject<{
|
|
156
|
+
path: z.ZodString;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
path: string;
|
|
159
|
+
}, {
|
|
160
|
+
path: string;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const featureLabelsAnndataSchema: z.ZodObject<{
|
|
163
|
+
path: z.ZodString;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
path: string;
|
|
166
|
+
}, {
|
|
167
|
+
path: string;
|
|
168
|
+
}>;
|
|
169
|
+
export declare const obsEmbeddingCsvSchema: z.ZodObject<{
|
|
170
|
+
obsIndex: z.ZodString;
|
|
171
|
+
obsEmbedding: z.ZodArray<z.ZodString, "many">;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
obsIndex: string;
|
|
174
|
+
obsEmbedding: string[];
|
|
175
|
+
}, {
|
|
176
|
+
obsIndex: string;
|
|
177
|
+
obsEmbedding: string[];
|
|
178
|
+
}>;
|
|
179
|
+
export declare const obsLocationsCsvSchema: z.ZodObject<{
|
|
180
|
+
obsIndex: z.ZodString;
|
|
181
|
+
obsLocations: z.ZodArray<z.ZodString, "many">;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
obsIndex: string;
|
|
184
|
+
obsLocations: string[];
|
|
185
|
+
}, {
|
|
186
|
+
obsIndex: string;
|
|
187
|
+
obsLocations: string[];
|
|
188
|
+
}>;
|
|
189
|
+
export declare const obsLabelsCsvSchema: z.ZodObject<{
|
|
190
|
+
obsIndex: z.ZodString;
|
|
191
|
+
obsLabels: z.ZodString;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
obsIndex: string;
|
|
194
|
+
obsLabels: string;
|
|
195
|
+
}, {
|
|
196
|
+
obsIndex: string;
|
|
197
|
+
obsLabels: string;
|
|
198
|
+
}>;
|
|
199
|
+
export declare const featureLabelsCsvSchema: z.ZodObject<{
|
|
200
|
+
featureIndex: z.ZodString;
|
|
201
|
+
featureLabels: z.ZodString;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
featureIndex: string;
|
|
204
|
+
featureLabels: string;
|
|
205
|
+
}, {
|
|
206
|
+
featureIndex: string;
|
|
207
|
+
featureLabels: string;
|
|
208
|
+
}>;
|
|
209
|
+
export declare const obsSetsCsvSchema: z.ZodObject<{
|
|
210
|
+
obsIndex: z.ZodString;
|
|
211
|
+
obsSets: z.ZodArray<z.ZodObject<{
|
|
212
|
+
name: z.ZodString;
|
|
213
|
+
column: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
214
|
+
scoreColumn: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
name: string;
|
|
217
|
+
column: (string | string[]) & (string | string[] | undefined);
|
|
218
|
+
scoreColumn?: string | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
name: string;
|
|
221
|
+
column: (string | string[]) & (string | string[] | undefined);
|
|
222
|
+
scoreColumn?: string | undefined;
|
|
223
|
+
}>, "many">;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
obsIndex: string;
|
|
226
|
+
obsSets: {
|
|
227
|
+
name: string;
|
|
228
|
+
column: (string | string[]) & (string | string[] | undefined);
|
|
229
|
+
scoreColumn?: string | undefined;
|
|
230
|
+
}[];
|
|
231
|
+
}, {
|
|
232
|
+
obsIndex: string;
|
|
233
|
+
obsSets: {
|
|
234
|
+
name: string;
|
|
235
|
+
column: (string | string[]) & (string | string[] | undefined);
|
|
236
|
+
scoreColumn?: string | undefined;
|
|
237
|
+
}[];
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* Options schemas for joint file types.
|
|
241
|
+
*/
|
|
242
|
+
export declare const anndataZarrSchema: z.ZodObject<{
|
|
243
|
+
obsLabels: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
244
|
+
path: z.ZodString;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
path: string;
|
|
247
|
+
}, {
|
|
248
|
+
path: string;
|
|
249
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
250
|
+
path: z.ZodString;
|
|
251
|
+
obsLabelsType: z.ZodString;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
path: string;
|
|
254
|
+
obsLabelsType: string;
|
|
255
|
+
}, {
|
|
256
|
+
path: string;
|
|
257
|
+
obsLabelsType: string;
|
|
258
|
+
}>, "many">]>>;
|
|
259
|
+
featureLabels: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
260
|
+
path: z.ZodString;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
path: string;
|
|
263
|
+
}, {
|
|
264
|
+
path: string;
|
|
265
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
266
|
+
path: z.ZodString;
|
|
267
|
+
featureLabelsType: z.ZodString;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
path: string;
|
|
270
|
+
featureLabelsType: string;
|
|
271
|
+
}, {
|
|
272
|
+
path: string;
|
|
273
|
+
featureLabelsType: string;
|
|
274
|
+
}>, "many">]>>;
|
|
275
|
+
obsFeatureMatrix: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
path: z.ZodString;
|
|
277
|
+
featureFilterPath: z.ZodOptional<z.ZodString>;
|
|
278
|
+
initialFeatureFilterPath: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, "strip", z.ZodTypeAny, {
|
|
280
|
+
path: string;
|
|
281
|
+
featureFilterPath?: string | undefined;
|
|
282
|
+
initialFeatureFilterPath?: string | undefined;
|
|
283
|
+
}, {
|
|
284
|
+
path: string;
|
|
285
|
+
featureFilterPath?: string | undefined;
|
|
286
|
+
initialFeatureFilterPath?: string | undefined;
|
|
287
|
+
}>>;
|
|
288
|
+
obsSets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
289
|
+
name: z.ZodString;
|
|
290
|
+
path: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
291
|
+
scorePath: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
294
|
+
name: string;
|
|
295
|
+
scorePath?: string | undefined;
|
|
296
|
+
}, {
|
|
297
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
298
|
+
name: string;
|
|
299
|
+
scorePath?: string | undefined;
|
|
300
|
+
}>, "many">>;
|
|
301
|
+
obsLocations: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
path: z.ZodString;
|
|
303
|
+
dims: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
path: string;
|
|
306
|
+
dims?: number[] | undefined;
|
|
307
|
+
}, {
|
|
308
|
+
path: string;
|
|
309
|
+
dims?: number[] | undefined;
|
|
310
|
+
}>>;
|
|
311
|
+
obsSegmentations: z.ZodOptional<z.ZodObject<{
|
|
312
|
+
path: z.ZodString;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
path: string;
|
|
315
|
+
}, {
|
|
316
|
+
path: string;
|
|
317
|
+
}>>;
|
|
318
|
+
obsEmbedding: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
319
|
+
path: z.ZodString;
|
|
320
|
+
dims: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
321
|
+
}, "strip", z.ZodTypeAny, {
|
|
322
|
+
path: string;
|
|
323
|
+
dims?: number[] | undefined;
|
|
324
|
+
}, {
|
|
325
|
+
path: string;
|
|
326
|
+
dims?: number[] | undefined;
|
|
327
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
328
|
+
path: z.ZodString;
|
|
329
|
+
dims: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
330
|
+
embeddingType: z.ZodString;
|
|
331
|
+
}, "strip", z.ZodTypeAny, {
|
|
332
|
+
path: string;
|
|
333
|
+
embeddingType: string;
|
|
334
|
+
dims?: number[] | undefined;
|
|
335
|
+
}, {
|
|
336
|
+
path: string;
|
|
337
|
+
embeddingType: string;
|
|
338
|
+
dims?: number[] | undefined;
|
|
339
|
+
}>, "many">]>>;
|
|
340
|
+
}, "strip", z.ZodTypeAny, {
|
|
341
|
+
obsLabels?: {
|
|
342
|
+
path: string;
|
|
343
|
+
} | {
|
|
344
|
+
path: string;
|
|
345
|
+
obsLabelsType: string;
|
|
346
|
+
}[] | undefined;
|
|
347
|
+
featureLabels?: {
|
|
348
|
+
path: string;
|
|
349
|
+
} | {
|
|
350
|
+
path: string;
|
|
351
|
+
featureLabelsType: string;
|
|
352
|
+
}[] | undefined;
|
|
353
|
+
obsFeatureMatrix?: {
|
|
354
|
+
path: string;
|
|
355
|
+
featureFilterPath?: string | undefined;
|
|
356
|
+
initialFeatureFilterPath?: string | undefined;
|
|
357
|
+
} | undefined;
|
|
358
|
+
obsSets?: {
|
|
359
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
360
|
+
name: string;
|
|
361
|
+
scorePath?: string | undefined;
|
|
362
|
+
}[] | undefined;
|
|
363
|
+
obsLocations?: {
|
|
364
|
+
path: string;
|
|
365
|
+
dims?: number[] | undefined;
|
|
366
|
+
} | undefined;
|
|
367
|
+
obsSegmentations?: {
|
|
368
|
+
path: string;
|
|
369
|
+
} | undefined;
|
|
370
|
+
obsEmbedding?: {
|
|
371
|
+
path: string;
|
|
372
|
+
dims?: number[] | undefined;
|
|
373
|
+
} | {
|
|
374
|
+
path: string;
|
|
375
|
+
embeddingType: string;
|
|
376
|
+
dims?: number[] | undefined;
|
|
377
|
+
}[] | undefined;
|
|
378
|
+
}, {
|
|
379
|
+
obsLabels?: {
|
|
380
|
+
path: string;
|
|
381
|
+
} | {
|
|
382
|
+
path: string;
|
|
383
|
+
obsLabelsType: string;
|
|
384
|
+
}[] | undefined;
|
|
385
|
+
featureLabels?: {
|
|
386
|
+
path: string;
|
|
387
|
+
} | {
|
|
388
|
+
path: string;
|
|
389
|
+
featureLabelsType: string;
|
|
390
|
+
}[] | undefined;
|
|
391
|
+
obsFeatureMatrix?: {
|
|
392
|
+
path: string;
|
|
393
|
+
featureFilterPath?: string | undefined;
|
|
394
|
+
initialFeatureFilterPath?: string | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
obsSets?: {
|
|
397
|
+
path: (string | string[]) & (string | string[] | undefined);
|
|
398
|
+
name: string;
|
|
399
|
+
scorePath?: string | undefined;
|
|
400
|
+
}[] | undefined;
|
|
401
|
+
obsLocations?: {
|
|
402
|
+
path: string;
|
|
403
|
+
dims?: number[] | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
obsSegmentations?: {
|
|
406
|
+
path: string;
|
|
407
|
+
} | undefined;
|
|
408
|
+
obsEmbedding?: {
|
|
409
|
+
path: string;
|
|
410
|
+
dims?: number[] | undefined;
|
|
411
|
+
} | {
|
|
412
|
+
path: string;
|
|
413
|
+
embeddingType: string;
|
|
414
|
+
dims?: number[] | undefined;
|
|
415
|
+
}[] | undefined;
|
|
416
|
+
}>;
|
|
417
|
+
//# sourceMappingURL=file-def-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-def-options.d.ts","sourceRoot":"","sources":["../src/file-def-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgFxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG7B,CAAC;AAGH;;GAEG;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;EAAsB,CAAC;AAC7D,eAAO,MAAM,yBAAyB;;;;;;;;;EAAsB,CAAC;AAC7D,eAAO,MAAM,6BAA6B;;;;;;EAA0B,CAAC;AACrE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;WAAiB,CAAC;AACnD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAA0B,CAAC;AACrE,eAAO,MAAM,sBAAsB;;;;;;EAAmB,CAAC;AACvD,eAAO,MAAM,0BAA0B;;;;;;EAAuB,CAAC;AAG/D,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBlB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Shared
|
|
3
|
+
const annDataObs = z.object({
|
|
4
|
+
path: z.string(),
|
|
5
|
+
});
|
|
6
|
+
const annDataObsm = z.object({
|
|
7
|
+
path: z.string(),
|
|
8
|
+
dims: z.array(z.number())
|
|
9
|
+
.optional(),
|
|
10
|
+
});
|
|
11
|
+
const annDataConvenienceObsLabelsItem = z.object({
|
|
12
|
+
path: z.string(),
|
|
13
|
+
obsLabelsType: z.string(),
|
|
14
|
+
});
|
|
15
|
+
const annDataConvenienceFeatureLabelsItem = z.object({
|
|
16
|
+
path: z.string(),
|
|
17
|
+
featureLabelsType: z.string(),
|
|
18
|
+
});
|
|
19
|
+
const annDataConvenienceObsEmbeddingItem = z.object({
|
|
20
|
+
path: z.string(),
|
|
21
|
+
dims: z.array(z.number())
|
|
22
|
+
.optional(),
|
|
23
|
+
embeddingType: z.string(),
|
|
24
|
+
});
|
|
25
|
+
const annDataObsLabels = annDataObs;
|
|
26
|
+
const annDataFeatureLabels = annDataObs;
|
|
27
|
+
const annDataObsFeatureMatrix = z.object({
|
|
28
|
+
path: z.string(),
|
|
29
|
+
featureFilterPath: z.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.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'),
|
|
32
|
+
initialFeatureFilterPath: z.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.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'),
|
|
35
|
+
});
|
|
36
|
+
const annDataObsSets = z.array(z.object({
|
|
37
|
+
name: z.string()
|
|
38
|
+
.describe("The display name for the set, like 'Cell Type' or 'Louvain.'"),
|
|
39
|
+
path: z.union([
|
|
40
|
+
z.string()
|
|
41
|
+
.describe("The location in the AnnData store for the set, like 'obs/louvain' or 'obs/celltype.'"),
|
|
42
|
+
z.array(z.string())
|
|
43
|
+
.describe('An array of locations in the AnnData store for a hierarchy of set names, from coarse to fine levels.'),
|
|
44
|
+
]),
|
|
45
|
+
scorePath: z.string()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'"),
|
|
48
|
+
}));
|
|
49
|
+
const annDataObsLocations = annDataObsm;
|
|
50
|
+
const annDataObsEmbedding = annDataObsm;
|
|
51
|
+
const annDataObsSegmentations = annDataObs;
|
|
52
|
+
// OME
|
|
53
|
+
// coordinateTransformations matches the OME-NGFF v0.4 spec.
|
|
54
|
+
// Reference: https://ngff.openmicroscopy.org/0.4/#trafo-md
|
|
55
|
+
const omeCoordinateTransformations = z.array(z.union([
|
|
56
|
+
z.object({
|
|
57
|
+
type: z.literal('identity'),
|
|
58
|
+
}),
|
|
59
|
+
z.object({
|
|
60
|
+
type: z.literal('translation'),
|
|
61
|
+
translation: z.array(z.number()),
|
|
62
|
+
}),
|
|
63
|
+
z.object({
|
|
64
|
+
type: z.literal('scale'),
|
|
65
|
+
scale: z.array(z.number()),
|
|
66
|
+
}),
|
|
67
|
+
]));
|
|
68
|
+
// OME-TIFF
|
|
69
|
+
export const imageOmeTiffSchema = z.object({
|
|
70
|
+
offsetsUrl: z.string()
|
|
71
|
+
.optional(),
|
|
72
|
+
coordinateTransformations: omeCoordinateTransformations
|
|
73
|
+
.optional(),
|
|
74
|
+
});
|
|
75
|
+
// OME-Zarr (NGFF)
|
|
76
|
+
export const imageOmeZarrSchema = z.object({
|
|
77
|
+
coordinateTransformations: omeCoordinateTransformations
|
|
78
|
+
.optional(),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Options schemas for atomic file types.
|
|
82
|
+
*/
|
|
83
|
+
// AnnData
|
|
84
|
+
export const obsEmbeddingAnndataSchema = annDataObsEmbedding;
|
|
85
|
+
export const obsLocationsAnndataSchema = annDataObsLocations;
|
|
86
|
+
export const obsSegmentationsAnndataSchema = annDataObsSegmentations;
|
|
87
|
+
export const obsSetsAnndataSchema = annDataObsSets;
|
|
88
|
+
export const obsFeatureMatrixAnndataSchema = annDataObsFeatureMatrix;
|
|
89
|
+
export const obsLabelsAnndataSchema = annDataObsLabels;
|
|
90
|
+
export const featureLabelsAnndataSchema = annDataFeatureLabels;
|
|
91
|
+
// CSV
|
|
92
|
+
export const obsEmbeddingCsvSchema = z.object({
|
|
93
|
+
obsIndex: z.string(),
|
|
94
|
+
obsEmbedding: z.array(z.string()).length(2),
|
|
95
|
+
});
|
|
96
|
+
export const obsLocationsCsvSchema = z.object({
|
|
97
|
+
obsIndex: z.string(),
|
|
98
|
+
obsLocations: z.array(z.string()).length(2),
|
|
99
|
+
});
|
|
100
|
+
export const obsLabelsCsvSchema = z.object({
|
|
101
|
+
obsIndex: z.string(),
|
|
102
|
+
obsLabels: z.string(),
|
|
103
|
+
});
|
|
104
|
+
export const featureLabelsCsvSchema = z.object({
|
|
105
|
+
featureIndex: z.string(),
|
|
106
|
+
featureLabels: z.string(),
|
|
107
|
+
});
|
|
108
|
+
export const obsSetsCsvSchema = z.object({
|
|
109
|
+
obsIndex: z.string(),
|
|
110
|
+
obsSets: z.array(z.object({
|
|
111
|
+
name: z.string(),
|
|
112
|
+
column: z.union([
|
|
113
|
+
z.string(),
|
|
114
|
+
z.array(z.string()),
|
|
115
|
+
]),
|
|
116
|
+
scoreColumn: z.string().optional(),
|
|
117
|
+
})),
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* Options schemas for joint file types.
|
|
121
|
+
*/
|
|
122
|
+
export const anndataZarrSchema = z.object({
|
|
123
|
+
obsLabels: z.union([
|
|
124
|
+
annDataObsLabels,
|
|
125
|
+
z.array(annDataConvenienceObsLabelsItem),
|
|
126
|
+
]),
|
|
127
|
+
featureLabels: z.union([
|
|
128
|
+
annDataFeatureLabels,
|
|
129
|
+
z.array(annDataConvenienceFeatureLabelsItem),
|
|
130
|
+
]),
|
|
131
|
+
obsFeatureMatrix: annDataObsFeatureMatrix,
|
|
132
|
+
obsSets: annDataObsSets,
|
|
133
|
+
obsLocations: annDataObsLocations,
|
|
134
|
+
obsSegmentations: annDataObsSegmentations,
|
|
135
|
+
obsEmbedding: z.union([
|
|
136
|
+
annDataObsEmbedding,
|
|
137
|
+
z.array(annDataConvenienceObsEmbeddingItem),
|
|
138
|
+
]),
|
|
139
|
+
}).partial();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { buildConfigSchema } from './schema-builders.js';
|
|
2
|
+
export { latestConfigSchema } from './previous-config-meta.js';
|
|
3
|
+
export { latestFileDefSchema } from './previous-config-schemas.js';
|
|
4
|
+
export { upgradeAndParse, VERSIONED_CONFIG_SCHEMAS } from './view-config-versions.js';
|
|
5
|
+
export { rasterJsonSchema } from './raster-json.js';
|
|
6
|
+
export { obsEmbeddingCsvSchema, obsSetsCsvSchema, obsLocationsCsvSchema, obsLabelsCsvSchema, featureLabelsCsvSchema, obsSetsAnndataSchema, obsEmbeddingAnndataSchema, obsLocationsAnndataSchema, obsLabelsAnndataSchema, obsFeatureMatrixAnndataSchema, obsSegmentationsAnndataSchema, featureLabelsAnndataSchema, anndataZarrSchema, imageOmeZarrSchema, imageOmeTiffSchema, } from './file-def-options.js';
|
|
7
|
+
export { anndataCellsZarrSchema, anndataCellSetsZarrSchema, anndataExpressionMatrixZarrSchema, cellsJsonSchema, } from './file-def-options-legacy.js';
|
|
8
|
+
export { obsSetPath, rgbArray, obsSetsSchema, obsSetsTabularSchema, } from './shared.js';
|
|
9
|
+
export { imageLayerObj, cellsLayerObj, neighborhoodsLayerObj, moleculesLayerObj, } from './spatial-layers.js';
|
|
10
|
+
export { z } from 'zod';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,iCAAiC,EACjC,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,QAAQ,EACR,aAAa,EACb,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { buildConfigSchema } from './schema-builders.js';
|
|
2
|
+
export { latestConfigSchema } from './previous-config-meta.js';
|
|
3
|
+
export { latestFileDefSchema } from './previous-config-schemas.js';
|
|
4
|
+
export { upgradeAndParse, VERSIONED_CONFIG_SCHEMAS } from './view-config-versions.js';
|
|
5
|
+
export { rasterJsonSchema } from './raster-json.js';
|
|
6
|
+
export { obsEmbeddingCsvSchema, obsSetsCsvSchema, obsLocationsCsvSchema, obsLabelsCsvSchema, featureLabelsCsvSchema, obsSetsAnndataSchema, obsEmbeddingAnndataSchema, obsLocationsAnndataSchema, obsLabelsAnndataSchema, obsFeatureMatrixAnndataSchema, obsSegmentationsAnndataSchema, featureLabelsAnndataSchema, anndataZarrSchema, imageOmeZarrSchema, imageOmeTiffSchema, } from './file-def-options.js';
|
|
7
|
+
export { anndataCellsZarrSchema, anndataCellSetsZarrSchema, anndataExpressionMatrixZarrSchema, cellsJsonSchema, } from './file-def-options-legacy.js';
|
|
8
|
+
export { obsSetPath, rgbArray, obsSetsSchema, obsSetsTabularSchema, } from './shared.js';
|
|
9
|
+
export { imageLayerObj, cellsLayerObj, neighborhoodsLayerObj, moleculesLayerObj, } from './spatial-layers.js';
|
|
10
|
+
export { z } from 'zod';
|