@sjcrh/proteinpaint-types 2.158.0 → 2.160.1-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.
@@ -21,7 +21,7 @@ var termdbSingleCellDEgenesPayload = {
21
21
  var validTermdbSingleCellDEgenesRequest = (input) => {
22
22
  const errors = [];
23
23
  const __is = (input2) => {
24
- return "object" === typeof input2 && null !== input2 && ("string" === typeof input2.genome && "string" === typeof input2.dslabel && "string" === typeof input2.sample && "string" === typeof input2.columnName && "string" === typeof input2.categoryName);
24
+ return "object" === typeof input2 && null !== input2 && ("string" === typeof input2.genome && "string" === typeof input2.dslabel && "string" === typeof input2.sample && "string" === typeof input2.termId && "string" === typeof input2.categoryName);
25
25
  };
26
26
  if (false === __is(input)) {
27
27
  const $report = import_typia.createValidate.report(errors);
@@ -38,10 +38,10 @@ var validTermdbSingleCellDEgenesRequest = (input) => {
38
38
  path: _path2 + ".sample",
39
39
  expected: "string",
40
40
  value: input3.sample
41
- }), "string" === typeof input3.columnName || $report(_exceptionable2, {
42
- path: _path2 + ".columnName",
41
+ }), "string" === typeof input3.termId || $report(_exceptionable2, {
42
+ path: _path2 + ".termId",
43
43
  expected: "string",
44
- value: input3.columnName
44
+ value: input3.termId
45
45
  }), "string" === typeof input3.categoryName || $report(_exceptionable2, {
46
46
  path: _path2 + ".categoryName",
47
47
  expected: "string",
@@ -74,7 +74,15 @@ var validTermdbSingleSampleMutationResponse = (input) => {
74
74
  return Array.isArray(value) && value.every((elem) => "object" === typeof elem && null !== elem && $io5(elem));
75
75
  return true;
76
76
  });
77
- const $io5 = (input3) => (void 0 === input3.nameHtml || "string" === typeof input3.nameHtml) && (void 0 === input3.name || "string" === typeof input3.name) && (void 0 === input3.inuse || "boolean" === typeof input3.inuse) && (Array.isArray(input3.mlst) && input3.mlst.every((elem) => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io2(elem)));
77
+ const $io5 = (input3) => (void 0 === input3.nameHtml || "string" === typeof input3.nameHtml) && (void 0 === input3.name || "string" === typeof input3.name) && (void 0 === input3.inuse || "boolean" === typeof input3.inuse) && (Array.isArray(input3.mlst) && input3.mlst.every((elem) => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io2(elem))) && (void 0 === input3.attrs || "object" === typeof input3.attrs && null !== input3.attrs && false === Array.isArray(input3.attrs) && $io6(input3.attrs));
78
+ const $io6 = (input3) => Object.keys(input3).every((key) => {
79
+ const value = input3[key];
80
+ if (void 0 === value)
81
+ return true;
82
+ if (RegExp(/(.*)/).test(key))
83
+ return "string" === typeof value;
84
+ return true;
85
+ });
78
86
  const $iu0 = (input3) => (() => {
79
87
  if (void 0 !== input3.status)
80
88
  return $io0(input3);
@@ -200,7 +208,27 @@ var validTermdbSingleSampleMutationResponse = (input) => {
200
208
  path: _path2 + ".mlst",
201
209
  expected: "Array<object>",
202
210
  value: input3.mlst
211
+ }), void 0 === input3.attrs || ("object" === typeof input3.attrs && null !== input3.attrs && false === Array.isArray(input3.attrs) || $report(_exceptionable2, {
212
+ path: _path2 + ".attrs",
213
+ expected: "(__type.o3 | undefined)",
214
+ value: input3.attrs
215
+ })) && $vo6(input3.attrs, _path2 + ".attrs", _exceptionable2) || $report(_exceptionable2, {
216
+ path: _path2 + ".attrs",
217
+ expected: "(__type.o3 | undefined)",
218
+ value: input3.attrs
203
219
  })].every((flag) => flag);
220
+ const $vo6 = (input3, _path2, _exceptionable2 = true) => [false === _exceptionable2 || Object.keys(input3).map((key) => {
221
+ const value = input3[key];
222
+ if (void 0 === value)
223
+ return true;
224
+ if (RegExp(/(.*)/).test(key))
225
+ return "string" === typeof value || $report(_exceptionable2, {
226
+ path: _path2 + $join(key),
227
+ expected: "string",
228
+ value
229
+ });
230
+ return true;
231
+ }).every((flag) => flag)].every((flag) => flag);
204
232
  const $vu0 = (input3, _path2, _exceptionable2 = true) => (() => {
205
233
  if (void 0 !== input3.status)
206
234
  return $vo0(input3, _path2, _exceptionable2);
@@ -20,7 +20,7 @@ var termdbSampleScatterPayload = {
20
20
  var validTermdbSampleScatterRequest = (input) => {
21
21
  const errors = [];
22
22
  const __is = (input2) => {
23
- const $io0 = (input3) => "string" === typeof input3.genome && "string" === typeof input3.dslabel && true && true && true && true && (void 0 === input3.coordTWs || Array.isArray(input3.coordTWs)) && (void 0 === input3.plotName || "string" === typeof input3.plotName) && true && true && true;
23
+ const $io0 = (input3) => "string" === typeof input3.genome && "string" === typeof input3.dslabel && true && true && true && true && (void 0 === input3.coordTWs || Array.isArray(input3.coordTWs)) && (void 0 === input3.plotName || "string" === typeof input3.plotName) && true && true && (void 0 === input3.chartType || "string" === typeof input3.chartType) && true;
24
24
  return "object" === typeof input2 && null !== input2 && $io0(input2);
25
25
  };
26
26
  if (false === __is(input)) {
@@ -42,7 +42,11 @@ var validTermdbSampleScatterRequest = (input) => {
42
42
  path: _path2 + ".plotName",
43
43
  expected: "(string | undefined)",
44
44
  value: input3.plotName
45
- }), true, true, true].every((flag) => flag);
45
+ }), true, true, void 0 === input3.chartType || "string" === typeof input3.chartType || $report(_exceptionable2, {
46
+ path: _path2 + ".chartType",
47
+ expected: "(string | undefined)",
48
+ value: input3.chartType
49
+ }), true].every((flag) => flag);
46
50
  return ("object" === typeof input2 && null !== input2 || $report(true, {
47
51
  path: _path + "",
48
52
  expected: "TermdbSampleScatterRequest",
package/dist/index.js CHANGED
@@ -42,17 +42,17 @@ import {
42
42
  termdbSampleScatterPayload,
43
43
  validTermdbSampleScatterRequest,
44
44
  validTermdbSampleScatterResponse
45
- } from "./chunk-5BNDT4E6.js";
45
+ } from "./chunk-GDZUCVIB.js";
46
46
  import {
47
47
  termdbSingleSampleMutationPayload,
48
48
  validTermdbSingleSampleMutationRequest,
49
49
  validTermdbSingleSampleMutationResponse
50
- } from "./chunk-UGYLBYUU.js";
50
+ } from "./chunk-5L4VF3ZL.js";
51
51
  import {
52
52
  termdbSingleCellDEgenesPayload,
53
53
  validTermdbSingleCellDEgenesRequest,
54
54
  validTermdbSingleCellDEgenesResponse
55
- } from "./chunk-4LOGWDCZ.js";
55
+ } from "./chunk-3EVYVWI2.js";
56
56
  import {
57
57
  termdbSingleCellDataPayload,
58
58
  validTermdbSingleCellDataRequest,
@@ -2,7 +2,7 @@ import {
2
2
  termdbSampleScatterPayload,
3
3
  validTermdbSampleScatterRequest,
4
4
  validTermdbSampleScatterResponse
5
- } from "./chunk-5BNDT4E6.js";
5
+ } from "./chunk-GDZUCVIB.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbSampleScatterPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbSingleSampleMutationPayload,
3
3
  validTermdbSingleSampleMutationRequest,
4
4
  validTermdbSingleSampleMutationResponse
5
- } from "./chunk-UGYLBYUU.js";
5
+ } from "./chunk-5L4VF3ZL.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbSingleSampleMutationPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbSingleCellDEgenesPayload,
3
3
  validTermdbSingleCellDEgenesRequest,
4
4
  validTermdbSingleCellDEgenesResponse
5
- } from "./chunk-4LOGWDCZ.js";
5
+ } from "./chunk-3EVYVWI2.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbSingleCellDEgenesPayload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.158.0",
3
+ "version": "2.160.1-0",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -756,28 +756,40 @@ export type SingleCellSamples = {
756
756
  extraSampleTabLabel?: string
757
757
  }
