@sjcrh/proteinpaint-types 2.81.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.81.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
@@ -70,9 +70,9 @@ type InfoFieldEntry = {
70
70
 
71
71
  /*
72
72
  type GenomicPositionEntry = {
73
- chr: string
74
- start: number
75
- stop: number
73
+ chr: string
74
+ start: number
75
+ stop: number
76
76
  }
77
77
  */
78
78
 
@@ -138,12 +138,12 @@ type GdcApi = {
138
138
  type SnvIndelFormat = {
139
139
  [index: string]: {
140
140
  /* has value for a non-GT field indicating the variant
141
- is annotated to this sample*/
141
+ is annotated to this sample*/
142
142
  ID: string
143
143
  Description: string
144
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 */
145
+ as we don't need to compute on the format values on backend
146
+ client will parse the values for display */
147
147
  Number: string | number
148
148
  Type: string
149
149
  }
@@ -260,8 +260,8 @@ type SnvIndelQuery = {
260
260
  variant_filter?: VariantFilter
261
261
  populations?: Population[]
262
262
  /** NOTE **
263
- this definition can appear either in queries.snvindel{} or termdb{}
264
- so that it can work for a termdb-less ds, e.g. clinvar, where termdbConfig cannot be made */
263
+ this definition can appear either in queries.snvindel{} or termdb{}
264
+ so that it can work for a termdb-less ds, e.g. clinvar, where termdbConfig cannot be made */
265
265
  ssmUrl?: UrlTemplateSsm
266
266
  m2csq?: {
267
267
  gdcapi?: boolean
@@ -415,21 +415,21 @@ type TrackLstEntry = {
415
415
  type CnvSegment = {
416
416
  byrange: CnvSegmentByRange
417
417
  /****** rendering parameters ****
418
- not used as query parameter to filter segments
419
- value range for color scaling. default to 5. cnv segment value>this will use solid color
420
- */
418
+ not used as query parameter to filter segments
419
+ value range for color scaling. default to 5. cnv segment value>this will use solid color
420
+ */
421
421
  absoluteValueRenderMax?: number
422
422
  gainColor?: string
423
423
  lossColor?: string
424
424
 
425
425
  /*** filtering parameters ***
426
- 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 */
427
427
  cnvMaxLength?: number
428
428
 
429
429
  /** TODO define value type, if logratio, or copy number */
430
430
 
431
431
  /** following two cutoffs only apply to log ratio, cnv gain value is positive, cnv loss value is negative
432
- if cnv is gain, skip if value<this cutoff */
432
+ if cnv is gain, skip if value<this cutoff */
433
433
  cnvGainCutoff?: number
434
434
  /** if cnv is loss, skip if value>this cutoff */
435
435
  cnvLossCutoff?: number
@@ -448,13 +448,16 @@ for a given region, the median signal from probes in the region is used to make
448
448
  this is alternative to CnvSegment
449
449
 
450
450
  type Probe2Cnv = {
451
- file: string
451
+ file: string
452
452
  }
453
453
  */
454
454
 
455
455
  type RnaseqGeneCount = {
456
+ /** Name of the HDF5 or text file */
456
457
  file: string
457
458
  samplesFile?: string
459
+ /** Storage_type for storing data (HDF5 or text). Will deprecate text files in the future */
460
+ storage_type: 'text' | 'HDF5'
458
461
  }
459
462
 
460
463
  /** the metabolite query */
@@ -486,7 +489,10 @@ export type GeneExpressionQueryNative = {
486
489
  get?: (param: any) => void
487
490
  /** This dictionary is used to store/cache the default bins calculated for a geneExpression term when initialized in the fillTermWrapper */
488
491
  geneExpression2bins?: { [index: string]: any }
492
+ /** Type of data format HDF5 or bed */
493
+ storage_type?: 'HDF5' | 'bed'
489
494
  }
495
+
490
496
  export type GeneExpressionQuery = GeneExpressionQueryGdc | GeneExpressionQueryNative
491
497
 
492
498
  export type SingleCellGeneExpressionNative = {
@@ -509,11 +515,11 @@ export type SingleCellSamplesNative = {
509
515
  src: 'native'
510
516
 
511
517
  /** logic to decide sample table columns (the one shown on singlecell app ui, displaying a table of samples with sc data)
512
- a sample table will always have a sample column, to show sample.sample value
513
- firstColumnName allow to change name of 1st column from "Sample" to different, e.g. "Case" for gdc
514
- the other two properties allow to declare additional columns to be shown in table, that are for display only
515
- when sample.experiments[] are used, a last column of experiment id will be auto added
516
- */
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
+ */
517
523
  firstColumnName?: string
518
524
 
519
525
  /** do not use for native ds! gdc-only property. kept as optional to avoid tsc err */
@@ -548,11 +554,8 @@ export type SingleCellDataGdc = {
548
554
  export type SingleCellDEgeneGdc = {
549
555
  src: 'gdcapi'
550
556
  /** Column name.
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 */
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
+ */
556
559
  columnName: string
557
560
  }
558
561
 
@@ -560,6 +563,8 @@ type GDCSingleCellPlot = {
560
563
  name: string
561
564
  colorColumns: ColorColumn[]
562
565
  coordsColumns: { x: number; y: number }
566
+ /** if true the plot is shown by default. otherwise hidden */
567
+ selected?: boolean
563
568
  }
564
569
 
565
570
  type ColorColumn = {
@@ -576,21 +581,23 @@ type SingleCellPlot = {
576
581
  /** type of the plot, e.g. tsne or umap, also display as plot name on ui */
577
582
  name: string
578
583
  /** folder in which per-sample files are stored.
579
- each file is a tabular text file with all cells (rows) from that sample.
580
- all files must have same set of columns
581
- file columns include cell types and x/y coords, as described by other parameters
582
- */
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
+ */
583
588
  folder: string
584
589
  /** optional suffix to locate the file for a sample, via ${folder}/${sampleName}${fileSuffix}
585
- assumes that file name always start with sample name.
586
- if not introduce filePrefix
587
- */
590
+ assumes that file name always start with sample name.
591
+ if not introduce filePrefix
592
+ */
588
593
  fileSuffix?: string
589
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
590
595
  */
591
596
  colorColumns: ColorColumn[]
592
597
  /** 0-based column number for x/y coordinate for this plot */
593
598
  coordsColumns: { x: number; y: number }
599
+ /** if true the plot is shown by default. otherwise hidden */
600
+ selected?: boolean
594
601
  }
595
602
  export type SingleCellDataNative = {
596
603
  src: 'native'
@@ -610,9 +617,9 @@ export type SingleCellDataNative = {
610
617
 
611
618
  export type SingleCellQuery = {
612
619
  /** methods to identify samples with singlecell data,
613
- this data allows client-side to display a table with these samples for user to choose from
614
- also, sampleView uses this to determine if to invoke the sc plot for a sample
615
- */
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
+ */
616
623
  samples: SingleCellSamplesGdc | SingleCellSamplesNative
617
624
  /** defines tsne/umap type of clustering maps for each sample
618
625
  */
@@ -764,8 +771,11 @@ type SelectCohortValuesEntry = {
764
771
  note?: string
765
772
  }
766
773
 
767
- type SelectCohortEntry = {
774
+ export type SelectCohortEntry = {
768
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. */
769
779
  prompt: string
770
780
  values: SelectCohortValuesEntry[]
771
781
  description?: string
@@ -803,9 +813,9 @@ type ScatterPlotsEntry = {
803
813
  colorTW?: { id: string }
804
814
  colorColumn?: ColorColumn
805
815
  /** provide a sampletype term to filter for specific type of samples for subjects with multiple samples and show in the plot.
806
- e.g. to only show D samples from all patients
807
- this is limited to only one term and doesn't allow switching between multiple terms
808
- */
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
+ */
809
819
  sampleCategory?: {
810
820
  /** categorical term like "sampleType" which describes types of multiple samples from the same subject */
811
821
  tw: { id: string }
@@ -867,7 +877,7 @@ type SortPriorityEntry = {
867
877
  }
868
878
 
869
879
  type SurvivalSettings = {
870
- /** 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 */
871
881
  maxTimeToEvent?: number
872
882
  }
873
883
 
@@ -985,11 +995,10 @@ type UrlTemplateBase = {
985
995
  }
986
996
  export type UrlTemplateSsm = UrlTemplateBase & {
987
997
  /** to create separate link, but not directly on chr.pos.ref.alt string.
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 */
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 */
990
999
  shownSeparately?: boolean
991
1000
  /** optional name of link, if set, same name will be used for all links. e.g. "ClinVar".
992
- 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) */
993
1002
  linkText?: string
994
1003
  }
995
1004
 
@@ -1013,25 +1022,26 @@ type Termdb = {
1013
1022
  selectCohort?: SelectCohortEntry
1014
1023
 
1015
1024
  /** quick fix to convert category values from a term to lower cases for comparison (case insensitive comparison)
1016
- for gdc, graphql and rest apis return case-mismatching strings for the same category e.g. "Breast/breast"
1017
- keep this setting here for reason of:
1018
- - in mds3.gdc.js, when received all-lowercase values from graphql, it's hard to convert them to Title case for comparison
1019
- - mds3.variant2samples consider this setting, allows to handle other datasets of same issue
1020
- */
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
+ */
1021
1030
  useLower?: boolean
1022
1031
 
1023
1032
  scatterplots?: Scatterplots
1024
1033
  matrix?: Matrix
1025
1034
  survival?: Survival
1026
1035
  logscaleBase2?: boolean
1027
- chartConfigByType?: ChartConfigByType
1036
+ plotConfigByCohort?: PlotConfigByCohort
1028
1037
  /** Functionality */
1029
1038
  dataDownloadCatch?: DataDownloadCatch
1030
1039
  helpPages?: URLEntry[]
1031
1040
  multipleTestingCorrection?: MultipleTestingCorrection
1032
- /** regression settings for neuro-oncology datasets:
1033
- - no interaction terms
1034
- - 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 */
1035
1045
  neuroOncRegression?: boolean
1036
1046
  urlTemplates?: {
1037
1047
  /** gene link definition */
@@ -1061,10 +1071,9 @@ type Termdb = {
1061
1071
  hierCluster?: any
1062
1072
 
1063
1073
  /** ds customization of rules in TermTypeSelect on what term type to exclude for a usecase.
1064
- used by gdc in that gene exp cannot be used for filtering
1065
- note this applies to left-side term type tabs, but not terms in dict tree. latter
1066
- is controlled by excludeTermtypeByTarget
1067
- */
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
+ */
1068
1077
  useCasesExcluded?: {
1069
1078
  /** key is target name (todo restrict values), value is array of 1 or more term
1070
1079
  * types (todo restrict values) */
@@ -1094,12 +1103,13 @@ type SampleType = {
1094
1103
  parent_id: string
1095
1104
  }
1096
1105
 
1097
- type ChartConfigByType = {
1098
- [index: string]: ChartConfig
1099
- }
1100
-
1101
- type ChartConfig = {
1102
- [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
+ }
1103
1113
  }
1104
1114
 
1105
1115
  /** modified version of termwrapper*/
@@ -1303,9 +1313,9 @@ type Svcnv = BaseTrack & {
1303
1313
 
1304
1314
  type KeyLabelFull = {
1305
1315
  /* Used in:
1306
- queries.genefpkm.boxplotbysamplegroup.attributes
1307
- cohort.hierarchies.lst[i].levels
1308
- */
1316
+ queries.genefpkm.boxplotbysamplegroup.attributes
1317
+ cohort.hierarchies.lst[i].levels
1318
+ */
1309
1319
  k: string
1310
1320
  label: string
1311
1321
  full?: 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
+ }