@sjcrh/proteinpaint-types 2.180.1 → 2.182.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 (50) hide show
  1. package/dist/brainImaging.js +1 -1
  2. package/dist/{chunk-XCSFBW4V.js → chunk-2QTCQFYE.js} +1101 -649
  3. package/dist/{chunk-DIKDKRFN.js → chunk-3DA4MJ2U.js} +691 -467
  4. package/dist/{chunk-Y6F7ZVSV.js → chunk-45VA4Y6L.js} +691 -467
  5. package/dist/chunk-7OA6G77M.js +113 -0
  6. package/dist/{chunk-XAGXFLSH.js → chunk-C5ECCXOT.js} +1402 -756
  7. package/dist/{chunk-PZUKZRSI.js → chunk-DDMUMMOL.js} +438 -214
  8. package/dist/{chunk-4DCPDZW4.js → chunk-G6ZTAMGK.js} +13 -1
  9. package/dist/{chunk-DPWX7ORN.js → chunk-J55IQXT7.js} +515 -291
  10. package/dist/{chunk-P75GBHFO.js → chunk-K6W2WEPW.js} +857 -395
  11. package/dist/{chunk-LLBTODL6.js → chunk-KNDCWQJD.js} +691 -467
  12. package/dist/{chunk-NOT62STS.js → chunk-UBAJYDGK.js} +453 -229
  13. package/dist/{chunk-WSKMTIOO.js → chunk-URYAC364.js} +677 -453
  14. package/dist/{chunk-6PTYP7X4.js → chunk-UYKWZWCU.js} +2180 -1062
  15. package/dist/{chunk-OT6W3FNI.js → chunk-VUNM6QTX.js} +438 -214
  16. package/dist/{chunk-ICACMXK2.js → chunk-ZKO7LMCC.js} +438 -214
  17. package/dist/{chunk-KFNXZOED.js → chunk-ZRTB7SRA.js} +653 -425
  18. package/dist/correlationVolcano.js +1 -1
  19. package/dist/grin2.js +1 -1
  20. package/dist/index.js +34 -34
  21. package/dist/termdb.categories.js +1 -1
  22. package/dist/termdb.chat.js +438 -214
  23. package/dist/termdb.chat2.js +1 -1
  24. package/dist/termdb.cluster.js +1 -1
  25. package/dist/termdb.descrstats.js +1 -1
  26. package/dist/termdb.diffMeth.js +1 -1
  27. package/dist/termdb.dmr.js +1 -1
  28. package/dist/termdb.isoformAvailability.js +11 -0
  29. package/dist/termdb.numericcategories.js +1 -1
  30. package/dist/termdb.percentile.js +1 -1
  31. package/dist/termdb.termsbyids.js +1 -1
  32. package/dist/termdb.topTermsByType.js +1 -1
  33. package/dist/termdb.topVariablyExpressedGenes.js +1 -1
  34. package/dist/termdb.violinBox.js +11 -0
  35. package/package.json +1 -1
  36. package/src/dataset.ts +92 -58
  37. package/src/index.ts +3 -2
  38. package/src/routes/termdb.cluster.ts +11 -0
  39. package/src/routes/termdb.diffMeth.ts +6 -0
  40. package/src/routes/termdb.dmr.ts +73 -14
  41. package/src/routes/termdb.isoformAvailability.ts +22 -0
  42. package/src/routes/termdb.violinBox.ts +230 -0
  43. package/src/terms/isoformExpression.ts +36 -0
  44. package/src/terms/numeric.ts +2 -0
  45. package/src/vocab.ts +0 -1
  46. package/dist/chunk-R7BNDCKV.js +0 -3722
  47. package/dist/termdb.boxplot.js +0 -11
  48. package/dist/termdb.violin.js +0 -11
  49. package/src/routes/termdb.boxplot.ts +0 -164
  50. package/src/routes/termdb.violin.ts +0 -163
