@sjcrh/proteinpaint-types 2.83.0 → 2.85.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 (135) hide show
  1. package/dist/routes.ts +28847 -0
  2. package/package.json +17 -11
  3. package/src/Mclass.js +0 -0
  4. package/src/checkers/routes.js +167 -0
  5. package/src/dataset.js +0 -0
  6. package/src/fileOrUrl.js +0 -0
  7. package/src/filter.js +0 -0
  8. package/src/genome.js +0 -0
  9. package/src/index.js +66 -0
  10. package/src/routes/brainImaging.js +11 -0
  11. package/src/routes/brainImagingSamples.js +11 -0
  12. package/src/routes/burden.js +44 -0
  13. package/src/routes/dataset.js +12 -0
  14. package/src/routes/dsdata.js +12 -0
  15. package/src/routes/dzimages.js +12 -0
  16. package/src/routes/errorResponse.js +0 -0
  17. package/src/routes/filter.gdc.js +0 -0
  18. package/src/routes/gdc.maf.js +17 -0
  19. package/src/routes/gdc.mafBuild.js +12 -0
  20. package/src/routes/gdc.topMutatedGenes.js +12 -0
  21. package/src/routes/genelookup.js +12 -0
  22. package/src/routes/genesetEnrichment.js +12 -0
  23. package/src/routes/genesetOverrepresentation.js +12 -0
  24. package/src/routes/healthcheck.js +23 -0
  25. package/src/routes/hicdata.js +12 -0
  26. package/src/routes/hicgenome.js +29 -0
  27. package/src/routes/hicstat.js +12 -0
  28. package/src/routes/isoformlst.js +12 -0
  29. package/src/routes/ntseq.js +12 -0
  30. package/src/routes/pdomain.js +12 -0
  31. package/src/routes/routeApi.js +0 -0
  32. package/src/routes/samplewsimages.js +12 -0
  33. package/src/routes/snp.js +11 -0
  34. package/src/routes/termdb.DE.js +13 -0
  35. package/src/routes/termdb.boxplot.js +12 -0
  36. package/src/routes/termdb.categories.js +48 -0
  37. package/src/routes/termdb.cluster.js +12 -0
  38. package/src/routes/termdb.cohort.summary.js +12 -0
  39. package/src/routes/termdb.cohorts.js +12 -0
  40. package/src/routes/termdb.descrstats.js +48 -0
  41. package/src/routes/termdb.numericcategories.js +12 -0
  42. package/src/routes/termdb.percentile.js +49 -0
  43. package/src/routes/termdb.rootterm.js +27 -0
  44. package/src/routes/termdb.sampleImages.js +12 -0
  45. package/src/routes/termdb.singleSampleMutation.js +12 -0
  46. package/src/routes/termdb.singlecellDEgenes.js +12 -0
  47. package/src/routes/termdb.singlecellData.js +12 -0
  48. package/src/routes/termdb.singlecellSamples.js +12 -0
  49. package/src/routes/termdb.termchildren.js +28 -0
  50. package/src/routes/termdb.termsbyids.js +12 -0
  51. package/src/routes/termdb.topTermsByType.js +12 -0
  52. package/src/routes/termdb.topVariablyExpressedGenes.js +12 -0
  53. package/src/routes/termdb.violin.js +49 -0
  54. package/src/routes/tileserver.js +12 -0
  55. package/src/routes/wsimages.js +12 -0
  56. package/src/terms/categorical.js +0 -0
  57. package/src/terms/condition.js +0 -0
  58. package/src/terms/geneExpression.js +0 -0
  59. package/src/terms/geneVariant.js +0 -0
  60. package/src/terms/metaboliteIntensity.js +0 -0
  61. package/src/terms/numeric.js +0 -0
  62. package/src/terms/q.js +0 -0
  63. package/src/terms/samplelst.js +0 -0
  64. package/src/terms/singleCellCellType.js +0 -0
  65. package/src/terms/singleCellGeneExpression.js +0 -0
  66. package/src/terms/snp.js +0 -0
  67. package/src/terms/snps.js +0 -0
  68. package/src/terms/term.js +0 -0
  69. package/src/terms/tw.js +0 -0
  70. package/src/terms/updated-types.js +0 -0
  71. package/src/termsetting.js +0 -0
  72. package/src/test/numeric.type.spec.js +117 -0
  73. package/src/vocab.js +0 -0
  74. package/src/Mclass.ts +0 -8
  75. package/src/dataset.ts +0 -1575
  76. package/src/docs.json +0 -16417
  77. package/src/fileOrUrl.ts +0 -15
  78. package/src/filter.ts +0 -125
  79. package/src/genome.ts +0 -123
  80. package/src/index.ts +0 -57
  81. package/src/routes/brainImaging.ts +0 -21
  82. package/src/routes/burden.ts +0 -69
  83. package/src/routes/dzimages.ts +0 -9
  84. package/src/routes/errorResponse.ts +0 -6
  85. package/src/routes/filter.gdc.ts +0 -15
  86. package/src/routes/gdc.maf.ts +0 -41
  87. package/src/routes/gdc.mafBuild.ts +0 -13
  88. package/src/routes/gdc.topMutatedGenes.ts +0 -25
  89. package/src/routes/genelookup.ts +0 -10
  90. package/src/routes/genesetEnrichment.ts +0 -46
  91. package/src/routes/genesetOverrepresentation.ts +0 -36
  92. package/src/routes/healthcheck.ts +0 -57
  93. package/src/routes/hicdata.ts +0 -37
  94. package/src/routes/hicgenome.ts +0 -22
  95. package/src/routes/hicstat.ts +0 -45
  96. package/src/routes/sampledzimages.ts +0 -1
  97. package/src/routes/samplewsimages.ts +0 -15
  98. package/src/routes/termdb.DE.ts +0 -44
  99. package/src/routes/termdb.boxplot.ts +0 -40
  100. package/src/routes/termdb.categories.ts +0 -26
  101. package/src/routes/termdb.cluster.ts +0 -86
  102. package/src/routes/termdb.getSampleImages.ts +0 -14
  103. package/src/routes/termdb.getTopTermsByType.ts +0 -21
  104. package/src/routes/termdb.getdescrstats.ts +0 -31
  105. package/src/routes/termdb.getnumericcategories.ts +0 -21
  106. package/src/routes/termdb.getpercentile.ts +0 -17
  107. package/src/routes/termdb.getrootterm.ts +0 -22
  108. package/src/routes/termdb.gettermchildren.ts +0 -21
  109. package/src/routes/termdb.singleSampleMutation.ts +0 -18
  110. package/src/routes/termdb.singlecellDEgenes.ts +0 -30
  111. package/src/routes/termdb.singlecellData.ts +0 -58
  112. package/src/routes/termdb.singlecellSamples.ts +0 -35
  113. package/src/routes/termdb.termsbyids.ts +0 -15
  114. package/src/routes/termdb.topVariablyExpressedGenes.ts +0 -45
  115. package/src/routes/termdb.violin.ts +0 -74
  116. package/src/routes/wsimages.ts +0 -12
  117. package/src/terms/categorical.ts +0 -106
  118. package/src/terms/condition.ts +0 -55
  119. package/src/terms/geneExpression.ts +0 -32
  120. package/src/terms/geneVariant.ts +0 -51
  121. package/src/terms/metaboliteIntensity.ts +0 -31
  122. package/src/terms/numeric.ts +0 -253
  123. package/src/terms/q.ts +0 -38
  124. package/src/terms/samplelst.ts +0 -41
  125. package/src/terms/singleCellCellType.ts +0 -22
  126. package/src/terms/singleCellGeneExpression.ts +0 -28
  127. package/src/terms/snp.ts +0 -28
  128. package/src/terms/snps.ts +0 -110
  129. package/src/terms/term.ts +0 -184
  130. package/src/terms/tw.ts +0 -38
  131. package/src/terms/updated-types.ts +0 -9
  132. package/src/termsetting.ts +0 -197
  133. package/src/test/numeric.type.spec.ts +0 -275
  134. package/src/typedoc.js +0 -30
  135. package/src/vocab.ts +0 -37
