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