@vitessce/types 3.4.12 → 3.5.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.
@@ -0,0 +1,42 @@
1
+ export type KgNodeType = 'gene' | 'protein' | 'pathway' | 'cell-type';
2
+ export type TargetModalityType = 'gene' | 'protein';
3
+ export type StratificationType = 'sampleSet' | 'structural-region' | 'structural-presence';
4
+ export type KgNodeReason = ('modality-agnostic' | KgNode);
5
+ export type KgNodeMethod = 'canonical' | 'data-driven';
6
+ export type KgNode = {
7
+ kgId: string;
8
+ nodeType: KgNodeType;
9
+ label: string;
10
+ term?: string;
11
+ altIds?: string[];
12
+ source?: string;
13
+ sourceMethod?: KgNodeMethod;
14
+ sourceVersion?: string;
15
+ reason?: KgNodeReason;
16
+ };
17
+ export type KgEdge = {
18
+ source: string;
19
+ target: string;
20
+ relation: string;
21
+ };
22
+ export type KgStratification = {
23
+ name: string;
24
+ stratificationId: string;
25
+ stratificationType: StratificationType;
26
+ sampleSets?: [
27
+ string[],
28
+ string[]
29
+ ];
30
+ };
31
+ export type AutocompleteFeatureFunc = (partial: string, targetModality: null | TargetModalityType) => Promise<KgNode[]>;
32
+ export type TransformFeatureFunc = (node: KgNode, targetModality: TargetModalityType) => Promise<KgNode[]>;
33
+ export type RelatedFeaturesFunc = (node: KgNode) => Promise<KgNode[]>;
34
+ export type FeatureToUrlFunc = (node: KgNode) => Promise<string>;
35
+ export type FeatureToIntervalFunc = (node: KgNode, assembly: string) => Promise<{
36
+ chr: string;
37
+ start: number;
38
+ end: number;
39
+ }>;
40
+ export type ObsSetToFeaturesFunc = (node: KgNode) => Promise<KgNode[]>;
41
+ export type FeaturesToObsSetFunc = (nodes: KgNode[]) => Promise<KgNode>;
42
+ //# sourceMappingURL=biomarkers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biomarkers.d.ts","sourceRoot":"","sources":["../src/biomarkers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,U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AkB,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3G,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAG7H,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -2,5 +2,6 @@ export type { MatrixResult, ObsFeatureMatrixData, ObsFeatureMatrixAttrs, ObsEmbe
2
2
  export type { DataSourceParams, } from './data-sources.js';
3
3
  export type { AbstractImageWrapper, VivLoaderType, VivLoaderDataType, ImageOptions, ChannelObject, ResolutionObject, BoundingCube, } from './imaging.js';
4
4
  export type { SetsTreeNodeLeaf, SetsTreeNodeNonLeaf, SetsTree, } from './sets.js';
