@sjcrh/proteinpaint-types 2.178.0 → 2.179.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 (38) hide show
  1. package/dist/brainImaging.js +1 -1
  2. package/dist/{chunk-GAYJUXNZ.js → chunk-4J5BPYYR.js} +429 -201
  3. package/dist/{chunk-WXCXZRKP.js → chunk-6DWX22RA.js} +707 -479
  4. package/dist/{chunk-UWAVSKMD.js → chunk-7V7USAKJ.js} +705 -477
  5. package/dist/{chunk-2XQJCZEO.js → chunk-A2FMYVMI.js} +520 -292
  6. package/dist/{chunk-FQYNRDHB.js → chunk-CC4IBTKW.js} +429 -201
  7. package/dist/{chunk-2Y7WE3JU.js → chunk-CSK3ZCDF.js} +705 -477
  8. package/dist/{chunk-UFYKXOY2.js → chunk-DUFHC6EI.js} +1073 -625
  9. package/dist/{chunk-NRV6MPRM.js → chunk-E2O4N7OC.js} +1346 -898
  10. package/dist/{chunk-CYQDO4FX.js → chunk-FQLGK65A.js} +742 -456
  11. package/dist/{chunk-HZEV7D5E.js → chunk-JTZQYNIT.js} +705 -477
  12. package/dist/{chunk-CX2Y673E.js → chunk-MKM4A5NU.js} +429 -201
  13. package/dist/{chunk-26UKKPK2.js → chunk-QQNDJ6BY.js} +713 -485
  14. package/dist/{chunk-PHRILOVX.js → chunk-RANWGPF7.js} +429 -201
  15. package/dist/{chunk-VBNF7BRI.js → chunk-XAHE4RNZ.js} +452 -224
  16. package/dist/{chunk-YHKFJCXG.js → chunk-YI63CW7Y.js} +646 -426
  17. package/dist/correlationVolcano.js +1 -1
  18. package/dist/grin2.js +1 -1
  19. package/dist/index.js +15 -15
  20. package/dist/termdb.boxplot.js +1 -1
  21. package/dist/termdb.categories.js +1 -1
  22. package/dist/termdb.chat.js +429 -201
  23. package/dist/termdb.chat2.js +1 -1
  24. package/dist/termdb.cluster.js +1 -1
  25. package/dist/termdb.descrstats.js +1 -1
  26. package/dist/termdb.dmr.js +1 -1
  27. package/dist/termdb.numericcategories.js +1 -1
  28. package/dist/termdb.percentile.js +1 -1
  29. package/dist/termdb.termsbyids.js +1 -1
  30. package/dist/termdb.topTermsByType.js +1 -1
  31. package/dist/termdb.topVariablyExpressedGenes.js +1 -1
  32. package/dist/termdb.violin.js +1 -1
  33. package/package.json +1 -1
  34. package/src/dataset.ts +28 -8
  35. package/src/filter.ts +33 -4
  36. package/src/routes/termdb.chat2.ts +13 -2
  37. package/src/routes/termdb.dmr.ts +17 -2
  38. package/src/terms/termCollection.ts +0 -3
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  validChatRequest,
3
3
  validChatResponse
4
- } from "./chunk-GAYJUXNZ.js";
4
+ } from "./chunk-4J5BPYYR.js";
5
5
  import {
6
6
  ChatPayload
7
7
  } from "./chunk-FRXRNCDV.js";
