@sjcrh/proteinpaint-types 2.189.0 → 2.190.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 (245) hide show
  1. package/README.md +8 -20
  2. package/dist/index.js +422 -553
  3. package/dist/index.js.map +7 -0
  4. package/package.json +13 -25
  5. package/dist/aiProjectAdmin.js +0 -11
  6. package/dist/aiProjectSelectedWSImages.js +0 -11
  7. package/dist/aiProjectTrainModel.js +0 -11
  8. package/dist/alphaGenome.js +0 -11
  9. package/dist/alphaGenomeTypes.js +0 -11
  10. package/dist/brainImaging.js +0 -11
  11. package/dist/brainImagingSamples.js +0 -11
  12. package/dist/burden.js +0 -11
  13. package/dist/chunk-2744ACBX.js +0 -126
  14. package/dist/chunk-2BCLGYAG.js +0 -96
  15. package/dist/chunk-2C4X5B6N.js +0 -62
  16. package/dist/chunk-2VJRTZE2.js +0 -287
  17. package/dist/chunk-2X36CBQF.js +0 -158
  18. package/dist/chunk-46YIGVUP.js +0 -908
  19. package/dist/chunk-4EAGOSMN.js +0 -128
  20. package/dist/chunk-5H2LJKPX.js +0 -104
  21. package/dist/chunk-5L4VF3ZL.js +0 -266
  22. package/dist/chunk-5N7V62ZL.js +0 -231
  23. package/dist/chunk-62XTWOVJ.js +0 -273
  24. package/dist/chunk-6GKG55BT.js +0 -232
  25. package/dist/chunk-7MUISZHS.js +0 -61
  26. package/dist/chunk-7OA6G77M.js +0 -113
  27. package/dist/chunk-BCBSHTHS.js +0 -75
  28. package/dist/chunk-CQXBQY2H.js +0 -161
  29. package/dist/chunk-CWACV4MW.js +0 -305
  30. package/dist/chunk-D7AKQKDG.js +0 -238
  31. package/dist/chunk-DDKGTDDB.js +0 -6739
  32. package/dist/chunk-DI4Q26E7.js +0 -16
  33. package/dist/chunk-EIJT53QB.js +0 -240
  34. package/dist/chunk-EOKM345J.js +0 -222
  35. package/dist/chunk-FK7OCBPT.js +0 -341
  36. package/dist/chunk-FMC4G5BP.js +0 -62
  37. package/dist/chunk-GCJESMM2.js +0 -354
  38. package/dist/chunk-GTS2G4R4.js +0 -62
  39. package/dist/chunk-HD3J5BKM.js +0 -409
  40. package/dist/chunk-HQV2A7JV.js +0 -62
  41. package/dist/chunk-IS74WYQF.js +0 -207
  42. package/dist/chunk-JEQGBUK2.js +0 -5993
  43. package/dist/chunk-K4FSDTDW.js +0 -109
  44. package/dist/chunk-KCMPDEH7.js +0 -62
  45. package/dist/chunk-KXYFG2HO.js +0 -307
  46. package/dist/chunk-LC6KLHCJ.js +0 -8903
  47. package/dist/chunk-LQYSPLDQ.js +0 -3613
  48. package/dist/chunk-LRVF7U64.js +0 -62
  49. package/dist/chunk-MHDQO7R5.js +0 -195
  50. package/dist/chunk-MKYLCBTP.js +0 -5475
  51. package/dist/chunk-MNT3GF7M.js +0 -3628
  52. package/dist/chunk-MVB7LQS5.js +0 -3986
  53. package/dist/chunk-P25WDNMD.js +0 -171
  54. package/dist/chunk-P3WBZJFF.js +0 -158
  55. package/dist/chunk-PTE2I7DF.js +0 -91
  56. package/dist/chunk-Q3HGHP3J.js +0 -174
  57. package/dist/chunk-RPX4TVMD.js +0 -14
  58. package/dist/chunk-RXJNXOZC.js +0 -326
  59. package/dist/chunk-SDZIGJY3.js +0 -5931
  60. package/dist/chunk-SLXGWQZ4.js +0 -458
  61. package/dist/chunk-SZZXZZKO.js +0 -3991
  62. package/dist/chunk-TD4YLTHL.js +0 -158
  63. package/dist/chunk-TEXOICIS.js +0 -11810
  64. package/dist/chunk-THQOFV2K.js +0 -205
  65. package/dist/chunk-TLZ5ROOU.js +0 -347
  66. package/dist/chunk-TQQWSHFM.js +0 -5980
  67. package/dist/chunk-U3BTVE5T.js +0 -111
  68. package/dist/chunk-UBOVHONH.js +0 -62
  69. package/dist/chunk-UDTEGP3G.js +0 -365
  70. package/dist/chunk-UYJA4UM7.js +0 -97
  71. package/dist/chunk-V3JDD3ZG.js +0 -3671
  72. package/dist/chunk-VUKRI3TG.js +0 -164
  73. package/dist/chunk-W3F3CLYP.js +0 -61
  74. package/dist/chunk-X4JBWMXY.js +0 -130
  75. package/dist/chunk-X5E72ZXA.js +0 -5979
  76. package/dist/chunk-YNHC5SXO.js +0 -1780
  77. package/dist/chunk-YPEFUAJW.js +0 -62
  78. package/dist/chunk-YSTMGNYR.js +0 -113
  79. package/dist/chunk-Z3IYM5OK.js +0 -296
  80. package/dist/chunk-ZCV62ELK.js +0 -96
  81. package/dist/chunk-ZIOJDN75.js +0 -197
  82. package/dist/chunk-ZMDZYG5B.js +0 -4224
  83. package/dist/clearwsisession.js +0 -78
  84. package/dist/clearwsisessions.js +0 -13
  85. package/dist/correlationVolcano.js +0 -11
  86. package/dist/dataset.js +0 -11
  87. package/dist/deleteWSITileSelection.js +0 -11
  88. package/dist/dsdata.js +0 -11
  89. package/dist/dzimages.js +0 -11
  90. package/dist/gdc.grin2.js +0 -17
  91. package/dist/gdc.maf.js +0 -11
  92. package/dist/gdc.mafBuild.js +0 -11
  93. package/dist/genelookup.js +0 -11
  94. package/dist/genesetEnrichment.js +0 -11
  95. package/dist/genesetOverrepresentation.js +0 -11
  96. package/dist/grin2.js +0 -11
  97. package/dist/healthcheck.js +0 -11
  98. package/dist/hicdata.js +0 -11
  99. package/dist/hicgenome.js +0 -11
  100. package/dist/hicstat.js +0 -11
  101. package/dist/img.js +0 -11
  102. package/dist/isoformlst.js +0 -11
  103. package/dist/ntseq.js +0 -11
  104. package/dist/pdomain.js +0 -11
  105. package/dist/samplewsimages.js +0 -13
  106. package/dist/saveWSIAnnotation.js +0 -11
  107. package/dist/snp.js +0 -11
  108. package/dist/termdb.DE.js +0 -11
  109. package/dist/termdb.categories.js +0 -11
  110. package/dist/termdb.chat.js +0 -3631
  111. package/dist/termdb.chat2.js +0 -15
  112. package/dist/termdb.cluster.js +0 -11
  113. package/dist/termdb.cohort.summary.js +0 -11
  114. package/dist/termdb.cohorts.js +0 -11
  115. package/dist/termdb.dapVolcano.js +0 -11
  116. package/dist/termdb.descrstats.js +0 -11
  117. package/dist/termdb.diffMeth.js +0 -11
  118. package/dist/termdb.dmr.js +0 -11
  119. package/dist/termdb.filterTermValues.js +0 -11
  120. package/dist/termdb.isoformAvailability.js +0 -11
  121. package/dist/termdb.numericcategories.js +0 -11
  122. package/dist/termdb.percentile.js +0 -11
  123. package/dist/termdb.profileFormScores.js +0 -11
  124. package/dist/termdb.profileForms2Scores.js +0 -11
  125. package/dist/termdb.profileScores.js +0 -11
  126. package/dist/termdb.proteome.js +0 -11
  127. package/dist/termdb.rootterm.js +0 -11
  128. package/dist/termdb.runChart.js +0 -13
  129. package/dist/termdb.sampleImages.js +0 -11
  130. package/dist/termdb.sampleScatter.js +0 -11
  131. package/dist/termdb.singleSampleMutation.js +0 -11
  132. package/dist/termdb.singlecellDEgenes.js +0 -11
  133. package/dist/termdb.singlecellData.js +0 -11
  134. package/dist/termdb.singlecellSamples.js +0 -11
  135. package/dist/termdb.termchildren.js +0 -11
  136. package/dist/termdb.termsbyids.js +0 -11
  137. package/dist/termdb.topMutatedGenes.js +0 -11
  138. package/dist/termdb.topTermsByType.js +0 -11
  139. package/dist/termdb.topVariablyExpressedGenes.js +0 -11
  140. package/dist/termdb.violinBox.js +0 -17
  141. package/dist/tileserver.js +0 -11
  142. package/dist/wsimages.js +0 -11
  143. package/dist/wsisamples.js +0 -11
  144. package/src/Mclass.ts +0 -8
  145. package/src/dataset.ts +0 -2188
  146. package/src/docs.json +0 -16417
  147. package/src/fileOrUrl.ts +0 -15
  148. package/src/filter.ts +0 -110
  149. package/src/genome.ts +0 -129
  150. package/src/index.ts +0 -94
  151. package/src/routes/aiProjectAdmin.ts +0 -37
  152. package/src/routes/aiProjectSelectedWSImages.ts +0 -47
  153. package/src/routes/aiProjectTrainModel.ts +0 -20
  154. package/src/routes/alphaGenome.ts +0 -27
  155. package/src/routes/alphaGenomeTypes.ts +0 -21
  156. package/src/routes/brainImaging.ts +0 -47
  157. package/src/routes/brainImagingSamples.ts +0 -25
  158. package/src/routes/burden.ts +0 -113
  159. package/src/routes/clearwsisessions.ts +0 -19
  160. package/src/routes/correlationVolcano.ts +0 -51
  161. package/src/routes/dataset.ts +0 -14
  162. package/src/routes/deleteWSITileSelection.ts +0 -25
  163. package/src/routes/dsdata.ts +0 -14
  164. package/src/routes/dzimages.ts +0 -25
  165. package/src/routes/errorResponse.ts +0 -6
  166. package/src/routes/filter.gdc.ts +0 -15
  167. package/src/routes/gdc.grin2.ts +0 -246
  168. package/src/routes/gdc.maf.ts +0 -52
  169. package/src/routes/gdc.mafBuild.ts +0 -20
  170. package/src/routes/genelookup.ts +0 -22
  171. package/src/routes/genesetEnrichment.ts +0 -116
  172. package/src/routes/genesetOverrepresentation.ts +0 -48
  173. package/src/routes/grin2.ts +0 -173
  174. package/src/routes/healthcheck.ts +0 -80
  175. package/src/routes/hicdata.ts +0 -48
  176. package/src/routes/hicgenome.ts +0 -50
  177. package/src/routes/hicstat.ts +0 -57
  178. package/src/routes/img.ts +0 -23
  179. package/src/routes/isoformlst.ts +0 -14
  180. package/src/routes/ntseq.ts +0 -14
  181. package/src/routes/pdomain.ts +0 -14
  182. package/src/routes/routeApi.ts +0 -47
  183. package/src/routes/samplewsimages.ts +0 -44
  184. package/src/routes/saveWSIAnnotation.ts +0 -25
  185. package/src/routes/snp.ts +0 -13
  186. package/src/routes/termdb.DE.ts +0 -226
  187. package/src/routes/termdb.categories.ts +0 -74
  188. package/src/routes/termdb.chat2.ts +0 -190
  189. package/src/routes/termdb.cluster.ts +0 -134
  190. package/src/routes/termdb.cohort.summary.ts +0 -14
  191. package/src/routes/termdb.cohorts.ts +0 -14
  192. package/src/routes/termdb.dapVolcano.ts +0 -35
  193. package/src/routes/termdb.descrstats.ts +0 -75
  194. package/src/routes/termdb.diffMeth.ts +0 -63
  195. package/src/routes/termdb.dmr.ts +0 -121
  196. package/src/routes/termdb.filterTermValues.ts +0 -23
  197. package/src/routes/termdb.isoformAvailability.ts +0 -22
  198. package/src/routes/termdb.numericcategories.ts +0 -32
  199. package/src/routes/termdb.percentile.ts +0 -67
  200. package/src/routes/termdb.profileFormScores.ts +0 -26
  201. package/src/routes/termdb.profileForms2Scores.ts +0 -25
  202. package/src/routes/termdb.profileScores.ts +0 -27
  203. package/src/routes/termdb.proteome.ts +0 -13
  204. package/src/routes/termdb.rootterm.ts +0 -49
  205. package/src/routes/termdb.runChart.ts +0 -66
  206. package/src/routes/termdb.sampleImages.ts +0 -26
  207. package/src/routes/termdb.sampleScatter.ts +0 -60
  208. package/src/routes/termdb.singleSampleMutation.ts +0 -51
  209. package/src/routes/termdb.singlecellDEgenes.ts +0 -50
  210. package/src/routes/termdb.singlecellData.ts +0 -75
  211. package/src/routes/termdb.singlecellSamples.ts +0 -50
  212. package/src/routes/termdb.termchildren.ts +0 -49
  213. package/src/routes/termdb.termsbyids.ts +0 -26
  214. package/src/routes/termdb.topMutatedGenes.ts +0 -51
  215. package/src/routes/termdb.topTermsByType.ts +0 -32
  216. package/src/routes/termdb.topVariablyExpressedGenes.ts +0 -54
  217. package/src/routes/termdb.violinBox.ts +0 -230
  218. package/src/routes/tileserver.ts +0 -14
  219. package/src/routes/wsimages.ts +0 -34
  220. package/src/routes/wsisamples.ts +0 -25
  221. package/src/termdb.matrix.ts +0 -57
  222. package/src/terms/categorical.ts +0 -18
  223. package/src/terms/condition.ts +0 -73
  224. package/src/terms/date.ts +0 -20
  225. package/src/terms/dnaMethylation.ts +0 -28
  226. package/src/terms/geneExpression.ts +0 -38
  227. package/src/terms/geneVariant.ts +0 -132
  228. package/src/terms/isoformExpression.ts +0 -36
  229. package/src/terms/metaboliteIntensity.ts +0 -30
  230. package/src/terms/numeric.ts +0 -278
  231. package/src/terms/proteomeAbundance.ts +0 -38
  232. package/src/terms/q.ts +0 -105
  233. package/src/terms/qualitative.ts +0 -73
  234. package/src/terms/samplelst.ts +0 -34
  235. package/src/terms/singleCellCellType.ts +0 -18
  236. package/src/terms/singleCellGeneExpression.ts +0 -32
  237. package/src/terms/snp.ts +0 -24
  238. package/src/terms/snps.ts +0 -111
  239. package/src/terms/ssGSEA.ts +0 -26
  240. package/src/terms/term.ts +0 -60
  241. package/src/terms/termCollection.ts +0 -139
  242. package/src/terms/tw.ts +0 -64
  243. package/src/termsetting.ts +0 -201
  244. package/src/test/numeric.type.spec.ts +0 -275
  245. package/src/vocab.ts +0 -37
