@sjcrh/proteinpaint-types 2.79.7 → 2.81.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.79.7",
3
+ "version": "2.81.0",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -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,9 +58,13 @@ 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
 
@@ -58,11 +76,19 @@ type GenomicPositionEntry = {
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,7 +256,6 @@ 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[]
@@ -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,32 +360,55 @@ 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
 
@@ -368,6 +434,7 @@ type CnvSegment = {
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 */
@@ -401,6 +468,7 @@ export type MetaboliteIntensityQueryNative = {
401
468
  find?: (param: string[]) => void
402
469
  metaboliteIntensity2bins?: { [index: string]: any }
403
470
  }
471
+
404
472
  export type MetaboliteIntensityQuery = MetaboliteIntensityQueryNative
405
473
 
406
474
  /** the geneExpression query */
@@ -457,6 +525,7 @@ export type SingleCellSamplesNative = {
457
525
  /** dynamically added getter */
458
526
  get?: (q: any) => any
459
527
  }
528
+
460
529
  export type SingleCellSamplesGdc = {
461
530
  src: 'gdcapi'
462
531
  get?: (q: any) => any
@@ -479,8 +548,11 @@ export type SingleCellDataGdc = {
479
548
  export type SingleCellDEgeneGdc = {
480
549
  src: 'gdcapi'
481
550
  /** 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
- */
551
+ this must be the colorColumn from one of the plots. so that at the client app,
552
+ as soon as the plot data have been loaded and maps rendered, client will find
553
+ out the cell groups based on this columnName value, and show a drop down of
554
+ these groups on UI. user selects a group, and pass it as request body to backend
555
+ to get DE genes for this group */
484
556
  columnName: string
485
557
  }
486
558
 
@@ -567,8 +639,11 @@ type LdQuery = {
567
639
  /** max range allowed to show data */
568
640
  viewrangelimit: number
569
641
  }[]
642
+ /** color scale when LD is used to overlay on variants of a locus */
570
643
  overlay: {
644
+ /** color for r2 value 1 */
571
645
  color_1: string
646
+ /** Color for r2 value 0 */
572
647
  color_0: string
573
648
  }
574
649
  }
@@ -582,7 +657,6 @@ type SingleSampleGenomeQuantification = {
582
657
  min: number
583
658
  /** max value of Y axis */
584
659
  max: number
585
- /** */
586
660
  sample_id_key: string
587
661
  /** folder path of data files per sample */
588
662
  folder: string
@@ -620,7 +694,11 @@ type Mds3Queries = {
620
694
  NIdata?: NIdataQuery
621
695
  geneExpression?: GeneExpressionQuery
622
696
  rnaseqGeneCount?: RnaseqGeneCount
697
+ /** Used to create the top mutated genes UI in the gene
698
+ * set edit ui and data requests. */
623
699
  topMutatedGenes?: TopMutatedGenes
700
+ /** Used to create the top variably expressed UI in the gene
701
+ * set edit ui. Also used for data requests */
624
702
  topVariablyExpressedGenes?: TopVariablyExpressedGenesQuery
625
703
  metaboliteIntensity?: {
626
704
  src: 'native' | 'gdc'
@@ -637,6 +715,7 @@ type Mds3Queries = {
637
715
  ld?: LdQuery
638
716
  singleSampleGenomeQuantification?: SingleSampleGenomeQuantification
639
717
  singleSampleGbtk?: SingleSampleGbtk
718
+ /** depreciated. replaced by WSImages */
640
719
  DZImages?: DZImages
641
720
  WSImages?: WSImages
642
721
  images?: Images
@@ -650,7 +729,8 @@ type Images = {
650
729
  folder: string
651
730
  }
652
731
 
653
- /** deep zoom image shown via openseadragon, with precomputed tiles. this is replaced by WSImages and should not be used anymore */
732
+ /** Depreciated. deep zoom image shown via openseadragon, with precomputed tiles.
733
+ * this is replaced by WSImages and should not be used anymore */
654
734
  export type DZImages = {
655
735
  // type of the image, e.g. H&E
656
736
  type: string
@@ -689,6 +769,9 @@ type SelectCohortEntry = {
689
769
  prompt: string
690
770
  values: SelectCohortValuesEntry[]
691
771
  description?: string
772
+ /* If the description is dependent on the user pass a descriptionByUser dict instead */
773
+ descriptionByUser?: { [index: string]: string }
774
+ /** subtext shown at the very bottom of the cohort/about tab subheader */
692
775
  asterisk?: string
693
776
  //The profile has clearOnChange. The terms used in the plots are not always the same for the profile.
694
777
  //Therefore when switching cohorts, it is necessary to delete the plots opened and the global filter
@@ -810,11 +893,14 @@ type MatrixSettings = {
810
893
  synonymousMutations?: string[]
811
894
  showHints?: string[]
812
895
  displayDictRowWithNoValues?: boolean
813
- /** allow to add two buttons (CNV and mutation) to control panel for selecting mclasses displayed on oncoMatrix */
896
+ /** allow to add two buttons (CNV and mutation) to control panel for selecting
897
+ * mclasses displayed on oncoMatrix */
814
898
  addMutationCNVButtons?: boolean
815
- /** this is now computed from sortPriority[x].tiebreakers.find(tb => tb.filter?.values[0]?.dt === 1) ... */
899
+ /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
900
+ * tb.filter?.values[0]?.dt === 1) ... */
816
901
  sortByMutation?: string
817
- /** this is now computed from sortPriority[x].tiebreakers.find(tb => tb.filter?.values[0]?.dt === 4).isOrdered */
902
+ /** this is now computed from sortPriority[x].tiebreakers.find(tb =>
903
+ * tb.filter?.values[0]?.dt === 4).isOrdered */
818
904
  sortByCNV?: boolean
819
905
  cnvUnit?: 'log2ratio' | 'segmedian'
820
906
  }
@@ -899,7 +985,8 @@ type UrlTemplateBase = {
899
985
  }
900
986
  export type UrlTemplateSsm = UrlTemplateBase & {
901
987
  /** 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 */
988
+ name of link is determined by either namekey or linkText. former allows
989
+ to retrieve a name per m that's different from chr.pos.xx */
903
990
  shownSeparately?: boolean
904
991
  /** optional name of link, if set, same name will be used for all links. e.g. "ClinVar".
905
992
  if missing, name is value of m[url.namekey], as used in url itself (e.g. snp rsid) */
@@ -942,9 +1029,8 @@ type Termdb = {
942
1029
  dataDownloadCatch?: DataDownloadCatch
943
1030
  helpPages?: URLEntry[]
944
1031
  multipleTestingCorrection?: MultipleTestingCorrection
945
- /** regression settings for neuro-oncology portals:
1032
+ /** regression settings for neuro-oncology datasets:
946
1033
  - no interaction terms
947
- - report event counts of cox coefficients
948
1034
  - hide type III stats and miscellaneous statistical tests */
949
1035
  neuroOncRegression?: boolean
950
1036
  urlTemplates?: {
@@ -969,19 +1055,19 @@ type Termdb = {
969
1055
  dictionary?: GdcApi
970
1056
  allowCaseDetails?: AllowCaseDetails
971
1057
  isGeneSetTermdb?: boolean
972
- // !!! TODO: improve this type definition !!!
973
- getGeneAlias?: (q: any, tw: any) => any
974
- convertSampleId?: {
975
- gdcapi: boolean
976
- }
1058
+ /** Searches the genedb alias list to return the genecode ID */
1059
+ getGeneAlias?: (q: any, tw: any) => { gencodeId: any }
1060
+ convertSampleId?: GdcApi
977
1061
  hierCluster?: any
978
1062
 
979
1063
  /** ds customization of rules in TermTypeSelect on what term type to exclude for a usecase.
980
1064
  used by gdc in that gene exp cannot be used for filtering
981
- note this applies to left-side term type tabs, but not terms in dict tree. latter is controlled by excludeTermtypeByTarget
1065
+ note this applies to left-side term type tabs, but not terms in dict tree. latter
1066
+ is controlled by excludeTermtypeByTarget
982
1067
  */
983
1068
  useCasesExcluded?: {
984
- /** key is target name (todo restrict values), value is array of 1 or more term types (todo restrict values) */
1069
+ /** key is target name (todo restrict values), value is array of 1 or more term
1070
+ * types (todo restrict values) */
985
1071
  [useCaseTarget: string]: string[]
986
1072
  }
987
1073
  /** ds customization to rules in isUsableTerm(). this applies to what's showing in dict tree
@@ -1083,7 +1169,8 @@ export type Cohort = {
1083
1169
  }
1084
1170
  }
1085
1171
  db: FileObj
1086
- /** customize the default chart to open on mass ui when there's no charts. if missing it opens dictionary ui */
1172
+ /** customize the default chart to open on mass ui when there's no charts. if
1173
+ * missing it opens dictionary ui */
1087
1174
  defaultChartType?: string
1088
1175
  hiddenChartTypes?: string[]
1089
1176
  massNav?: MassNav
@@ -1262,6 +1349,7 @@ type GeneFpkm = Fpkm & {
1262
1349
  }
1263
1350
 
1264
1351
  type CutoffValueLstEntry = {
1352
+ /** '<' or '>' to add to the label */
1265
1353
  side: string
1266
1354
  value: number
1267
1355
  label: string
@@ -43,6 +43,10 @@ export type NoTermPromptOptsEntry = {
43
43
  text?: string
44
44
  html?: string
45
45
  q?: Q
46
+ /** whether or not opt is invalid */
47
+ invalid?: boolean
48
+ /** message displayed when opt is invalid */
49
+ invalidMsg?: string
46
50
  }
47
51
 
48
52
  type NumericContEditOptsEntry = {