@@ -1,11 +0,0 @@
1
- import {
2
- boxplotPayload,
3
- validBoxPlotRequest,
4
- validBoxPlotResponse
5
- } from "./chunk-XAGXFLSH.js";
6
- import "./chunk-YNHC5SXO.js";
7
- export {
8
- boxplotPayload,
9
- validBoxPlotRequest,
10
- validBoxPlotResponse
11
- };
@@ -1,11 +0,0 @@
1
- import {
2
- validViolinRequest,
3
- validViolinResponse,
4
- violinPayload
5
- } from "./chunk-R7BNDCKV.js";
6
- import "./chunk-YNHC5SXO.js";
7
- export {
8
- validViolinRequest,
9
- validViolinResponse,
10
- violinPayload
11
- };
@@ -1,164 +0,0 @@
1
- import type { RoutePayload } from './routeApi.js'
2
- import type { TermWrapper } from '../terms/tw.ts'
3
- import type { Filter } from '../filter.ts'
4
- import type { DescrStats } from './termdb.descrstats.ts'
5
-
6
- /**Args set in Termdb vocab and from mass box plot */
7
- export type BoxPlotRequest = {
8
- /** Args set in TermVocab */
9
- /** term1 or term */
10
- tw: TermWrapper
11
- genome: string
12
- dslabel: string
13
- /** if true, only return positive values */
14
- isLogScale: boolean
15
- /** sort plots by median value */
16
- orderByMedian: boolean
17
- removeOutliers?: boolean
18
- /** If true, show association tests table */
19
- showAssocTests?: boolean
20
- /** term2 */
21
- overlayTw?: TermWrapper
22
- /** term0 */
23
- divideTw?: TermWrapper
24
- filter?: Filter
25
- filter0?: any
26
- }
27
-
28
- export type BoxPlotResponse = {
29
- /** Absolute min value for all plots */
30
- absMin?: number
31
- /** Absolute max value for all plots */
32
- absMax?: number
33
- /** Bins for overlay and/or divide terms */
34
- bins?: {
35
- [index: string]: any
36
- }
37
- /** Charts data. chartId corresponds the divide by term value*/
38
- charts: {
39
- [chartId: string]: BoxPlotChartEntry
40
- }
41
- /** Descriptive statistics for the entire response */
42
- descrStats: DescrStats
43
- /** Categories not shown in the final plot */
44
- uncomputableValues: { label: string; value: number }[] | null
45
- error?: any
46
- }
47
-
48
- // chart containing a set of boxplots
49
- export type BoxPlotChartEntry = {
50
- /** Chart ID */
51
- chartId: string
52
- /** Boxplot data within the chart */
53
- plots: BoxPlotEntry[]
54
- /** Number of samples represented in the chart */
55
- sampleCount: number
56
- /** Wilcoxon test results for the chart formatted
57
- * for #dom/table.js */
58
- wilcoxon?: [{ value: string }, { value: string }, { html: string }][]
59
- }
60
-
61
- // individual boxplot
62
- export type BoxPlotEntry = {
63
- boxplot: BoxPlotData & { label: string }
64
- /** color matching the value/category color */
65
- color?: string
66
- descrStats: DescrStats
67
- /** Pertains to an uncomputable term value and
68
- * whether or not the plot is hidden by default */
69
- isHidden?: boolean
70
- key: string
71
- /** Usually the same as key, but determined by the tw */
72
- seriesId?: string
73
- }
74
-
75
- export type BoxPlotData = {
76
- /** Min/1st whisker value */
77
- w1: number | undefined
78
- /** Max/2nd whisker value */
79
- w2: number | undefined
80
- /** 5% */
81
- p05: number
82
- /** 25% */
83
- p25: number
84
- /** 50%, median */
85
- p50: number
86
- /** 75% */
87
- p75: number
88
- /** 95% */
89
- p95: number
90
- /** Interquartile region */
91
- iqr: number
92
- /** Outliers */
93
- out: { value: number }[]
94
- }
95
-
96
- export type BoxPlotDescrStatsEntry = {
97
- /** Short hand for summary stat. Use lower case for sanity check */
98
- id: 'total' | 'min' | 'p25' | 'median' | 'mean' | 'p75' | 'max' | 'sd' | 'variance' | 'iqr' | string
99
- /** Full label displayed to the user */
100
- label: string
101
- /** Calculated value. */
102
- value: number
103
- }
104
-
105
- export const boxplotPayload: RoutePayload = {
106
- request: {
107
- typeId: 'BoxPlotRequest'
108
- },
109
- response: {
110
- typeId: 'BoxPlotResponse'
111
- },
112
- examples: [
113
- {
114
- request: {
115
- body: {
116
- tw: {
117
- term: { id: 'subcohort', type: 'categorical' },
118
- values: [{ key: 'ABC', label: 'ABC' }]
119
- },
120
- genome: 'hg38-test',
121
- dslabel: 'TermdbTest',
122
- orderByMedian: true
123
- }
124
- },
125
- response: {
126
- body: {
127
- absMin: 0,
128
- absMax: 100,
129
- plots: [
130
- {
131
- boxplot: {
132
- label: 'ABC',
133
- w1: 0,
134
- w2: 100,
135
- p05: 0,
136
- p25: 25,
137
- p50: 50,
138
- p75: 75,
139
- p95: 100,
140
- iqr: 50,
141
- out: [101, 102, 106]
142
- },
143
- color: 'blue',
144
- descrStats: [
145
- { id: 'total', label: 'Total', value: 100 },
146
- { id: 'min', label: 'Min', value: 0 },
147
- { id: 'p25', label: '25%', value: 25 },
148
- { id: 'median', label: 'Median', value: 50 },
149
- { id: 'mean', label: 'Mean', value: 50 },
150
- { id: 'p75', label: '75%', value: 75 },
151
- { id: 'max', label: 'Max', value: 100 },
152
- { id: 'sd', label: 'SD', value: 0 },
153
- { id: 'variance', label: 'Variance', value: 0 },
154
- { id: 'iqr', label: 'IQR', value: 50 }
155
- ],
156
- key: 'ABC'
157
- }
158
- ],
159
- uncomputableValues: [{ label: 'uncomputable-test', value: 1 }]
160
- }
161
- }
162
- }
163
- ]
164
- }
@@ -1,163 +0,0 @@
1
- import type { RoutePayload } from './routeApi.js'
2
- import type { Filter } from '../filter.ts'
3
- import type { ErrorResponse } from './errorResponse.ts'
4
-
5
- export type ViolinRequest = {
6
- /** A number representing the dimension perpendicular to the violin spread
7
- * (the height of the axis) */
8
- axisHeight: number
9
- /** ?? TODO: Needs description */
10
- currentGeneNames: string[]
11
- /** A string representing the type of symbol used on the plot, which can be
12
- * either 'circles' or 'rugs' */
13
- datasymbol: string
14
- /** A number representing the device's pixel ratio, which may be used for
15
- * rendering quality adjustments */
16
- devicePixelRatio: number
17
- /** optional overlay tw, will generate multiple violin plots */
18
- overlayTw?: any
19
- /** optional divide tw, will generate multiple charts, each of which will contain violin plots */
20
- divideTw?: any
21
- /** Reference label (i.e. short label) for the ds */
22
- dslabel: string
23
- /** optional mass filter */
24
- filter?: Filter
25
- /** optional read-only invisible filter TODO GdcFilter0 */
26
- filter0?: any
27
- /** Reference label */
28
- genome: string
29
- /** If true, uses KDE method to build plot. Otherwise a histogram is rendered */
30
- isKDE: boolean
31
- /** A string with two possible values: 'horizontal' or 'vertical',
32
- * indicating the orientation of the chart, either horizontal or vertical */
33
- orientation: 'horizontal' | 'vertical'
34
- /** A number representing the radius of the data symbols rendered on the plot */
35
- radius: number
36
- /** A number representing the right margin of the chart or plot */
37
- rightMargin: number
38
- /** Term may be scaled from regression analysis. Equivalent of term.q.scale */
39
- scale?: any
40
- /** A number representing the width of the stroke used to generate the data symbols
41
- * (data symbols are rendered on the server side) */
42
- strokeWidth: number
43
- /** A number representing the width of the SVG (Scalable Vector Graphics) box, used for
44
- * rendering the chart */
45
- svgw: number
46
- /** Number of bins to build the plot. Default is 20. */
47
- ticks: number
48
- /** main tw to fetch numeric data to show in violin */
49
- tw: any
50
- /** A string representing a unit of measurement (e.g., 'log' for log scale) */
51
- unit: string
52
- }
53
-
54
- /** ?? TODO: Needs description */
55
- interface BinsEntries {
56
- x0: number
57
- x1: number
58
- density: number
59
- }
60
-
61
- /** ?? TODO: Needs description */
62
- interface ValuesEntries {
63
- id: string
64
- label: string
65
- value: number
66
- }
67
-
68
- /** Computed in wilcoxon to show in table */
69
- interface PValueEntries {
70
- value?: string
71
- html?: string
72
- }
73
-
74
- /** ?? TODO: Needs description */
75
- type ViolinDensity = {
76
- bins: BinsEntries[]
77
- densityMax: number
78
- densityMin: number
79
- }
80
-
81
- export type ViolinPlotEntry = {
82
- /** Color to render */
83
- color: string
84
- chartId: string
85
- density: ViolinDensity
86
- /** Text for label */
87
- label: string
88
- /** Number of samples/cases/patients/etc. */
89
- plotValueCount: number
90
- /** Corresponds to the tw.$id */
91
- seriesId: string
92
- /** Plot image to display */
93
- src: string
94
- /** Descriptive stats (i.e. min, max, sd, etc.) */
95
- summaryStats: ValuesEntries[]
96
- }
97
-
98
- export type ViolinResponse = ValidResponse | ErrorResponse
99
-
100
- type ValidResponse = {
101
- /** Bins used for each term
102
- * Used for listing samples, filtering, etc.*/
103
- bins: { [index: string]: any }
104
- charts: {
105
- [index: string]: {
106
- chartId: string
107
- plots: ViolinPlotEntry[]
108
- pvalues?: PValueEntries[][]
109
- }
110
- }
111
- /** Absolute min value for all plots */
112
- min: number
113
- /** Absolute max value for all plots */
114
- max: number
115
- uncomputableValues: { [index: string]: number }[] | null
116
- }
117
-
118
- export const violinPayload: RoutePayload = {
119
- request: {
120
- typeId: 'ViolinRequest'
121
- },
122
- response: {
123
- typeId: 'ViolinResponse'
124
- },
125
- examples: [
126
- {
127
- request: {
128
- body: {
129
- genome: 'hg38-test',
130
- dslabel: 'TermdbTest',
131
- embedder: 'localhost',
132
- devicePixelRatio: 2.200000047683716,
133
- maxThickness: 150,
134
- screenThickness: 1218,
135
- filter: {
136
- type: 'tvslst',
137
- in: true,
138
- join: '',
139
- lst: [
140
- {
141
- tag: 'cohortFilter',
142
- type: 'tvs',
143
- tvs: { term: { id: 'subcohort', type: 'categorical' }, values: [{ key: 'ABC', label: 'ABC' }] }
144
- }
145
- ]
146
- },
147
- svgw: 227.27272234672367,
148
- orientation: 'horizontal',
149
- datasymbol: 'bean',
150
- radius: 5,
151
- strokeWidth: 0.2,
152
- axisHeight: 60,
153
- rightMargin: 50,
154
- unit: 'abs',
155
- termid: 'agedx'
156
- }
157
- },
158
- response: {
159
- header: { status: 200 }
160
- }
161
- }
162
- ]
163
- }