@sjcrh/proteinpaint-types 2.174.1 → 2.175.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.
@@ -20,7 +20,11 @@ var runChartPayload = {
20
20
  var validRunChartRequest = (input) => {
21
21
  const errors = [];
22
22
  const __is = (input2) => {
23
- const $io0 = (input3) => "string" === typeof input3.genome && "string" === typeof input3.dslabel && ("object" === typeof input3.term && null !== input3.term && "string" === typeof input3.term.id) && ("object" === typeof input3.term2 && null !== input3.term2 && "string" === typeof input3.term2.id) && ("median" === input3.aggregation || "mean" === input3.aggregation || "count" === input3.aggregation) && true && true;
23
+ const $io0 = (input3) => "string" === typeof input3.genome && "string" === typeof input3.dslabel && ("object" === typeof input3.xtw && null !== input3.xtw && $io1(input3.xtw)) && ("object" === typeof input3.ytw && null !== input3.ytw && $io4(input3.ytw)) && "median" === input3.aggregation && true && true;
24
+ const $io1 = (input3) => "object" === typeof input3.term && null !== input3.term && "string" === typeof input3.term.id && (void 0 === input3.q || "object" === typeof input3.q && null !== input3.q && false === Array.isArray(input3.q) && $io3(input3.q)) && (void 0 === input3.$id || "string" === typeof input3.$id);
25
+ const $io3 = (input3) => void 0 === input3.mode || "discrete" === input3.mode || "continuous" === input3.mode;
26
+ const $io4 = (input3) => "object" === typeof input3.term && null !== input3.term && "string" === typeof input3.term.id && (void 0 === input3.q || "object" === typeof input3.q && null !== input3.q && false === Array.isArray(input3.q) && $io6(input3.q)) && (void 0 === input3.$id || "string" === typeof input3.$id);
27
+ const $io6 = (input3) => void 0 === input3.mode || "string" === typeof input3.mode;
24
28
  return "object" === typeof input2 && null !== input2 && $io0(input2);
25
29
  };
26
30
  if (false === __is(input)) {
@@ -34,37 +38,89 @@ var validRunChartRequest = (input) => {
34
38
  path: _path2 + ".dslabel",
35
39
  expected: "string",
36
40
  value: input3.dslabel
37
- }), ("object" === typeof input3.term && null !== input3.term || $report(_exceptionable2, {
38
- path: _path2 + ".term",
41
+ }), ("object" === typeof input3.xtw && null !== input3.xtw || $report(_exceptionable2, {
42
+ path: _path2 + ".xtw",
39
43
  expected: "__type",
40
- value: input3.term
41
- })) && $vo1(input3.term, _path2 + ".term", _exceptionable2) || $report(_exceptionable2, {
42
- path: _path2 + ".term",
44
+ value: input3.xtw
45
+ })) && $vo1(input3.xtw, _path2 + ".xtw", _exceptionable2) || $report(_exceptionable2, {
46
+ path: _path2 + ".xtw",
43
47
  expected: "__type",
44
- value: input3.term
45
- }), ("object" === typeof input3.term2 && null !== input3.term2 || $report(_exceptionable2, {
46
- path: _path2 + ".term2",
47
- expected: "__type.o1",
48
- value: input3.term2
49
- })) && $vo2(input3.term2, _path2 + ".term2", _exceptionable2) || $report(_exceptionable2, {
50
- path: _path2 + ".term2",
51
- expected: "__type.o1",
52
- value: input3.term2
53
- }), "median" === input3.aggregation || "mean" === input3.aggregation || "count" === input3.aggregation || $report(_exceptionable2, {
48
+ value: input3.xtw
49
+ }), ("object" === typeof input3.ytw && null !== input3.ytw || $report(_exceptionable2, {
50
+ path: _path2 + ".ytw",
51
+ expected: "__type.o3",
52
+ value: input3.ytw
53
+ })) && $vo4(input3.ytw, _path2 + ".ytw", _exceptionable2) || $report(_exceptionable2, {
54
+ path: _path2 + ".ytw",
55
+ expected: "__type.o3",
56
+ value: input3.ytw
57
+ }), "median" === input3.aggregation || $report(_exceptionable2, {
54
58
  path: _path2 + ".aggregation",
55
- expected: '("count" | "mean" | "median")',
59
+ expected: '"median"',
56
60
  value: input3.aggregation
57
61
  }), true, true].every((flag) => flag);
58
- const $vo1 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.id || $report(_exceptionable2, {
62
+ const $vo1 = (input3, _path2, _exceptionable2 = true) => [("object" === typeof input3.term && null !== input3.term || $report(_exceptionable2, {
63
+ path: _path2 + ".term",
64
+ expected: "__type.o1",
65
+ value: input3.term
66
+ })) && $vo2(input3.term, _path2 + ".term", _exceptionable2) || $report(_exceptionable2, {
67
+ path: _path2 + ".term",
68
+ expected: "__type.o1",
69
+ value: input3.term
70
+ }), void 0 === input3.q || ("object" === typeof input3.q && null !== input3.q && false === Array.isArray(input3.q) || $report(_exceptionable2, {
71
+ path: _path2 + ".q",
72
+ expected: "(__type.o2 | undefined)",
73
+ value: input3.q
74
+ })) && $vo3(input3.q, _path2 + ".q", _exceptionable2) || $report(_exceptionable2, {
75
+ path: _path2 + ".q",
76
+ expected: "(__type.o2 | undefined)",
77
+ value: input3.q
78
+ }), void 0 === input3.$id || "string" === typeof input3.$id || $report(_exceptionable2, {
79
+ path: _path2 + ".$id",
80
+ expected: "(string | undefined)",
81
+ value: input3.$id
82
+ })].every((flag) => flag);
83
+ const $vo2 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.id || $report(_exceptionable2, {
59
84
  path: _path2 + ".id",
60
85
  expected: "string",
61
86
  value: input3.id
62
87
  })].every((flag) => flag);
63
- const $vo2 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.id || $report(_exceptionable2, {
88
+ const $vo3 = (input3, _path2, _exceptionable2 = true) => [void 0 === input3.mode || "discrete" === input3.mode || "continuous" === input3.mode || $report(_exceptionable2, {
89
+ path: _path2 + ".mode",
90
+ expected: '("continuous" | "discrete" | undefined)',
91
+ value: input3.mode
92
+ })].every((flag) => flag);
93
+ const $vo4 = (input3, _path2, _exceptionable2 = true) => [("object" === typeof input3.term && null !== input3.term || $report(_exceptionable2, {
94
+ path: _path2 + ".term",
95
+ expected: "__type.o4",
96
+ value: input3.term
97
+ })) && $vo5(input3.term, _path2 + ".term", _exceptionable2) || $report(_exceptionable2, {
98
+ path: _path2 + ".term",
99
+ expected: "__type.o4",
100
+ value: input3.term
101
+ }), void 0 === input3.q || ("object" === typeof input3.q && null !== input3.q && false === Array.isArray(input3.q) || $report(_exceptionable2, {
102
+ path: _path2 + ".q",
103
+ expected: "(__type.o5 | undefined)",
104
+ value: input3.q
105
+ })) && $vo6(input3.q, _path2 + ".q", _exceptionable2) || $report(_exceptionable2, {
106
+ path: _path2 + ".q",
107
+ expected: "(__type.o5 | undefined)",
108
+ value: input3.q
109
+ }), void 0 === input3.$id || "string" === typeof input3.$id || $report(_exceptionable2, {
110
+ path: _path2 + ".$id",
111
+ expected: "(string | undefined)",
112
+ value: input3.$id
113
+ })].every((flag) => flag);
114
+ const $vo5 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.id || $report(_exceptionable2, {
64
115
  path: _path2 + ".id",
65
116
  expected: "string",
66
117
  value: input3.id
67
118
  })].every((flag) => flag);
119
+ const $vo6 = (input3, _path2, _exceptionable2 = true) => [void 0 === input3.mode || "string" === typeof input3.mode || $report(_exceptionable2, {
120
+ path: _path2 + ".mode",
121
+ expected: "(string | undefined)",
122
+ value: input3.mode
123
+ })].every((flag) => flag);
68
124
  return ("object" === typeof input2 && null !== input2 || $report(true, {
69
125
  path: _path + "",
70
126
  expected: "RunChartRequest",
@@ -87,7 +143,7 @@ var validRunChartResponse = (input) => {
87
143
  const errors = [];
88
144
  const __is = (input2) => {
89
145
  const $io0 = (input3) => ("ok" === input3.status || "error" === input3.status) && (Array.isArray(input3.series) && input3.series.every((elem) => "object" === typeof elem && null !== elem && $io1(elem)));
90
- const $io1 = (input3) => "number" === typeof input3.median && (Array.isArray(input3.points) && input3.points.every((elem) => "object" === typeof elem && null !== elem && $io2(elem)));
146
+ const $io1 = (input3) => (void 0 === input3.seriesId || "string" === typeof input3.seriesId) && "number" === typeof input3.median && (Array.isArray(input3.points) && input3.points.every((elem) => "object" === typeof elem && null !== elem && $io2(elem)));
91
147
  const $io2 = (input3) => "number" === typeof input3.x && "string" === typeof input3.xName && "number" === typeof input3.y && "number" === typeof input3.sampleCount;
92
148
  return "object" === typeof input2 && null !== input2 && $io0(input2);
93
149
  };
@@ -115,7 +171,11 @@ var validRunChartResponse = (input) => {
115
171
  expected: "Array<__type>",
116
172
  value: input3.series
117
173
  })].every((flag) => flag);
118
- const $vo1 = (input3, _path2, _exceptionable2 = true) => ["number" === typeof input3.median || $report(_exceptionable2, {
174
+ const $vo1 = (input3, _path2, _exceptionable2 = true) => [void 0 === input3.seriesId || "string" === typeof input3.seriesId || $report(_exceptionable2, {
175
+ path: _path2 + ".seriesId",
176
+ expected: "(string | undefined)",
177
+ value: input3.seriesId
178
+ }), "number" === typeof input3.median || $report(_exceptionable2, {
119
179
  path: _path2 + ".median",
120
180
  expected: "number",
121
181
  value: input3.median
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  runChartPayload,
43
43
  validRunChartRequest,
44
44
  validRunChartResponse
45
- } from "./chunk-JKELINOM.js";
45
+ } from "./chunk-CJKG67B2.js";
46
46
  import {
47
47
  termdbSampleImagesPayload,
48
48
  validTermdbSampleImagesRequest,
@@ -2,7 +2,7 @@ import {
2
2
  runChartPayload,
3
3
  validRunChartRequest,
4
4
  validRunChartResponse
5
- } from "./chunk-JKELINOM.js";
5
+ } from "./chunk-CJKG67B2.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  runChartPayload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.174.1",
3
+ "version": "2.175.0",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
@@ -18,11 +18,12 @@ type HtmlResponse = {
18
18
  }
19
19
  export type PlotResponse = {
20
20
  type: 'plot'
21
- /** plot state. Currently only supports summary chart, will add other chart types later */
22
21
  plot: object
23
22
  /** Specifies what action to take e.g. Summary plot or no action. Will add more chart types later */
24
23
  }
25
24
 
25
+ export type LlmConfig = { provider: 'SJ' | 'ollama'; api: string; modelName: string }
26
+
26
27
  export type ChatResponse = HtmlResponse | PlotResponse
27
28
 
28
29
  export const ChatPayload: RoutePayload = {
@@ -42,6 +43,8 @@ export type SummaryType = {
42
43
  term2?: string
43
44
  /** Optional simple filter terms */
44
45
  simpleFilter: FilterTerm[]
46
+ /** Optional explicit child type requested by the user. If omitted, the logic of the data types picks the child type. */
47
+ childType?: 'violin' | 'boxplot' | 'sampleScatter' | 'barchart'
45
48
  }
46
49
 
47
50
  export type FilterTerm =
@@ -101,7 +104,7 @@ export type plot_type = {
101
104
  /** When type == plot, show the corresponding plot in the plot field */
102
105
  type: 'plot'
103
106
  /** The type of plot to be displayed on the UI. */
104
- plot: 'summary' | 'dge' | 'none' | 'survival'
107
+ plot: 'summary' | 'dge' | 'none' | 'survival' | 'matrix'
105
108
  }
106
109
 
107
110
  export type DEType = {
@@ -112,3 +115,12 @@ export type DEType = {
112
115
  /** Method used for carrying out differential gene expression analysis */
113
116
  method?: 'edgeR' | 'limma' | 'wilcoxon'
114
117
  }
118
+
119
+ export type MatrixType = {
120
+ /** Names of dictionary terms to include as rows in the matrix (e.g. "Diagnosis", "Gender", "Race") */
121
+ terms?: string[]
122
+ /** Names of genes to include as gene variant rows in the matrix (e.g. "TP53", "KRAS", "NRAS") */
123
+ geneNames?: string[]
124
+ /** Optional simple filter terms to restrict the sample set */
125
+ simpleFilter?: FilterTerm[]
126
+ }
@@ -3,15 +3,15 @@ import type { RoutePayload } from './routeApi.ts'
3
3
  export type RunChartRequest = {
4
4
  genome: string
5
5
  dslabel: string
6
- /** date term for x axis */
7
- term: {
8
- id: string
9
- }
10
- /** timeline/duration term for y axis */
11
- term2: {
12
- id: string
13
- }
14
- aggregation: 'mean' | 'median' | 'count'
6
+ /**
7
+ * term wrapper for x axis: { term, q }.
8
+ * runChart2: q.mode='continuous' → 1 series.
9
+ * runChart2Period: q.mode='discrete' (with bins) → multiple series by period.
10
+ */
11
+ xtw: { term: { id: string }; q?: { mode?: 'continuous' | 'discrete' }; $id?: string }
12
+ /** term wrapper for y axis: { term, q } */
13
+ ytw: { term: { id: string }; q?: { mode?: string }; $id?: string }
14
+ aggregation: 'median'
15
15
  filter?: any
16
16
  __protected__?: any // auth token for accessing protected data
17
17
  }
@@ -20,6 +20,8 @@ export type RunChartResponse = {
20
20
  status: 'ok' | 'error'
21
21
  /** each series is one curve, with a median. a runchart may show 1 or multiple curves */
22
22
  series: {
23
+ /** period/series identifier */
24
+ seriesId?: string
23
25
  /** calculated Y median value for this curve */
24
26
  median: number
25
27
  points: Point[]