Skip to content

Commit b2dd5c4

Browse files
authored
Merge pull request #326 from bcgsc/release/v6.19.1
Release/v6.19.1
2 parents 7e11013 + eac2f93 commit b2dd5c4

File tree

11 files changed

+287
-170
lines changed

11 files changed

+287
-170
lines changed

app/common.d.ts

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ declare global {
3737
};
3838
}
3939

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;
4150

4251
type RecordDefaults = {
4352
ident: string;
@@ -106,7 +115,7 @@ type GeneType = {
106115
tumourSuppressor: boolean;
107116
};
108117

109-
type KbMatchType = {
118+
type KbMatchType<T extends AnyVariantType = AnyVariantType> = {
110119
category: string;
111120
approvedTherapy: boolean;
112121
kbVariant: string;
@@ -121,7 +130,8 @@ type KbMatchType = {
121130
iprEvidenceLevel: string;
122131
matchedCancer: boolean;
123132
pmidRef: string;
124-
variantType: VariantType;
133+
variantType: T;
134+
variant: VariantTypeMap<T>;
125135
kbVariantId: string;
126136
kbStatementId: string;
127137
kbData: {
@@ -141,12 +151,10 @@ type CopyNumberType = {
141151
end: number | null;
142152
gene: GeneType | null;
143153
kbCategory: string | null;
144-
kbMatches: null | KbMatchType[];
145154
log2Cna: string | null;
146155
lohState: string | null;
147156
size: number | null;
148157
start: number | null;
149-
variantType: VariantType;
150158
} & RecordDefaults;
151159

152160
type StructuralVariantType = {
@@ -163,15 +171,13 @@ type StructuralVariantType = {
163171
gene1: GeneType | null;
164172
gene2: GeneType | null;
165173
highQuality: boolean;
166-
kbMatches: null | KbMatchType[];
167174
mavis_product_id: number | null;
168175
name: string | null;
169176
ntermGene: string | null;
170177
ntermTranscript: string | null;
171178
omicSupport: boolean;
172179
svg: string | null;
173180
svgTitle: string | null;
174-
variantType: VariantType;
175181
} & RecordDefaults;
176182

177183
type SmallMutationType = {
@@ -184,7 +190,6 @@ type SmallMutationType = {
184190
hgvsCds: string | null;
185191
hgvsGenomic: string | null;
186192
hgvsProtein: string | null;
187-
kbMatches: KbMatchType[];
188193
library: string | null;
189194
ncbiBuild: string | null;
190195
normalAltCount: number | null;
@@ -202,7 +207,6 @@ type SmallMutationType = {
202207
tumourDepth: number | null;
203208
tumourRefCopies: number | null;
204209
tumourRefCount: number | null;
205-
variantType: VariantType;
206210
zygosity: string | null;
207211
} & RecordDefaults;
208212

@@ -220,7 +224,6 @@ type ExpOutliersType = {
220224
expressionState: string | null;
221225
gene: GeneType;
222226
kbCategory: string | null;
223-
kbMatches: KbMatchType[];
224227
location: number | null;
225228
primarySiteFoldChange: number | null;
226229
primarySitePercentile: number | null;
@@ -230,7 +233,36 @@ type ExpOutliersType = {
230233
rnaReads: number | null;
231234
rpkm: number | null;
232235
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';
234266
} & RecordDefaults;
235267

236268
type TemplateType = {
@@ -256,6 +288,7 @@ export {
256288
UserType,
257289
TemplateType,
258290
AppendixType,
291+
AnyVariantType,
259292
GroupType,
260293
UserProjectsType,
261294
UserGroupMemberType,
@@ -267,4 +300,6 @@ export {
267300
SmallMutationType,
268301
ExpOutliersType,
269302
TumourSummaryType,
303+
TmburType,
304+
MsiType,
270305
};

0 commit comments

Comments
 (0)