@@ -2,7 +2,7 @@ import {
2
2
  termdbClusterPayload,
3
3
  validTermdbClusterRequest,
4
4
  validTermdbClusterResponse
5
- } from "./chunk-NRV6MPRM.js";
5
+ } from "./chunk-E2O4N7OC.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbClusterPayload,
@@ -2,7 +2,7 @@ import {
2
2
  descrStatsPayload,
3
3
  validDescrStatsRequest,
4
4
  validDescrStatsResponse
5
- } from "./chunk-UWAVSKMD.js";
5
+ } from "./chunk-7V7USAKJ.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  descrStatsPayload,
@@ -2,7 +2,7 @@ import {
2
2
  TermdbDmrPayload,
3
3
  validTermdbDmrRequest,
4
4
  validTermdbDmrResponse
5
- } from "./chunk-CYQDO4FX.js";
5
+ } from "./chunk-FQLGK65A.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  TermdbDmrPayload,
@@ -2,7 +2,7 @@ import {
2
2
  numericCategoriesPayload,
3
3
  validNumericCategoriesRequest,
4
4
  validNumericCategoriesResponse
5
- } from "./chunk-CX2Y673E.js";
5
+ } from "./chunk-MKM4A5NU.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  numericCategoriesPayload,
@@ -2,7 +2,7 @@ import {
2
2
  percentilePayload,
3
3
  validPercentileRequest,
4
4
  validPercentileResponse
5
- } from "./chunk-YHKFJCXG.js";
5
+ } from "./chunk-YI63CW7Y.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  percentilePayload,
@@ -2,7 +2,7 @@ import {
2
2
  termsByIdsPayload,
3
3
  validTermsByIdsRequest,
4
4
  validTermsByIdsResponse
5
- } from "./chunk-HZEV7D5E.js";
5
+ } from "./chunk-JTZQYNIT.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termsByIdsPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbTopTermsByTypePayload,
3
3
  validTermdbTopTermsByTypeRequest,
4
4
  validTermdbTopTermsByTypeResponse
5
- } from "./chunk-UFYKXOY2.js";
5
+ } from "./chunk-DUFHC6EI.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbTopTermsByTypePayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbTopVariablyExpressedGenesPayload,
3
3
  validTermdbTopVariablyExpressedGenesRequest,
4
4
  validTermdbTopVariablyExpressedGenesResponse
5
- } from "./chunk-FQYNRDHB.js";
5
+ } from "./chunk-CC4IBTKW.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbTopVariablyExpressedGenesPayload,
@@ -2,7 +2,7 @@ import {
2
2
  validViolinRequest,
3
3
  validViolinResponse,
4
4
  violinPayload
5
- } from "./chunk-PHRILOVX.js";
5
+ } from "./chunk-RANWGPF7.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  validViolinRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.178.0",
3
+ "version": "2.179.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
@@ -161,6 +161,17 @@ type AiApi = {
161
161
  }
162
162
  }
163
163
 
164
+ /** configuration for api-based dictionary
165
+ NOTE: currently used by mmrf, but may also be used
166
+ by other api-based datasets (e.g. gdc) */
167
+ type DictApi = {
168
+ // builds dictionary and sets standard
169
+ // helpers at ds.cohort.termdb.q{}
170
+ build?: (ds: any) => void
171
+ // gets dictionary term data
172
+ get?: (twLst: any) => void
173
+ }
174
+
164
175
  type SnvIndelFormat = {
165
176
  [index: string]: {
166
177
  /* has value for a non-GT field indicating the variant
@@ -1460,12 +1471,6 @@ export type Termdb = {
1460
1471
  }
1461
1472
  /** if true, backend is allowed to send sample names to client in charts */
1462
1473
  displaySampleIds?: (clientAuthResult: any) => boolean
1463
- /** ds-supplied async callback to build dictionary
1464
- argument: dataset object
1465
- sets termdb.q{}
1466
- no return
1467
- */
1468
- buildDictionary?: (ds: any) => void
1469
1474
  converSampleIds?: boolean
1470
1475
  alwaysShowBranchTerms?: boolean
1471
1476
  minimumSampleAllowed4filter?: number
@@ -1567,7 +1572,8 @@ keep this setting here for reason of:
1567
1572
  gdcapi?: true
1568
1573
  }
1569
1574
  /** Do not use a union here. */
1570
- dictionary?: GdcApi & AiApi
1575
+ /** TODO: should use a union to distinguish between type defs */
1576
+ dictionary?: GdcApi & AiApi & DictApi
1571
1577
  allowCaseDetails?: AllowCaseDetails
1572
1578
  /** Searches the genedb alias list to return the genecode ID */
1573
1579
  getGeneAlias?: (q: any, tw: any) => { gencodeId: any }
@@ -2044,8 +2050,22 @@ export type Mds3 = BaseMds & {
2044
2050
  }
2045
2051
  }
2046
2052
  // !!! TODO: improve these type definitions below !!!
2047
- getHostHeaders?: (q?: any) => any
2048
2053
  serverconfigFeatures?: any
