@sjcrh/proteinpaint-types 2.98.0 → 2.98.1

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.
@@ -24,7 +24,7 @@ var validTermdbTopVariablyExpressedGenesRequest = (input) => {
24
24
  const $join = import_typia.createValidate.join;
25
25
  const $io0 = (input3) => "string" === typeof input3.genome && "string" === typeof input3.dslabel && "number" === typeof input3.maxGenes && (void 0 === input3.geneSet || "object" === typeof input3.geneSet && null !== input3.geneSet && $io1(input3.geneSet)) && (void 0 === input3.min_median_log2_uqfpkm || "number" === typeof input3.min_median_log2_uqfpkm) && (void 0 === input3.filter_extreme_values || "number" === typeof input3.filter_extreme_values) && (void 0 === input3.min_count || "number" === typeof input3.min_count) && (void 0 === input3.min_total_count || "number" === typeof input3.min_total_count) && (void 0 === input3.rank_type || "object" === typeof input3.rank_type && null !== input3.rank_type && $io2(input3.rank_type)) && (void 0 === input3.filter || "object" === typeof input3.filter && null !== input3.filter && $io3(input3.filter)) && true;
26
26
  const $io1 = (input3) => ("all" === input3.type || "custom" === input3.type || "msigdb" === input3.type) && (null === input3.geneList || Array.isArray(input3.geneList) && input3.geneList.every((elem) => "string" === typeof elem));
27
- const $io2 = (input3) => "var" === input3.type || "iqr" === input3.type;
27
+ const $io2 = (input3) => "iqr" === input3.type || "var" === input3.type;
28
28
  const $io3 = (input3) => "lst" === input3.type && (void 0 === input3["in"] || "boolean" === typeof input3["in"]) && ("and" === input3.join || "or" === input3.join) && (void 0 === input3.tag || "string" === typeof input3.tag) && (Array.isArray(input3.lst) && input3.lst.every((elem) => "object" === typeof elem && null !== elem && $iu0(elem)));
29
29
  const $io4 = (input3) => (void 0 === input3.join || "string" === typeof input3.join) && (void 0 === input3.isnot || "boolean" === typeof input3.isnot) && ("object" === typeof input3.term && null !== input3.term && $io5(input3.term)) && (void 0 === input3.groupset_label || "string" === typeof input3.groupset_label) && (Array.isArray(input3.values) && input3.values.every((elem) => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io7(elem)));
30
30
  const $io5 = (input3) => "string" === typeof input3.id && "string" === typeof input3.name && "categorical" === input3.type && (void 0 === input3.child_types || Array.isArray(input3.child_types) && input3.child_types.every((elem) => "string" === typeof elem)) && (void 0 === input3.hashtmldetail || "boolean" === typeof input3.hashtmldetail) && (void 0 === input3.included_types || Array.isArray(input3.included_types) && input3.included_types.every((elem) => "string" === typeof elem)) && (void 0 === input3.isleaf || "boolean" === typeof input3.isleaf) && (void 0 === input3.values || "object" === typeof input3.values && null !== input3.values && false === Array.isArray(input3.values) && $io6(input3.values)) && ("object" === typeof input3.groupsetting && null !== input3.groupsetting && $iu4(input3.groupsetting));
@@ -221,7 +221,7 @@ var validTermdbTopVariablyExpressedGenesRequest = (input) => {
221
221
  expected: "(Array<string> | null)",
222
222
  value: input3.geneList
223
223
  })].every((flag) => flag);