5
+ export type { KgNode, KgNodeType, TargetModalityType, StratificationType, KgNodeReason, KgNodeMethod, KgEdge, KgStratification, AutocompleteFeatureFunc, TransformFeatureFunc, RelatedFeaturesFunc, FeatureToUrlFunc, FeatureToIntervalFunc, ObsSetToFeaturesFunc, FeaturesToObsSetFunc, } from './biomarkers.js';
5
6
  export {};
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,GACT,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,CAAC"}
@@ -0,0 +1,81 @@
1
+ export type NgffAxis = {
2
+ /**
3
+ * Name of the axis
4
+ */
5
+ name: string;
6
+ /**
7
+ * Longer name or description of the axis.
8
+ */
9
+ longName?: string;
10
+ /**
11
+ * Dimension of the axis
12
+ */
13
+ type?: string;
14
+ /**
15
+ * Whether the dimension is discrete
16
+ */
17
+ discrete?: boolean;
18
+ /**
19
+ * Unit for the axis
20
+ */
21
+ unit?: string;
22
+ };
23
+ export type NgffAxes = NgffAxis[];
24
+ export type NgffCoordinateSystem = {
25
+ name: string;
26
+ axes: NgffAxes;
27
+ };
28
+ export type NgffCoordinateSystems = NgffCoordinateSystem[];
29
+ export type ScaleTransformation = {
30
+ type: 'scale';
31
+ scale: number[];
32
+ };
33
+ export type TranslationTransformation = {
34
+ type: 'translation';
35
+ translation: number[];
36
+ };
37
+ export type AffineTransformation = {
38
+ type: 'affine';
39
+ matrix: number[] | number[][];
40
+ };
41
+ export type RotationTransformation = {
42
+ type: 'rotation';
43
+ rotation: number[];
44
+ };
45
+ export type InverseOfTransformation = {
46
+ type: 'inverseOf';
47
+ transformation: NgffCoordinateTransformation;
48
+ };
49
+ export type SequenceTransformation = {
50
+ type: 'sequence';
51
+ transformations: NgffCoordinateTransformation[];
52
+ };
53
+ export type CoordinatesTransformation = {
54
+ type: 'coordinates';
55
+ path: string;
56
+ interpolation: 'nearest' | 'linear' | 'cubic';
57
+ };
58
+ export type DisplacementsTransformation = {
59
+ type: 'displacements';
60
+ path: string;
61
+ interpolation: 'nearest' | 'linear' | 'cubic';
62
+ };
63
+ export type ByDimensionTransformation = {
64
+ type: 'byDimension';
65
+ transformations: NgffCoordinateTransformation[];
66
+ };
67
+ export type BijectionTransformation = {
68
+ type: 'bijection';
69
+ forward: object;
70
+ inverse: object;
71
+ };
72
+ export type NgffCoordinateTransformation = {
73
+ input: string | NgffCoordinateSystem;
74
+ output: string | NgffCoordinateSystem;
75
+ } & (ScaleTransformation | TranslationTransformation | AffineTransformation | RotationTransformation | InverseOfTransformation | SequenceTransformation | CoordinatesTransformation | DisplacementsTransformation | ByDimensionTransformation | BijectionTransformation);
76
+ export type NgffCoordinateTransformations = NgffCoordinateTransformation[];
77
+ export type NgffCoordinateSystemsAndTransformations = {
78
+ coordinateSystems: NgffCoordinateSystems;
79
+ coordinateTransformations: NgffCoordinateTransformations;
80
+ };
81
+ //# sourceMappingURL=ngff-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngff-types.d.ts","sourceRoot":"","sources":["../src/ngff-types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,QAAQ,EAAE,CAAC;AAIlC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,EAAE,CAAC;AAG3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,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AAuB,CAC1B,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,4BAA4B,EAAE,CAAC;AAG3E,MAAM,MAAM,uCAAuC,GAAG;IACpD,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,yBAAyB,EAAE,6BAA6B,CAAC;CAC1D,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitessce/types",
3
- "version": "3.4.12",
4
- "author": "Gehlenborg Lab",
3
+ "version": "3.5.0",
4
+ "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
7
7
  "type": "git",
