@@ -37,7 +37,16 @@ declare global {
37
37
} ;
38
38
}
39
39
40
- type VariantType = 'cnv' | 'mut' | 'sv' ;
40
+ type AnyVariantType = 'cnv' | 'mut' | 'sv' | 'exp' | 'msi' | 'tmb' ;
41
+
42
+ type VariantTypeMap < T > =
43
+ T extends 'cnv' ? CopyNumberType :
44
+ T extends 'mut' ? SmallMutationType :
45
+ T extends 'sv' ? StructuralVariantType :
46
+ T extends 'exp' ? ExpOutliersType :
47
+ T extends 'msi' ? MsiType :
48
+ T extends 'tmb' ? TmburType :
49
+ never ;
41
50
42
51
type RecordDefaults = {
43
52
ident : string ;
@@ -106,7 +115,7 @@ type GeneType = {
106
115
tumourSuppressor : boolean ;
107
116
} ;
108
117
109
- type KbMatchType = {
118
+ type KbMatchType < T extends AnyVariantType = AnyVariantType > = {
110
119
category : string ;
111
120
approvedTherapy : boolean ;
112
121
kbVariant : string ;
@@ -121,7 +130,8 @@ type KbMatchType = {
121
130
iprEvidenceLevel : string ;
122
131
matchedCancer : boolean ;
123
132
pmidRef : string ;
124
- variantType : VariantType ;
133
+ variantType : T ;
134
+ variant : VariantTypeMap < T > ;
125
135
kbVariantId : string ;
126
136
kbStatementId : string ;
127
137
kbData : {
@@ -141,12 +151,10 @@ type CopyNumberType = {
141
151
end : number | null ;
142
152
gene : GeneType | null ;
143
153
kbCategory : string | null ;
144
- kbMatches : null | KbMatchType [ ] ;
145
154
log2Cna : string | null ;
146
155
lohState : string | null ;
147
156
size : number | null ;
148
157
start : number | null ;
149
- variantType : VariantType ;
150
158
} & RecordDefaults ;
151
159
152
160
type StructuralVariantType = {
@@ -163,15 +171,13 @@ type StructuralVariantType = {
163
171
gene1 : GeneType | null ;
164
172
gene2 : GeneType | null ;
165
173
highQuality : boolean ;
166
- kbMatches : null | KbMatchType [ ] ;
167
174
mavis_product_id : number | null ;
168
175
name : string | null ;
169
176
ntermGene : string | null ;
170
177
ntermTranscript : string | null ;
171
178
omicSupport : boolean ;
172
179
svg : string | null ;
173
180
svgTitle : string | null ;
174
- variantType : VariantType ;
175
181
} & RecordDefaults ;
176
182
177
183
type SmallMutationType = {
@@ -184,7 +190,6 @@ type SmallMutationType = {
184
190
hgvsCds : string | null ;
185
191
hgvsGenomic : string | null ;
186
192
hgvsProtein : string | null ;
187
- kbMatches : KbMatchType [ ] ;
188
193
library : string | null ;
189
194
ncbiBuild : string | null ;
190
195
normalAltCount : number | null ;
@@ -202,7 +207,6 @@ type SmallMutationType = {
202
207
tumourDepth : number | null ;
203
208
tumourRefCopies : number | null ;
204
209
tumourRefCount : number | null ;
205
- variantType : VariantType ;
206
210
zygosity : string | null ;
207
211
} & RecordDefaults ;
208
212
@@ -220,7 +224,6 @@ type ExpOutliersType = {
220
224
expressionState : string | null ;
221
225
gene : GeneType ;
222
226
kbCategory : string | null ;
223
- kbMatches : KbMatchType [ ] ;
224
227
location : number | null ;
225
228
primarySiteFoldChange : number | null ;
226
229
primarySitePercentile : number | null ;
@@ -230,7 +233,36 @@ type ExpOutliersType = {
230
233
rnaReads : number | null ;
231
234
rpkm : number | null ;
232
235
tpm : number | null ;
233
- variantType : VariantType ;
236
+ } & RecordDefaults ;
237
+
238
+ type TmburType = {
239
+ cdsBasesIn1To22AndXAndY : string ;
240
+ cdsIndels : number ;
241
+ cdsIndelTmb : number ;
242
+ cdsSnvs : number ,
243
+ cdsSnvTmb : number ;
244
+ comments : string ;
245
+ genomeSnvTmb : number ;
246
+ genomeIndelTmb : number ;
247
+ kbCategory : string | null ;
248
+ kbMatches : KbMatchType [ ] ;
249
+ msiScore : number ;
250
+ nonNBasesIn1To22AndXAndY : string ;
251
+ normal : string ;
252
+ proteinIndels : number ;
253
+ proteinIndelTmb : number ;
254
+ proteinSnvs : number ;
255
+ proteinSnvTmb : number ;
256
+ totalGenomeIndels : number ;
257
+ totalGenomeSnvs : number ;
258
+ tumour : string ;
259
+ variantType : 'tmb' ;
260
+ } & RecordDefaults ;
261
+
262
+ type MsiType = {
263
+ score : number | null ;
264
+ kbCategory : string | null ;
265
+ variantType : 'msi' ;
234
266
} & RecordDefaults ;
235
267
236
268
type TemplateType = {
@@ -256,6 +288,7 @@ export {
256
288
UserType ,
257
289
TemplateType ,
258
290
AppendixType ,
291
+ AnyVariantType ,
259
292
GroupType ,
260
293
UserProjectsType ,
261
294
UserGroupMemberType ,
@@ -267,4 +300,6 @@ export {
267
300
SmallMutationType ,
268
301
ExpOutliersType ,
269
302
TumourSummaryType ,
303
+ TmburType ,
304
+ MsiType ,
270
305
} ;
0 commit comments