package/src/dataset.ts DELETED
@@ -1,1575 +0,0 @@
1
- import { Mclass } from './Mclass.ts'
2
-
3
- /*** General usage types ***/
4
- type FileObj = {
5
- file: string
6
- }
7
-
8
- type KeyVal = {
9
- k: string
10
- v?: string
11
- }
12
-
13
- type KeyLabel = {
14
- key: string
15
- label: string
16
- }
17
-
18
- /** a set of categories about a vcf INFO field */
19
- export type InfoFieldCategories = {
20
- /** category key from an INFO field of a vcf file */
21
- [index: string]: {
22
- /** Color used for rendering labels and backgrounds in the legend, tables, etc. */
23
- color: string
24
- /** Human readable label */
25
- label?: string
26
- /** Shown in the legend on label click */
27
- desc: string
28
- /** When .color is used as the background, denoted whether
29
- * to use 'white', 'black', or other color for the text */
30
- textcolor?: string
31
- }
32
- }
33
-
34
- type NumericFilterEntry = {
35
- /** '<' or '>' for filtering */
36
- side: string
37
- /** value for filtering */
38
- value: number
39
- }
40
-
41
- type AFEntry = {
42
- /** human readable label */
43
- name: string
44
- /** */
45
- locusinfo: {
46
- /** usually the data dictionary value (e.g. AF_EXAC for ExAC frequency) */
47
- key: string
48
- }
49
- /** key/values for filtering */
50
- numericfilter: NumericFilterEntry[]
51
- }
52
-
53
- /** Specific allele freq info for ClinVar */
54
- export type ClinvarAF = {
55
- [index: string]: AFEntry
56
- }
57
-
58
- /*** types supporting Queries type ***/
59
-
60
- type InfoFieldEntry = {
61
- /** Human readable name to display */
62
- name: string
63
- /** vcf INFO field */
64
- key: string
65
- /** a set of categories about a vcf INFO field */
66
- categories?: InfoFieldCategories
67
- /** seperator (e.g. '&', '|' ) between join values */
68
- separator?: string
69
- }
70
-
71
- /*
72
- type GenomicPositionEntry = {
73
- chr: string
74
- start: number
75
- stop: number
76
- }
77
- */
78
-
79
- type Chr2bcffile = {
80
- /** index is the chr (e.g. 'chr1', 'chr2', etc.)
81
- * value is the bcf file path */
82
- [index: string]: string
83
- }
84
-
85
- type bcfMafFile = {
86
- /** bcf file for only variants, no samples and FORMAT */
87
- bcffile: string
88
- /** maf file for sample mutations. bcf header contents with FORMAT and list of samples are
89
- * copied into this maf as headers followed by the maf header starting with #chr, pos, ref,
90
- * alt and sample. Each column after sample corresponds to the information in FORMAT. file
91
- * is bgzipped and tabix indexed (tabix -c"#" -s 1 -b 2 -e 2 <maf.gz>) */
92
- maffile: string
93
- }
94
-
95
- type SnvindelByRange = {
96
- /** if true, served from gdc. no other parameters TODO change to src='gdc/native' */
97
- gdcapi?: boolean
98
-
99
- //local ds can have following different setup
100
-
101
- /** one single bcf file */
102
- bcffile?: string
103
- /** one bcf file per chr */
104
- chr2bcffile?: Chr2bcffile
105
- /** bcf+maf combined */
106
- bcfMafFile?: bcfMafFile
107
- /** allow to apply special configurations to certain INFO fields of the bcf file */
108
- infoFields?: InfoFieldEntry[]
109
- /** if true, bcf or chr2bcf uses string sample name in header. to be used during this migrating so the code can deal with old files with integer sample ids and new ones; TODO once all datasets are migrated, delete the flag */
110
- tempflag_sampleNameInVcfHeader?: boolean
111
- }
112
-
113
- type URLEntry = {
114
- /** base URL, including the host and possibly other queries */
115
- base?: string
116
- key?: string
117
- namekey?: string
118
- label?: string
119
- url?: string
120
- }
121
-
122
- type SkewerRim = {
123
- /** only enabled for 'format' */
124
- type: string
125
- /** 'origin' */
126
- formatKey: string
127
- /** 'somatic' or 'germline', generally germline */
128
- rim1value: string
129
- /** 'somatic' or 'germline', generally somatic */
130
- noRimValue: string
131
- }
132
-
133
- type GdcApi = {
134
- /** Represents the configuration for accessing the GDC API. */
135
- gdcapi?: boolean
136
- }
137
-
138
- type SnvIndelFormat = {
139
- [index: string]: {
140
- /* has value for a non-GT field indicating the variant
141
- is annotated to this sample*/
142
- ID: string
143
- Description: string
144
- /** 'R' or 1. do not parse values here based on Number="R"
145
- as we don't need to compute on the format values on backend
146
- client will parse the values for display */
147
- Number: string | number
148
- Type: string
149
- }
150
- }
151
-
152
- type FilterValues = {
153
- [index: string | number]: {
154
- key?: string | number
155
- label: string
156
- }
157
- }
158
-
159
- type RangesEntry = {
160
- start: number
161
- startinclusive: boolean
162
- stopunbounded: boolean
163
- }
164
-
165
- type BaseTvsFilter = {
166
- isnot?: boolean
167
- ranges?: RangesEntry[]
168
- }
169
-
170
- type TvsFilter = BaseTvsFilter & {
171
- values?: (string | number | { label: string })[]
172
- }
173
-
174
- export type FilterTermEntry = BaseTvsFilter & {
175
- id: string
176
- name: string
177
- type: string
178
- parent_id: string | null
179
- isleaf: boolean
180
- values?: FilterValues
181
- tvs?: TvsFilter
182
- min?: number
183
- max?: number
184
- }
185
-
186
- type FilterLstTvs = BaseTvsFilter & {
187
- term: FilterTermEntry
188
- values: (string | number | FilterValues)[]
189
- }
190
-
191
- type FilterLstEntry = {
192
- type: string
193
- tvs: FilterLstTvs
194
- }
195
-
196
- type Filter = {
197
- type: string
198
- join: string
199
- in: boolean
200
- lst?: FilterLstEntry[]
201
- }
202
-
203
- type VariantFilter = {
204
- opts: { joinWith: string[] }
205
- filter: Filter
206
- terms: FilterTermEntry[]
207
- }
208
-
209
- /** one set of AC and AN info fields to retrieve data for this population */
210
- type PopulationINFOset = {
211
- /** optional name for identifying this set, when the population is ancestry-stratified and a population has multiple sets */
212
- key?: string
213
- /** required info field */
214
- infokey_AC: string
215
- /** required info field */
216
- infokey_AN: string
217
- /** Optional */
218
- termfilter_value?: string
219
- }
220
-
221
- /* define method to retrieve allele AC/AN in a population, by using bcf INFO fields; population could be ancestry-stratified
222
- two types of population are supported:
223
- - ancestry-stratified
224
- allowto_adjust_race can be set to true
225
- sets[] has >1 elements
226
- - not stratified
227
- allowto_adjust_race cannot be set to true
228
- sets[] has only 1 element
229
- */
230
- type Population = {
231
- /** for identifying this element */
232
- key: string
233
- /** display, in fact it can replace key since label should also be unique*/
234
- label: string
235
- /** allow to set to true for race-stratified population, will adjust population AC/AN values based on admix coefficient for the dataset's cohort variants
236
- * supposed to be "read-only" attribute and not modifiable in runtime */
237
- allowto_adjust_race?: boolean
238
- /** when above is true, this flag is flip switch for this adjustion */
239
- adjust_race?: boolean
240
- /** optional term id used for race adjusting, must correspond to a term in dataset db */
241
- termfilter?: string
242
- /** if AC/AN of the population is ancestry-stratified, will be multiple elements of this array; otherwise just one */
243
- sets: PopulationINFOset[]
244
- }
245
-
246
- /** a data type under ds.queries{} */
247
- type SnvIndelQuery = {
248
- forTrack?: boolean
249
- /** allow to query data by either isoform or range
250
- * isoform query is only used for gdc api
251
- */
252
- byisoform?: GdcApi
253
- /** query data by range */
254
- byrange: SnvindelByRange
255
-
256
- infoUrl?: URLEntry[]
257
- skewerRim?: SkewerRim
258
- format4filters?: string[]
259
- format?: SnvIndelFormat
260
- variant_filter?: VariantFilter
261
- populations?: Population[]
262
- /** NOTE **
263
- this definition can appear either in queries.snvindel{} or termdb{}
264
- so that it can work for a termdb-less ds, e.g. clinvar, where termdbConfig cannot be made */
265
- ssmUrl?: UrlTemplateSsm
266
- m2csq?: {
267
- gdcapi?: boolean
268
- by: string
269
- }
270
- allowSNPs?: boolean
271
- vcfid4skewerName?: boolean
272
- details?: any
273
- }
274
-
275
- type SvFusion = {
276
- byrange: {
277
- /** file paths for sv fusion data */
278
- file?: string
279
- }
280
- }
281
-
282
- type SingleSampleMutationQuery = {
283
- src: 'native' | 'gdcapi' | string
284
- /** which property of client mutation object to retrieve sample identifier for
285
- * querying single sample data with */
286
- sample_id_key: string
287
- /** only required for src=native */
288
- folder?: string
289
- /** quick fix to hide chrM from disco, due to reason e.g. this dataset doesn't
290
- * have data on chrM */
291
- discoSkipChrM?: true
292
- }
293
-
294
- type NIdataQuery = {
295
- /** Reference obj for NI data query. */
296
- Ref1: NIdataQueryRef
297
- }
298
-
299
- type NIdataQueryRef = {
300
- /** file path for the reference file */
301
- referenceFile: string
302
- /** file path for the sample file */
303
- samples: string
304
- /** Parameters for slice indices in the mass brain imaging plot */
305
- parameters?: NIdataQueryRefParams
306
- /** optional terms to show as table columns and annotate samples */
307
- sampleColumns?: { termid: string }[]
308
- }
309
-
310
- type NIdataQueryRefParams = {
311
- /** index of slice for default sagittal plane */
312
- l: number
313
- /** index of slice for default coronal plane */
314
- f: number
315
- /** index of slice for default axial plane */
316
- t: number
317
- }
318
-
319
- /** used for the gene set edit ui */
320
- export type GeneArgumentEntry = {
321
- /** Dom element id
322
- * Use the cooresponding parameter name as the id
323
- */
324
- id: string
325
- /** label/prompt for the checkbox, input, etc. */
326
- label: string
327
- /** Optional: Creates subtext below the main label */
328
- sublabel?: string
329
- /** boolean and string creates a checkbox
330
- * number creates a text input
331
- */
332
- type: 'boolean' | 'string' | 'number' | 'radio'
333
- /** value of the input or checkbox
334
- * required if type is string. Otherwise, optional
335
- */
336
- value?:
337
- | string
338
- | boolean
339
- | number
340
- | {
341
- type: string
342
- value: string[] | null
343
- }
344
- options?: {
345
- /** Type of dom element to render underneath the radio
346
- * 'text': creates a text area input
347
- * 'tree': launches termdb app and the tree
348
- * 'boolean': No element is created
349
- */
350
- type: 'text' | 'tree' | 'boolean' | string
351
- /** value used to construct the server argument
352
- * also the element id in the gene set edit ui
353
- */
354
- value: number | string
355
- /** radio label */
356
- label: string
357
- /** Optional: smaller text that appears underneath the label */
358
- sublabel?: string
359
- }[]
360
- }
361
-
362
- type TopVariablyExpressedGenesQuery = {
363
- /** Denotes either gdc specific data requests or common
364
- * data request processing */
365
- src: 'gdcapi' | 'native' | string
366
- /** Specifies the dom element rendered in the menu */
367
- arguments?: GeneArgumentEntry[]
368
- }
369
-
370
- type TopMutatedGenes = {
371
- /** Specifies the dom element rendered in the menu */
372
- arguments?: GeneArgumentEntry[]
373
- }
374
-
375
- type TklstEntry = {
376
- /** Determines the column to add the track via the assay names
377
- * shown at the top of the facet table.*/
378
- assay?: string
379
- /** track type (e.g. bigwig, bedj, etc.) */
380
- type: string
381
- /** Human readable name */
382
- name: string
383
- /** Corresponding sample id in the data file */
384
- sampleID?: string
385
- /** data file path */
386
- file: string
387
- /** The key for the second tier of the facet table*/
388
- level1?: string
389
- /** The key for the third tier of the facet table*/
390
- level2?: string
391
- /** Whether the track is shown by default */
392
- defaultShown?: boolean
393
- /** Track height */
394
- stackheight?: number
395
- /** Space added to the height of the track */
396
- stackspace?: number
397
- /** padding-top for the track */
398
- toppad?: number
399
- /** padding-bottom for the track */
400
- bottompad?: number
401
- /** Specifically for bedj tracks. if true, will render all items in a
402
- * single row and do not stack them */
403
- onerow?: number | boolean
404
- }
405
-
406
- type TrackLstEntry = {
407
- /** creates a facet table if true. */
408
- isfacet: boolean
409
- /** name shown for the facet table button from Tracks button*/
410
- name: string
411
- /** tk objs to show on click of the facet table */
412
- tklst: TklstEntry[]
413
- }
414
-
415
- type CnvSegment = {
416
- byrange: CnvSegmentByRange
417
- /****** rendering parameters ****
418
- not used as query parameter to filter segments
419
- value range for color scaling. default to 5. cnv segment value>this will use solid color
420
- */
421
- absoluteValueRenderMax?: number
422
- gainColor?: string
423
- lossColor?: string
424
-
425
- /*** filtering parameters ***
426
- default max length setting to restrict to focal events; if missing show all */
427
- cnvMaxLength?: number
428
-
429
- /** TODO define value type, if logratio, or copy number */
430
-
431
- /** following two cutoffs only apply to log ratio, cnv gain value is positive, cnv loss value is negative
432
- if cnv is gain, skip if value<this cutoff */
433
- cnvGainCutoff?: number
434
- /** if cnv is loss, skip if value>this cutoff */
435
- cnvLossCutoff?: number
436
- }
437
-
438
- type CnvSegmentByRange = {
439
- src: 'native' | 'gdcapi' | string
440
- /** only for src=native */
441
- file?: string
442
- }
443
-
444
- /*
445
- no longer used!!
446
- file content is a probe-by-sample matrix, values are signals
447
- for a given region, the median signal from probes in the region is used to make a gain/loss call for each sample
448
- this is alternative to CnvSegment
449
-
450
- type Probe2Cnv = {
451
- file: string
452
- }
453
- */
454
-
455
- type RnaseqGeneCount = {
456
- /** Name of the HDF5 or text file */
457
- file: string
458
- samplesFile?: string
459
- /** Storage_type for storing data (HDF5 or text). Will deprecate text files in the future */
460
- storage_type: 'text' | 'HDF5'
461
- }
462
-
463
- /** the metabolite query */
464
- export type MetaboliteIntensityQueryNative = {
465
- src: 'native' | string
466
- file: string
467
- samples?: number[]
468
- /** _metabolites,used to dynamically built cache of metabolite names to speed up search */
469
- _metabolites?: string[]
470
- get?: (param: any) => void
471
- find?: (param: string[]) => void
472
- metaboliteIntensity2bins?: { [index: string]: any }
473
- }
474
-
475
- export type MetaboliteIntensityQuery = MetaboliteIntensityQueryNative
476
-
477
- /** the geneExpression query */
478
- export type GeneExpressionQueryGdc = {
479
- src: 'gdcapi' | string
480
- geneExpression2bins?: { [index: string]: any }
481
- }
482
-
483
- export type GeneExpressionQueryNative = {
484
- src: 'native' | string
485
- file: string
486
- /** dynamically added during server launch, list of sample integer IDs from file */
487
- samples?: number[]
488
- nochr?: boolean
489
- get?: (param: any) => void
490
- /** This dictionary is used to store/cache the default bins calculated for a geneExpression term when initialized in the fillTermWrapper */
491
- geneExpression2bins?: { [index: string]: any }
492
- /** Type of data format HDF5 or bed */
493
- storage_type?: 'HDF5' | 'bed'
494
- }
495
-
496
- export type GeneExpressionQuery = GeneExpressionQueryGdc | GeneExpressionQueryNative
497
-
498
- export type SingleCellGeneExpressionNative = {
499
- src: 'native'
500
- /** path to R rds or HDF5 files, each is a gene-by-cell matrix for a sample, with ".rdx" suffix. missing files are detected and handled */
501
- folder: string
502
- /** HDF5 or RDS file, will deprecate RDS file later */
503
- storage_type: 'HDF5' | 'RDS'
504
- /** dynamically added getter */
505
- get?: (q: any) => any
506
- /** cached gene exp bins */
507
- sample2gene2expressionBins?: { [sample: string]: { [gene: string]: any } }
508
- }
509
-
510
- export type SingleCellGeneExpressionGdc = {
511
- src: 'gdcapi'
512
- }
513
-
514
- export type SingleCellSamplesNative = {
515
- src: 'native'
516
-
517
- /** logic to decide sample table columns (the one shown on singlecell app ui, displaying a table of samples with sc data)
518
- a sample table will always have a sample column, to show sample.sample value
519
- firstColumnName allow to change name of 1st column from "Sample" to different, e.g. "Case" for gdc
520
- the other two properties allow to declare additional columns to be shown in table, that are for display only
521
- when sample.experiments[] are used, a last column of experiment id will be auto added
522
- */
523
- firstColumnName?: string
524
-
525
- /** do not use for native ds! gdc-only property. kept as optional to avoid tsc err */
526
- experimentColumns?: string
527
-
528
- /** any other columns to be added to sample table. each is a term id */
529
- sampleColumns?: { termid: string }[]
530
-
531
- /** dynamically added getter */
532
- get?: (q: any) => any
533
- }
534
-
535
- export type SingleCellSamplesGdc = {
536
- src: 'gdcapi'
537
- get?: (q: any) => any
538
- /** if missing refer to the samples as 'sample', this provides override e.g. 'case' */
539
- firstColumnName?: string
540
- sampleColumns?: { termid: string }[]
541
- experimentColumns?: { label: string }[]
542
- }
543
-
544
- export type SingleCellDataGdc = {
545
- src: 'gdcapi'
546
- sameLegend: boolean
547
- get?: (q: any) => any
548
- refName: string
549
- plots: GDCSingleCellPlot[]
550
- width?: number
551
- height?: number
552
- }
553
-
554
- export type SingleCellDEgeneGdc = {
555
- src: 'gdcapi'
556
- /** Column name.
557
- 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
558
- */
559
- columnName: string
560
- }
561
-
562
- type GDCSingleCellPlot = {
563
- name: string
564
- colorColumns: ColorColumn[]
565
- coordsColumns: { x: number; y: number }
566
- /** if true the plot is shown by default. otherwise hidden */
567
- selected?: boolean
568
- }
569
-
570
- type ColorColumn = {
571
- /** 0-based column number in the tabular file */
572
- index?: number
573
- /** name of the column */
574
- name: string
575
- /** column values (categories) to color mapping */
576
- colorMap?: { [index: string]: string }
577
- }
578
-
579
- /** defines a tsne type of plot for cells from one sample */
580
- type SingleCellPlot = {
581
- /** type of the plot, e.g. tsne or umap, also display as plot name on ui */
582
- name: string
583
- /** folder in which per-sample files are stored.
584
- each file is a tabular text file with all cells (rows) from that sample.
585
- all files must have same set of columns
586
- file columns include cell types and x/y coords, as described by other parameters
587
- */
588
- folder: string
589
- /** optional suffix to locate the file for a sample, via ${folder}/${sampleName}${fileSuffix}
590
- assumes that file name always start with sample name.
591
- if not introduce filePrefix
592
- */
593
- fileSuffix?: string
594
- /** list of columns in tabular text file that define cell categories and can be used to color the cells in the plot. must have categorical values
595
- */
596
- colorColumns: ColorColumn[]
597
- /** 0-based column number for x/y coordinate for this plot */
598
- coordsColumns: { x: number; y: number }
599
- /** if true the plot is shown by default. otherwise hidden */
600
- selected?: boolean
601
- }
602
- export type SingleCellDataNative = {
603
- src: 'native'
604
- /** when a sample has multiple tsne plots, this flag allows allows all plots to share one cell type legend */
605
- sameLegend: boolean
606
- /** available tsne type of plots for each sample */
607
- plots: SingleCellPlot[]
608
- /** name of ref cells? */
609
- refName?: string
610
- /** dynamically added getter */
611
- get?: (q: any) => any
612
- /** width and height of the plots */
613
-
614
- width?: number
615
- height?: number
616
- }
617
-
618
- export type SingleCellQuery = {
619
- /** methods to identify samples with singlecell data,
620
- this data allows client-side to display a table with these samples for user to choose from
621
- also, sampleView uses this to determine if to invoke the sc plot for a sample
622
- */
623
- samples: SingleCellSamplesGdc | SingleCellSamplesNative
624
- /** defines tsne/umap type of clustering maps for each sample
625
- */
626
- data: SingleCellDataGdc | SingleCellDataNative
627
- /** defines available gene-level expression values for each cell of each sample */
628
- geneExpression?: SingleCellGeneExpressionGdc | SingleCellGeneExpressionNative
629
- /** Precomputed top differentialy expressed genes for a cell cluster, against rest of cells */
630
- DEgenes?: SingleCellDEgeneGdc
631
- }
632
-
633
- type LdQuery = {
634
- /** each track obj defines a ld track */
635
- tracks: {
636
- /** for displaying and identifying a track. must not duplicate */
637
- name: string
638
- /** relative path of ld .gz file */
639
- file: string
640
- /** dynamically added full path */
641
- file0?: string
642
- /** dynamically added */
643
- nochr?: boolean
644
- /** if to show by default */
645
- shown: boolean
646
- /** max range allowed to show data */
647
- viewrangelimit: number
648
- }[]
649
- /** color scale when LD is used to overlay on variants of a locus */
650
- overlay: {
651
- /** color for r2 value 1 */
652
- color_1: string
653
- /** Color for r2 value 0 */
654
- color_0: string
655
- }
656
- }
657
-
658
- /** one more multiple sets of genome-wide plots per sample, e.g. dna meth probe beta values. the plot has a Y axis and shows all chromosomes. each key is one set of such plot. there could be multiple sets */
659
- type SingleSampleGenomeQuantification = {
660
- [index: string]: {
661
- /** description of this data */
662
- description: string
663
- /** min value of Y axis */
664
- min: number
665
- /** max value of Y axis */
666
- max: number
667
- sample_id_key: string
668
- /** folder path of data files per sample */
669
- folder: string
670
- /** plot color for positive values */
671
- positiveColor: string
672
- /** plot color for negative values */
673
- negativeColor: string
674
- /** optionally, link the plot to singleSampleGbtk, in that clicking on the plot will luanch a detailed block view defined by singleSampleGbtk */
675
- singleSampleGbtk?: string
676
- }
677
- }
678
-
679
- /** single sample genome browser track. each key corresponds to one track. currently hardcoded to "<sampleId>.gz" bedgraph files in the folder */
680
- type SingleSampleGbtk = {
681
- [index: string]: {
682
- /** description of this data */
683
- description: string
684
- /** min value of Y axis */
685
- min: number
686
- /** max value of Y axis */
687
- max: number
688
- /** */
689
- sample_id_key: string
690
- /** folder path of data files per sample */
691
- folder: string
692
- }
693
- }
694
-
695
- type Mds3Queries = {
696
- defaultBlock2GeneMode?: boolean
697
- snvindel?: SnvIndelQuery
698
- svfusion?: SvFusion
699
- cnv?: CnvSegment
700
- singleSampleMutation?: SingleSampleMutationQuery
701
- NIdata?: NIdataQuery
702
- geneExpression?: GeneExpressionQuery
703
- rnaseqGeneCount?: RnaseqGeneCount
704
- /** Used to create the top mutated genes UI in the gene
705
- * set edit ui and data requests. */
706
- topMutatedGenes?: TopMutatedGenes
707
- /** Used to create the top variably expressed UI in the gene
708
- * set edit ui. Also used for data requests */
709
- topVariablyExpressedGenes?: TopVariablyExpressedGenesQuery
710
- metaboliteIntensity?: {
711
- src: 'native' | 'gdc'
712
- file: string
713
- }
714
- trackLst?: TrackLstEntry[]
715
- singleCell?: SingleCellQuery
716
- geneCnv?: {
717
- bygene?: {
718
- gdcapi: true
719
- }
720
- }
721
- defaultCoord?: string
722
- ld?: LdQuery
723
- singleSampleGenomeQuantification?: SingleSampleGenomeQuantification
724
- singleSampleGbtk?: SingleSampleGbtk
725
- /** depreciated. replaced by WSImages */
726
- DZImages?: DZImages
727
- WSImages?: WSImages
728
- images?: Images
729
- }
730
-
731
- /** non-zoom small images
732
- iamge file to sample mapping is stored in images table
733
- */
734
- type Images = {
735
- /** folder where the per-sample image files are stored */
736
- folder: string
737
- }
738
-
739
- /** Depreciated. deep zoom image shown via openseadragon, with precomputed tiles.
740
- * this is replaced by WSImages and should not be used anymore */
741
- export type DZImages = {
742
- // type of the image, e.g. H&E
743
- type: string
744
- // path to the folder where sample images are stored
745
- imageBySampleFolder: string
746
- }
747
-
748
- /** deep zoom image shown via tiatoolbox, covers any big image files including whole-slide image.
749
- image file to sample mapping is stored in wsimages table
750
- */
751
- export type WSImages = {
752
- // type of the image, e.g. H&E
753
- type: string
754
- // path to the folder where sample images are stored
755
- imageBySampleFolder: string
756
- // TODO extend to support multiple sources
757
- //sources?: []
758
- }
759
-
760
- /*** types supporting Termdb ***/
761
-
762
- type TermIds = {
763
- [index: string]: string
764
- }
765
-
766
- type SelectCohortValuesEntry = {
767
- keys: string[]
768
- label: string
769
- shortLabel: string
770
- isdefault?: boolean
771
- note?: string
772
- }
773
-
774
- export type SelectCohortEntry = {
775
- term: { id: string; type: string }
776
- /** Title above the cohort introduction/content in the about tab */
777
- title?: string
778
- /** Text above radio cohort options in the about tab. */
779
- prompt: string
780
- values: SelectCohortValuesEntry[]
781
- description?: string
782
- /* If the description is dependent on the user pass a descriptionByUser dict instead */
783
- descriptionByUser?: { [index: string]: string }
784
- /** subtext shown at the very bottom of the cohort/about tab subheader */
785
- asterisk?: string
786
- //The profile has clearOnChange. The terms used in the plots are not always the same for the profile.
787
- //Therefore when switching cohorts, it is necessary to delete the plots opened and the global filter
788
- clearOnChange?: { [index: string]: boolean }
789
- }
790
-
791
- type MissingAccess = {
792
- message: string
793
- links: { [index: string]: string }
794
- }
795
-
796
- type DataDownloadCatch = {
797
- helpLink: string
798
- missingAccess: MissingAccess
799
- jwt: { [index: string]: string }
800
- }
801
-
802
- //Plots
803
-
804
- type ScatterPlotsEntry = {
805
- name: string
806
- dimension: number
807
- file: string
808
- coordsColumns?: { x: number; y: number; z?: number }
809
- settings?: { [index: string]: any }
810
- /** by default the dots are called "samples" on the plot, use this to call it by diff name e.g. "cells" */
811
- sampleType?: string
812
- /** a plot can be colored by either a dict term termsetting (colorTW) or file column values (colorColumn) */
813
- colorTW?: { id: string }
814
- colorColumn?: ColorColumn
815
- /** provide a sampletype term to filter for specific type of samples for subjects with multiple samples and show in the plot.
816
- e.g. to only show D samples from all patients
817
- this is limited to only one term and doesn't allow switching between multiple terms
818
- */
819
- sampleCategory?: {
820
- /** categorical term like "sampleType" which describes types of multiple samples from the same subject */
821
- tw: { id: string }
822
- /** default category */
823
- defaultValue: string
824
- /** order of categories */
825
- order: string[]
826
- }
827
- }
828
-
829
- type Scatterplots = {
830
- plots: ScatterPlotsEntry[]
831
- }
832
-
833
- type MatrixSettingsControlLabels = {
834
- samples?: string
835
- sample?: string
836
- Samples?: string
837
- Sample?: string
838
- Mutations?: string
839
- Mutation?: string
840
- }
841
-
842
- type SurvPlotsEntry = {
843
- name: string
844
- serialtimekey: string
845
- iscensoredkey: string
846
- timelabel: string
847
- }
848
-
849
- type SurvPlots = {
850
- [index: string]: SurvPlotsEntry
851
- }
852
-
853
- type sampleGroupAttrLstEntry = { key: string }
854
-
855
- type SurvivalPlot = {
856
- plots: SurvPlots
857
- samplegroupattrlst: sampleGroupAttrLstEntry[]
858
- }
859
-
860
- type TieBreakerFilterValuesEntry = {
861
- dt: number
862
- }
863
-
864
- type TieBreakerFilter = {
865
- values: TieBreakerFilterValuesEntry[]
866
- }
867
-
868
- type TieBreakersEntry = {
869
- by: string
870
- order?: (string | number)[]
871
- filter?: TieBreakerFilter
872
- }
873
-
874
- type SortPriorityEntry = {
875
- types: string[]
876
- tiebreakers: TieBreakersEntry[]
877
- }
878
-
879
- type SurvivalSettings = {
880
- /** The max time-to-event to be displayed in plot, hide all the samples with Time-to-Event longer than this maxTimeToEvent */
881
- maxTimeToEvent?: number
882
- }
883
-
884
- type MatrixSettings = {
885
- maxSample?: number
886
- svgCanvasSwitch?: number
887
- cellEncoding?: string
888
- cellbg?: string
889
- controlLabels?: MatrixSettingsControlLabels
890
- sortSamplesBy?: string
891
- sortPriority?: SortPriorityEntry[]
892
- ignoreCnvValues?: boolean
893
- geneVariantCountSamplesSkipMclass?: string[]
894
- /** all the truncating mutations exist in the dataset */
895
- truncatingMutations?: string[]
896
- /** all the protein-changing mutations mutations exist in the dataset */
897
- proteinChangingMutations?: string[]
898
- /** all the mutation classes exist in the dataset */
899
- mutationClasses?: string[]
900
- /** all the CNV classes exist in the dataset */
901
- CNVClasses?: string[]
902
- /** all the synonymous mutations exist in the dataset */
903
- synonymousMutations?: string[]
904
- showHints?: string[]
905
- displayDictRowWithNoValues?: boolean
906
- /** allow to add two buttons (CNV and mutation) to control panel for selecting
907
- * mclasses displayed on oncoMatrix */
908
- addMutationCNVButtons?: boolean
909
- /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
910
- * tb.filter?.values[0]?.dt === 1) ... */
911
- sortByMutation?: string
912
- /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
913
- * tb.filter?.values[0]?.dt === 4).isOrdered */
914
- sortByCNV?: boolean
915
- cnvUnit?: 'log2ratio' | 'segmedian'
916
- }
917
-
918
- type NumericDictTermClusterSettings = {
919
- /** default hiercluster group name */
920
- termGroupName?: string
921
- }
922
-
923
- type Matrix = {
924
- /** alternative name, e.g. the plot is called "oncomatrix" in gdc; by default it's called "matrix" */
925
- appName?: string
926
- /** default settings for matrix plot */
927
- settings?: MatrixSettings
928
- /** matrix-specific mclass override? */
929
- mclass?: Mclass
930
- // TODO: improve definitions below
931
- legendGrpFilter?: any
932
- legendValueFilter?: any
933
- }
934
-
935
- type NumericDictTermCluster = {
936
- /** alternative name, e.g. the plot is called "drug sensitivity" in ALL-pharmacotyping; by default it's called "Numeric Dictionary Term cluster" */
937
- appName?: string
938
- /** default settings for numericDictTermCluster plot */
939
- settings?: NumericDictTermClusterSettings
940
- /** list of numeric term ids that will be excluded from the numeric dictionary term cluster, add to usecase.detail to exclude terms*/
941
- exclude?: string[]
942
- }
943
-
944
- type Survival = {
945
- /** default settings for survival plot */
946
- settings?: SurvivalSettings
947
- }
948
-
949
- type MatrixPlotsEntry = {
950
- name: string
951
- file: string
952
- settings?: {
953
- [key: string]: any
954
- }
955
- getConfig?: (f: any) => void
956
- }
957
-
958
- type MatrixPlots = {
959
- plots: MatrixPlotsEntry[]
960
- }
961
-
962
- type AllowCaseDetails = {
963
- sample_id_key: string
964
- terms: string[]
965
- }
966
-
967
- type MultipleTestingCorrection = {
968
- method: string
969
- skipLowSampleSize: boolean
970
- }
971
-
972
- type TvsTerm = {
973
- id: string
974
- type: string
975
- name: string
976
- }
977
-
978
- type TvsValues = {
979
- key?: string
980
- label: string
981
- }
982
-
983
- type Tvs = {
984
- term: TvsTerm
985
- values: TvsValues[]
986
- }
987
-
988
- type RestrictAncestriesEntry = {
989
- name: string
990
- tvs: Tvs
991
- PCcount: number
992
-
993
- // TODO declare that either PCTermId or PCBySubcohort is required
994
- PCTermId?: string
995
- PCBySubcohort?: {
996
- [subcohortId: string]: any
997
- }
998
- }
999
-
1000
- /*
1001
- base type for deriving new types with new attributes
1002
-
1003
- */
1004
- type UrlTemplateBase = {
1005
- /** must end with '/' */
1006
- base: string
1007
- namekey: string
1008
- defaultText?: string
1009
- }
1010
- export type UrlTemplateSsm = UrlTemplateBase & {
1011
- /** to create separate link, but not directly on chr.pos.ref.alt string.
1012
- name of link is determined by either namekey or linkText. former allows to retrieve a name per m that's different from chr.pos.xx */
1013
- shownSeparately?: boolean
1014
- /** optional name of link, if set, same name will be used for all links. e.g. "ClinVar".
1015
- if missing, name is value of m[url.namekey], as used in url itself (e.g. snp rsid) */
1016
- linkText?: string
1017
- }
1018
-
1019
- /*** type of ds.cohort.termdb{} ***/
1020
- type Termdb = {
1021
- /** Terms */
1022
- termIds?: TermIds
1023
- /** if true, backend is allowed to send sample names to client in charts */
1024
- displaySampleIds?: boolean
1025
- converSampleIds?: boolean
1026
- allowedTermTypes?: string[]
1027
- alwaysShowBranchTerms?: boolean
1028
- minimumSampleAllowed4filter?: number
1029
- minTimeSinceDx?: number
1030
- timeUnit?: string
1031
- ageEndOffset?: number
1032
- cohortStartTimeMsg?: string
1033
- alwaysRefillCategoricalTermValues?: boolean
1034
- restrictAncestries?: RestrictAncestriesEntry[]
1035
- /** Cohort specific */
1036
- selectCohort?: SelectCohortEntry
1037
-
1038
- /** quick fix to convert category values from a term to lower cases for comparison (case insensitive comparison)
1039
- for gdc, graphql and rest apis return case-mismatching strings for the same category e.g. "Breast/breast"
1040
- keep this setting here for reason of:
1041
- - in mds3.gdc.js, when received all-lowercase values from graphql, it's hard to convert them to Title case for comparison
1042
- - mds3.variant2samples consider this setting, allows to handle other datasets of same issue
1043
- */
1044
- useLower?: boolean
1045
-
1046
- scatterplots?: Scatterplots
1047
- matrix?: Matrix
1048
- numericDictTermCluster?: NumericDictTermCluster
1049
- survival?: Survival
1050
- logscaleBase2?: boolean
1051
- plotConfigByCohort?: PlotConfigByCohort
1052
- /** Functionality */
1053
- dataDownloadCatch?: DataDownloadCatch
1054
- helpPages?: URLEntry[]
1055
- multipleTestingCorrection?: MultipleTestingCorrection
1056
- /** regression settings for neuro-oncology portals:
1057
- - no interaction terms
1058
- - report event counts of cox coefficients
1059
- - hide type III stats and miscellaneous statistical tests */
1060
- neuroOncRegression?: boolean
1061
- urlTemplates?: {
1062
- /** gene link definition */
1063
- gene?: UrlTemplateBase
1064
- /** sample link definition */
1065
- sample?: UrlTemplateBase
1066
- /** ssm link definition */
1067
- ssm?: UrlTemplateSsm | UrlTemplateSsm[]
1068
- }
1069
-
1070
- q?: {
1071
- getSupportedChartTypes: (a: any) => any
1072
- }
1073
- termMatch2geneSet?: any
1074
- mclass?: Mclass
1075
- lollipop?: any
1076
- hasAncestry?: boolean
1077
-
1078
- //GDC
1079
- termid2totalsize2?: GdcApi
1080
- dictionary?: GdcApi
1081
- allowCaseDetails?: AllowCaseDetails
1082
- isGeneSetTermdb?: boolean
1083
- /** Searches the genedb alias list to return the genecode ID */
1084
- getGeneAlias?: (q: any, tw: any) => { gencodeId: any }
1085
- convertSampleId?: GdcApi
1086
- hierCluster?: any
1087
-
1088
- /** ds customization of rules in TermTypeSelect on what term type to exclude for a usecase.
1089
- used by gdc in that gene exp cannot be used for filtering
1090
- note this applies to left-side term type tabs, but not terms in dict tree. latter is controlled by excludeTermtypeByTarget
1091
- */
1092
- useCasesExcluded?: {
1093
- /** key is target name (todo restrict values), value is array of 1 or more term
1094
- * types (todo restrict values) */
1095
- [useCaseTarget: string]: string[]
1096
- }
1097
- /** ds customization to rules in isUsableTerm(). this applies to what's showing in dict tree
1098
- */
1099
- excludedTermtypeByTarget?: {
1100
- /** key is usecase target (todo restrict). value is array of term type (todo restrict) */
1101
- [useCaseTarget: string]: string[]
1102
- }
1103
- /** in development!
1104
- * Supports the About tab in mass UI
1105
- */
1106
- hasSampleAncestry?: boolean
1107
- sampleTypes?: SampleType[]
1108
-
1109
- tracks?: {
1110
- /** allow color or shape changes in the lollipop */
1111
- allowSkewerChanges: boolean
1112
- }
1113
- }
1114
-
1115
- type SampleType = {
1116
- name: string
1117
- plural_name: string
1118
- parent_id: string
1119
- }
1120
-
1121
- /** predefined configuration objects per subcohort per plot type */
1122
- type PlotConfigByCohort = {
1123
- /** key is subcohort string */
1124
- [index: string]: {
1125
- /** key is plot type as in mass/charts.js */
1126
- [key: string]: object
1127
- }
1128
- }
1129
-
1130
- /** modified version of termwrapper*/
1131
- type Tw = {
1132
- id: string
1133
- q: unknown
1134
- baseURL?: string //Only appears as a quick fix in SAMD9-SAMD9L.hg19?
1135
- }
1136
-
1137
- type Variant2Samples = GdcApi & {
1138
- variantkey: string
1139
- twLst?: Tw[]
1140
- sunburst_twLst?: Tw[]
1141
- }
1142
-
1143
- type MutationSet = {
1144
- snvindel: string
1145
- cnv: string
1146
- fusion: string
1147
- }
1148
-
1149
- type BaseDtEntry = {
1150
- term_id: string
1151
- yes: { value: string[] }
1152
- no: { value: string[] }
1153
- label?: string
1154
- }
1155
-
1156
- type SNVByOrigin = {
1157
- [index: string]: BaseDtEntry
1158
- }
1159
-
1160
- type DtEntrySNV = {
1161
- byOrigin: SNVByOrigin
1162
- }
1163
-
1164
- type ByDt = {
1165
- /** SNVs differentiate by sample origin. Non-SNV, no differentiation*/
1166
- [index: number]: DtEntrySNV | BaseDtEntry
1167
- }
1168
-
1169
- type AssayValuesEntry = {
1170
- [index: string]: { label: string; color: string }
1171
- }
1172
-
1173
- type AssaysEntry = {
1174
- id: string
1175
- name: string
1176
- type: string
1177
- values?: AssayValuesEntry
1178
- }
1179
-
1180
- type AssayAvailability = {
1181
- byDt?: ByDt
1182
- file?: string
1183
- assays?: AssaysEntry[]
1184
- }
1185
-
1186
- //Shared with genome.ts
1187
- export type Cohort = {
1188
- allowedChartTypes?: string[]
1189
- cumburden?: {
1190
- files: {
1191
- fit: string
1192
- surv: string
1193
- sample: string
1194
- }
1195
- }
1196
- db: FileObj
1197
- /** customize the default chart to open on mass ui when there's no charts. if
1198
- * missing it opens dictionary ui */
1199
- defaultChartType?: string
1200
- hiddenChartTypes?: string[]
1201
- massNav?: MassNav
1202
- matrixplots?: MatrixPlots
1203
- mutationset?: MutationSet[]
1204
- renamedChartTypes?: { singleCellPlot?: string; sampleScatter?: string }
1205
- scatterplots?: Scatterplots
1206
- termdb: Termdb
1207
- }
1208
-
1209
- /** Customizations specific to the mass nav component */
1210
- type MassNav = {
1211
- /** optional title of this ds, if missing use ds.label. shown on mass nav header.
1212
- * use blank string to not to show a label*/
1213
- title?: Title
1214
- /** Customization for the tabs*/
1215
- tabs?: {
1216
- /** about, charts, groups, and fitler */
1217
- [index: string]: {
1218
- /** show in a specific order of tabs */
1219
- order?: number
1220
- /** label appearing in the top row in upper case */
1221
- top?: string
1222
- /** biggest label appearing in the middle row in upper case */
1223
- mid?: string
1224
- /** label appearing in the bottom row*/
1225
- btm?: string
1226
- /** if true, does not show the tab */
1227
- hide?: boolean
1228
- /** html code, specifically for the about tab
1229
- * maybe used for other tabs as well.
1230
- */
1231
- html?: string
1232
- }
1233
- }
1234
- }
1235
-
1236
- type Title = {
1237
- text: string
1238
- link?: string
1239
- }
1240
- /*** types supporting MdsCohort type ***/
1241
- type SampleAttribute = {
1242
- attributes: Attributes
1243
- }
1244
-
1245
- type HierarchiesLstEntry = {
1246
- name: string
1247
- levels: KeyLabelFull[]
1248
- }
1249
-
1250
- type Hierarchies = {
1251
- lst: HierarchiesLstEntry[]
1252
- }
1253
-
1254
- type SetSamples = {
1255
- file: string
1256
- valuename: string
1257
- skipzero: boolean
1258
- }
1259
-
1260
- type SetSignatures = {
1261
- [index: number]: { name: string; color: string }
1262
- }
1263
-
1264
- type MutSigSets = {
1265
- [index: string]: {
1266
- name: string
1267
- samples: SetSamples
1268
- signatures: SetSignatures
1269
- }
1270
- }
1271
-
1272
- type MutationSignature = {
1273
- sets: MutSigSets
1274
- }
1275
-
1276
- type MdsCohort = {
1277
- //Does not apply to Mds3 or genomes!
1278
- files: FileObj[]
1279
- samplenamekey: string
1280
- tohash: (item: any, ds: any) => void //Fix later
1281
- sampleAttribute?: SampleAttribute
1282
- hierarchies?: Hierarchies
1283
- survivalplot?: SurvivalPlot
1284
- mutation_signature?: MutationSignature
1285
- //scatterplot - skipping b/c codes to the old scatterplot, not mass
1286
- }
1287
-
1288
- /*** types supporting MdsQueries type ***/
1289
- type BaseTrack = {
1290
- name?: string
1291
- istrack?: boolean
1292
- type?: string
1293
- file?: string
1294
- hideforthemoment?: number
1295
- viewrangeupperlimit?: number
1296
- }
1297
-
1298
- type LegendVOrigin = {
1299
- key: string
1300
- somatic: string
1301
- germline: string
1302
- }
1303
-
1304
- type GroupSampleByAttr = {
1305
- attrlst: KeyLabelFull[]
1306
- sortgroupby?: {
1307
- key: string
1308
- order: string[]
1309
- }
1310
- attrnamespacer?: string
1311
- }
1312
-
1313
- type Svcnv = BaseTrack & {
1314
- valueCutoff: number
1315
- bplengthUpperLimit: number
1316
- segmeanValueCutoff?: number
1317
- no_loh?: number
1318
- lohLengthUpperLimit?: number
1319
- hideLOHwithCNVoverlap?: boolean
1320
- vcf_querykey?: string
1321
- expressionrank_querykey?: string
1322
- multihidelabel_vcf: boolean
1323
- multihidelabel_fusion?: boolean
1324
- multihidelabel_sv: boolean
1325
- legend_vorigin?: LegendVOrigin
1326
- groupsamplebyattr?: GroupSampleByAttr
1327
- }
1328
-
1329
- type KeyLabelFull = {
1330
- /* Used in:
1331
- queries.genefpkm.boxplotbysamplegroup.attributes
1332
- cohort.hierarchies.lst[i].levels
1333
- */
1334
- k: string
1335
- label: string
1336
- full?: string
1337
- }
1338
-
1339
- type ASE = {
1340
- qvalue: number
1341
- meandelta_monoallelic: number
1342
- asemarkernumber_biallelic: number
1343
- color_noinfo: string
1344
- color_notsure: string
1345
- color_biallelic: string
1346
- color_monoallelic: string
1347
- }
1348
-
1349
- type GeneFpkmOutlier = {
1350
- pvalue: number
1351
- color: string
1352
- }
1353
-
1354
- type BoxPlotAdditionalsEntry = {
1355
- label: string
1356
- attributes: KeyVal[]
1357
- }
1358
-
1359
- type BoxPlotBySampleGroup = {
1360
- attributes: KeyLabelFull[]
1361
- additionals?: BoxPlotAdditionalsEntry[]
1362
- }
1363
-
1364
- type Fpkm = BaseTrack & {
1365
- datatype: string
1366
- itemcolor: string
1367
- }
1368
-
1369
- type GeneFpkm = Fpkm & {
1370
- isgenenumeric: boolean
1371
- boxplotbysamplegroup?: BoxPlotBySampleGroup
1372
- ase?: ASE
1373
- outlier?: GeneFpkmOutlier
1374
- }
1375
-
1376
- type CutoffValueLstEntry = {
1377
- /** '<' or '>' to add to the label */
1378
- side: string
1379
- value: number
1380
- label: string
1381
- }
1382
-
1383
- type ValuePerSample = KeyLabel & {
1384
- cutoffValueLst: CutoffValueLstEntry[]
1385
- }
1386
-
1387
- type InfoFilterCatEntry = {
1388
- label: string
1389
- color: string
1390
- valuePerSample?: ValuePerSample
1391
- }
1392
-
1393
- type InfoFilterCat = {
1394
- [index: string]: InfoFilterCatEntry
1395
- }
1396
-
1397
- type InfoFilterLstEntry = KeyLabel & {
1398
- categories: InfoFilterCat
1399
- hiddenCategories: { Unannotated: number }
1400
- }
1401
-
1402
- type InfoFilter = {
1403
- lst: InfoFilterLstEntry[]
1404
- }
1405
-
1406
- type ReadCountBoxPlotPerCohort = {
1407
- groups: KeyLabel[]
1408
- }
1409
-
1410
- type SingleJunctionSummary = {
1411
- readcountboxplotpercohort: ReadCountBoxPlotPerCohort
1412
- }
1413
-
1414
- type Junction = BaseTrack & {
1415
- readcountCutoff: number
1416
- infoFilter: InfoFilter
1417
- singlejunctionsummary: SingleJunctionSummary
1418
- }
1419
-
1420
- type MdsSnvindel = BaseTrack & {
1421
- tracks: BaseTrack[]
1422
- singlesamples?: {
1423
- tablefile: string
1424
- }
1425
- }
1426
-
1427
- type SomaticCnv = BaseTrack & {
1428
- valueLabel: string
1429
- valueCutoff: number
1430
- bplengthUpperLimit: number
1431
- }
1432
-
1433
- type Vcf = BaseTrack & {
1434
- tracks: BaseTrack[]
1435
- }
1436
-
1437
- type MdsQueries = {
1438
- svcnv?: Svcnv
1439
- genefpkm?: GeneFpkm
1440
- junction?: Junction
1441
- snvindel?: MdsSnvindel
1442
- somaticcnv?: SomaticCnv
1443
- vcf?: Vcf
1444
- fpkm?: Fpkm
1445
- }
1446
-
1447
- type AttrValues = {
1448
- [index: string]: {
1449
- name?: string
1450
- label?: string
1451
- color?: string
1452
- }
1453
- }
1454
-
1455
- type AttributesEntry = {
1456
- label: string
1457
- values?: AttrValues
1458
- hidden?: number
1459
- filter?: number
1460
- appendto_link?: string
1461
- isfloat?: number | boolean
1462
- isinteger?: number | boolean
1463
- clientnoshow?: number
1464
- showintrack?: boolean
1465
- }
1466
-
1467
- type Attributes = {
1468
- [index: string]: AttributesEntry
1469
- }
1470
-
1471
- type MutationAttribute = {
1472
- attributes: Attributes
1473
- }
1474
-
1475
- type MutationTypesEntry = {
1476
- db_col: string
1477
- label?: string
1478
- default: number
1479
- sizecutoff?: string
1480
- log2cutoff?: number
1481
- }
1482
-
1483
- type Gene2MutCount = {
1484
- dbfile: string
1485
- mutationTypes: MutationTypesEntry[]
1486
- }
1487
-
1488
- type LocusAttribute = {
1489
- attributes: Attributes
1490
- }
1491
-
1492
- type ViewMode = {
1493
- byAttribute?: string
1494
- byInfo?: string
1495
- inuse?: boolean
1496
- }
1497
-
1498
- /*** types supporting Mds Dataset types ***/
1499
- type BaseMds = {
1500
- genome?: string //Not declared in TermdbTest
1501
- assayAvailability?: AssayAvailability
1502
- }
1503
-
1504
- export type Mds = BaseMds & {
1505
- isMds: boolean
1506
- about?: KeyVal[]
1507
- sampleAssayTrack?: FileObj
1508
- singlesamplemutationjson?: FileObj
1509
- cohort?: MdsCohort
1510
- queries?: MdsQueries
1511
- mutationAttribute?: MutationAttribute
1512
- dbFile?: string
1513
- version?: { label: string; link: string }
1514
- gene2mutcount?: Gene2MutCount
1515
- locusAttribute?: LocusAttribute
1516
- alleleAttribute?: {
1517
- attributes: {
1518
- [attrName: string]: {
1519
- label: string
1520
- isnumeric: number
1521
- filter: number
1522
- }
1523
- }
1524
- }
1525
- }
1526
-
1527
- type PreInitStatus = {
1528
- status: string
1529
- message?: string
1530
- [props: string]: any
1531
- }
1532
-
1533
- export type PreInit = {
1534
- getStatus: () => Promise<PreInitStatus>
1535
- retryDelay?: number
1536
- retryMax?: number
1537
- errorCallback?: (response: PreInitStatus) => void
1538
- test?: {
1539
- numCalls: number
1540
- minor: number
1541
- mayEditResponse: (response: any) => any
1542
- }
1543
- }
1544
-
1545
- export type Mds3 = BaseMds & {
1546
- label?: Title
1547
- isMds3: boolean
1548
- loadWithoutBlocking?: boolean
1549
- preInit?: PreInit
1550
- initErrorCallback?: (a: any) => void
1551
- viewModes?: ViewMode[]
1552
- dsinfo?: KeyVal[]
1553
- queries?: Mds3Queries
1554
- cohort?: Cohort
1555
- // TODO: termdb should be nested under cohort
1556
- termdb?: Termdb
1557
- validate_filter0?: (f: any) => void
1558
- ssm2canonicalisoform?: GdcApi
1559
- variant2samples?: Variant2Samples
1560
- // !!! TODO: improve these type definitions below !!!
1561
- getHostHeaders?: (q?: any) => any
1562
- serverconfigFeatures?: any
1563
- customTwQByType?: {
1564
- [termType: string]: {
1565
- [key: string]: any
1566
- }
1567
- }
1568
- getHealth?: (ds: any) => {
1569
- [key: string]: any
1570
- }
1571
- }
1572
-
1573
- export type Mds3WithCohort = Mds3 & {
1574
- cohort: Cohort
1575
- }