@sjcrh/proteinpaint-types 2.80.0 → 2.81.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.80.0",
3
+ "version": "2.81.5",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -17,26 +17,40 @@ type KeyLabel = {
17
17
 
18
18
  /** a set of categories about a vcf INFO field */
19
19
  export type InfoFieldCategories = {
20
+ /** category key from an INFO field of a vcf file */
20
21
  [index: string]: {
22
+ /** Color used for rendering labels and backgrounds in the legend, tables, etc. */
21
23
  color: string
24
+ /** Human readable label */
22
25
  label?: string
26
+ /** Shown in the legend on label click */
23
27
  desc: string
28
+ /** When .color is used as the background, denoted whether
29
+ * to use 'white', 'black', or other color for the text */
24
30
  textcolor?: string
25
- name?: string
26
31
  }
27
32
  }
28
33
 
29
34
  type NumericFilterEntry = {
35
+ /** '<' or '>' for filtering */
30
36
  side: string
37
+ /** value for filtering */
31
38
  value: number
32
39
  }
33
40
 
34
41
  type AFEntry = {
42
+ /** human readable label */
35
43
  name: string
36
- locusinfo: { key: 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 */
37
50
  numericfilter: NumericFilterEntry[]
38
51
  }
39
52
 
53
+ /** Specific allele freq info for ClinVar */
40
54
  export type ClinvarAF = {
41
55
  [index: string]: AFEntry
42
56
  }
@@ -44,25 +58,37 @@ export type ClinvarAF = {
44
58
  /*** types supporting Queries type ***/
45
59
 
46
60
  type InfoFieldEntry = {
61
+ /** Human readable name to display */
47
62
  name: string
63
+ /** vcf INFO field */
48
64
  key: string
65
+ /** a set of categories about a vcf INFO field */
49
66
  categories?: InfoFieldCategories
67
+ /** seperator (e.g. '&', '|' ) between join values */
50
68
  separator?: string
51
69
  }
52
70
 
53
71
  /*
54
72
  type GenomicPositionEntry = {
55
- chr: string
56
- start: number
57
- stop: number
73
+ chr: string
74
+ start: number
75
+ stop: number
58
76
  }
59
77
  */
60
78
 
61
- type Chr2bcffile = { [index: string]: string }
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
+
62
85
  type bcfMafFile = {
63
86
  /** bcf file for only variants, no samples and FORMAT */
64
87
  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>) */
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>) */
66
92
  maffile: string
67
93
  }
68
94
 
@@ -84,11 +110,8 @@ type SnvindelByRange = {
84
110
  tempflag_sampleNameInVcfHeader?: boolean
85
111
  }
86
112
 
87
- type SvfusionByRange = {
88
- file?: string
89
- }
90
-
91
113
  type URLEntry = {
114
+ /** base URL, including the host and possibly other queries */
92
115
  base?: string
93
116
  key?: string
94
117
  namekey?: string
@@ -97,29 +120,33 @@ type URLEntry = {
97
120
  }
98
121
 
99
122
  type SkewerRim = {
123
+ /** only enabled for 'format' */
100
124
  type: string
125
+ /** 'origin' */
101
126
  formatKey: string
127
+ /** 'somatic' or 'germline', generally germline */
102
128
  rim1value: string
129
+ /** 'somatic' or 'germline', generally somatic */
103
130
  noRimValue: string
104
131
  }
105
132
 
106
133
  type GdcApi = {
134
+ /** Represents the configuration for accessing the GDC API. */
107
135
  gdcapi?: boolean
108
136
  }
109
137
 
110
- type M2Csq = GdcApi & {
111
- by: string
112
- }
113
-
114
- type SnvIndelFormatEntry = {
115
- ID: string
116
- Description: string
117
- Number: string | number
118
- Type: string
119
- }
120
-
121
138
  type SnvIndelFormat = {
122
- [index: string]: SnvIndelFormatEntry
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
+ }
123
150
  }
124
151
 
125
152
  type FilterValues = {
@@ -229,13 +256,12 @@ type SnvIndelQuery = {
229
256
  infoUrl?: URLEntry[]
230
257
  skewerRim?: SkewerRim
231
258
  format4filters?: string[]
232
- m2csp?: M2Csq
233
259
  format?: SnvIndelFormat
234
260
  variant_filter?: VariantFilter
235
261
  populations?: Population[]
236
262
  /** NOTE **
237
- this definition can appear either in queries.snvindel{} or termdb{}
238
- so that it can work for a termdb-less ds, e.g. clinvar, where termdbConfig cannot be made */
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 */
239
265
  ssmUrl?: UrlTemplateSsm
240
266
  m2csq?: {
241
267
  gdcapi?: boolean
@@ -247,27 +273,37 @@ type SnvIndelQuery = {
247
273
  }
248
274
 
249
275
  type SvFusion = {
250
- byrange: SvfusionByRange
276
+ byrange: {
277
+ /** file paths for sv fusion data */
278
+ file?: string
279
+ }
251
280
  }
252
281
 
253
282
  type SingleSampleMutationQuery = {
254
283
  src: 'native' | 'gdcapi' | string
255
- /** which property of client mutation object to retrieve sample identifier for querying single sample data with */
284
+ /** which property of client mutation object to retrieve sample identifier for
285
+ * querying single sample data with */
256
286
  sample_id_key: string
257
287
  /** only required for src=native */
258
288
  folder?: string
259
- /** quick fix to hide chrM from disco, due to reason e.g. this dataset doesn't have data on chrM */
289
+ /** quick fix to hide chrM from disco, due to reason e.g. this dataset doesn't
290
+ * have data on chrM */
260
291
  discoSkipChrM?: true
261
292
  }
262
293
 
263
294
  type NIdataQuery = {
295
+ /** Reference obj for NI data query. */
264
296
  Ref1: NIdataQueryRef
265
297
  }
266
298
 
267
299
  type NIdataQueryRef = {
300
+ /** file path for the reference file */
268
301
  referenceFile: string
302
+ /** file path for the sample file */
269
303
  samples: string
304
+ /** Parameters for slice indices in the mass brain imaging plot */
270
305
  parameters?: NIdataQueryRefParams
306
+ /** optional terms to show as table columns and annotate samples */
271
307
  sampleColumns?: { termid: string }[]
272
308
  }
273
309
 
@@ -297,7 +333,14 @@ export type GeneArgumentEntry = {
297
333
  /** value of the input or checkbox
298
334
  * required if type is string. Otherwise, optional
299
335
  */
300
- value?: string | boolean | number | { type: string; value: string[] | null }
336
+ value?:
337
+ | string
338
+ | boolean
339
+ | number
340
+ | {
341
+ type: string
342
+ value: string[] | null
343
+ }
301
344
  options?: {
302
345
  /** Type of dom element to render underneath the radio
303
346
  * 'text': creates a text area input
@@ -317,57 +360,81 @@ export type GeneArgumentEntry = {
317
360
  }
318
361
 
319
362
  type TopVariablyExpressedGenesQuery = {
363
+ /** Denotes either gdc specific data requests or common
364
+ * data request processing */
320
365
  src: 'gdcapi' | 'native' | string
366
+ /** Specifies the dom element rendered in the menu */
321
367
  arguments?: GeneArgumentEntry[]
322
368
  }
323
369
 
324
370
  type TopMutatedGenes = {
371
+ /** Specifies the dom element rendered in the menu */
325
372
  arguments?: GeneArgumentEntry[]
326
373
  }
327
374
 
328
375
  type TklstEntry = {
376
+ /** Determines the column to add the track via the assay names
377
+ * shown at the top of the facet table.*/
329
378
  assay?: string
379
+ /** track type (e.g. bigwig, bedj, etc.) */
330
380
  type: string
381
+ /** Human readable name */
331
382
  name: string
332
- sample?: string
383
+ /** Corresponding sample id in the data file */
384
+ sampleID?: string
385
+ /** data file path */
333
386
  file: string
387
+ /** The key for the second tier of the facet table*/
334
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 */
335
392
  defaultShown?: boolean
393
+ /** Track height */
336
394
  stackheight?: number
395
+ /** Space added to the height of the track */
337
396
  stackspace?: number
397
+ /** padding-top for the track */
338
398
  toppad?: number
399
+ /** padding-bottom for the track */
339
400
  bottompad?: number
340
- onerow?: number // should be boolean???
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
341
404
  }
342
405
 
343
406
  type TrackLstEntry = {
407
+ /** creates a facet table if true. */
344
408
  isfacet: boolean
409
+ /** name shown for the facet table button from Tracks button*/
345
410
  name: string
411
+ /** tk objs to show on click of the facet table */
346
412
  tklst: TklstEntry[]
347
413
  }
348
414
 
349
415
  type CnvSegment = {
350
416
  byrange: CnvSegmentByRange
351
417
  /****** rendering parameters ****
352
- not used as query parameter to filter segments
353
- value range for color scaling. default to 5. cnv segment value>this will use solid color
354
- */
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
+ */
355
421
  absoluteValueRenderMax?: number
356
422
  gainColor?: string
357
423
  lossColor?: string
358
424
 
359
425
  /*** filtering parameters ***
360
- default max length setting to restrict to focal events; if missing show all */
426
+ default max length setting to restrict to focal events; if missing show all */
361
427
  cnvMaxLength?: number
362
428
 
363
429
  /** TODO define value type, if logratio, or copy number */
364
430
 
365
431
  /** following two cutoffs only apply to log ratio, cnv gain value is positive, cnv loss value is negative
366
- if cnv is gain, skip if value<this cutoff */
432
+ if cnv is gain, skip if value<this cutoff */
367
433
  cnvGainCutoff?: number
368
434
  /** if cnv is loss, skip if value>this cutoff */
369
435
  cnvLossCutoff?: number
370
436
  }
437
+
371
438
  type CnvSegmentByRange = {
372
439
  src: 'native' | 'gdcapi' | string
373
440
  /** only for src=native */
@@ -381,13 +448,16 @@ for a given region, the median signal from probes in the region is used to make
381
448
  this is alternative to CnvSegment
382
449
 
383
450
  type Probe2Cnv = {
384
- file: string
451
+ file: string
385
452
  }
386
453
  */
387
454
 
388
455
  type RnaseqGeneCount = {
456
+ /** Name of the HDF5 or text file */
389
457
  file: string
390
458
  samplesFile?: string
459
+ /** Storage_type for storing data (HDF5 or text). Will deprecate text files in the future */
460
+ storage_type: 'text' | 'HDF5'
391
461
  }
392
462
 
393
463
  /** the metabolite query */
@@ -401,6 +471,7 @@ export type MetaboliteIntensityQueryNative = {
401
471
  find?: (param: string[]) => void
402
472
  metaboliteIntensity2bins?: { [index: string]: any }
403
473
  }
474
+
404
475
  export type MetaboliteIntensityQuery = MetaboliteIntensityQueryNative
405
476
 
406
477
  /** the geneExpression query */
@@ -418,7 +489,10 @@ export type GeneExpressionQueryNative = {
418
489
  get?: (param: any) => void
419
490
  /** This dictionary is used to store/cache the default bins calculated for a geneExpression term when initialized in the fillTermWrapper */
420
491
  geneExpression2bins?: { [index: string]: any }
492
+ /** Type of data format HDF5 or bed */
493
+ storage_type?: 'HDF5' | 'bed'
421
494
  }
495
+
422
496
  export type GeneExpressionQuery = GeneExpressionQueryGdc | GeneExpressionQueryNative
423
497
 
424
498
  export type SingleCellGeneExpressionNative = {
@@ -441,11 +515,11 @@ export type SingleCellSamplesNative = {
441
515
  src: 'native'
442
516
 
443
517
  /** logic to decide sample table columns (the one shown on singlecell app ui, displaying a table of samples with sc data)
444
- a sample table will always have a sample column, to show sample.sample value
445
- firstColumnName allow to change name of 1st column from "Sample" to different, e.g. "Case" for gdc
446
- the other two properties allow to declare additional columns to be shown in table, that are for display only
447
- when sample.experiments[] are used, a last column of experiment id will be auto added
448
- */
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
+ */
449
523
  firstColumnName?: string
450
524
 
451
525
  /** do not use for native ds! gdc-only property. kept as optional to avoid tsc err */
@@ -457,6 +531,7 @@ export type SingleCellSamplesNative = {
457
531
  /** dynamically added getter */
458
532
  get?: (q: any) => any
459
533
  }
534
+
460
535
  export type SingleCellSamplesGdc = {
461
536
  src: 'gdcapi'
462
537
  get?: (q: any) => any
@@ -479,8 +554,8 @@ export type SingleCellDataGdc = {
479
554
  export type SingleCellDEgeneGdc = {
480
555
  src: 'gdcapi'
481
556
  /** Column name.
482
- 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
483
- */
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
+ */
484
559
  columnName: string
485
560
  }
486
561
 
@@ -488,6 +563,8 @@ type GDCSingleCellPlot = {
488
563
  name: string
489
564
  colorColumns: ColorColumn[]
490
565
  coordsColumns: { x: number; y: number }
566
+ /** if true the plot is shown by default. otherwise hidden */
567
+ selected?: boolean
491
568
  }
492
569
 
493
570
  type ColorColumn = {
@@ -504,21 +581,23 @@ type SingleCellPlot = {
504
581
  /** type of the plot, e.g. tsne or umap, also display as plot name on ui */
505
582
  name: string
506
583
  /** folder in which per-sample files are stored.
507
- each file is a tabular text file with all cells (rows) from that sample.
508
- all files must have same set of columns
509
- file columns include cell types and x/y coords, as described by other parameters
510
- */
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
+ */
511
588
  folder: string
512
589
  /** optional suffix to locate the file for a sample, via ${folder}/${sampleName}${fileSuffix}
513
- assumes that file name always start with sample name.
514
- if not introduce filePrefix
515
- */
590
+ assumes that file name always start with sample name.
591
+ if not introduce filePrefix
592
+ */
516
593
  fileSuffix?: string
517
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
518
595
  */
519
596
  colorColumns: ColorColumn[]
520
597
  /** 0-based column number for x/y coordinate for this plot */
521
598
  coordsColumns: { x: number; y: number }
599
+ /** if true the plot is shown by default. otherwise hidden */
600
+ selected?: boolean
522
601
  }
523
602
  export type SingleCellDataNative = {
524
603
  src: 'native'
@@ -538,9 +617,9 @@ export type SingleCellDataNative = {
538
617
 
539
618
  export type SingleCellQuery = {
540
619
  /** methods to identify samples with singlecell data,
541
- this data allows client-side to display a table with these samples for user to choose from
542
- also, sampleView uses this to determine if to invoke the sc plot for a sample
543
- */
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
+ */
544
623
  samples: SingleCellSamplesGdc | SingleCellSamplesNative
545
624
  /** defines tsne/umap type of clustering maps for each sample
546
625
  */
@@ -567,8 +646,11 @@ type LdQuery = {
567
646
  /** max range allowed to show data */
568
647
  viewrangelimit: number
569
648
  }[]
649
+ /** color scale when LD is used to overlay on variants of a locus */
570
650
  overlay: {
651
+ /** color for r2 value 1 */
571
652
  color_1: string
653
+ /** Color for r2 value 0 */
572
654
  color_0: string
573
655
  }
574
656
  }
@@ -582,7 +664,6 @@ type SingleSampleGenomeQuantification = {
582
664
  min: number
583
665
  /** max value of Y axis */
584
666
  max: number
585
- /** */
586
667
  sample_id_key: string
587
668
  /** folder path of data files per sample */
588
669
  folder: string
@@ -620,7 +701,11 @@ type Mds3Queries = {
620
701
  NIdata?: NIdataQuery
621
702
  geneExpression?: GeneExpressionQuery
622
703
  rnaseqGeneCount?: RnaseqGeneCount
704
+ /** Used to create the top mutated genes UI in the gene
705
+ * set edit ui and data requests. */
623
706
  topMutatedGenes?: TopMutatedGenes
707
+ /** Used to create the top variably expressed UI in the gene
708
+ * set edit ui. Also used for data requests */
624
709
  topVariablyExpressedGenes?: TopVariablyExpressedGenesQuery
625
710
  metaboliteIntensity?: {
626
711
  src: 'native' | 'gdc'
@@ -637,6 +722,7 @@ type Mds3Queries = {
637
722
  ld?: LdQuery
638
723
  singleSampleGenomeQuantification?: SingleSampleGenomeQuantification
639
724
  singleSampleGbtk?: SingleSampleGbtk
725
+ /** depreciated. replaced by WSImages */
640
726
  DZImages?: DZImages
641
727
  WSImages?: WSImages
642
728
  images?: Images
@@ -650,7 +736,8 @@ type Images = {
650
736
  folder: string
651
737
  }
652
738
 
653
- /** deep zoom image shown via openseadragon, with precomputed tiles. this is replaced by WSImages and should not be used anymore */
739
+ /** Depreciated. deep zoom image shown via openseadragon, with precomputed tiles.
740
+ * this is replaced by WSImages and should not be used anymore */
654
741
  export type DZImages = {
655
742
  // type of the image, e.g. H&E
656
743
  type: string
@@ -684,11 +771,17 @@ type SelectCohortValuesEntry = {
684
771
  note?: string
685
772
  }
686
773
 
687
- type SelectCohortEntry = {
774
+ export type SelectCohortEntry = {
688
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. */
689
779
  prompt: string
690
780
  values: SelectCohortValuesEntry[]
691
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 */
692
785
  asterisk?: string
693
786
  //The profile has clearOnChange. The terms used in the plots are not always the same for the profile.
694
787
  //Therefore when switching cohorts, it is necessary to delete the plots opened and the global filter
@@ -720,9 +813,9 @@ type ScatterPlotsEntry = {
720
813
  colorTW?: { id: string }
721
814
  colorColumn?: ColorColumn
722
815
  /** provide a sampletype term to filter for specific type of samples for subjects with multiple samples and show in the plot.
723
- e.g. to only show D samples from all patients
724
- this is limited to only one term and doesn't allow switching between multiple terms
725
- */
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
+ */
726
819
  sampleCategory?: {
727
820
  /** categorical term like "sampleType" which describes types of multiple samples from the same subject */
728
821
  tw: { id: string }
@@ -784,7 +877,7 @@ type SortPriorityEntry = {
784
877
  }
785
878
 
786
879
  type SurvivalSettings = {
787
- /** filters out all the survival data with Time-to-Event longer than this maxTimeToEvent */
880
+ /** The max time-to-event to be displayed in plot, hide all the samples with Time-to-Event longer than this maxTimeToEvent */
788
881
  maxTimeToEvent?: number
789
882
  }
790
883
 
@@ -810,11 +903,14 @@ type MatrixSettings = {
810
903
  synonymousMutations?: string[]
811
904
  showHints?: string[]
812
905
  displayDictRowWithNoValues?: boolean
813
- /** allow to add two buttons (CNV and mutation) to control panel for selecting mclasses displayed on oncoMatrix */
906
+ /** allow to add two buttons (CNV and mutation) to control panel for selecting
907
+ * mclasses displayed on oncoMatrix */
814
908
  addMutationCNVButtons?: boolean
815
- /** this is now computed from sortPriority[x].tiebreakers.find(tb => tb.filter?.values[0]?.dt === 1) ... */
909
+ /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
910
+ * tb.filter?.values[0]?.dt === 1) ... */
816
911
  sortByMutation?: string
817
- /** this is now computed from sortPriority[x].tiebreakers.find(tb => tb.filter?.values[0]?.dt === 4).isOrdered */
912
+ /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
913
+ * tb.filter?.values[0]?.dt === 4).isOrdered */
818
914
  sortByCNV?: boolean
819
915
  cnvUnit?: 'log2ratio' | 'segmedian'
820
916
  }
@@ -899,10 +995,10 @@ type UrlTemplateBase = {
899
995
  }
900
996
  export type UrlTemplateSsm = UrlTemplateBase & {
901
997
  /** to create separate link, but not directly on chr.pos.ref.alt string.
902
- 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 */
998
+ 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 */
903
999
  shownSeparately?: boolean
904
1000
  /** optional name of link, if set, same name will be used for all links. e.g. "ClinVar".
905
- if missing, name is value of m[url.namekey], as used in url itself (e.g. snp rsid) */
1001
+ if missing, name is value of m[url.namekey], as used in url itself (e.g. snp rsid) */
906
1002
  linkText?: string
907
1003
  }
908
1004
 
@@ -926,25 +1022,26 @@ type Termdb = {
926
1022
  selectCohort?: SelectCohortEntry
927
1023
 
928
1024
  /** quick fix to convert category values from a term to lower cases for comparison (case insensitive comparison)
929
- for gdc, graphql and rest apis return case-mismatching strings for the same category e.g. "Breast/breast"
930
- keep this setting here for reason of:
931
- - in mds3.gdc.js, when received all-lowercase values from graphql, it's hard to convert them to Title case for comparison
932
- - mds3.variant2samples consider this setting, allows to handle other datasets of same issue
933
- */
1025
+ for gdc, graphql and rest apis return case-mismatching strings for the same category e.g. "Breast/breast"
1026
+ keep this setting here for reason of:
1027
+ - in mds3.gdc.js, when received all-lowercase values from graphql, it's hard to convert them to Title case for comparison
1028
+ - mds3.variant2samples consider this setting, allows to handle other datasets of same issue
1029
+ */
934
1030
  useLower?: boolean
935
1031
 
936
1032
  scatterplots?: Scatterplots
937
1033
  matrix?: Matrix
938
1034
  survival?: Survival
939
1035
  logscaleBase2?: boolean
940
- chartConfigByType?: ChartConfigByType
1036
+ plotConfigByCohort?: PlotConfigByCohort
941
1037
  /** Functionality */
942
1038
  dataDownloadCatch?: DataDownloadCatch
943
1039
  helpPages?: URLEntry[]
944
1040
  multipleTestingCorrection?: MultipleTestingCorrection
945
- /** regression settings for neuro-oncology datasets:
946
- - no interaction terms
947
- - hide type III stats and miscellaneous statistical tests */
1041
+ /** regression settings for neuro-oncology portals:
1042
+ - no interaction terms
1043
+ - report event counts of cox coefficients
1044
+ - hide type III stats and miscellaneous statistical tests */
948
1045
  neuroOncRegression?: boolean
949
1046
  urlTemplates?: {
950
1047
  /** gene link definition */
@@ -968,19 +1065,18 @@ type Termdb = {
968
1065
  dictionary?: GdcApi
969
1066
  allowCaseDetails?: AllowCaseDetails
970
1067
  isGeneSetTermdb?: boolean
971
- // !!! TODO: improve this type definition !!!
972
- getGeneAlias?: (q: any, tw: any) => any
973
- convertSampleId?: {
974
- gdcapi: boolean
975
- }
1068
+ /** Searches the genedb alias list to return the genecode ID */
1069
+ getGeneAlias?: (q: any, tw: any) => { gencodeId: any }
1070
+ convertSampleId?: GdcApi
976
1071
  hierCluster?: any
977
1072
 
978
1073
  /** ds customization of rules in TermTypeSelect on what term type to exclude for a usecase.
979
- used by gdc in that gene exp cannot be used for filtering
980
- note this applies to left-side term type tabs, but not terms in dict tree. latter is controlled by excludeTermtypeByTarget
981
- */
1074
+ used by gdc in that gene exp cannot be used for filtering
1075
+ note this applies to left-side term type tabs, but not terms in dict tree. latter is controlled by excludeTermtypeByTarget
1076
+ */
982
1077
  useCasesExcluded?: {
983
- /** key is target name (todo restrict values), value is array of 1 or more term types (todo restrict values) */
1078
+ /** key is target name (todo restrict values), value is array of 1 or more term
1079
+ * types (todo restrict values) */
984
1080
  [useCaseTarget: string]: string[]
985
1081
  }
986
1082
  /** ds customization to rules in isUsableTerm(). this applies to what's showing in dict tree
@@ -1007,12 +1103,13 @@ type SampleType = {
1007
1103
  parent_id: string
1008
1104
  }
1009
1105
 
1010
- type ChartConfigByType = {
1011
- [index: string]: ChartConfig
1012
- }
1013
-
1014
- type ChartConfig = {
1015
- [key: string]: any
1106
+ /** predefined configuration objects per subcohort per plot type */
1107
+ type PlotConfigByCohort = {
1108
+ /** key is subcohort string */
1109
+ [index: string]: {
1110
+ /** key is plot type as in mass/charts.js */
1111
+ [key: string]: object
1112
+ }
1016
1113
  }
1017
1114
 
1018
1115
  /** modified version of termwrapper*/
@@ -1082,7 +1179,8 @@ export type Cohort = {
1082
1179
  }
1083
1180
  }
1084
1181
  db: FileObj
1085
- /** customize the default chart to open on mass ui when there's no charts. if missing it opens dictionary ui */
1182
+ /** customize the default chart to open on mass ui when there's no charts. if
1183
+ * missing it opens dictionary ui */
1086
1184
  defaultChartType?: string
1087
1185
  hiddenChartTypes?: string[]
1088
1186
  massNav?: MassNav
@@ -1215,9 +1313,9 @@ type Svcnv = BaseTrack & {
1215
1313
 
1216
1314
  type KeyLabelFull = {
1217
1315
  /* Used in:
1218
- queries.genefpkm.boxplotbysamplegroup.attributes
1219
- cohort.hierarchies.lst[i].levels
1220
- */
1316
+ queries.genefpkm.boxplotbysamplegroup.attributes
1317
+ cohort.hierarchies.lst[i].levels
1318
+ */
1221
1319
  k: string
1222
1320
  label: string
1223
1321
  full?: string
@@ -1261,6 +1359,7 @@ type GeneFpkm = Fpkm & {
1261
1359
  }
1262
1360
 
1263
1361
  type CutoffValueLstEntry = {
1362
+ /** '<' or '>' to add to the label */
1264
1363
  side: string
1265
1364
  value: number
1266
1365
  label: string
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ export * from './routes/hicgenome.ts'
20
20
  export * from './routes/hicstat.ts'
21
21
  export * from './routes/sampledzimages.ts'
22
22
  export * from './routes/samplewsimages.ts'
23
+ export * from './routes/termdb.boxplot.ts'
23
24
  export * from './routes/termdb.categories.ts'
24
25
  export * from './routes/termdb.cluster.ts'
25
26
  export * from './routes/termdb.DE.ts'
@@ -7,6 +7,8 @@ export type genesetOverrepresentationRequest = {
7
7
  genome: string
8
8
  /** msigdb branch term name. all genesets under this branch will be analyzed */
9
9
  geneSetGroup: string
10
+ /** Boolean variable describing if non-coding genes should be filtered */
11
+ filter_non_coding_genes: boolean
10
12
  }
11
13
 
12
14
  export type genesetOverrepresentationResponse = {
@@ -29,4 +31,6 @@ export type gene_overrepresentation_input = {
29
31
  gene_set_group: string
30
32
  /** Path to gene db */
31
33
  genedb: string
34
+ /** Boolean variable describing if non-coding genes should be filtered */
35
+ filter_non_coding_genes: boolean
32
36
  }
@@ -9,10 +9,29 @@ export type DERequest = {
9
9
  min_count: number
10
10
  /** Minimum total read count required for each sample */
11
11
  min_total_count: number
12
+ /** Storage_type for storing data. Will deprecate text files */
13
+ storage_type: 'text' | 'HDF5'
12
14
  /** Method of DE used wilcoxon/edgeR */
13
15
  method?: string
14
16
  }
15
17
 
18
+ export type ExpressionInput = {
19
+ /** Case samples separated by , */
20
+ case: string
21
+ /** Control samples separated by , */
22
+ control: string
23
+ /** data_type instructs rust to carry out differential gene expression analysis */
24
+ data_type: 'do_DE'
25
+ /** File containing raw gene counts for DE analysis */
26
+ input_file: string
27
+ /** Relative cpm cutoff for filtering a gene compared to all samples and genes in dataset */
28
+ min_count: number
29
+ /** Minimum total read count required for each sample */
30
+ min_total_count: number
31
+ /** Type of storage file: HDF5 or text. Text will be deprecated in the future */
32
+ storage_type: 'HDF5' | 'text'
33
+ }
34
+
16
35
  export type DEResponse = {
17
36
  /** Array containing objects of each gene containing foldchange, gene name, gene symbol, original pvalue, adjusted pvalue */
18
37
  data: string
@@ -0,0 +1,40 @@
1
+ export type BoxPlotRequest = {
2
+ //TOOD: define request
3
+ tw: any
4
+ }
5
+
6
+ export type BoxPlotResponse = {
7
+ plots: BoxPlotEntry[]
8
+ /** Absolute min value for all plots */
9
+ absMin: number
10
+ /** Absolute max value for all plots */
11
+ absMax: number
12
+ /** Longest label length for all plots */
13
+ maxLabelLgth: number
14
+ }
15
+
16
+ export type BoxPlotEntry = {
17
+ boxplot: BoxPlotData
18
+ /** Label to show */
19
+ label: string
20
+ // /** Number of samples */
21
+ // plotValueCount: number
22
+ /** TODO: Is this needed? */
23
+ values: number[]
24
+ /** Lowest min for the scale domain */
25
+ min: number
26
+ /** Highest max for the scale domain */
27
+ max: number
28
+ }
29
+
30
+ export type BoxPlotData = {
31
+ w1: number
32
+ w2: number
33
+ p05: number
34
+ p25: number
35
+ p50: number
36
+ p75: number
37
+ p95: number
38
+ iqr: number
39
+ out: { value: number }[]
40
+ }