2054
+ /** a dataset may supply custom URL host and headers to use when making external API requests, such as for GDC */
2055
+ getHostHeaders?: (q?: any) => {
2056
+ host: {
2057
+ [apiStyle: string]: string
2058
+ }
2059
+ headers?: {
2060
+ [field: string]: string
2061
+ }
2062
+ }
2063
+ /** a dataset may track req.headers based on an abort signal and/or filter0 that was created for the req;
2064
+ * this tracking is necessary since the req.headers is not necessarily passed through all to downstream code
2065
+ * when processing external API-based dataset data, such as for GDC, but req.query.__abortSignal and filter0
2066
+ * both much more likely to be passed as-is and make it to when `getHostHeaders()` is called */
2067
+ trackReqHeaders?: (req: any, res: any) => void
2068
+ /** a dataset may supply additional information to include in the `/healthcheck` response payload, nested under byDataset[dslabel][genome] = {} property */
2049
2069
  getHealth?: (ds: any) => {
2050
2070
  [key: string]: any
2051
2071
  }
package/src/filter.ts CHANGED
@@ -18,19 +18,26 @@ Filter
18
18
  export type BaseTvs = {
19
19
  join?: string //and, or
20
20
  isnot?: boolean
21
+ // Additional properties used in runtime
22
+ bar_by_grade?: boolean
23
+ bar_by_children?: boolean
24
+ value_by_max_grade?: boolean
25
+ value_by_most_recent?: boolean
26
+ value_by_computable_grade?: boolean
21
27
  }
22
28
 
23
29
  export type CategoricalTvs = BaseTvs & {
24
30
  term: CategoricalTerm
25
31
  groupset_label?: string
26
32
  values: BaseValue[]
33
+ valueset?: Set<any> // Runtime property set by setDatasetAnnotations
27
34
  }
28
35
 
