@sjcrh/proteinpaint-types 2.82.0 → 2.84.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.82.0",
3
+ "version": "2.84.0",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
@@ -21,9 +21,11 @@
21
21
  "devDependencies": {
22
22
  "ts-node": "^10.9.2",
23
23
  "ts-patch": "^3.2.1",
24
- "typescript": "^5.6.2",
25
24
  "typia": "^4.1.14"
26
25
  },
26
+ "peerDependencies": {
27
+ "typescript": "^5.6.3"
28
+ },
27
29
  "files": [
28
30
  "src"
29
31
  ]
package/src/dataset.ts CHANGED
@@ -545,7 +545,7 @@ export type SingleCellDataGdc = {
545
545
  src: 'gdcapi'
546
546
  sameLegend: boolean
547
547
  get?: (q: any) => any
548
- refName: string
548
+ refName?: string
549
549
  plots: GDCSingleCellPlot[]
550
550
  width?: number
551
551
  height?: number
@@ -915,6 +915,11 @@ type MatrixSettings = {
915
915
  cnvUnit?: 'log2ratio' | 'segmedian'
916
916
  }
917
917
 
918
+ type NumericDictTermClusterSettings = {
919
+ /** default hiercluster group name */
920
+ termGroupName?: string
921
+ }
922
+
918
923
  type Matrix = {
919
924
  /** alternative name, e.g. the plot is called "oncomatrix" in gdc; by default it's called "matrix" */
920
925
  appName?: string
@@ -927,6 +932,15 @@ type Matrix = {
927
932
  legendValueFilter?: any
928
933
  }
929
934
 
935
+ type NumericDictTermCluster = {
936
+ /** alternative name, e.g. the plot is called "drug sensitivity" in ALL-pharmacotyping; by default it's called "Numeric Dictionary Term cluster" */
937
+ appName?: string
938
+ /** default settings for numericDictTermCluster plot */
939
+ settings?: NumericDictTermClusterSettings
940
+ /** list of numeric term ids that will be excluded from the numeric dictionary term cluster, add to usecase.detail to exclude terms*/
941
+ exclude?: string[]
942
+ }
943
+
930
944
  type Survival = {
931
945
  /** default settings for survival plot */
932
946
  settings?: SurvivalSettings
@@ -1031,6 +1045,7 @@ keep this setting here for reason of:
1031
1045
 
1032
1046
  scatterplots?: Scatterplots
1033
1047
  matrix?: Matrix
1048
+ numericDictTermCluster?: NumericDictTermCluster
1034
1049
  survival?: Survival
1035
1050
  logscaleBase2?: boolean
1036
1051
  plotConfigByCohort?: PlotConfigByCohort
@@ -1520,6 +1535,11 @@ export type PreInit = {
1520
1535
  retryDelay?: number
1521
1536
  retryMax?: number
1522
1537
  errorCallback?: (response: PreInitStatus) => void
1538
+ test?: {
1539
+ numCalls: number
1540
+ minor: number
1541
+ mayEditResponse: (response: any) => any
1542
+ }
1523
1543
  }
1524
1544
 
1525
1545
  export type Mds3 = BaseMds & {
@@ -1,3 +1,5 @@
1
+ import { CategoricalTW } from '../terms/categorical.ts'
2
+
1
3
  export type GetBrainImagingRequest = {
2
4
  /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
3
5
  genome: string
@@ -5,17 +7,36 @@ export type GetBrainImagingRequest = {
5
7
  dslabel: string
6
8
  /** a user-defined brain template label in dataset file, such as Ref1, Ref2 */
7
9
  refKey: string
8
- /** when true will only return all the samples that have NIdata */
9
- samplesOnly?: boolean
10
10
  /** the slice index of sagittal, coronal and axial planes*/
11
11
  l?: string
12
12
  f?: string
13
13
  t?: string
14
14
  /** the sample names selected by the users to plot on brain template */
15
- selectedSampleFileNames?: string[]
15
+ selectedSampleFileNames: string[]
16
+ /* the term to divide the samples into groups */
17
+ divideByTW?: CategoricalTW
18
+ /* the term to color the samples based on their category */
19
+ overlayTW?: CategoricalTW
16
20
  }
17
21
 
22
+ export type GetBrainImagingSamplesRequest = {
23
+ /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
24
+ genome: string
25
+ /** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */
26
+ dslabel: string
27
+ /** a user-defined brain template label in dataset file, such as Ref1, Ref2 */
28
+ refKey: string
29
+ }
30
+
31
+ export type GetBrainImagingSamplesResponse = {
32
+ samples: BrainSample[]
33
+ }
34
+
35
+ export type BrainSample = { [key: string]: string }
36
+
18
37
  export type GetBrainImagingResponse = {
19
38
  /** the brain imaging plot */
20
39
  brainImage: string
21
40
  }
41
+
42
+ export type FilesByCategory = { [category: string]: { samples: string[]; color: string } }
@@ -4,16 +4,16 @@ export type BoxPlotRequest = {
4
4
  }
5
5
 
6
6
  export type BoxPlotResponse = {
7
- plots: BoxPlotEntry[]
8
7
  /** Absolute min value for all plots */
9
8
  absMin: number
10
9
  /** Absolute max value for all plots */
11
10
  absMax: number
12
11
  /** Longest label length for all plots */
13
12
  maxLabelLgth: number
13
+ plots: BoxPlotEntry[]
14
14
  }
15
15
 
16
- export type BoxPlotEntry = {
16
+ type BoxPlotEntry = {
17
17
  boxplot: BoxPlotData
18
18
  /** Label to show */
19
19
  label: string
@@ -27,14 +27,23 @@ export type BoxPlotEntry = {
27
27
  max: number
28
28
  }
29
29
 
30
- export type BoxPlotData = {
30
+ type BoxPlotData = {
31
+ /** Min/1st whisker value */
31
32
  w1: number
33
+ /** Max/2nd whisker value */
32
34
  w2: number
35
+ /** 5% */
33
36
  p05: number
37
+ /** 25% */
34
38
  p25: number
39
+ /** 50% */
35
40
  p50: number
41
+ /** 75% */
36
42
  p75: number
43
+ /** 95% */
37
44
  p95: number
45
+ /** Interquartile region */
38
46
  iqr: number
47
+ /** Outliers */
39
48
  out: { value: number }[]
40
49
  }
@@ -3,6 +3,7 @@ import { Filter } from '../filter.ts'
3
3
  import { Term } from '../terms/term.ts'
4
4
  import { GeneExpressionTerm } from '../terms/geneExpression.ts'
5
5
  import { MetaboliteIntensityTerm } from '../terms/metaboliteIntensity.ts'
6
+ import { NumericDictTerm } from '../terms/numeric.ts'
6
7
 
7
8
  export type Gene = {
8
9
  /** gene symbol, required */
@@ -42,7 +43,17 @@ export type TermdbClusterRequestMetabolite = TermdbClusterRequestBase & {
42
43
  terms: MetaboliteIntensityTerm[]
43
44
  }
44
45
 
45
- export type TermdbClusterRequest = TermdbClusterRequestGeneExpression | TermdbClusterRequestMetabolite
46
+ export type TermdbClusterRequestNumericDictTerm = TermdbClusterRequestBase & {
47
+ /** Data type */
48
+ dataType: 'numericDictTerm'
49
+ /** List of terms */
50
+ terms: NumericDictTerm[]
51
+ }
52
+
53
+ export type TermdbClusterRequest =
54
+ | TermdbClusterRequestGeneExpression
55
+ | TermdbClusterRequestMetabolite
56
+ | TermdbClusterRequestNumericDictTerm
46
57
 
47
58
  export type Hclust = {
48
59
  merge: { n1: number; n2: number }[]
@@ -50,6 +50,14 @@ export type NumericTerm = BaseTerm & {
50
50
  valueConversion?: ValueConversion*/
51
51
  }
52
52
 
53
+ export type NumericDictTerm = BaseTerm & {
54
+ id?: string
55
+ type: 'integer' | 'float'
56
+ bins: PresetNumericBins
57
+ values?: TermValues
58
+ unit?: string
59
+ }
60
+
53
61
  export type StartUnboundedBin = {
54
62
  // where possible, assign a concrete value (true) when it is known in advance,
55
63
  // in which case, do not use an abstract type (boolean) to startunbounded