@@ -0,0 +1,74 @@
1
+ /* eslint-disable max-len */
2
+ // Here, "Kg" stands for "knowledge graph"
3
+ export type KgNodeType = 'gene' | 'protein' | 'pathway' | 'cell-type';
4
+ export type TargetModalityType = 'gene' | 'protein'; // TODO: support protein, genomic region, etc.
5
+ export type StratificationType = 'sampleSet' | 'structural-region' | 'structural-presence';
6
+
7
+ // Why was this node included in the list?
8
+ export type KgNodeReason = (
9
+ // The user selected during modality-agnostic selection.
10
+ 'modality-agnostic'
11
+ // The user selected the linked node during modality-agnostic selection.
12
+ // This node may then be modality-specific after some feature
13
+ // transformation to a different modality.
14
+ // eslint-disable-next-line no-use-before-define
15
+ | KgNode
16
+ );
17
+ // Why did the data source include this node?
18
+ // Is the knowledge canonical or data-driven?
19
+ export type KgNodeMethod = 'canonical' | 'data-driven';
20
+ // If this is a node from a suggestion,
21
+ // export type SuggestionReason = 'ligand-receptor' | 'pathway-membership';
22
+ // export type SuggestionSource = string;
23
+
24
+ // A node from a knowledge graph.
25
+ export type KgNode = {
26
+ // ID in the knowledge graph. Not necessarily human-readable.
27
+ kgId: string;
28
+ nodeType: KgNodeType;
29
+
30
+ // Alternate identifiers
31
+ // Human-readable name of the node.
32
+ label: string;
33
+ // Ontology term for this node. Should be a CURIE.
34
+ term?: string;
35
+ // Alternative identifiers like gene symbols or Ensembl IDs, in CURIE string format.
36
+ altIds?: string[];
37
+
38
+ // Provenance info
39
+ // Name of a data source like 'EnrichrKG'.
40
+ source?: string;
41
+ sourceMethod?: KgNodeMethod;
42
+ // Version of the data source.
43
+ sourceVersion?: string;
44
+ // Note: this is a recursive type.
45
+ reason?: KgNodeReason;
46
+ };
47
+
48
+ // Are the edge and stratification types needed here?
49
+ export type KgEdge = {
50
+ source: string;
51
+ target: string;
52
+ relation: string;
53
+ };
54
+
55
+ export type KgStratification = {
56
+ name: string;
57
+ stratificationId: string;
58
+ stratificationType: StratificationType;
59
+ sampleSets?: [
60
+ string[], // Control sampleSet path
61
+ string[], // Case sampleSet path
62
+ ];
63
+ };
64
+
65
+ // Async function types that operate on KgNodes.
66
+ export type AutocompleteFeatureFunc = (partial: string, targetModality: null | TargetModalityType) => Promise<KgNode[]>;
67
+ export type TransformFeatureFunc = (node: KgNode, targetModality: TargetModalityType) => Promise<KgNode[]>;
68
+ export type RelatedFeaturesFunc = (node: KgNode) => Promise<KgNode[]>;
69
+ export type FeatureToUrlFunc = (node: KgNode) => Promise<string>;
70
+ export type FeatureToIntervalFunc = (node: KgNode, assembly: string) => Promise<{ chr: string, start: number, end: number }>;
71
+
72
+ // TODO: should the node types be more precise?
73
+ export type ObsSetToFeaturesFunc = (node: KgNode) => Promise<KgNode[]>;
74
+ export type FeaturesToObsSetFunc = (nodes: KgNode[]) => Promise<KgNode>;
package/src/index.ts CHANGED
@@ -32,6 +32,23 @@ export type {
32
32
  SetsTreeNodeNonLeaf,
33
33
  SetsTree,
34
34
  } from './sets.js';
35
+ export type {
36
+ KgNode,
37
+ KgNodeType,
38
+ TargetModalityType,
39
+ StratificationType,
40
+ KgNodeReason,
41
+ KgNodeMethod,
42
+ KgEdge,
43
+ KgStratification,
44
+ AutocompleteFeatureFunc,
45
+ TransformFeatureFunc,
46
+ RelatedFeaturesFunc,
47
+ FeatureToUrlFunc,
48
+ FeatureToIntervalFunc,
49
+ ObsSetToFeaturesFunc,
50
+ FeaturesToObsSetFunc,
51
+ } from './biomarkers.js';
35
52
 
36
53
  // This is a types-only package.
37
54
  export {};