@@ -1,230 +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 { ErrorResponse } from './errorResponse.ts'
5
- import type { DescrStats } from './termdb.descrstats.ts'
6
-
7
- /** Common properties shared by both violin and box plots */
8
- type CommonProps = {
9
- /** numeric tw to fetch numeric data. tw.q.mode must be continuous */
10
- tw: TermWrapper
11
- dslabel: string
12
- genome: string
13
- /** overlay tw for multiple violins/boxplots */
14
- overlayTw?: TermWrapper
15
- /** tw to divide to multiple charts */
16
- divideTw?: TermWrapper
17
- /** mass filter */
18
- filter?: Filter
19
- /** read-only invisible filter */
20
- filter0?: any
21
- /** TODO: Needs description FIXME delete */
22
- currentGeneNames?: string[]
23
- /** if true, use log scale; if false or undefined, use linear scale */
24
- isLogScale?: boolean
25
- }
26
-
27
- /** Request type for violin plots with required violin-specific parameters */
28
- export type ViolinRequest = CommonProps & {
29
- /** Indicates the type of chart to render */
30
- plotType: 'violin'
31
- /** A number representing the dimension perpendicular to the violin spread */
32
- axisHeight?: number
33
- /** A string representing the type of symbol used on the plot */
34
- datasymbol?: string
35
- /** A number representing the device's pixel ratio */
36
- devicePixelRatio: number
37
- /** If true, uses KDE method to build plot */
38
- isKDE?: boolean
39
- /** A string with two possible values: 'horizontal' or 'vertical' */
40
- orientation: string
41
- /** A number representing the radius of the data symbols */
42
- radius: number
43
- /** A number representing the right margin */
44
- rightMargin?: number
45
- /** Term may be scaled from regression analysis */
46
- scale?: any
47
- /** A number representing the width of the stroke */
48
- strokeWidth?: number
49
- /** A number representing the width of the SVG box */
50
- svgw: number
51
- /** Number of bins to build the plot. Default is 20. */
52
- ticks?: number
53
- }
54
-
55
- /** Request type for box plots with required box-specific parameters */
56
- export type BoxRequest = CommonProps & {
57
- /** Indicates the type of chart to render */
58
- plotType: 'box'
59
- /** sort plots by median value */
60
- orderByMedian?: boolean
61
- /** Remove outliers from the plot */
62
- removeOutliers?: boolean
63
- /** If true, show association tests table */
64
- showAssocTests?: boolean
65
- }
66
-
67
- /**Unified request type for violin and boxplot - union of ViolinRequest and BoxRequest */
68
- export type ViolinBoxRequest = ViolinRequest | BoxRequest
69
-
70
- export type ViolinBoxResponse = ViolinResponse | BoxPlotResponse | ErrorResponse
71
-
72
- /** Type guard to check if response is an ErrorResponse */
73
- export function isErrorResponse(response: ViolinBoxResponse): response is ErrorResponse {
74
- return 'error' in response && 'status' in response
75
- }
76
-
77
- /** Type guard to check if response is a BoxPlotResponse */
78
- export function isBoxPlotResponse(response: ViolinBoxResponse): response is BoxPlotResponse {
79
- return !isErrorResponse(response) && 'charts' in response && 'descrStats' in response
80
- }
81
-
82
- /** Type guard to check if response is a ViolinResponse */
83
- export function isViolinResponse(response: ViolinBoxResponse): response is ViolinResponse {
84
- return !isErrorResponse(response) && 'min' in response && 'max' in response
85
- }
86
-
87
- /** Violin response types */
88
- interface BinsEntries {
89
- x0: number
90
- x1: number
91
- density: number
92
- }
93
-
94
- interface ValuesEntries {
95
- id: string
96
- label: string
97
- value: number
98
- }
99
-
100
- interface PValueEntries {
101
- value?: string
102
- html?: string
103
- }
104
-
105
- type ViolinDensity = {
106
- bins: BinsEntries[]
107
- densityMax: number
108
- densityMin: number
109
- }
110
-
111
- export type ViolinPlotEntry = {
112
- color: string
113
- chartId: string
114
- density: ViolinDensity
115
- label: string
116
- plotValueCount: number
117
- seriesId: string
118
- src: string
119
- summaryStats: ValuesEntries[]
120
- }
121
-
122
- export type ViolinResponse = {
123
- bins: { [index: string]: any }
124
- charts: {
125
- [index: string]: {
126
- chartId: string
127
- plots: ViolinPlotEntry[]
128
- pvalues?: PValueEntries[][]
129
- }
130
- }
131
- min: number
132
- max: number
133
- uncomputableValues: { [index: string]: number }[] | null
134
- descrStats?: DescrStats
135
- }
136
-
137
- /** Boxplot response types */
138
- export type BoxPlotData = {
139
- w1: number | undefined
140
- w2: number | undefined
141
- p05: number
142
- p25: number
143
- p50: number
144
- p75: number
145
- p95: number
146
- iqr: number
147
- out: { value: number }[]
148
- }
149
-
150
- export type BoxPlotEntry = {
151
- boxplot: BoxPlotData & { label: string }
152
- color?: string
153
- descrStats: DescrStats
154
- isHidden?: boolean
155
- key: string
156
- seriesId?: string
157
- }
158
-
159
- export type BoxPlotChartEntry = {
160
- chartId: string
161
- plots: BoxPlotEntry[]
162
- sampleCount: number
163
- wilcoxon?: [{ value: string }, { value: string }, { html: string }][]
164
- }
165
-
166
- export type BoxPlotResponse = {
167
- absMin?: number
168
- absMax?: number
169
- bins?: {
170
- [index: string]: any
171
- }
172
- charts: {
173
- [chartId: string]: BoxPlotChartEntry
174
- }
175
- descrStats: DescrStats
176
- uncomputableValues: { label: string; value: number }[] | null
177
- }
178
-
179
- export const violinBoxPayload: RoutePayload = {
180
- request: {
181
- typeId: 'ViolinBoxRequest'
182
- },
183
- response: {
184
- typeId: 'ViolinBoxResponse'
185
- },
186
- examples: [
187
- {
188
- request: {
189
- body: {
190
- plotType: 'violin',
191
- genome: 'hg38-test',
192
- dslabel: 'TermdbTest',
193
- tw: {
194
- term: { id: 'aaclassic_5', type: 'float' },
195
- q: { mode: 'continuous' }
196
- },
197
- devicePixelRatio: 2,
198
- svgw: 200,
199
- orientation: 'horizontal',
200
- datasymbol: 'rug',
201
- radius: 5,
202
- isLogScale: false
203
- }
204
- },
205
- response: {
206
- header: { status: 200 }
207
- }
208
- },
209
- {
210
- request: {
211
- body: {
212
- plotType: 'box',
213
- genome: 'hg38-test',
214
- dslabel: 'TermdbTest',
215
- tw: {
216
- term: { id: 'agedx', type: 'float' },
217
- q: { mode: 'continuous' }
218
- },
219
- overlayTw: {
220
- term: { id: 'sex', type: 'categorical' }
221
- },
222
- orderByMedian: true
223
- }
224
- },
225
- response: {
226
- header: { status: 200 }
227
- }
228
- }
229
- ]
230
- }
@@ -1,14 +0,0 @@
1
- import type { RoutePayload } from './routeApi.js'
2
-
3
- export type TileRequest = any
4
- export type TileResponse = any
5
-
6
- export const tilePayload: RoutePayload = {
7
- request: {
8
- typeId: 'TileRequest'
9
- },
10
- response: {
11
- typeId: 'TileResponse'
12
- }
13
- // examples: []
14
- }
@@ -1,34 +0,0 @@
1
- import type { RoutePayload } from './routeApi.js'
2
-
3
- export type WSImagesRequest = {
4
- genome: string
5
- dslabel: string
6
- sampleId?: string
7
- wsimage: string
8
- aiProjectId?: number
9
- }
10
-
11
- export type WSImagesResponse = {
12
- // TileServer image session id
13
- wsiSessionId?: string
14
- overlays?: Array<PredictionOverlay>
15
- slide_dimensions: number[]
16
- mpp: number[]
17
- status: string
18
- error?: string
19
- }
20
-
21
- export type PredictionOverlay = {
22
- layerNumber: string
23
- predictionOverlayType: string
24
- }
25
-
26
- export const wsImagesPayload: RoutePayload = {
27
- request: {
28
- typeId: 'WSImagesRequest'
29
- },
30
- response: {
31
- typeId: 'WSImagesResponse'
32
- }
33
- // examples: []
34
- }
@@ -1,25 +0,0 @@
1
- import type { RoutePayload } from './routeApi.js'
2
-
3
- export type WSISamplesRequest = {
4
- genome: string
5
- dslabel: string
6
- }
7
-
8
- export type WSISamplesResponse = {
9
- samples: Array<WSISample>
10
- error?: string
11
- }
12
-
13
- export type WSISample = {
14
- sampleId: string
15
- wsimages: Array<string>
16
- }
17
-
18
- export const wsiSamplesPayload: RoutePayload = {
19
- request: {
20
- typeId: 'WSISamplesRequest'
21
- },
22
- response: {
23
- typeId: 'WSISamplesResponse'
24
- }
25
- }
@@ -1,57 +0,0 @@
1
- /******* server/src/termdb.matrix.js is ~not~ a route *****
2
- * getData() is used frequently in other routes or typescript files.
3
- * Although the original file is 1) not ts and 2) not a route, a type
4
- * is still needed when func used in other ts files.
5
- *
6
- * Use this type for that purpose.
7
- */
8
-
9
- type SampleEntry = {
10
- /** stringified integer sample id */
11
- sample: string | number
12
- } & {
13
- /** key and values for terms, separated by tw.$id */
14
- [index: string]: {
15
- key: number
16
- value: number
17
- }
18
- }
19
-
20
- type CategoryEntry = {
21
- key: string
22
- label: string
23
- samplecount: number
24
- }
25
-
26
- // TODO: need to add a discriminant property (e.g. ".kind") to
27
- // distinguish between ValidGetDataResponse and { error: string }
28
- export type ValidGetDataResponse = {
29
- samples: {
30
- [index: string | number]: SampleEntry
31
- }
32
- /** Metadata */
33
- refs: {
34
- /** metadata about terms
35
- * Index is <tw.$id> */
36
- byTermId: Record<
37
- string,
38
- {
39
- keyOrder?: any
40
- /** CTE.bins */
41
- bins?: any
42
- /** CTE.events. These info are not available in term object and is computed during run time. */
43
- events?: any
44
- /** Categories of term. Only computed for categorical terms that
45
- have an empty term.values{}. */
46
- categories?: CategoryEntry[]
47
- }
48
- >
49
- /** metadata about samples (e.g. print names). avoid duplicating such in sample data elements (e.g. mutations)
50
- [sample integer id]: {label: [string sample name for display], ...}
51
- May return as an empty object. */
52
- bySampleId: Record<string, { label: string }> | object
53
- }
54
- sampleType?: any
55
- }
56
-
57
- export type GetDataResponse = ValidGetDataResponse | { error: string }
@@ -1,18 +0,0 @@
1
- import type { TermGroupSetting, TermValues, BaseTerm } from '../index.ts'
2
-
3
- /*
4
- For term type 'snp'
5
- */
6
-
7
- export type CategoricalTerm = BaseTerm & {
8
- id: string
9
- name?: string
10
- type: 'categorical'
11
- values: TermValues
12
- groupsetting: TermGroupSetting
13
- }
14
-
15
- export type RawCategoricalTerm = CategoricalTerm & {
16
- groupsetting?: TermGroupSetting
17
- values?: TermValues
18
- }
@@ -1,73 +0,0 @@
1
- import type { BaseTerm, MinBaseQ, TermValues, BaseTW } from '../index.ts'
2
- //import type { TermWrapper } from './tw.ts'
3
-
4
- /**
5
- * @category TW
6
- */
7
-
8
- export type ConditionGradeQ = MinBaseQ & {
9
- mode: 'discrete' | 'binary' | 'cuminc' | 'cox'
10
- valueFor: 'grade'
11
- bar_by_grade: true
12
- /**
13
- Breaks grades into groups
14
- Array length=1, will break grades to 2 groups.
15
- E.g. [3] divides to [-1,0,1,2,], [3,4,5]
16
- Allowed for both conditionModes "discrete/binary"
17
- Array length=2, break to 3 groups.
18
- E.g. [1,2] divides to [-1,0], [1], [2,3,4,5]
19
- E.g. [1,3] divides to [-1,0], [1,2], [3,4,5]
20
- Only allowed for conditionMode="discrete" but not "binary"
21
- */
22
- timeScale: 'age' | 'time'
23
- breaks?: number[]
24
- value_by_max_grade?: boolean //'false' if bar_by_children is 'true'
25
- value_by_most_recent?: boolean //'false' if bar_by_children is 'true'
26
- value_by_computable_grade?: boolean //'true' if bar_by_children is 'true'
27
- groups?: any // TODO: should use a defined type
28
- }
29
-
30
- export type ConditionChildrenQ = MinBaseQ & {
31
- mode: 'discrete'
32
- valueFor: 'children'
33
- bar_by_children: true
34
- groups?: any // TODO: should use a defined type
35
- }
36
-
37
- // TODO: should implement the expected property combinations as distinct types
38
- export type ConditionQ = ConditionGradeQ | ConditionChildrenQ
39
-
40
- export type ConditionTerm = BaseTerm & {
41
- type: 'condition'
42
- values: TermValues
43
- }
44
-
45
- /**
46
- * @group Termdb
47
- * @category TW
48
- */
49
- export type ConditionTW = BaseTW & {
50
- type: 'ConditionTW'
51
- term: ConditionTerm
52
- q: ConditionQ //replace the generic Q with specific condition Q
53
- }
54
-
55
- /**
56
- * @group Termdb
57
- * @category TW
58
- */
59
- /*
60
- export type ConditionTermSettingInstance = TermSettingInstance & {
61
- q: ConditionQ
62
- category2samplecount: { key: string; label: string; count: number }[]
63
- refGrp: any
64
- }
65
- */
66
-
67
- export type RawConditionTW = ConditionTW & {
68
- q: {
69
- valueFor?: 'grade' | 'children'
70
- bar_by_children?: true
71
- bar_by_grade?: true
72
- }
73
- }
package/src/terms/date.ts DELETED
@@ -1,20 +0,0 @@
1
- import type { NumericBaseTerm, PresetNumericBins, NumTW, RawNumTW } from '../index.ts'
2
-
3
- /*
4
- --------EXPORTED--------
5
- DateTerm
6
- DateTW
7
- DateTermSettingInstance
8
- */
9
-
10
- export type DateTerm = NumericBaseTerm & {
11
- name: string
12
- type: 'date'
13
- bins?: PresetNumericBins
14
- }
15
-
16
- export type DateTW = NumTW & { term: DateTerm }
17
-
18
- export type RawDateTerm = DateTerm & { name?: string }
19
-
20
- export type RawDateTW = RawNumTW & { term: RawDateTerm }
@@ -1,28 +0,0 @@
1
- import type { NumericBaseTerm, NumericQ, PresetNumericBins, NumTW, RawNumTW } from './numeric.ts'
2
-
3
- export type DnaMethylationQ = NumericQ & { dt?: number }
4
-
5
- export type DnaMethylationTerm = NumericBaseTerm & {
6
- type: 'dnaMethylation'
7
- /** concatenated string value "chr:start-stop" */
8
- id?: string
9
- chr: string
10
- start: number
11
- stop: number
12
- /** Type used to categorize the genomic feature */
13
- genomicFeatureType: 'gene' | 'promoter' | 'region' | 'enhancer'
14
- bins?: PresetNumericBins
15
- }
16
-
17
- export type RawDnaMethylationTerm = DnaMethylationTerm & {
18
- /** Name of the genomic feature, e.g., gene name or promoter id/name, etc.
19
- * Different than .name, which includes the genomic coordinates and unit,
20
- * and is used for display purposes.*/
21
- featureName?: string
22
- name?: string
23
- unit?: string
24
- }
25
-
26
- export type DnaMethylationTW = NumTW & { term: DnaMethylationTerm }
27
-
28
- export type RawDnaMethylationTW = RawNumTW & { term: RawDnaMethylationTerm }
@@ -1,38 +0,0 @@
1
- import type { PresetNumericBins, NumericBaseTerm, NumTW, RawNumTW } from '../index.ts'
2
-
3
- /*
4
- --------EXPORTED--------
5
- GeneExpressionTerm
6
- GeneExpressionTermWrapper
7
- GeneExpressionTermSettingInstance
8
- */
9
-
10
- type Gene = {
11
- kind?: 'gene'
12
- gene: string
13
- // chr,start,stop should exist together as a separate type called
14
- // 'Coord', but hard to code as atomic `& Coord` because it may
15
- // need to be filled in
16
- chr?: string
17
- start?: number
18
- stop?: number
19
- }
20
-
21
- type Coord = {
22
- kind?: 'coord'
23
- gene?: string
24
- chr: string
25
- start: number
26
- stop: number
27
- }
28
-
29
- export type GeneExpressionTerm = NumericBaseTerm & {
30
- type: 'geneExpression'
31
- bins?: PresetNumericBins
32
- } & (Gene | Coord)
33
-
34
- export type GeneExpressionTW = NumTW & { term: GeneExpressionTerm }
35
-
36
- export type RawGeneExpTerm = GeneExpressionTerm & { name?: string }
37
-
38
- export type RawGeneExpTW = RawNumTW & { term: RawGeneExpTerm }
@@ -1,132 +0,0 @@
1
- import type { MinBaseQ, BaseTerm, TermGroupSetting, BaseTW, TermValues, BaseGroupSet } from '../index.ts'
2
-
3
- // q types
4
- export type GvBaseQ = MinBaseQ & {
5
- // TODO: may uncomment below if q.mode is required in downstream code
6
- // mode?: 'discrete' // may support 'continuous' for CNV?
7
- cnvGainCutoff?: number
8
- cnvMaxLength?: number
9
- cnvMinAbsValue?: number
10
- cnvLossCutoff?: number
11
- }
12
-
13
- type RawGvValuesQ = GvBaseQ & { type?: 'values' }
14
- type RawGvPredefinedGsQ = GvBaseQ & {
15
- type: 'predefined-groupset'
16
- predefined_groupset_idx?: number
17
- dtLst?: any[] // dts to query
18
- }
19
- type RawGvCustomGsQ = GvBaseQ & {
20
- type: 'custom-groupset'
21
- customset?: BaseGroupSet
22
- dtLst?: any[] // dts to query
23
- }
24
- export type RawGvQ = RawGvValuesQ | RawGvPredefinedGsQ | RawGvCustomGsQ
25
-
26
- export type GvValuesQ = GvBaseQ & { type: 'values' }
27
- export type GvPredefinedGsQ = GvBaseQ & {
28
- type: 'predefined-groupset'
29
- predefined_groupset_idx: number
30
- dtLst: any[] // dts to query
31
- }
32
- export type GvCustomGsQ = GvBaseQ & {
33
- type: 'custom-groupset'
34
- customset: BaseGroupSet
35
- dtLst: any[] // dts to query
36
- }
37
-
38
- export type GvQ = GvValuesQ | GvPredefinedGsQ | GvCustomGsQ
39
-
40
- // term types
41
- type Gene = {
42
- kind: 'gene'
43
- gene: string
44
- // chr,start,stop should exist together as a separate type called
45
- // 'Coord', but hard to code as atomic `& Coord` because it may
46
- // need to be filled in
47
- chr?: string
48
- start?: number
49
- stop?: number
50
- }
51
-
52
- type Coord = {
53
- kind: 'coord'
54
- chr: string
55
- start: number
56
- stop: number
57
- }
58
-
59
- type GvGeneTerm = BaseTerm & (Gene | Coord)
60
-
61
- // including (Gene | Coord) for backwards compatibility
62
- // with older geneVariant term structure
63
- type GvBaseTerm = BaseTerm &
64
- (Gene | Coord) & {
65
- type: 'geneVariant'
66
- genes: GvGeneTerm[]
67
- }
68
-
69
- export type RawGvTerm = GvBaseTerm & {
70
- groupsetting?: TermGroupSetting
71
- childTerms?: DtTerm[]
72
- }
73
-
74
- export type GvTerm = GvBaseTerm & {
75
- groupsetting: TermGroupSetting
76
- childTerms: DtTerm[]
77
- }
78
-
79
- // tw types
80
- export type RawGvValuesTW = BaseTW & {
81
- type?: 'GvValuesTW'
82
- term: RawGvTerm
83
- q: RawGvValuesQ
84
- }
85
-
86
- export type RawGvPredefinedGsTW = BaseTW & {
87
- type?: 'GvPredefinedGsTW'
88
- term: RawGvTerm
89
- q: RawGvPredefinedGsQ
90
- }
91
-
92
- export type RawGvCustomGsTW = BaseTW & {
93
- type?: 'GvCustomGsTW'
94
- term: RawGvTerm
95
- q: RawGvCustomGsQ
96
- }
97
-
98
- export type GvValuesTW = BaseTW & {
99
- type: 'GvValuesTW'
100
- term: GvTerm
101
- q: GvValuesQ
102
- }
103
-
104
- export type GvPredefinedGsTW = BaseTW & {
105
- type: 'GvPredefinedGsTW'
106
- term: GvTerm
107
- q: GvPredefinedGsQ
108
- }
109
-
110
- export type GvCustomGsTW = BaseTW & {
111
- type: 'GvCustomGsTW'
112
- term: GvTerm
113
- q: GvCustomGsQ
114
- }
115
-
116
- export type RawGvTW = RawGvValuesTW | RawGvPredefinedGsTW | RawGvCustomGsTW
117
- export type GvTW = GvValuesTW | GvPredefinedGsTW | GvCustomGsTW
118
-
119
- // miscellaneous types
120
- export type DtTerm = {
121
- id: string
122
- query: string
123
- name: string
124
- name_noOrigin: string
125
- parentTerm?: RawGvTerm
126
- parent_id: any
127
- isleaf: boolean
128
- type: string
129
- dt: number
130
- origin?: string
131
- values: TermValues
132
- }