@sjcrh/proteinpaint-types 2.188.1 → 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-46YIGVUP.js +0 -908
  18. package/dist/chunk-4EAGOSMN.js +0 -128
  19. package/dist/chunk-5H2LJKPX.js +0 -104
  20. package/dist/chunk-5L4VF3ZL.js +0 -266
  21. package/dist/chunk-5N7V62ZL.js +0 -231
  22. package/dist/chunk-62XTWOVJ.js +0 -273
  23. package/dist/chunk-6GKG55BT.js +0 -232
  24. package/dist/chunk-7MUISZHS.js +0 -61
  25. package/dist/chunk-7OA6G77M.js +0 -113
  26. package/dist/chunk-AGMCAWBR.js +0 -454
  27. package/dist/chunk-BCBSHTHS.js +0 -75
  28. package/dist/chunk-BZVFHGN3.js +0 -350
  29. package/dist/chunk-CQXBQY2H.js +0 -161
  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-DUCWIRPX.js +0 -311
  34. package/dist/chunk-EIJT53QB.js +0 -240
  35. package/dist/chunk-EOKM345J.js +0 -222
  36. package/dist/chunk-FK7OCBPT.js +0 -341
  37. package/dist/chunk-FMC4G5BP.js +0 -62
  38. package/dist/chunk-G4MMYXP6.js +0 -405
  39. package/dist/chunk-GTS2G4R4.js +0 -62
  40. package/dist/chunk-HQV2A7JV.js +0 -62
  41. package/dist/chunk-IS74WYQF.js +0 -207
  42. package/dist/chunk-JDF7A2LY.js +0 -361
  43. package/dist/chunk-JEQGBUK2.js +0 -5993
  44. package/dist/chunk-K4FSDTDW.js +0 -109
  45. package/dist/chunk-KCMPDEH7.js +0 -62
  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-PTE2I7DF.js +0 -91
  55. package/dist/chunk-Q3HGHP3J.js +0 -174
  56. package/dist/chunk-QNH3PKJK.js +0 -343
  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-SZZXZZKO.js +0 -3991
  61. package/dist/chunk-TD4YLTHL.js +0 -158
  62. package/dist/chunk-TEXOICIS.js +0 -11810
  63. package/dist/chunk-THQOFV2K.js +0 -205
  64. package/dist/chunk-TQQWSHFM.js +0 -5980
  65. package/dist/chunk-U3BTVE5T.js +0 -111
  66. package/dist/chunk-UBOVHONH.js +0 -62
  67. package/dist/chunk-ULKGA7YY.js +0 -158
  68. package/dist/chunk-UYJA4UM7.js +0 -97
  69. package/dist/chunk-V3JDD3ZG.js +0 -3671
  70. package/dist/chunk-VJB6F2HL.js +0 -309
  71. package/dist/chunk-VUKRI3TG.js +0 -164
  72. package/dist/chunk-W3F3CLYP.js +0 -61
  73. package/dist/chunk-X4JBWMXY.js +0 -130
  74. package/dist/chunk-X5E72ZXA.js +0 -5979
  75. package/dist/chunk-YNHC5SXO.js +0 -1780
  76. package/dist/chunk-YPEFUAJW.js +0 -62
  77. package/dist/chunk-YSTMGNYR.js +0 -113
  78. package/dist/chunk-YW5G4M5D.js +0 -158
  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 -2186
  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 -48
  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 -220
  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,36 +0,0 @@