@@ -0,0 +1,115 @@
1
+ // Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/axes.schema
2
+ export type NgffAxis = {
3
+ /**
4
+ * Name of the axis
5
+ */
6
+ name: string
7
+ /**
8
+ * Longer name or description of the axis.
9
+ */
10
+ longName?: string
11
+ /**
12
+ * Dimension of the axis
13
+ */
14
+ type?: string
15
+ /**
16
+ * Whether the dimension is discrete
17
+ */
18
+ discrete?: boolean
19
+ /**
20
+ * Unit for the axis
21
+ */
22
+ unit?: string
23
+ };
24
+ export type NgffAxes = NgffAxis[];
25
+
26
+
27
+ // Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinate_systems.schema
28
+ export type NgffCoordinateSystem = {
29
+ name: string;
30
+ axes: NgffAxes;
31
+ };
32
+ export type NgffCoordinateSystems = NgffCoordinateSystem[];
33
+
34
+ // Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinateTransformations.schema
35
+ export type ScaleTransformation = {
36
+ type: 'scale';
37
+ scale: number[];
38
+ };
39
+ export type TranslationTransformation = {
40
+ type: 'translation';
41
+ translation: number[];
42
+ };
43
+ export type AffineTransformation = {
44
+ type: 'affine';
45
+ matrix: number[] | number[][];
46
+ // Can have a "c" referenced in the affine, but we
47
+ // just throw away and use the x/y parts of the matrix.
48
+ };
49
+ export type RotationTransformation = {
50
+ // Not supported yet by SpatialData
51
+ type: 'rotation';
52
+ rotation: number[];
53
+ };
54
+ export type InverseOfTransformation = {
55
+ type: 'inverseOf';
56
+ // eslint-disable-next-line no-use-before-define
57
+ transformation: NgffCoordinateTransformation;
58
+ };
59
+ export type SequenceTransformation = {
60
+ type: 'sequence';
61
+ // eslint-disable-next-line no-use-before-define
62
+ transformations: NgffCoordinateTransformation[];
63
+ // Sometimes, the axes are not explicitly specified,
64
+ // and instead they are inferred. May need to throw error
65
+ // if ambiguous.
66
+ };
67
+ export type CoordinatesTransformation = {
68
+ type: 'coordinates';
69
+ path: string;
70
+ interpolation: 'nearest' | 'linear' | 'cubic';
71
+ };
72
+ export type DisplacementsTransformation = {
73
+ type: 'displacements';
74
+ path: string;
75
+ interpolation: 'nearest' | 'linear' | 'cubic';
76
+ };
77
+ export type ByDimensionTransformation = {
78
+ // Weird behavior, we can parse and just throw error/warning.
79
+ type: 'byDimension';
80
+ // eslint-disable-next-line no-use-before-define
81
+ transformations: NgffCoordinateTransformation[];
82
+ };
83
+ export type BijectionTransformation = {
84
+ type: 'bijection';
85
+ forward: object;
86
+ inverse: object;
87
+ };
88
+ export type NgffCoordinateTransformation = {
89
+ // Note: in the latest version of the NGFF coordinate systems proposal,
90
+ // the `input` and `output` fields are only allowed to be strings referencing
91
+ // coordinate systems within the `coordinateSystems` array.
92
+ // Here, we also support an earlier version in which these coordinate systems
93
+ // are defined inline a bit redundantly (because there is not a
94
+ // `coordinateSystems` property more globally).
95
+ input: string | NgffCoordinateSystem;
96
+ output: string | NgffCoordinateSystem;
97
+ } & (
98
+ ScaleTransformation
99
+ | TranslationTransformation
100
+ | AffineTransformation
101
+ | RotationTransformation
102
+ | InverseOfTransformation
103
+ | SequenceTransformation
104
+ | CoordinatesTransformation
105
+ | DisplacementsTransformation
106
+ | ByDimensionTransformation
107
+ | BijectionTransformation
108
+ );
109
+ export type NgffCoordinateTransformations = NgffCoordinateTransformation[];
110
+
111
+ // Reference: https://github.com/ome/ngff/blob/bc4f395193b63ed671d4e4bdc0d7477c58abada8/latest/schemas/coordinate_systems_and_transforms.schema
112
+ export type NgffCoordinateSystemsAndTransformations = {
113
+ coordinateSystems: NgffCoordinateSystems;
114
+ coordinateTransformations: NgffCoordinateTransformations;
115
+ };