29
36
  export type NumericTvs = BaseTvs & {
30
37
  term: NumericTerm
31
- ranges: NumericBin[]
38
+ ranges: (NumericBin | { value: number; label?: string; name?: string })[]
32
39
  // TODO: define uncomputable values object
33
- values: {
40
+ values?: {
34
41
  key: string
35
42
  value: number
36
43
  uncomputable: true
@@ -51,16 +58,37 @@ export type ConditionTvs = BaseTvs & {
51
58
  value_by_most_recent?: boolean
52
59
  value_by_computable_grade?: boolean
53
60
  grade_and_child?: GradeAndChildEntry[]
61
+ values: { key: string | number; label?: string; [key: string]: any }[]
62
+ }
63
+
64
+ export type GeneVariantValue = {
65
+ key?: string
66
+ label?: string | number
67
+ value?: string
68
+ dt?: number
69
+ mclasslst?: string[]
70
+ mclassExcludeLst?: string[]
71
+ origin?: string
54
72
  }
55
73
 
56
- type GeneVariantTvs = BaseTvs & {
74
+ export type GeneVariantTvs = BaseTvs & {
57
75
  term: DtTerm
58
- values: { key: string; label: string; value: string }[]
76
+ values: GeneVariantValue[]
59
77
  /** boolean for including not tested classes (excluded by default) */
60
78
  includeNotTested?: boolean
61
79
  /** boolean for excluding gene name from pill name (included by default)
62
80
  * used by geneVariant edit ui to exclude unnecessary gene name */
63
81
  excludeGeneName?: boolean
82
+ /** FIXME following are quick fix to avoid tsc err. TODO define snvindel tsv type */
83
+ genotype?: 'variant' | 'nt' | 'wt'
84
+ mcount?: 'any' | 'single' | 'multiple' | 'all'
85
+ /** FIXME following are quick fix to avoid tsc err. TODO define cnv tsv type */
86
+ continuousCnv?: boolean
87
+ cnvLossCutoff?: number
88
+ cnvGainCutoff?: number
89
+ cnvMaxLength?: number
90
+ cnvWT?: boolean
91
+ fractionOverlap?: number
64
92
  }
65
93
 
66
94
  export type TermCollectionTvs = BaseTvs & {
@@ -78,4 +106,5 @@ export type Filter = {
78
106
  join: string
79
107
  tag?: string // client-side only
80
108
  lst: ({ type: 'tvs'; tvs: Tvs } | Filter)[]
109
+ $id?: string // Optional ID property
81
110
  }
@@ -115,7 +115,7 @@ export type plot_type = {
115
115
  type: 'plot'
116
116
  /** The type of plot to be displayed on the UI.
117
117
  * Standard categories are listed; datasets may define additional custom categories. */
118
- plot: 'summary' | 'dge' | 'survival' | 'matrix' | 'sampleScatter'
118
+ plot: 'summary' | 'dge' | 'survival' | 'matrix' | 'sampleScatter' | 'hierCluster'
119
119
  }
120
120
 
121
121
  export type resource_type = {
@@ -132,7 +132,7 @@ export type none_type = {
132
132
  export type QueryClassification = { type: 'plot' } | { type: 'notplot' }
133
133
 
134
134
  /** Specific plot type returned by classifyPlotType in plot.ts */
135
- export type PlotType = 'summary' | 'dge' | 'survival' | 'matrix' | 'samplescatter'
135
+ export type PlotType = 'summary' | 'dge' | 'survival' | 'matrix' | 'samplescatter' | 'hiercluster'
136
136
 
137
137
  export type DEType = {
138
138
  /** Name of group1 which is an array of filter terms */
@@ -148,6 +148,17 @@ export type MatrixType = {
148
148
  terms?: string[]
149
149
  /** Names of genes to include as gene variant rows in the matrix (e.g. "TP53", "KRAS", "NRAS") */
150
150
  geneNames?: string[]
151
+ /** Names of gene sets containing ssGSEA enrichment scores */
152
+ genesetNames?: string[]
153
+ /** Optional simple filter terms to restrict the sample set */
154
+ simpleFilter?: FilterTerm[]
155
+ }
156
+
157
+ export type HierClusterType = {
158
+ /** Names of genes to include in the hierarchical clustering (e.g. "TP53", "KRAS", "BCR") */
159
+ geneNames?: string[]
160
+ /** Names of gene sets containing list of genes to be used for hierarchical clustering */
161
+ genesetNames?: string[]
151
162
  /** Optional simple filter terms to restrict the sample set */
152
163
  simpleFilter?: FilterTerm[]
153
164
  }
@@ -11,7 +11,10 @@ export type TermdbDmrRequest = {
11
11
  chr: string
12
12
  start: number
13
13
  stop: number
14
- // todo more params
14
+ /** optional regulatory domain annotations for the GP model */
15
+ annotations?: DmrAnnotation[]
16
+ /** max fraction of NaN per probe before dropping (default 0.5) */
17
+ nan_threshold?: number
15
18
  filter?: Filter
16
19
  __protected__?: any
17
20
  }
@@ -21,13 +24,25 @@ type Sample = {
21
24
  sample: string
22
25
  }
23
26
 
27
+ type DmrAnnotation = {
28
+ name: string
29
+ start: number
30
+ end: number
31
+ base_methylation?: number
32
+ length_scale_bp?: number
33
+ }
34
+
24
35
  export type TermdbDmrSuccessResponse = {
25
36
  status: 'ok'
26
37
  dmrs: {
27
38
  chr: string
28
39
  start: number
29
40
  stop: number
30
- // todo more stats
41
+ width: number
42
+ max_delta_beta: number
43
+ /** hyper = group2 hypermethylated relative to group1; hypo = opposite */
44
+ direction: 'hyper' | 'hypo'
45
+ probability: number
31
46
  }[]
32
47
  }
33
48
 
@@ -7,7 +7,6 @@ export type CategoryKey = { key: string; shown: boolean }
7
7
 
8
8
  type BaseTermCollection = BaseTerm & {
9
9
  name: string
10
- collectionId?: string
11
10
  type: 'termCollection'
12
11
  /** list of term.ids that are available in this collection. this is used in request payload and server side */
13
12
  termIds?: string[]
@@ -50,7 +49,6 @@ export type RawNumericTermCollection = {
50
49
  type?: 'termCollection'
51
50
  memberType?: 'numeric'
52
51
  name?: string
53
- collectionId?: string
54
52
  termIds?: string[]
55
53
  termlst?: BaseTerm[]
56
54
  propsByTermId?: {
@@ -66,7 +64,6 @@ export type RawCategoricalTermCollection = {
66
64
  type?: 'termCollection'
67
65
  memberType?: 'categorical'
68
66
  name?: string
69
- collectionId?: string
70
67
  termIds?: string[]
71
68
  termlst?: BaseTerm[]
72
69
  propsByTermId?: {