@sjcrh/proteinpaint-types 2.84.0 → 2.86.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/dist/routes.ts +28911 -0
- package/package.json +20 -13
- package/src/Mclass.js +0 -0
- package/src/checkers/routes.js +167 -0
- package/src/dataset.js +0 -0
- package/src/fileOrUrl.js +0 -0
- package/src/filter.js +0 -0
- package/src/genome.js +0 -0
- package/src/index.js +66 -0
- package/src/routes/brainImaging.js +11 -0
- package/src/routes/brainImagingSamples.js +11 -0
- package/src/routes/burden.js +44 -0
- package/src/routes/dataset.js +12 -0
- package/src/routes/dsdata.js +12 -0
- package/src/routes/dzimages.js +12 -0
- package/src/routes/errorResponse.js +0 -0
- package/src/routes/filter.gdc.js +0 -0
- package/src/routes/gdc.maf.js +17 -0
- package/src/routes/gdc.mafBuild.js +12 -0
- package/src/routes/gdc.topMutatedGenes.js +12 -0
- package/src/routes/genelookup.js +12 -0
- package/src/routes/genesetEnrichment.js +12 -0
- package/src/routes/genesetOverrepresentation.js +12 -0
- package/src/routes/healthcheck.js +23 -0
- package/src/routes/hicdata.js +12 -0
- package/src/routes/hicgenome.js +29 -0
- package/src/routes/hicstat.js +12 -0
- package/src/routes/isoformlst.js +12 -0
- package/src/routes/ntseq.js +12 -0
- package/src/routes/pdomain.js +12 -0
- package/src/routes/routeApi.js +0 -0
- package/src/routes/samplewsimages.js +12 -0
- package/src/routes/snp.js +11 -0
- package/src/routes/termdb.DE.js +13 -0
- package/src/routes/termdb.boxplot.js +12 -0
- package/src/routes/termdb.categories.js +48 -0
- package/src/routes/termdb.cluster.js +12 -0
- package/src/routes/termdb.cohort.summary.js +12 -0
- package/src/routes/termdb.cohorts.js +12 -0
- package/src/routes/termdb.descrstats.js +48 -0
- package/src/routes/termdb.numericcategories.js +12 -0
- package/src/routes/termdb.percentile.js +49 -0
- package/src/routes/termdb.rootterm.js +27 -0
- package/src/routes/termdb.sampleImages.js +12 -0
- package/src/routes/termdb.singleSampleMutation.js +12 -0
- package/src/routes/termdb.singlecellDEgenes.js +12 -0
- package/src/routes/termdb.singlecellData.js +12 -0
- package/src/routes/termdb.singlecellSamples.js +12 -0
- package/src/routes/termdb.termchildren.js +28 -0
- package/src/routes/termdb.termsbyids.js +12 -0
- package/src/routes/termdb.topTermsByType.js +12 -0
- package/src/routes/termdb.topVariablyExpressedGenes.js +12 -0
- package/src/routes/termdb.violin.js +49 -0
- package/src/routes/tileserver.js +12 -0
- package/src/routes/wsimages.js +12 -0
- package/src/terms/categorical.js +0 -0
- package/src/terms/condition.js +0 -0
- package/src/terms/geneExpression.js +0 -0
- package/src/terms/geneVariant.js +0 -0
- package/src/terms/metaboliteIntensity.js +0 -0
- package/src/terms/numeric.js +0 -0
- package/src/terms/q.js +0 -0
- package/src/terms/samplelst.js +0 -0
- package/src/terms/singleCellCellType.js +0 -0
- package/src/terms/singleCellGeneExpression.js +0 -0
- package/src/terms/snp.js +0 -0
- package/src/terms/snps.js +0 -0
- package/src/terms/term.js +0 -0
- package/src/terms/tw.js +0 -0
- package/src/terms/updated-types.js +0 -0
- package/src/termsetting.js +0 -0
- package/src/test/numeric.type.spec.js +117 -0
- package/src/vocab.js +0 -0
- package/src/Mclass.ts +0 -8
- package/src/dataset.ts +0 -1575
- package/src/docs.json +0 -16417
- package/src/fileOrUrl.ts +0 -15
- package/src/filter.ts +0 -125
- package/src/genome.ts +0 -123
- package/src/index.ts +0 -57
- package/src/routes/brainImaging.ts +0 -42
- package/src/routes/burden.ts +0 -69
- package/src/routes/dzimages.ts +0 -9
- package/src/routes/errorResponse.ts +0 -6
- package/src/routes/filter.gdc.ts +0 -15
- package/src/routes/gdc.maf.ts +0 -41
- package/src/routes/gdc.mafBuild.ts +0 -13
- package/src/routes/gdc.topMutatedGenes.ts +0 -25
- package/src/routes/genelookup.ts +0 -10
- package/src/routes/genesetEnrichment.ts +0 -46
- package/src/routes/genesetOverrepresentation.ts +0 -36
- package/src/routes/healthcheck.ts +0 -57
- package/src/routes/hicdata.ts +0 -37
- package/src/routes/hicgenome.ts +0 -22
- package/src/routes/hicstat.ts +0 -45
- package/src/routes/sampledzimages.ts +0 -1
- package/src/routes/samplewsimages.ts +0 -15
- package/src/routes/termdb.DE.ts +0 -44
- package/src/routes/termdb.boxplot.ts +0 -49
- package/src/routes/termdb.categories.ts +0 -26
- package/src/routes/termdb.cluster.ts +0 -86
- package/src/routes/termdb.getSampleImages.ts +0 -14
- package/src/routes/termdb.getTopTermsByType.ts +0 -21
- package/src/routes/termdb.getdescrstats.ts +0 -31
- package/src/routes/termdb.getnumericcategories.ts +0 -21
- package/src/routes/termdb.getpercentile.ts +0 -17
- package/src/routes/termdb.getrootterm.ts +0 -22
- package/src/routes/termdb.gettermchildren.ts +0 -21
- package/src/routes/termdb.singleSampleMutation.ts +0 -18
- package/src/routes/termdb.singlecellDEgenes.ts +0 -30
- package/src/routes/termdb.singlecellData.ts +0 -58
- package/src/routes/termdb.singlecellSamples.ts +0 -35
- package/src/routes/termdb.termsbyids.ts +0 -15
- package/src/routes/termdb.topVariablyExpressedGenes.ts +0 -45
- package/src/routes/termdb.violin.ts +0 -74
- package/src/routes/wsimages.ts +0 -12
- package/src/terms/categorical.ts +0 -106
- package/src/terms/condition.ts +0 -55
- package/src/terms/geneExpression.ts +0 -32
- package/src/terms/geneVariant.ts +0 -51
- package/src/terms/metaboliteIntensity.ts +0 -31
- package/src/terms/numeric.ts +0 -253
- package/src/terms/q.ts +0 -38
- package/src/terms/samplelst.ts +0 -41
- package/src/terms/singleCellCellType.ts +0 -22
- package/src/terms/singleCellGeneExpression.ts +0 -28
- package/src/terms/snp.ts +0 -28
- package/src/terms/snps.ts +0 -110
- package/src/terms/term.ts +0 -184
- package/src/terms/tw.ts +0 -38
- package/src/terms/updated-types.ts +0 -9
- package/src/termsetting.ts +0 -197
- package/src/test/numeric.type.spec.ts +0 -275
- package/src/typedoc.js +0 -30
- package/src/vocab.ts +0 -37
package/src/terms/numeric.ts
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { MinBaseQ, BaseTW, TermValues, BaseTerm } from '../index.ts'
|
|
2
|
-
|
|
3
|
-
export type RawRegularBin = Partial<RegularNumericBinConfig> & { preferredBins?: string }
|
|
4
|
-
|
|
5
|
-
export type RawNumTWRegularBin = BaseTW & {
|
|
6
|
-
type?: 'NumTWRegularBin'
|
|
7
|
-
term: NumericTerm
|
|
8
|
-
q: RawRegularBin
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type RawCustomBin = Partial<CustomNumericBinConfig> & { preferredBins?: string }
|
|
12
|
-
|
|
13
|
-
export type RawNumTWCustomBin = BaseTW & {
|
|
14
|
-
type?: 'NumTWCustomBin'
|
|
15
|
-
term: NumericTerm
|
|
16
|
-
q: RawCustomBin
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type RawNumTWCont = BaseTW & {
|
|
20
|
-
type?: 'NumTWCont'
|
|
21
|
-
term: NumericTerm
|
|
22
|
-
q: ContinuousNumericQ
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type RawNumTWSpline = BaseTW & {
|
|
26
|
-
type?: 'NumTWSpline'
|
|
27
|
-
term: NumericTerm
|
|
28
|
-
q: SplineNumericQ
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type RawNumTW = RawNumTWCustomBin | RawNumTWRegularBin | RawNumTWCont | RawNumTWSpline
|
|
32
|
-
|
|
33
|
-
export type NumericTerm = BaseTerm & {
|
|
34
|
-
id?: string
|
|
35
|
-
// these concrete term.type values make it clear that only these are numeric,
|
|
36
|
-
// "categorical", "condition", and other term.types are not included in this union
|
|
37
|
-
type: 'integer' | 'float' | 'geneExpression' | 'metaboliteIntensity'
|
|
38
|
-
bins: PresetNumericBins
|
|
39
|
-
values?: TermValues
|
|
40
|
-
unit?: string
|
|
41
|
-
/*densityNotAvailable?: boolean //Not used?
|
|
42
|
-
logScale?: string | number
|
|
43
|
-
max?: number
|
|
44
|
-
min?: number
|
|
45
|
-
name?: string
|
|
46
|
-
skip0forPercentile?: boolean
|
|
47
|
-
tvs?: Tvs
|
|
48
|
-
values?: TermValues
|
|
49
|
-
unit?: string
|
|
50
|
-
valueConversion?: ValueConversion*/
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type NumericDictTerm = BaseTerm & {
|
|
54
|
-
id?: string
|
|
55
|
-
type: 'integer' | 'float'
|
|
56
|
-
bins: PresetNumericBins
|
|
57
|
-
values?: TermValues
|
|
58
|
-
unit?: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type StartUnboundedBin = {
|
|
62
|
-
// where possible, assign a concrete value (true) when it is known in advance,
|
|
63
|
-
// in which case, do not use an abstract type (boolean) to startunbounded
|
|
64
|
-
startunbounded: true
|
|
65
|
-
startinclusive?: false // cannot include an infinite bound
|
|
66
|
-
stop: number
|
|
67
|
-
stopinclusive?: boolean
|
|
68
|
-
stopunbounded?: false
|
|
69
|
-
label?: string
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export type StopUnboundedBin = {
|
|
73
|
-
start: number
|
|
74
|
-
stopunbounded: true
|
|
75
|
-
startinclusive?: boolean
|
|
76
|
-
startunbounded?: false
|
|
77
|
-
stopinclusive?: false // cannot include an infinite bound
|
|
78
|
-
label?: string
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// TODO??? should separate a fully bounded bin by startinclusive, stopinclusive
|
|
82
|
-
// since neighboring bins must not contain the same boundary value
|
|
83
|
-
export type FullyBoundedBin = {
|
|
84
|
-
startunbounded?: false
|
|
85
|
-
startinclusive?: boolean
|
|
86
|
-
start: number
|
|
87
|
-
stop: number
|
|
88
|
-
stopinclusive?: boolean
|
|
89
|
-
stopunbounded?: false
|
|
90
|
-
label?: string
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type NumericBin = StartUnboundedBin | FullyBoundedBin | StopUnboundedBin
|
|
94
|
-
|
|
95
|
-
export type RegularNumericBinConfig = MinBaseQ & {
|
|
96
|
-
type: 'regular-bin' // another concrete value being assigned, instead of `string`
|
|
97
|
-
//regular-sized bins
|
|
98
|
-
mode?: 'discrete'
|
|
99
|
-
bin_size: number
|
|
100
|
-
// first_bin.stop is always required
|
|
101
|
-
first_bin: StartUnboundedBin | FullyBoundedBin
|
|
102
|
-
|
|
103
|
-
// if last_bin?.start is set, then a fixed last bin is used; otherwise it's not fixed and computed from data
|
|
104
|
-
last_bin?: StopUnboundedBin | FullyBoundedBin
|
|
105
|
-
label_offset?: number
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type CustomNumericBinConfig = MinBaseQ & {
|
|
109
|
-
type: 'custom-bin'
|
|
110
|
-
mode?: 'discrete' | 'binary'
|
|
111
|
-
// since ts will allow NumericBin[] to be empty,
|
|
112
|
-
// use this workaround to define a non-empty array
|
|
113
|
-
lst: [NumericBin, ...NumericBin[]]
|
|
114
|
-
preferredBins?: 'median'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// |
|
|
118
|
-
// {
|
|
119
|
-
// type?: 'custom-bin'
|
|
120
|
-
// mode?: 'discrete' | 'binary'
|
|
121
|
-
// // since ts will allow NumericBin[] to be empty,
|
|
122
|
-
// // use this workaround to define a non-empty array
|
|
123
|
-
// lst?: [NumericBin, ...NumericBin[]]
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
|
-
/*export type NumericQ = BaseQ & {
|
|
127
|
-
// termType: 'float' | 'integer' -- converts to 'numeric'
|
|
128
|
-
preferredBins?: 'median' | 'less' | 'default'
|
|
129
|
-
modeBinaryCutoffType: 'normal' | 'percentile'
|
|
130
|
-
modeBinaryCutoffPercentile?: number
|
|
131
|
-
knots?: any //[]?
|
|
132
|
-
scale?: number //0.1 | 0.01 | 0.001
|
|
133
|
-
rounding: string
|
|
134
|
-
}*/
|
|
135
|
-
|
|
136
|
-
export type PresetNumericBins = {
|
|
137
|
-
default: RegularNumericBinConfig | CustomNumericBinConfig
|
|
138
|
-
less: RegularNumericBinConfig | CustomNumericBinConfig
|
|
139
|
-
label_offset?: number
|
|
140
|
-
label_offset_ignored?: boolean
|
|
141
|
-
rounding?: string
|
|
142
|
-
min?: number
|
|
143
|
-
max?: number
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export type BinnedNumericQ = RegularNumericBinConfig | CustomNumericBinConfig
|
|
147
|
-
|
|
148
|
-
export type DiscreteNumericQ = BinnedNumericQ //&
|
|
149
|
-
// MinBaseQ & {
|
|
150
|
-
// mode: 'discrete' | 'binary'
|
|
151
|
-
// }
|
|
152
|
-
|
|
153
|
-
// TODO: test with live code that defines an actual binary q object
|
|
154
|
-
export type BinaryNumericQ = MinBaseQ & {
|
|
155
|
-
mode: 'binary'
|
|
156
|
-
type: 'custom-bin'
|
|
157
|
-
// tuple type with 2 members
|
|
158
|
-
lst: [StartUnboundedBin | FullyBoundedBin, StopUnboundedBin | FullyBoundedBin]
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export type ContinuousNumericQ = MinBaseQ & {
|
|
162
|
-
mode: 'continuous'
|
|
163
|
-
// TODO: do not use a boolean, convert to a `transform: 'zscore' | ...` option
|
|
164
|
-
convert2ZScore?: boolean
|
|
165
|
-
//scale?: string
|
|
166
|
-
// todo below: q.type is expected to be undefined for now,
|
|
167
|
-
// but may be used later like in other q.modes,
|
|
168
|
-
// making type optional here makes NumericQ operations/conditions
|
|
169
|
-
// work consistently within the TermWrapper union type
|
|
170
|
-
type?: undefined
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export type SplineNumericQ = MinBaseQ & {
|
|
174
|
-
mode: 'spline'
|
|
175
|
-
knots: {
|
|
176
|
-
value: number
|
|
177
|
-
}[]
|
|
178
|
-
// todo below: q.type is expected to be undefined for now,
|
|
179
|
-
// but may be used later like in other q.modes,
|
|
180
|
-
// making type optional here makes NumericQ operations/conditions
|
|
181
|
-
// work consistently within the TermWrapper union type
|
|
182
|
-
type?: undefined
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export type NumericQ = DiscreteNumericQ | BinaryNumericQ | ContinuousNumericQ | SplineNumericQ
|
|
186
|
-
|
|
187
|
-
export type NumericTW = BaseTW & {
|
|
188
|
-
//id: string
|
|
189
|
-
term: NumericTerm
|
|
190
|
-
q: NumericQ
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export type NumTWDiscrete = BaseTW & {
|
|
194
|
-
type: 'NumTWDiscrete'
|
|
195
|
-
term: NumericTerm
|
|
196
|
-
q: DiscreteNumericQ
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export type NumTWRegularBin = BaseTW & {
|
|
200
|
-
type: 'NumTWRegularBin'
|
|
201
|
-
term: NumericTerm
|
|
202
|
-
q: RegularNumericBinConfig
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export type NumTWCustomBin = BaseTW & {
|
|
206
|
-
type: 'NumTWCustomBin'
|
|
207
|
-
term: NumericTerm
|
|
208
|
-
q: CustomNumericBinConfig
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export type NumTWBinaryBin = BaseTW & {
|
|
212
|
-
type: 'NumTWBinaryBin'
|
|
213
|
-
term: NumericTerm
|
|
214
|
-
q: BinaryNumericQ
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export type NumTWBinary = BaseTW & {
|
|
218
|
-
type: 'NumTWBinary'
|
|
219
|
-
term: NumericTerm
|
|
220
|
-
q: BinaryNumericQ
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export type NumTWCont = BaseTW & {
|
|
224
|
-
type: 'NumTWCont'
|
|
225
|
-
term: NumericTerm
|
|
226
|
-
q: ContinuousNumericQ
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export type NumTWSpline = BaseTW & {
|
|
230
|
-
type: 'NumTWSpline'
|
|
231
|
-
term: NumericTerm
|
|
232
|
-
q: SplineNumericQ
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export type NumTWTypes = NumTWRegularBin | NumTWCustomBin | NumTWBinary | NumTWCont | NumTWSpline
|
|
236
|
-
export type NumTWDiscreteTypes = NumTWRegularBin | NumTWCustomBin //| NumTWBinary
|
|
237
|
-
|
|
238
|
-
export type DefaultMedianQ = {
|
|
239
|
-
isAtomic?: true
|
|
240
|
-
mode: 'discrete'
|
|
241
|
-
type: 'custom-bin'
|
|
242
|
-
preferredBins: 'median'
|
|
243
|
-
lst: []
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export type DefaultBinnedQ = {
|
|
247
|
-
isAtomic: true
|
|
248
|
-
mode: 'discrete'
|
|
249
|
-
type: 'regular-bin' | 'custom-bin'
|
|
250
|
-
preferredBins: 'default' | 'less'
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export type DefaultNumericQ = NumericQ | DefaultBinnedQ | DefaultMedianQ
|
package/src/terms/q.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { HiddenValues, GroupSettingQ, GroupEntry } from './term.ts'
|
|
2
|
-
|
|
3
|
-
// MinBaseQ is BaseQ without .mode and .type
|
|
4
|
-
// MinBaseQ should eventually replace BaseQ because .mode and .type
|
|
5
|
-
// should be specified in a term-type-specific manner
|
|
6
|
-
export type MinBaseQ = {
|
|
7
|
-
/**Automatically set by fillTermWrapper()
|
|
8
|
-
Applies to barchart, survival plot, and cuminc plot.
|
|
9
|
-
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.
|
|
10
|
-
This allows the key visibility to be stored in state, while toggling visibility will not trigger data re-request.
|
|
11
|
-
Currently termsetting menu does not manage this attribute. It’s managed by barchart legend.
|
|
12
|
-
*/
|
|
13
|
-
hiddenValues?: HiddenValues
|
|
14
|
-
/**indicates this object should not be extended by a copy-merge tool */
|
|
15
|
-
isAtomic?: true
|
|
16
|
-
name?: string
|
|
17
|
-
reuseId?: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type RawValuesQ = MinBaseQ & { type?: 'values'; mode?: 'binary' }
|
|
21
|
-
|
|
22
|
-
export type RawPredefinedGroupsetQ = MinBaseQ & {
|
|
23
|
-
type: 'predefined-groupset'
|
|
24
|
-
mode?: 'binary' | 'discrete'
|
|
25
|
-
predefined_groupset_idx: number
|
|
26
|
-
/** deprecated nested object, will be handled by reshapeLegacyTW() in TwRouter */
|
|
27
|
-
groupsetting?: { inuse?: boolean } & GroupSettingQ
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type RawCustomGroupsetQ = MinBaseQ & {
|
|
31
|
-
type: 'custom-groupset'
|
|
32
|
-
mode?: 'binary' | 'discrete'
|
|
33
|
-
customset: {
|
|
34
|
-
groups: GroupEntry[]
|
|
35
|
-
}
|
|
36
|
-
/** deprecated nested object, will be handled by reshapeLegacyTW() in TwRouter */
|
|
37
|
-
groupsetting?: { inuse?: boolean } & GroupSettingQ
|
|
38
|
-
}
|
package/src/terms/samplelst.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { BaseTerm, BaseQ } from './term.ts'
|
|
2
|
-
import { TermWrapper } from './tw.ts'
|
|
3
|
-
import { TermSettingInstance } from '../termsetting.ts'
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
--------EXPORTED--------
|
|
7
|
-
SampleLstTermValues
|
|
8
|
-
SampleLstQ
|
|
9
|
-
SampleLstTerm
|
|
10
|
-
SampleLstTW
|
|
11
|
-
SampleLstSettingInstance
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export type SampleLstTermValues = {
|
|
16
|
-
[index: string | number]: {
|
|
17
|
-
name: string
|
|
18
|
-
inuse: boolean
|
|
19
|
-
list: { sampleId: string; sample: string }[]
|
|
20
|
-
values: any
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type SampleLstQ = BaseQ & {
|
|
25
|
-
groups: SampleLstTermValues
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type SampleLstTerm = BaseTerm & {
|
|
29
|
-
values: SampleLstTermValues
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type SampleLstTW = TermWrapper & {
|
|
33
|
-
q: SampleLstQ
|
|
34
|
-
term: SampleLstTerm
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//temporary, will eventually change to SampleLstHandler
|
|
38
|
-
export type SampleLstTermSettingInstance = TermSettingInstance & {
|
|
39
|
-
q: SampleLstQ
|
|
40
|
-
term: SampleLstTerm
|
|
41
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseTerm, BaseTW, GroupSettingQ, TermGroupSetting, TermValues } from './term.ts'
|
|
2
|
-
import { MinBaseQ } from './q.ts'
|
|
3
|
-
|
|
4
|
-
type SingleCellCellTypeBaseQ = MinBaseQ & { mode: 'discrete' | 'binary' }
|
|
5
|
-
|
|
6
|
-
export type SingleCellCellTypeQ = SingleCellCellTypeBaseQ & GroupSettingQ
|
|
7
|
-
|
|
8
|
-
export type SingleCellCellTypeTerm = BaseTerm & {
|
|
9
|
-
type: 'singleCellCellType'
|
|
10
|
-
/** the cell types may be also cell attributes like CNV, Fusion, etc */
|
|
11
|
-
values: TermValues
|
|
12
|
-
/** single cell terms require a sample to read the term values, they are associated with a sample */
|
|
13
|
-
sample: string
|
|
14
|
-
/** 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 */
|
|
15
|
-
plot: string
|
|
16
|
-
groupsetting: TermGroupSetting
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type SingleCellCellTypeTW = BaseTW & {
|
|
20
|
-
term: SingleCellCellTypeTerm
|
|
21
|
-
q: SingleCellCellTypeQ
|
|
22
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TermWrapper } from './tw.ts'
|
|
2
|
-
import { BaseQ } from './term.ts'
|
|
3
|
-
import { GeneExpressionQ } from './geneExpression.ts'
|
|
4
|
-
import { TermSettingInstance } from '../termsetting.ts'
|
|
5
|
-
import { NumericTerm } from './numeric.ts'
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
--------EXPORTED--------
|
|
9
|
-
GeneExpressionQ
|
|
10
|
-
GeneExpressionTermWrapper
|
|
11
|
-
GeneExpressionTermSettingInstance
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export type SingleCellGeneExpressionTW = TermWrapper & {
|
|
16
|
-
q: GeneExpressionQ
|
|
17
|
-
term: SingleCellGeneExpressionTerm
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type SingleCellGeneExpressionTerm = NumericTerm & {
|
|
21
|
-
gene: string
|
|
22
|
-
sample: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type SingleCellGeneExpressionTermSettingInstance = TermSettingInstance & {
|
|
26
|
-
q: GeneExpressionQ
|
|
27
|
-
term: SingleCellGeneExpressionTerm
|
|
28
|
-
}
|
package/src/terms/snp.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TermWrapper } from './tw.ts'
|
|
2
|
-
import { BaseQ, BaseTerm, GroupSettingQ, TermGroupSetting } from './term.ts'
|
|
3
|
-
import { TermSettingInstance } from '../termsetting.ts'
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
For term type 'snp'
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export type SnpQ = BaseQ & GroupSettingQ
|
|
10
|
-
|
|
11
|
-
export type SnpTW = TermWrapper & {
|
|
12
|
-
q: SnpQ
|
|
13
|
-
term: SnpTerm
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type SnpTerm = BaseTerm & {
|
|
17
|
-
chr: string
|
|
18
|
-
start: number
|
|
19
|
-
stop: number
|
|
20
|
-
ref: string
|
|
21
|
-
alt: string[]
|
|
22
|
-
groupsetting: TermGroupSetting
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type SnpTermSettingInstance = TermSettingInstance & {
|
|
26
|
-
q: SnpQ
|
|
27
|
-
term: SnpTerm
|
|
28
|
-
}
|
package/src/terms/snps.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { BaseTW, BaseQ, BaseTerm } from './term.ts'
|
|
2
|
-
import { TermSettingInstance, InstanceDom, UseCase } from '../termsetting.ts'
|
|
3
|
-
import { VocabApi } from '../vocab.ts'
|
|
4
|
-
import { Tvs, Filter } from '../filter.ts'
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
--------EXPORTED--------
|
|
8
|
-
SnpsQ
|
|
9
|
-
SnpsEntry
|
|
10
|
-
SnpsTerm
|
|
11
|
-
SnpsTW
|
|
12
|
-
SnpsVocabApi
|
|
13
|
-
SnpsTermSettingInstance
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
type RestrictAncestry = {
|
|
18
|
-
name: string
|
|
19
|
-
tvs: Tvs
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type SnpsQ = BaseQ & {
|
|
23
|
-
// termType: 'snplocus' | 'snplst'
|
|
24
|
-
//for snplst and snplocus term types
|
|
25
|
-
AFcutoff: number
|
|
26
|
-
alleleType: number
|
|
27
|
-
cacheid: string
|
|
28
|
-
doNotRestrictAncestry: any
|
|
29
|
-
geneticModel: number
|
|
30
|
-
info_fields?: any //[] Not documented
|
|
31
|
-
missingGenotype?: number
|
|
32
|
-
numOfSampleWithAnyValidGT: number
|
|
33
|
-
restrictAncestry: RestrictAncestry
|
|
34
|
-
snp2effAle?: any
|
|
35
|
-
snp2refGrp: any //[] maybe??
|
|
36
|
-
variant_filter: Filter
|
|
37
|
-
//Position
|
|
38
|
-
chr: string
|
|
39
|
-
start: number
|
|
40
|
-
stop: number
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type AllelesEntry = {
|
|
44
|
-
allele: string
|
|
45
|
-
count: number
|
|
46
|
-
isRef: boolean
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type SnpsEntry = {
|
|
50
|
-
alt2csq?: any //{} In document but not implemented?
|
|
51
|
-
altAlleles?: string[]
|
|
52
|
-
alleles?: AllelesEntry[]
|
|
53
|
-
effectAllele: boolean
|
|
54
|
-
gt2count?: {
|
|
55
|
-
k: string
|
|
56
|
-
v: string | number
|
|
57
|
-
}
|
|
58
|
-
invalid?: boolean
|
|
59
|
-
referenceAllele?: string
|
|
60
|
-
rsid: string
|
|
61
|
-
snpid: string
|
|
62
|
-
tobe_deleted?: any
|
|
63
|
-
//Position properties
|
|
64
|
-
chr?: string
|
|
65
|
-
pos?: number
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type SnpsTerm = BaseTerm & {
|
|
69
|
-
id: string
|
|
70
|
-
reachedVariantLimit?: boolean
|
|
71
|
-
snps?: SnpsEntry[]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type SnpsTW = BaseTW & {
|
|
75
|
-
q: SnpsQ
|
|
76
|
-
term: SnpsTerm
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type VariantFilter = {
|
|
80
|
-
active: any
|
|
81
|
-
filter: any
|
|
82
|
-
opts: any
|
|
83
|
-
terms: any
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export type SnpsVocabApi = VocabApi & {
|
|
87
|
-
validateSnps: (f?: any) => {
|
|
88
|
-
error?: any
|
|
89
|
-
cacheid: string
|
|
90
|
-
snps: any
|
|
91
|
-
reachedVariantLimit: any
|
|
92
|
-
}
|
|
93
|
-
get_variantFilter: () => any
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
type SnpsDom = InstanceDom & {
|
|
97
|
-
input_AFcutoff_label: any
|
|
98
|
-
restrictAncestriesRow: any
|
|
99
|
-
setEffectAlleleAsHint: any
|
|
100
|
-
snplst_table: any
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export type SnpsTermSettingInstance = TermSettingInstance & {
|
|
104
|
-
dom: SnpsDom
|
|
105
|
-
q: Partial<SnpsQ>
|
|
106
|
-
term: SnpsTerm
|
|
107
|
-
usecase: UseCase
|
|
108
|
-
variantFilter: VariantFilter
|
|
109
|
-
vocabApi: SnpsVocabApi
|
|
110
|
-
}
|
package/src/terms/term.ts
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { Filter } from '../filter.js'
|
|
2
|
-
import { CategoricalTerm, CategoricalBaseQ } from './categorical.js'
|
|
3
|
-
import { ConditionTerm } from './condition.js'
|
|
4
|
-
import { NumericTerm } from './numeric.js'
|
|
5
|
-
import { GeneVariantTerm } from './geneVariant.js'
|
|
6
|
-
import { SampleLstTerm } from './samplelst.js'
|
|
7
|
-
import { SnpsTerm } from './snps.js'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param id term.id for dictionary terms, undefined for non-dictionary terms
|
|
11
|
-
* @params $id client-computed deterministic unique identifier, to distinguish tw with the same term but different q, that are in the same payload
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/*** types supporting termwrapper q ***/
|
|
15
|
-
|
|
16
|
-
export type HiddenValues = {
|
|
17
|
-
[index: string]: number
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// TODO: replace BaseQ with MinBaseQ (see below)
|
|
21
|
-
// keeping BaseQ for now to not break old code
|
|
22
|
-
export type BaseQ = {
|
|
23
|
-
/**Automatically set by fillTermWrapper()
|
|
24
|
-
Applies to barchart, survival plot, and cuminc plot.
|
|
25
|
-
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.
|
|
26
|
-
This allows the key visibility to be stored in state, while toggling visibility will not trigger data re-request.
|
|
27
|
-
Currently termsetting menu does not manage this attribute. It’s managed by barchart legend.
|
|
28
|
-
*/
|
|
29
|
-
hiddenValues?: HiddenValues
|
|
30
|
-
/**indicates this object should not be extended by a copy-merge tool */
|
|
31
|
-
isAtomic?: boolean
|
|
32
|
-
name?: string
|
|
33
|
-
mode?:
|
|
34
|
-
| 'discrete'
|
|
35
|
-
/** Binary is a special case of discrete. */
|
|
36
|
-
| 'binary'
|
|
37
|
-
| 'continuous'
|
|
38
|
-
/** Only for numeric terms in regression analysis. Requires q.knots */
|
|
39
|
-
| 'spline'
|
|
40
|
-
/** Only applies to condition term. Requires q.breaks[] to have one grade value.*/
|
|
41
|
-
| 'cuminc'
|
|
42
|
-
/** Only applies to condition term for cox regression outcome. Requires q.breaks[] to have one grade value, for event and q.timeScale.*/
|
|
43
|
-
| 'cox'
|
|
44
|
-
|
|
45
|
-
reuseId?: string
|
|
46
|
-
/** To define ways to divide up cohort based on a term, using methods specific to term types.*/
|
|
47
|
-
type?: /** Requires term.values{} to access categories for categorical term, and grade for condition term */
|
|
48
|
-
| 'values'
|
|
49
|
-
/** Applies to numeric terms */
|
|
50
|
-
| 'regular-bin'
|
|
51
|
-
/** Applies to numeric terms */
|
|
52
|
-
| 'custom-bin'
|
|
53
|
-
/** Applies to categorical, condition, geneVariant, and singleCellCellType terms */
|
|
54
|
-
| 'predefined-groupset'
|
|
55
|
-
/** Applies to categorical, condition, geneVariant, and singleCellCellType terms */
|
|
56
|
-
| 'custom-groupset'
|
|
57
|
-
/** Applies to samplelst terms */
|
|
58
|
-
| 'custom-samplelst'
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type ValuesQ = CategoricalBaseQ & {
|
|
62
|
-
type: 'values'
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type PredefinedGroupSettingQ = CategoricalBaseQ & {
|
|
66
|
-
type: 'predefined-groupset'
|
|
67
|
-
predefined_groupset_idx: number
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export type CustomGroupSettingQ = CategoricalBaseQ & {
|
|
71
|
-
type: 'custom-groupset'
|
|
72
|
-
customset: BaseGroupSet
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export type GroupSettingQ = ValuesQ | PredefinedGroupSettingQ | CustomGroupSettingQ
|
|
76
|
-
|
|
77
|
-
/*** types supporting termwrapper term ***/
|
|
78
|
-
|
|
79
|
-
export type BaseValue = {
|
|
80
|
-
key?: string
|
|
81
|
-
uncomputable?: boolean
|
|
82
|
-
label?: string | number
|
|
83
|
-
order?: string
|
|
84
|
-
color?: string
|
|
85
|
-
group?: number
|
|
86
|
-
filter?: Filter
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type TermValues = {
|
|
90
|
-
[key: string | number]: BaseValue
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type BaseTerm = {
|
|
94
|
-
id: string
|
|
95
|
-
name: string
|
|
96
|
-
type: string
|
|
97
|
-
child_types?: string[]
|
|
98
|
-
hashtmldetail?: boolean
|
|
99
|
-
included_types?: string[]
|
|
100
|
-
isleaf?: boolean
|
|
101
|
-
values?: TermValues
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export type Term = BaseTerm &
|
|
105
|
-
(NumericTerm | CategoricalTerm | ConditionTerm | GeneVariantTerm | SampleLstTerm | SnpsTerm)
|
|
106
|
-
|
|
107
|
-
export type ValuesGroup = {
|
|
108
|
-
name: string
|
|
109
|
-
type: 'values' | string // can remove boolean fallback once problematic js files are converted to .ts and can declare `type: 'values' as const`
|
|
110
|
-
values: { key: number | string; label: string }[]
|
|
111
|
-
uncomputable?: boolean // if true, do not include this group in computations
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// TODO: determine if this is used
|
|
115
|
-
export type FilterGroup = {
|
|
116
|
-
name: string
|
|
117
|
-
type: 'filter'
|
|
118
|
-
filter: Filter
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export type GroupEntry = ValuesGroup | FilterGroup
|
|
122
|
-
|
|
123
|
-
export type BaseGroupSet = {
|
|
124
|
-
groups: GroupEntry[]
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
type Groupset = {
|
|
128
|
-
name: string
|
|
129
|
-
is_grade?: boolean
|
|
130
|
-
is_subcondition?: boolean
|
|
131
|
-
} & BaseGroupSet
|
|
132
|
-
|
|
133
|
-
export type EnabledTermGroupSetting = {
|
|
134
|
-
disabled?: false | boolean // can remove boolean fallback once common.js is converted to .ts and can declare `disabled: false as const`
|
|
135
|
-
lst: Groupset[]
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export type TermGroupSetting =
|
|
139
|
-
| EnabledTermGroupSetting
|
|
140
|
-
| {
|
|
141
|
-
/** disabled=false when groupsetting is not applicable for term (e.g., when term has only two categories) */
|
|
142
|
-
disabled: true | boolean // can remove boolean fallback once common.js is converted to .ts and can declare `disabled: true as const`
|
|
143
|
-
lst?: []
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/*** types supporting termwrapper ***/
|
|
147
|
-
|
|
148
|
-
export type BaseTW = {
|
|
149
|
-
id?: string
|
|
150
|
-
$id?: string
|
|
151
|
-
isAtomic?: true
|
|
152
|
-
// plot-specific customizations that are applied to a tw copy
|
|
153
|
-
// todo: should rethink these
|
|
154
|
-
legend?: any
|
|
155
|
-
settings?: {
|
|
156
|
-
[key: string]: any
|
|
157
|
-
}
|
|
158
|
-
sortSamples?: any
|
|
159
|
-
minNumSamples?: number
|
|
160
|
-
valueFilter?: any
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/*** types supporting Term types ***/
|
|
164
|
-
|
|
165
|
-
export type Subconditions = {
|
|
166
|
-
[index: string | number]: {
|
|
167
|
-
label: string
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/*** other types ***/
|
|
172
|
-
|
|
173
|
-
export type RangeEntry = {
|
|
174
|
-
//Used binconfig.lst[] and in tvs.ranges[]
|
|
175
|
-
start?: number
|
|
176
|
-
startunbounded?: boolean
|
|
177
|
-
startinclusive?: boolean
|
|
178
|
-
stop?: number
|
|
179
|
-
stopunbounded?: boolean
|
|
180
|
-
stopinclusive?: boolean
|
|
181
|
-
label?: string //for binconfig.lst[]
|
|
182
|
-
value?: string //for tvs.ranges[]
|
|
183
|
-
range?: any //No idea what this is
|
|
184
|
-
}
|