224
- const $vo2 = (input3, _path2, _exceptionable2 = true) => ["var" === input3.type || "iqr" === input3.type || $report(_exceptionable2, {
224
+ const $vo2 = (input3, _path2, _exceptionable2 = true) => ["iqr" === input3.type || "var" === input3.type || $report(_exceptionable2, {
225
225
  path: _path2 + ".type",
226
226
  expected: '("iqr" | "var")',
227
227
  value: input3.type
@@ -0,0 +1,11 @@
1
+ import {
2
+ CorrelationVolcanoPayload,
3
+ validCorrelationVolcanoRequest,
4
+ validCorrelationVolcanoResponse
5
+ } from "./chunk-DFSJACIQ.js";
6
+ import "./chunk-Z6B6IQIY.js";
7
+ export {
8
+ CorrelationVolcanoPayload,
9
+ validCorrelationVolcanoRequest,
10
+ validCorrelationVolcanoResponse
11
+ };
package/dist/index.js CHANGED
@@ -1,13 +1,18 @@
1
+ import {
2
+ termdbTopTermsByTypePayload,
3
+ validTermdbTopTermsByTypeRequest,
4
+ validTermdbTopTermsByTypeResponse
5
+ } from "./chunk-CU5TLT6P.js";
1
6
  import {
2
7
  termdbTopVariablyExpressedGenesPayload,
3
8
  validTermdbTopVariablyExpressedGenesRequest,
4
9
  validTermdbTopVariablyExpressedGenesResponse
5
- } from "./chunk-WCMW6A75.js";
10
+ } from "./chunk-Y4KYTIK6.js";
6
11
  import {
7
12
  validViolinRequest,
8
13
  validViolinResponse,
9
14
  violinPayload
10
- } from "./chunk-SRDMLS6D.js";
15
+ } from "./chunk-GQVW2DPA.js";
11
16
  import {
12
17
  tilePayload,
13
18
  validTileRequest,
@@ -18,6 +23,11 @@ import {
18
23
  validWSImagesResponse,
19
24
  wsImagesPayload
20
25
  } from "./chunk-XLBSZOMF.js";
26
+ import {
27
+ rootTermPayload,
28
+ validRootTermRequest,
29
+ validRootTermResponse
30
+ } from "./chunk-GU7LIGHN.js";
21
31
  import {
22
32
  termdbSampleImagesPayload,
23
33
  validTermdbSampleImagesRequest,
@@ -54,10 +64,10 @@ import {
54
64
  validTermsByIdsResponse
55
65
  } from "./chunk-7K726NBK.js";
56
66
  import {
57
- termdbTopTermsByTypePayload,
58
- validTermdbTopTermsByTypeRequest,
59
- validTermdbTopTermsByTypeResponse
60
- } from "./chunk-CU5TLT6P.js";
67
+ boxplotPayload,
68
+ validBoxPlotRequest,
69
+ validBoxPlotResponse
70
+ } from "./chunk-X36QKCNU.js";
61
71
  import {
62
72
  termdbCategoriesPayload,
63
73
  validCategoriesRequest,
@@ -94,10 +104,10 @@ import {
94
104
  validPercentileResponse
95
105
  } from "./chunk-IORCECK2.js";
96
106
  import {
97
- rootTermPayload,
98
- validRootTermRequest,
99
- validRootTermResponse
100
- } from "./chunk-GU7LIGHN.js";
107
+ hicstatPayload,
108
+ validHicstatRequest,
109
+ validHicstatResponse
110
+ } from "./chunk-QX7QLUKY.js";
101
111
  import {
102
112
  isoformlstPayload,
103
113
  validIsoformLstRequest,
@@ -129,10 +139,10 @@ import {
129
139
  validDEResponse
130
140
  } from "./chunk-Z2WFGV6V.js";
131
141
  import {
132
- boxplotPayload,
133
- validBoxPlotRequest,
134
- validBoxPlotResponse
135
- } from "./chunk-OAO3UWUX.js";
142
+ GdcMafPayload,
143
+ validGdcMafBuildRequest,
144
+ validGdcMafBuildResponse
145
+ } from "./chunk-DIDZMC3G.js";
136
146
  import {
137
147
  gdcTopMutatedGenePayload,
138
148
  validGdcTopMutatedGeneRequest,
@@ -168,11 +178,6 @@ import {
168
178
  validHicGenomeRequest,
169
179
  validHicGenomeResponse
170
180
  } from "./chunk-W3QYIXXF.js";
171
- import {
172
- hicstatPayload,
173
- validHicstatRequest,
174
- validHicstatResponse
175
- } from "./chunk-QX7QLUKY.js";
176
181
  import {
177
182
  brainImagingPayload,
178
183
  validBrainImagingRequest,
@@ -188,6 +193,11 @@ import {
188
193
  validBurdenRequest,
189
194
  validBurdenResponse
190
195
  } from "./chunk-RLFGMVJZ.js";
196
+ import {
197
+ CorrelationVolcanoPayload,
198
+ validCorrelationVolcanoRequest,
199
+ validCorrelationVolcanoResponse
200
+ } from "./chunk-DFSJACIQ.js";
191
201
  import {
192
202
  datasetPayload,
193
203
  validDatasetRequest,
@@ -208,13 +218,9 @@ import {
208
218
  validGdcMafRequest,
209
219
  validGdcMafResponse
210
220
  } from "./chunk-CETMA2FU.js";
211
- import {
212
- GdcMafPayload,
213
- validGdcMafBuildRequest,
214
- validGdcMafBuildResponse
215
- } from "./chunk-DIDZMC3G.js";
216
221
  import "./chunk-Z6B6IQIY.js";
217
222
  export {
223
+ CorrelationVolcanoPayload,
218
224
  GdcMafPayload,
219
225
  boxplotPayload,
220
226
  brainImagingPayload,
@@ -266,6 +272,8 @@ export {
266
272
  validBurdenResponse,
267
273
  validCategoriesRequest,
268
274
  validCategoriesResponse,
275
+ validCorrelationVolcanoRequest,
276
+ validCorrelationVolcanoResponse,
269
277
  validDERequest,
270
278
  validDEResponse,
271
279
  validDZImagesRequest,
@@ -2,7 +2,7 @@ import {
2
2
  boxplotPayload,
3
3
  validBoxPlotRequest,
4
4
  validBoxPlotResponse
5
- } from "./chunk-OAO3UWUX.js";
5
+ } from "./chunk-X36QKCNU.js";
6
6
  import "./chunk-Z6B6IQIY.js";
7
7
  export {
8
8
  boxplotPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbTopVariablyExpressedGenesPayload,
3
3
  validTermdbTopVariablyExpressedGenesRequest,
4
4
  validTermdbTopVariablyExpressedGenesResponse
5
- } from "./chunk-WCMW6A75.js";
5
+ } from "./chunk-Y4KYTIK6.js";
6
6
  import "./chunk-Z6B6IQIY.js";
7
7
  export {
8
8
  termdbTopVariablyExpressedGenesPayload,
@@ -2,7 +2,7 @@ import {
2
2
  validViolinRequest,
3
3
  validViolinResponse,
4
4
  violinPayload
5
- } from "./chunk-SRDMLS6D.js";
5
+ } from "./chunk-GQVW2DPA.js";
6
6
  import "./chunk-Z6B6IQIY.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.98.0",
3
+ "version": "2.98.1",
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
@@ -838,15 +838,18 @@ type SelectCohortValuesEntry = {
838
838
  }
839
839
 
840
840
  export type SelectCohortEntry = {
841
+ /** subcohort term in db. uses hardcoded type=multivalue */
841
842
  term: { id: string; type: string }
842
843
  /** Title above the cohort introduction/content in the about tab */
843
844
  title?: string
844
845
  /** Text above radio cohort options in the about tab. */
845
846
  prompt: string
846
847
  values: SelectCohortValuesEntry[]
848
+ /** cohort-related static html shown in about tab */
847
849
  description?: string
848
- /* If the description is dependent on the user pass a descriptionByUser dict instead */
849
- descriptionByUser?: { [index: string]: string }
850
+ /** If the description is dependent on the user's role,
851
+ define this callback to return description based on auth */
852
+ descriptionByUser?: (auth: any) => string
850
853
  /** subtext shown at the very bottom of the cohort/about tab subheader */
851
854
  asterisk?: string
852
855
  //The profile has clearOnChange. The terms used in the plots are not always the same for the profile.
@@ -895,6 +898,22 @@ this is limited to only one term and doesn't allow switching between multiple te
895
898
  type Scatterplots = {
896
899
  plots: ScatterPlotsEntry[]
897
900
  }
901
+ /** this plot compares correlation of one feature against a bunch of variables across samples
902
+ */
903
+ type CorrelationVolcano = {
904
+ /** fixed feature, is one numeric term */
905
+ feature: {
906
+ /** later expand to other types */
907
+ termType: 'geneExpression'
908
+ }
909
+ /** list of numeric variables to be compared against fixed feature*/
910
+ variables: {
911
+ /** later can expand */
912
+ type: 'dictionaryTerm'
913
+ /** when type=dictionaryTerm, is array of numeric term ids */
914
+ termIds?: string[]
915
+ }
916
+ }
898
917
 
899
918
  type MatrixSettingsControlLabels = {
900
919
  samples?: string
@@ -951,6 +970,15 @@ type SurvivalSettings = {
951
970
  xTickValues?: number[]
952
971
  }
953
972
 
973
+ type RegressionSettings = {
974
+ /** disable interactions */
975
+ disableInteractions?: boolean
976
+ /** hide type III statistics table in results */
977
+ hideType3?: boolean
978
+ /** hide statistical tests table in results */
979
+ hideTests?: boolean
980
+ }
981
+
954
982
  type MatrixSettings = {
955
983
  maxSample?: number
956
984
  svgCanvasSwitch?: number
@@ -1021,6 +1049,11 @@ type Survival = {
1021
1049
  settings?: SurvivalSettings
1022
1050
  }
1023
1051
 
1052
+ type Regression = {
1053
+ /** default settings for regression */
1054
+ settings?: RegressionSettings
1055
+ }
1056
+
1024
1057
  type MatrixPlotsEntry = {
1025
1058
  name: string
1026
1059
  file: string
@@ -1128,21 +1161,16 @@ keep this setting here for reason of:
1128
1161
  */
1129
1162
  useLower?: boolean
1130
1163
 
1131
- scatterplots?: Scatterplots
1132
1164
  matrix?: Matrix
1133
1165
  numericDictTermCluster?: NumericDictTermCluster
1134
1166
  survival?: Survival
1167
+ regression?: Regression
1135
1168
  logscaleBase2?: boolean
1136
1169
  plotConfigByCohort?: PlotConfigByCohort
1137
1170
  /** Functionality */
1138
1171
  dataDownloadCatch?: DataDownloadCatch
1139
1172
  helpPages?: URLEntry[]
1140
1173
  multipleTestingCorrection?: MultipleTestingCorrection
1141
- /** regression settings for neuro-oncology portals:
1142
- - no interaction terms
1143
- - report event counts of cox coefficients
1144
- - hide type III stats and miscellaneous statistical tests */
1145
- neuroOncRegression?: boolean
1146
1174
  urlTemplates?: {
1147
1175
  /** gene link definition */
1148
1176
  gene?: UrlTemplateBase
@@ -1270,6 +1298,8 @@ type AssayAvailability = {
1270
1298
 
1271
1299
  //Shared with genome.ts
1272
1300
  export type Cohort = {
1301
+ /** if present, means correlation volcano plot analysis is enabled */
1302
+ correlationVolcano?: CorrelationVolcano
1273
1303
  cumburden?: {
1274
1304
  files: {
1275
1305
  fit: string
@@ -1285,6 +1315,7 @@ export type Cohort = {
1285
1315
  matrixplots?: MatrixPlots
1286
1316
  mutationset?: MutationSet[]
1287
1317
  renamedChartTypes?: { singleCellPlot?: string; sampleScatter?: string }
1318
+ /** if present, supplies premade scatter plots */
1288
1319
  scatterplots?: Scatterplots
1289
1320
  termdb: Termdb
1290
1321
  }
@@ -1676,15 +1707,10 @@ export type PreInit = {
1676
1707
  }
1677
1708
  }
1678
1709
 
1679
- /** supply "isSupported()" kind of callback per chart type,
1680
- that will overwrite default logic in getSupportedChartTypes()
1681
- - the callback can have arbitrary logic based on requirements from this ds
1682
- - can supply ()=>false to hide charts that will otherwise shown
1683
- - can define arbitrary chart type names for purpose-specific charts
1684
- */
1685
-
1710
+ /** see details in termdb.server.init.ts
1711
+ */
1686
1712
  export type isSupportedChartCallbacks = {
1687
- [chartType: string]: (f: any, auth: any) => boolean | undefined
1713
+ [chartType: string]: (f: any) => boolean | undefined
1688
1714
  }
1689
1715
 
1690
1716
  export type Mds3 = BaseMds & {
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from './routes/routeApi.ts'
8
8
  export * from './routes/brainImaging.ts'
9
9
  export * from './routes/brainImagingSamples.ts'
10
10
  export * from './routes/burden.ts'
11
+ export * from './routes/correlationVolcano.ts'
11
12
  export * from './routes/dataset.ts'
12
13
  export * from './routes/dsdata.ts'
13
14
  export * from './routes/dzimages.ts'
@@ -0,0 +1,44 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { TermWrapper } from '../terms/tw.ts'
3
+ import type { Filter } from '../filter.ts'
4
+
5
+ /** */
6
+ export type CorrelationVolcanoRequest = {
7
+ genome: string
8
+ dslabel: string
9
+ filter?: Filter
10
+ filter0?: any // gdc
11
+ /** feature tw */
12
+ featureTw: TermWrapper
13
+ /** variables */
14
+ variableTwLst: TermWrapper[]
15
+ /** correlation method */
16
+ correlationMethod: 'pearson' | 'spearman'
17
+ /** add new param */
18
+ }
19
+
20
+ export type CorrelationVolcanoResponse = {
21
+ /** each element is test result of one variable corresponding to variableTwLst */
22
+ variableItems: {
23
+ /** correlation coefficient, -1 to 1 */
24
+ correlation: number
25
+ /** pvalue */
26
+ original_pvalue: number
27
+ /** pvalue */
28
+ adjusted_pvalue: number
29
+ /** tw.$id, for client to match the item with variableTwLst */
30
+ tw$id: string
31
+ /** number of samples analyzed. samples not having complete data for all terms will be excluded, thus size may be lower than current cohort */
32
+ sampleSize: number
33
+ }[]
34
+ }
35
+
36
+ export const CorrelationVolcanoPayload: RoutePayload = {
37
+ request: {
38
+ typeId: 'CorrelationVolcanoRequest'
39
+ },
40
+ response: {
41
+ typeId: 'CorrelationVolcanoResponse'
42
+ }
43
+ //examples: []
44
+ }
@@ -1,18 +1,20 @@
1
1
  import type { RoutePayload } from './routeApi.js'
2
+ import type { TermWrapper } from '../terms/tw.ts'
3
+ import type { Filter } from '../filter.ts'
2
4
 
3
5
  /**Args set in Termdb vocab and from mass box plot */
4
6
  export type BoxPlotRequest = {
5
7
  /** Args set in TermVocab */
6
8
  /** term1 or term */
7
- tw: any
9
+ tw: TermWrapper
8
10
  genome: string
9
11
  dslabel: string
10
12
  /** sort plots by median value */
11
13
  orderByMedian: boolean
12
14
  /** term2 */
13
- overlayTw?: any
14
- filter: any
15
- filter0: any
15
+ overlayTw?: TermWrapper
16
+ filter?: Filter
17
+ filter0?: any
16
18
  }
17
19
 
18
20
  export type BoxPlotResponse = {
@@ -62,11 +64,11 @@ export type BoxPlotData = {
62
64
  }
63
65
 
64
66
  export type BoxPlotDescrStatsEntry = {
65
- /** Use lower case for sanity check
66
- * 'total' | 'min' | 'p25' | 'median' | 'mean' | 'p75' | 'max' | 'sd' | 'variance' | 'iqr'
67
- */
68
- id: string
67
+ /** Short hand for summary stat. Use lower case for sanity check */
68
+ id: 'total' | 'min' | 'p25' | 'median' | 'mean' | 'p75' | 'max' | 'sd' | 'variance' | 'iqr' | string
69
+ /** Full label displayed to the user */
69
70
  label: string
71
+ /** Calculated value. */
70
72
  value: number
71
73
  }
72
74
 
@@ -89,11 +89,8 @@ export type ViolinPlotEntry = {
89
89
  seriesId: string
90
90
  /** Plot image to display */
91
91
  src: string
92
- summaryStats: {
93
- /** Descriptive stats (i.e. min, max, sd, etc.) */
94
- values: ValuesEntries[]
95
- }
96
- uncomputableValueObj: { [index: string]: number } | null
92
+ /** Descriptive stats (i.e. min, max, sd, etc.) */
93
+ summaryStats: ValuesEntries[]
97
94
  }
98
95
 
99
96
  export type ViolinResponse = ValidResponse | ErrorResponse
@@ -105,7 +102,7 @@ type ValidResponse = {
105
102
  max: number
106
103
  plots: ViolinPlotEntry[]
107
104
  pvalues?: PValueEntries[][]
108
- uncomputableValueObj: { [index: string]: number }[] | null
105
+ uncomputableValues: { [index: string]: number }[] | null
109
106
  }
110
107
 
111
108
  export const violinPayload: RoutePayload = {
@@ -6,20 +6,21 @@
6
6
  * Use this type for that purpose.
7
7
  */
8
8
 
9
+ type SampleEntry = {
10
+ /** stringified integer sample id */
11
+ sample: string | number
12
+ } & {
13
+ /** key and values for terms, separated by tw.$id */
14
+ [index: string]: {
15
+ key: number
16
+ value: number
17
+ }
18
+ }
19
+
9
20
  export type ValidGetDataResponse = {
10
- samples: Record<
11
- string,
12
- {
13
- /** stringified integer sample id */
14
- key: number
15
- /** value: {
16
- sample: integerId,
17
- <tw.$id>: {key, value},
18
- <more terms...>
19
- } */
20
- value: number
21
- }
22
- >
21
+ samples: {
22
+ [index: string | number]: SampleEntry
23
+ }
23
24
  /** Metadata */
24
25
  refs: {
25
26
  /** metadata about terms