758
758
 
759
- export type SingleCellDataGdc = {
760
- src: 'gdcapi'
759
+ type SingleCellDataBase = {
760
+ /** when a sample has multiple tsne plots, this flag allows allows all plots to share one cell type legend */
761
761
  sameLegend: boolean
762
- get?: (q: any) => any
762
+ /** name of ref cells? */
763
763
  refName?: string
764
+ /** dynamically added getter */
765
+ get?: (q: any) => any
766
+ /** width and height of the plots */
767
+ settings?: { [key: string]: any }
768
+ /** In development
769
+ * Replacing colorColumns in gdc plot objs.*/
770
+ twLst?: object[]
771
+ }
772
+
773
+ export type SingleCellDataGdc = SingleCellDataBase & {
774
+ src: 'gdcapi'
764
775
  plots: GDCSingleCellPlot[]
765
- settings?: { [key: string]: string }
766
776
  }
767
777
 
768
778
  export type SingleCellDEgeneGdc = {
769
779
  src: 'gdcapi'
770
- /** Column name.
771
- this must be the colorColumn from one of the plots. so that at the client app, as soon as the plot data have been loaded and maps rendered, client will find out the cell groups based on this columnName value, and show a drop down of these groups on UI. user selects a group, and pass it as request body to backend to get DE genes for this group
780
+ /** termId = Column name.
781
+ this must be the colorColumn from one of the plots. In the client app, as soon as the plot data loads and maps renders, client finds the cell groups based on this columnName value, and shows a drop down of these groups on UI. user selects a group, and passes it as request body to backend to get DE genes for this group
772
782
  */
773
- columnName: string
783
+ termId: string
774
784
  }
775
785
 
776
786
  type GDCSingleCellPlot = {
777
787
  name: string
778
788
  colorColumns: ColorColumn[]
779
789
  coordsColumns: { x: number; y: number }
780
- /** if true the plot is shown by default. otherwise hidden */
790
+ /** if true the plot is shown by default. otherwise hidden
791
+ * Will not be needed when the singleCellPlot is depreciated.
792
+ */
781
793
  selected?: boolean
782
794
  }
783
795
 
@@ -818,19 +830,10 @@ type SingleCellPlot = {
818
830
  /** if true the plot is shown by default. otherwise hidden */
819
831
  selected?: boolean
820
832
  }
821
- export type SingleCellDataNative = {
833
+ export type SingleCellDataNative = SingleCellDataBase & {
822
834
  src: 'native'
823
- /** when a sample has multiple tsne plots, this flag allows allows all plots to share one cell type legend */
824
- sameLegend: boolean
825
835
  /** available tsne type of plots for each sample */
826
836
  plots: SingleCellPlot[]
827
- /** name of ref cells? */
828
- refName?: string
829
- /** dynamically added getter */
830
- get?: (q: any) => any
831
- /** width and height of the plots */
832
-
833
- settings?: { [key: string]: any }
834
837
  }
835
838
 
836
839
  export type SingleCellQuery = {
@@ -1380,24 +1383,23 @@ export type Termdb = {
1380
1383
  * in order to minimize the ease of extracting identifiable information from aggregate data
1381
1384
  * in server response
1382
1385
  *
1383
- * returns: {minSampleSize, canAccess}, see below
1386
+ * returns: {minSize, canAccess}, see below
1384
1387
  */
1385
1388
  checkAccessToSampleData?: (
1386
1389
  /** req.query as processed through app middleware (pre-parsed, may have req.body props, __protectec__, etc) */
1387
1390
  q: any,
1388
1391
  data: {
1389
- /** the number of samples with matching data from one or more queried terms */
1390
- sampleCount: number
1391
- /** option to specify sample names that is accessible to the current user,
1392
- * not using sample ID since portal embedder and token generator does not
1393
- * know the internal sample ID-to-name mapping */
1394
- sampleNames?: string[]
1392
+ /** the number of samples or sites with matching data from one or more queried terms */
1393
+ count: number
1394
+ /** option to specify sample names or sites that are accessible to the current user,
1395
+ */
1396
+ names?: string[]
1395
1397
  }
1396
1398
  ) => {
1397
- /** the required minimum sample size for the current user,
1399
+ /** the required minimum size for the current user to access certain data,
1398
1400
  * may be dependent on login status or other context
1399
1401
  * */
1400
- minSampleSize: number
1402
+ minSize: number
1401
1403
  /** whether downstreadm backend code can proceed */
1402
1404
  canAccess: boolean
1403
1405
  }
@@ -1562,6 +1564,7 @@ keep this setting here for reason of:
1562
1564
  }
1563
1565
  //terms are shown in the dictionary based on term and user role.
1564
1566
  isTermVisible?: (clientAuthResult: any, ids: string) => boolean
1567
+ hiddenIds?: string[]
1565
1568
  getAdditionalFilter?: (__protected__: any, term: any) => Filter | undefined
1566
1569
  }
1567
1570
 
@@ -13,6 +13,7 @@ export type TermdbSampleScatterRequest = {
13
13
  plotName?: string
14
14
  filter?: any
15
15
  filter0?: any
16
+ chartType?: string
16
17
  __protected__?: any // auth token for accessing protected data
17
18
  }
18
19
 
@@ -14,7 +14,7 @@ type ValidResponse = {
14
14
  mlst: object[]
15
15
  /** total number of items for each dt, useful to indicate snvindel limited to 10k for a hypermutator */
16
16
  dt2total?: { dt: number; total: number }[]
17
- /** this declares alternative data for some dt, e.g. a gdc case has cnv results from both snp array and wgs
17
+ /** declares presence of alternative data for some dt, e.g. a gdc case has cnv results from both snp array and wgs
18
18
  key: dt value
19
19
  value: array of objects, each is a distinct set of data points for this dt
20
20
  on ui, selecting an object will allow to show this data in disco plot
@@ -30,6 +30,10 @@ type ValidResponse = {
30
30
  inuse?: boolean
31
31
  /** required list of events from this data */
32
32
  mlst: object[]
33
+ /** optional info about this source */
34
+ attrs?: {
35
+ [index: string]: string
36
+ }
33
37
  }[]
34
38
  }
35
39
  }
@@ -7,12 +7,15 @@ export type TermdbSingleCellDEgenesRequest = {
7
7
  /** Dataset label */
8
8
  dslabel: string
9
9
  /** Sample name
10
- for GDC the value is "seurat.analysis.tsv" file UUID rather than sample name. the file contains the analysis results for an experiment
11
- */
10
+ for GDC the value is "seurat.analysis.tsv" file UUID
11
+ rather than sample name. the file contains the analysis
12
+ results for an experiment */
12
13
  sample: string
13
- /** column name to provide cell groups/clustering, for which DE genes are precomputed. */
14
- columnName: string
15
- /** User selected cell group/cluster, corresponds to columnName, for which DE genes will be returned to client */
14
+ /** column name to provide cell groups/clustering,
15
+ * for which DE genes are precomputed. */
16
+ termId: string
17
+ /** User selected cell group/cluster, corresponds to termId,
18
+ * for which DE genes will be returned to client */
16
19
  categoryName: string
17
20
  }
18
21