1
- import type { PresetNumericBins, NumericBaseTerm, NumTW, RawNumTW } from '../index.ts'
2
-
3
- /*
4
- --------EXPORTED--------
5
- IsoformExpressionTerm
6
- IsoformExpressionTermWrapper
7
- */
8
-
9
- type Isoform = {
10
- kind?: 'isoform'
11
- isoform: string
12
- gene?: string
13
- chr?: string
14
- start?: number
15
- stop?: number
16
- }
17
-
18
- type Coord = {
19
- kind?: 'coord'
20
- isoform?: string
21
- gene?: string
22
- chr: string
23
- start: number
24
- stop: number
25
- }
26
-
27
- export type IsoformExpressionTerm = NumericBaseTerm & {
28
- type: 'isoformExpression'
29
- bins?: PresetNumericBins
30
- } & (Isoform | Coord)
31
-
32
- export type IsoformExpressionTW = NumTW & { term: IsoformExpressionTerm }
33
-
34
- export type RawIsoformExpTerm = IsoformExpressionTerm & { name?: string }
35
-
36
- export type RawIsoformExpTW = RawNumTW & { term: RawIsoformExpTerm }
@@ -1,30 +0,0 @@
1
- import type { NumericBaseTerm, PresetNumericBins, NumTW, RawNumTW } from '../index.ts'
2
-
3
- /*
4
- --------EXPORTED--------
5
- MetaboliteIntensityTermWrapper
6
- MetaboliteIntensityTermSettingInstance
7
-
8
- */
9
-
10
- export type MetaboliteIntensityTerm = NumericBaseTerm & {
11
- id?: string
12
- name: string
13
- type: 'metaboliteIntensity'
14
- metabolite: string
15
- bins?: PresetNumericBins
16
- unit?: string
17
- }
18
-
19
- export type MetaboliteIntensityTW = NumTW & { term: MetaboliteIntensityTerm }
20
-
21
- export type RawMetaboliteIntensityTerm = NumericBaseTerm & {
22
- id?: string
23
- type: 'metaboliteIntensity'
24
- metabolite: string
25
- name?: string
26
- bins?: PresetNumericBins
27
- unit?: string
28
- }
29
-
30
- export type RawMetaboliteIntensityTW = RawNumTW & { term: RawMetaboliteIntensityTerm }
@@ -1,278 +0,0 @@
1
- import type {
2
- MinBaseQ,
3
- BaseTW,
4
- TermValues,
5
- BaseTerm,
6
- GeneExpressionTerm,
7
- IsoformExpressionTerm,
8
- MetaboliteIntensityTerm,
9
- ProteomeAbundanceTerm,
10
- DateTerm,
11
- SsGSEATerm,
12
- DnaMethylationTerm,
13
- SingleCellGeneExpressionTerm
14
- } from '../index.ts'
15
-
16
- export type RawRegularBin = Partial<RegularNumericBinConfig> & { preferredBins?: string }
17
-
18
- export type RawNumTWRegularBin = BaseTW & {
19
- type?: 'NumTWRegularBin'
20
- term: NumericTerm
21
- q: RawRegularBin
22
- }
23
-
24
- export type RawCustomBin = Partial<CustomNumericBinConfig> & { preferredBins?: string }
25
-
26
- export type RawNumTWCustomBin = BaseTW & {
27
- type?: 'NumTWCustomBin'
28
- term: NumericTerm
29
- q: RawCustomBin
30
- }
31
-
32
- export type RawNumTWCont = BaseTW & {
33
- type?: 'NumTWCont'
34
- term: NumericTerm
35
- q: ContinuousNumericQ
36
- }
37
-
38
- export type RawNumTWSpline = BaseTW & {
39
- type?: 'NumTWSpline'
40
- term: NumericTerm
41
- q: SplineNumericQ
42
- }
43
-
44
- export type RawNumTW = RawNumTWCustomBin | RawNumTWRegularBin | RawNumTWCont | RawNumTWSpline
45
-
46
- export type NumericBaseTerm = BaseTerm & {
47
- /** tailored color scale for this term, so that when the term is used for color gradient in scatter, this set of colors will be used by default */
48
- continuousColorScale?: { minColor: string; maxColor: string }
49
- unit?: string
50
- }
51
-
52
- export type NumericDictTerm = NumericBaseTerm & {
53
- id: string
54
- type: 'integer' | 'float'
55
- bins: PresetNumericBins
56
- values?: TermValues
57
- }
58
-
59
- export type RawNumericDictTerm = NumericDictTerm & {
60
- id?: string
61
- }
62
-
63
- export type NumericTerm =
64
- | NumericDictTerm
65
- | GeneExpressionTerm
66
- | IsoformExpressionTerm
67
- | MetaboliteIntensityTerm
68
- | ProteomeAbundanceTerm
69
- | DateTerm
70
- | SsGSEATerm
71
- | DnaMethylationTerm
72
- | SingleCellGeneExpressionTerm
73
-
74
- export type StartUnboundedBin = {
75
- // where possible, assign a concrete value (true) when it is known in advance,
76
- // in which case, do not use an abstract type (boolean) to startunbounded
77
- startunbounded: true
78
- startinclusive?: false // cannot include an infinite bound
79
- stop: number
80
- stopinclusive?: boolean
81
- stopunbounded?: false
82
- label?: string
83
- range?: string // alternative bin label
84
- }
85
-
86
- export type StopUnboundedBin = {
87
- start: number
88
- stopunbounded: true
89
- startinclusive?: boolean
90
- startunbounded?: false
91
- stopinclusive?: false // cannot include an infinite bound
92
- label?: string
93
- range?: string // alternative bin label
94
- }
95
-
96
- // TODO??? should separate a fully bounded bin by startinclusive, stopinclusive
97
- // since neighboring bins must not contain the same boundary value
98
- export type FullyBoundedBin = {
99
- startunbounded?: false
100
- startinclusive?: boolean
101
- start: number
102
- stop: number
103
- stopinclusive?: boolean
104
- stopunbounded?: false
105
- label?: string
106
- range?: string // alternative bin label
107
- }
108
-
109
- export type NumericBin = StartUnboundedBin | FullyBoundedBin | StopUnboundedBin
110
-
111
- export type RangeEntry = NumericBin | { value: number; label: string }
112
-
113
- export type RegularNumericBinConfig = MinBaseQ & {
114
- type: 'regular-bin' // another concrete value being assigned, instead of `string`
115
- //regular-sized bins
116
- mode?: 'discrete'
117
- bin_size: number
118
- // first_bin.stop is always required
119
- first_bin: StartUnboundedBin | FullyBoundedBin
120
-
121
- // if last_bin?.start is set, then a fixed last bin is used; otherwise it's not fixed and computed from data
122
- last_bin?: StopUnboundedBin | FullyBoundedBin
123
- label_offset?: number
124
- startinclusive?: boolean
125
- stopinclusive?: boolean
126
- /** a d3-format value to format the bin boundary values.
127
- * Defaults to none, in which case the computed bin start and stop values
128
- * (float numbers in javascript) will be used as-is for labels.
129
- * Or, when using the browser UI to edit the numeric bin, the number of decimals
130
- * in the bin_size will be used as the number of fixed decimals;
131
- * for example, bin_size = 0.25 and bin_size = 0.250 will imply a ‘.2f’ and ‘.3f’ d3-format value, respectively.
132
- * Note that the generated bin labels may use integer values in some cases for less clutter, such as when bins.size = 1.
133
- * */
134
- rounding?: string
135
- /** indicates the bin config was set when not enough data is available to compute bins,
136
- * may trigger resetting term.bins to avoid using dummy presetBins in TermdbVocab.setTermBins()
137
- * when the cohort changes
138
- */
139
- isDummyPreset?: boolean
140
- }
141
-
142
- export type CustomNumericBinConfigLst = [NumericBin, ...NumericBin[]]
143
-
144
- export type CustomNumericBinConfig = MinBaseQ & {
145
- type: 'custom-bin'
146
- mode?: 'discrete' | 'binary'
147
- // since ts will allow NumericBin[] to be empty,
148
- // use this workaround to define a non-empty array
149
- lst: CustomNumericBinConfigLst
150
- preferredBins?: 'median'
151
- /** indicates the bin config was set when not enough data is available to compute bins,
152
- * may trigger resetting term.bins to avoid using dummy presetBins in TermdbVocab.setTermBins()
153
- * when the cohort changes
154
- */
155
- isDummyPreset?: boolean
156
- }
157
-
158
- export type PresetNumericBins = {
159
- default: RegularNumericBinConfig | CustomNumericBinConfig
160
- less: RegularNumericBinConfig | CustomNumericBinConfig
161
- label_offset?: number
162
- label_offset_ignored?: boolean
163
- rounding?: string
164
- min?: number
165
- max?: number
166
- }
167
-
168
- export type BinnedNumericQ = RegularNumericBinConfig | CustomNumericBinConfig
169
-
170
- export type DiscreteNumericQ = BinnedNumericQ //&
171
- // MinBaseQ & {
172
- // mode: 'discrete' | 'binary'
173
- // }
174
-
175
- // TODO: test with live code that defines an actual binary q object
176
- export type BinaryNumericQ = MinBaseQ & {
177
- mode: 'binary'
178
- type: 'custom-bin'
179
- // tuple type with 2 members
180
- lst: [StartUnboundedBin | FullyBoundedBin, StopUnboundedBin | FullyBoundedBin]
181
- cutoffType?: 'normal' | 'percentile'
182
- cutoffPercentile?: number
183
- }
184
-
185
- export type ContinuousNumericQ = MinBaseQ & {
186
- mode?: 'continuous'
187
- // TODO: do not use a boolean, convert to a `transform: 'zscore' | ...` option
188
- convert2ZScore?: boolean
189
- //scale?: string
190
- // todo below: q.type is expected to be undefined for now,
191
- // but may be used later like in other q.modes,
192
- // making type optional here makes NumericQ operations/conditions
193
- // work consistently within the TermWrapper union type
194
- type?: undefined
195
- scale?: number
196
- }
197
-
198
- export type SplineNumericQ = MinBaseQ & {
199
- mode: 'spline'
200
- knots: {
201
- value: number
202
- }[]
203
- // todo below: q.type is expected to be undefined for now,
204
- // but may be used later like in other q.modes,
205
- // making type optional here makes NumericQ operations/conditions
206
- // work consistently within the TermWrapper union type
207
- type?: undefined
208
- }
209
-
210
- export type NumericQ = DiscreteNumericQ | BinaryNumericQ | ContinuousNumericQ | SplineNumericQ
211
-
212
- export type NumericTW = BaseTW & {
213
- //id: string
214
- term: NumericTerm
215
- q: NumericQ
216
- }
217
-
218
- export type NumTWDiscrete = BaseTW & {
219
- type: 'NumTWDiscrete'
220
- term: NumericTerm
221
- q: DiscreteNumericQ
222
- }
223
-
224
- export type NumTWRegularBin = BaseTW & {
225
- type: 'NumTWRegularBin'
226
- term: NumericTerm
227
- q: RegularNumericBinConfig
228
- }
229
-
230
- export type NumTWCustomBin = BaseTW & {
231
- type: 'NumTWCustomBin'
232
- term: NumericTerm
233
- q: CustomNumericBinConfig
234
- }
235
-
236
- export type NumTWBinaryBin = BaseTW & {
237
- type: 'NumTWBinaryBin'
238
- term: NumericTerm
239
- q: BinaryNumericQ
240
- }
241
-
242
- export type NumTWBinary = BaseTW & {
243
- type: 'NumTWBinary'
244
- term: NumericTerm
245
- q: BinaryNumericQ
246
- }
247
-
248
- export type NumTWCont = BaseTW & {
249
- type: 'NumTWCont'
250
- term: NumericTerm
251
- q: ContinuousNumericQ
252
- }
253
-
254
- export type NumTWSpline = BaseTW & {
255
- type: 'NumTWSpline'
256
- term: NumericTerm
257
- q: SplineNumericQ
258
- }
259
-
260
- export type NumTW = NumTWRegularBin | NumTWCustomBin | NumTWBinary | NumTWCont | NumTWSpline
261
- export type NumTWDiscreteTypes = NumTWRegularBin | NumTWCustomBin //| NumTWBinary
262
-
263
- export type DefaultMedianQ = {
264
- isAtomic?: true
265
- mode: 'discrete'
266
- type: 'custom-bin'
267
- preferredBins: 'median'
268
- lst: []
269
- }
270
-
271
- export type DefaultBinnedQ = {
272
- isAtomic: true
273
- mode: 'discrete'
274
- type: 'regular-bin' | 'custom-bin'
275
- preferredBins: 'default' | 'less'
276
- }
277
-
278
- export type DefaultNumericQ = NumericQ | DefaultBinnedQ | DefaultMedianQ
@@ -1,38 +0,0 @@
1
- import type { NumericBaseTerm, PresetNumericBins, NumTW, RawNumTW } from '../index.ts'
2
-
3
- /*
4
- --------EXPORTED--------
5
- ProteomeTermWrapper
6
- ProteomeTermSettingInstance
7
-
8
- */
9
-
10
- export type ProteomeDetails = {
11
- organism: string
12
- assay: string
13
- cohort: string
14
- }
15
-
16
- export type ProteomeAbundanceTerm = NumericBaseTerm & {
17
- id?: string
18
- name: string
19
- type: 'proteomeAbundance'
20
- protein: string
21
- bins?: PresetNumericBins
22
- unit?: string
23
- /** organism, assay and cohort this term belongs to */
24
- dataTypeDetails: ProteomeDetails
25
- }
26
-
27
- export type ProteomeAbundanceTW = NumTW & { term: ProteomeAbundanceTerm }
28
-
29
- export type RawProteomeAbundanceTerm = NumericBaseTerm & {
30
- id?: string
31
- type: 'proteomeAbundance'
32
- protein: string
33
- name?: string
34
- bins?: PresetNumericBins
35
- unit?: string
36
- }
37
-
38
- export type RawProteomeAbundanceTW = RawNumTW & { term: RawProteomeAbundanceTerm }
package/src/terms/q.ts DELETED
@@ -1,105 +0,0 @@
1
- //import type { CategoricalQ } from './q.ts'
2
- import type { Filter } from '../filter.js'
3
-
4
- // MinBaseQ is BaseQ without .mode and .type
5
- // MinBaseQ should eventually replace BaseQ because .mode and .type
6
- // should be specified in a term-type-specific manner
7
- export type MinBaseQ = {
8
- /**Automatically set by fillTermWrapper()
9
- Applies to barchart, survival plot, and cuminc plot.
10
- Contains categories of a term to be hidden in its chart. This should only apply to client-side rendering, and should not be part of “dataName” when requesting data from server. Server will always provide a summary for all categories. It’s up to the client to show/hide categories.
11
- This allows the key visibility to be stored in state, while toggling visibility will not trigger data re-request.
12
- Currently termsetting menu does not manage this attribute. It’s managed by barchart legend.
13
- */
14
- hiddenValues?: HiddenValues
15
- /**indicates this object should not be extended by a copy-merge tool */
16
- isAtomic?: true
17
- name?: string
18
- reuseId?: string
19
- }
20
-
21
- export type CategoricalBaseQ = MinBaseQ & {
22
- mode?: 'discrete' | 'binary'
23
- }
24
-
25
- export type RawValuesQ = MinBaseQ & {
26
- type?: 'values'
27
- mode?: 'binary' | 'discrete' | 'values' // legacy support for 'values', will be converted to 'discrete'
28
- }
29
-
30
- export type RawPredefinedGroupsetQ = MinBaseQ & {
31
- type: 'predefined-groupset'
32
- mode?: 'binary' | 'discrete'
33
- predefined_groupset_idx: number
34
- /** deprecated nested object, will be handled by reshapeLegacyTW() in TwRouter */
35
- groupsetting?: { inuse?: boolean } & GroupSettingQ
36
- }
37
-
38
- export type RawCustomGroupsetQ = MinBaseQ & {
39
- type: 'custom-groupset'
40
- mode?: 'binary' | 'discrete'
41
- customset: {
42
- groups: GroupEntry[]
43
- }
44
- /** deprecated nested object, will be handled by reshapeLegacyTW() in TwRouter */
45
- groupsetting?: { inuse?: boolean } & GroupSettingQ
46
- sampleCounts?: { key: string; value?: number; label?: string }[]
47
- }
48
-
49
- export type HiddenValues = {
50
- [index: string]: number
51
- }
52
-
53
- /*** types supporting termwrapper q ***/
54
-
55
- export type ValuesQ = CategoricalBaseQ & {
56
- type: 'values'
57
- }
58
-
59
- export type PredefinedGroupSettingQ = CategoricalBaseQ & {
60
- type: 'predefined-groupset'
61
- predefined_groupset_idx: number
62
- }
63
-
64
- export type CustomGroupSettingQ = CategoricalBaseQ & {
65
- type: 'custom-groupset'
66
- customset: BaseGroupSet
67
- }
68
-
69
- export type FilterQ = MinBaseQ & {
70
- type: 'filter'
71
- }
72
-
73
- export type GroupSettingQ = ValuesQ | FilterQ | PredefinedGroupSettingQ | CustomGroupSettingQ
74
-
75
- export type ValuesGroup = {
76
- name: string
77
- type: 'values' | string // can remove boolean fallback once problematic js files are converted to .ts and can declare `type: 'values' as const`
78
- values: { key: number | string; label: string }[]
79
- uncomputable?: boolean // if true, do not include this group in computations
80
- }
81
-
82
- export type FilterGroup = {
83
- name: string
84
- type: 'filter'
85
- filter: Filter
86
- color: string
87
- }
88
-
89
- export type GroupEntry = ValuesGroup | FilterGroup
90
-
91
- export type BaseGroupSet = {
92
- groups: GroupEntry[]
93
- }
94
-
95
- type Groupset = {
96
- name: string
97
- is_grade?: boolean
98
- is_subcondition?: boolean
99
- dt?: number // dt of groupset, used by geneVariant term
100
- } & BaseGroupSet
101
-
102
- export type TermGroupSetting = {
103
- disabled: boolean // true when term has <= 2 values, otherwise false
104
- lst?: Groupset[] // array of predefined groupsets
105
- }
@@ -1,73 +0,0 @@
1
- import type {
2
- GroupSettingQ,
3
- ValuesQ,
4
- BaseTW,
5
- PredefinedGroupSettingQ,
6
- CustomGroupSettingQ,
7
- RawCategoricalTerm,
8
- CategoricalTerm,
9
- RawSnpTerm,
10
- SnpTerm,
11
- RawSingleCellCellTypeTerm,
12
- SingleCellCellTypeTerm
13
- } from '../index.ts'
14
- import type { RawValuesQ, RawPredefinedGroupsetQ, RawCustomGroupsetQ, MinBaseQ } from './q.ts'
15
-
16
- /**
17
- * A raw qualitative termwrapper object, before filling-in
18
- *
19
- * test:QualitativeQ:
20
- *
21
- * @category TW
22
- */
23
-
24
- export type RawQualTerm = RawCategoricalTerm | RawSnpTerm | RawSingleCellCellTypeTerm
25
- export type QualTerm = CategoricalTerm | SnpTerm | SingleCellCellTypeTerm
26
-
27
- export type RawQualTWValues = BaseTW & {
28
- type?: 'QualTWValues'
29
- /** must already exist, for dictionary terms, TwRouter.fill() will use mayHydrateDictTwLst() */
30
- term: RawQualTerm
31
- q: RawValuesQ
32
- }
33
-
34
- export type RawQualTWPredefinedGS = BaseTW & {
35
- type?: 'QualTWPredefinedGS'
36
- term: RawQualTerm
37
- q: RawPredefinedGroupsetQ
38
- }
39
-
40
- export type RawQualTWCustomGS = BaseTW & {
41
- type?: 'QualTWCustomGS'
42
- term: RawQualTerm
43
- q: RawCustomGroupsetQ
44
- }
45
-
46
- export type RawQualTW = RawQualTWValues | RawQualTWPredefinedGS | RawQualTWCustomGS
47
-
48
- export type QualBaseQ = MinBaseQ & {
49
- mode?: 'discrete' | 'binary'
50
- }
51
-
52
- export type QualQ = GroupSettingQ | ValuesQ
53
-
54
- export type QualTWValues = BaseTW & {
55
- //id: string
56
- term: QualTerm
57
- q: ValuesQ
58
- type: 'QualTWValues'
59
- }
60
-
61
- export type QualTWPredefinedGS = BaseTW & {
62
- term: QualTerm
63
- q: PredefinedGroupSettingQ
64
- type: 'QualTWPredefinedGS'
65
- }
66
-
67
- export type QualTWCustomGS = BaseTW & {
68
- term: QualTerm
69
- q: CustomGroupSettingQ
70
- type: 'QualTWCustomGS'
71
- }
72
-
73
- export type QualTW = QualTWValues | QualTWPredefinedGS | QualTWCustomGS
@@ -1,34 +0,0 @@
1
- import type { BaseTerm, MinBaseQ } from '../index.ts'
2
- import type { TermWrapper } from './tw.ts'
3
-
4
- /*
5
- --------EXPORTED--------
6
- SampleLstTermValues
7
- SampleLstQ
8
- SampleLstTerm
9
- SampleLstTW
10
- SampleLstSettingInstance
11
-
12
- */
13
-
14
- export type SampleLstTermValues = {
15
- [index: string | number]: {
16
- name: string
17
- inuse: boolean
18
- list: { sampleId: string; sample: string }[]
19
- values: any
20
- }
21
- }
22
-
23
- export type SampleLstQ = MinBaseQ & {
24
- groups: SampleLstTermValues
25
- }
26
-
27
- export type SampleLstTerm = BaseTerm & {
28
- values: SampleLstTermValues
29
- }
30
-
31
- export type SampleLstTW = TermWrapper & {
32
- q: SampleLstQ
33
- term: SampleLstTerm
34
- }
@@ -1,18 +0,0 @@
1
- import type { BaseTerm, TermGroupSetting, TermValues } from '../index.ts'
2
-
3
- export type SingleCellCellTypeTerm = BaseTerm & {
4
- type: 'singleCellCellType'
5
- /** the cell types may be also cell attributes like CNV, Fusion, etc */
6
- /** single cell terms require a sample to read the term values, they are associated with a sample */
7
- sample: object
8
- /** the plot defined in the dataset contains a column with the term values for the sample, it needs to be passed to read the sample values */
9
- plot: string
10
- groupsetting: TermGroupSetting
11
- // may be used to hide
12
- values: TermValues
13
- }
14
-
15
- export type RawSingleCellCellTypeTerm = SingleCellCellTypeTerm & {
16
- groupsetting?: TermGroupSetting
17
- values?: TermValues
18
- }
@@ -1,32 +0,0 @@
1
- // import type { BaseTerm } from '../index.ts'
2
- import type { PresetNumericBins, NumericBaseTerm, NumTW, RawNumTW } from '../index.ts'
3
-
4
- type Gene = {
5
- kind?: 'gene'
6
- gene: string
7
- chr?: string
8
- start?: number
9
- stop?: number
10
- }
11
-
12
- type Coord = {
13
- kind?: 'coord'
14
- gene?: string
15
- chr: string
16
- start: number
17
- stop: number
18
- }
19
-
20
- export type SingleCellGeneExpressionTerm = NumericBaseTerm & {
21
- type: 'singleCellGeneExpression'
22
- gene: string
23
- sample: string
24
- unit: string
25
- bins?: PresetNumericBins
26
- } & (Gene | Coord)
27
-
28
- export type SingleCellGeneExpressionTermTW = NumTW & { term: SingleCellGeneExpressionTerm }
29
-
30
- export type RawSingleCellGeneExpTerm = SingleCellGeneExpressionTerm & { name?: string }
31
-
32
- export type RawSingleCellGeneExpTW = RawNumTW & { term: RawSingleCellGeneExpTerm }
package/src/terms/snp.ts DELETED
@@ -1,24 +0,0 @@
1
- import type { TermGroupSetting, TermValues, BaseTerm } from '../index.ts'
2
-
3
- /*
4
- For term type 'snp'
5
- */
6
-
7
- export type SnpTerm = BaseTerm & {
8
- type: 'snp'
9
- id: string
10
- name: string
11
- chr: string
12
- start: number
13
- stop: number
14
- ref: string
15
- alt: string[]
16
- groupsetting: TermGroupSetting
17
- // may be used to hide
18
- values: TermValues
19
- }
20
-
21
- export type RawSnpTerm = SnpTerm & {
22
- groupsetting?: TermGroupSetting
23
- values?: TermValues
24
- }