Skip to content

Commit b4681ce

Browse files
authored
Merge pull request #333 from bcgsc/release/v6.20.0
Release/v6.20.0
2 parents 3005aa8 + 3d2f203 commit b4681ce

File tree

19 files changed

+215
-128
lines changed

19 files changed

+215
-128
lines changed

app/common.d.ts

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,30 @@ type GeneType = {
116116
};
117117

118118
type KbMatchType<T extends AnyVariantType = AnyVariantType> = {
119-
category: string;
120119
approvedTherapy: boolean;
121-
kbVariant: string;
122-
disease: string;
123-
relevance: string;
120+
category: string;
124121
context: string;
125-
status: string;
126-
reference: string;
127-
sample: string;
128-
inferred: boolean;
122+
disease: string;
129123
evidenceLevel: string;
124+
externalSource: string;
125+
externalStatementId: string;
126+
inferred: boolean;
130127
iprEvidenceLevel: string;
131-
matchedCancer: boolean;
132-
pmidRef: string;
133-
variantType: T;
134-
variant: VariantTypeMap<T>;
135-
kbVariantId: string;
136-
kbStatementId: string;
137128
kbData: {
138129
inferred: boolean;
139-
}
140-
externalSource: string;
141-
externalStatementId: string;
130+
} | null;
131+
kbStatementId: string;
132+
kbVariant: string;
133+
kbVariantId: string;
134+
matchedCancer: boolean;
135+
pmidRef: string;
136+
reference: string;
137+
relevance: string;
142138
reviewStatus: string;
139+
sample: string | null;
140+
status: string | null;
141+
variant?: VariantTypeMap<T>;
142+
variantType: T;
143143
} & RecordDefaults;
144144

145145
type CopyNumberType = {
@@ -151,10 +151,12 @@ type CopyNumberType = {
151151
end: number | null;
152152
gene: GeneType | null;
153153
kbCategory: string | null;
154+
kbMatches?: VariantTypeMap<'cnv'>[];
154155
log2Cna: string | null;
155156
lohState: string | null;
156157
size: number | null;
157158
start: number | null;
159+
variantType: 'cnv';
158160
} & RecordDefaults;
159161

160162
type StructuralVariantType = {
@@ -171,13 +173,15 @@ type StructuralVariantType = {
171173
gene1: GeneType | null;
172174
gene2: GeneType | null;
173175
highQuality: boolean;
176+
kbMatches?: KbMatchType<'sv'>[];
174177
mavis_product_id: number | null;
175178
name: string | null;
176179
ntermGene: string | null;
177180
ntermTranscript: string | null;
178181
omicSupport: boolean;
179182
svg: string | null;
180183
svgTitle: string | null;
184+
variantType: 'sv';
181185
} & RecordDefaults;
182186

183187
type SmallMutationType = {
@@ -190,6 +194,7 @@ type SmallMutationType = {
190194
hgvsCds: string | null;
191195
hgvsGenomic: string | null;
192196
hgvsProtein: string | null;
197+
kbMatches?: KbMatchType<'mut'>[];
193198
library: string | null;
194199
ncbiBuild: string | null;
195200
normalAltCount: number | null;
@@ -208,6 +213,7 @@ type SmallMutationType = {
208213
tumourRefCopies: number | null;
209214
tumourRefCount: number | null;
210215
zygosity: string | null;
216+
variantType: 'mut';
211217
} & RecordDefaults;
212218

213219
type ExpOutliersType = {
@@ -233,6 +239,7 @@ type ExpOutliersType = {
233239
rnaReads: number | null;
234240
rpkm: number | null;
235241
tpm: number | null;
242+
variantType: 'exp';
236243
} & RecordDefaults;
237244

238245
type TmburType = {
@@ -279,6 +286,34 @@ type TumourSummaryType = {
279286
action?: () => void | null;
280287
};
281288

289+
type MutationBurdenType = {
290+
codingIndelPercentile: number | null;
291+
codingIndelsCount: number | null;
292+
codingSnvCount: number | null;
293+
codingSnvPercentile: number | null;
294+
frameshiftIndelsCount: number | null;
295+
qualitySvCount: number | null;
296+
qualitySvExpressedCount: number | null;
297+
qualitySvPercentile: number | null;
298+
role: string;
299+
totalIndelCount: number | null;
300+
totalMutationsPerMb: number | null;
301+
totalSnvCount: number | null;
302+
truncatingSnvCount: number | null;
303+
} & RecordDefaults;
304+
305+
type ImmuneType = {
306+
cellType: string | null;
307+
kbCategory: string | null;
308+
percentile: number | null;
309+
score: number | null;
310+
} & RecordDefaults;
311+
312+
type MicrobialType = {
313+
integrationSite: string | null;
314+
species: string | null;
315+
} & RecordDefaults;
316+
282317
type AppendixType = RecordDefaults & {
283318
text: string;
284319
};
@@ -302,4 +337,7 @@ export {
302337
TumourSummaryType,
303338
TmburType,
304339
MsiType,
340+
MutationBurdenType,
341+
ImmuneType,
342+
MicrobialType,
305343
};

app/components/DataTable/components/ArrayCellRenderer/__tests__/ArrayCellRenderer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('ArrayCellRenderer', () => {
5858

5959
const elem = await screen.findByText(mockLinkArrayData.test[0]);
6060

61-
expect(elem).toHaveAttribute('href', `http://${mockLinkArrayData.test[0]}`);
62-
expect(screen.queryByText(`http://${mockLinkArrayData.test[1]}`)).toBeNull();
61+
expect(elem).toHaveAttribute('href', `${mockLinkArrayData.test[0]}`);
62+
expect(screen.queryByText(`${mockLinkArrayData.test[1]}`)).toBeNull();
6363
});
6464
});

app/components/DataTable/components/ArrayCellRenderer/index.tsx

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,45 @@ import { ICellRendererParams } from '@ag-grid-community/core';
44

55
import './index.scss';
66

7+
const urlRegex = /^(?:https?:\/\/)?(?:[\w-]+\.)+[a-z]{2,}(?:\/[\w\-\.\/]*)*$/i;
8+
79
const RenderArrayCell = (field: string, isLink: boolean): (cellParams: ICellRendererParams) => JSX.Element => {
810
if (isLink) {
9-
return function ArrayCell(cellParams) {
10-
if (Array.isArray(cellParams.data[field])) {
11-
const cellData = [...cellParams.data[field]].sort();
12-
const firstVal = cellData[0].replace(/(pmid:)|(#)/, '');
11+
return function ArrayCell({ data }: ICellRendererParams) {
12+
if (Array.isArray(data[field])) {
13+
const cellData = [...data[field]].sort();
1314

14-
return (
15-
<div>
15+
const firstVal = cellData[0]?.replace(/(pmid:)|(#)/, '');
16+
17+
let link = firstVal;
18+
let validLink = false;
19+
20+
// firstVal might be non-link
21+
if (firstVal.match(/^\d+$/)) {
22+
link = `https://ncbi.nlm.nih.gov/pubmed/${firstVal}`;
23+
validLink = true;
24+
} else if (urlRegex.test(firstVal)) {
25+
validLink = true;
26+
}
27+
28+
let linkComponent = firstVal;
29+
30+
if (validLink) {
31+
linkComponent = (
1632
<a
1733
className="array-cell__link"
18-
href={(firstVal.match(/^\d+$/))
19-
? `https://ncbi.nlm.nih.gov/pubmed/${firstVal}`
20-
: `http://${firstVal}`}
34+
href={link}
2135
rel="noopener noreferrer"
2236
target="_blank"
2337
>
2438
{firstVal}
2539
</a>
40+
);
41+
}
42+
43+
return (
44+
<div>
45+
{linkComponent}
2646
{cellData.length > 1 && (
2747
<>
2848
@@ -33,15 +53,15 @@ const RenderArrayCell = (field: string, isLink: boolean): (cellParams: ICellRend
3353
}
3454
return (
3555
<div>
36-
{cellParams.data[field]}
56+
{data[field]}
3757
</div>
3858
);
3959
};
4060
}
4161

42-
return function ArrayCell(cellParams) {
43-
if (Array.isArray(cellParams.data[field])) {
44-
const cellData = [...cellParams.data[field]].sort();
62+
return function ArrayCell({ data }: ICellRendererParams) {
63+
if (Array.isArray(data[field])) {
64+
const cellData = [...data[field]].sort();
4565
const [firstVal] = cellData;
4666

4767
if (typeof firstVal === 'string') {
@@ -61,7 +81,7 @@ const RenderArrayCell = (field: string, isLink: boolean): (cellParams: ICellRend
6181
}
6282
return (
6383
<div>
64-
{`${cellParams.data[field] === null ? '' : cellParams.data[field]}`}
84+
{`${data[field] === null ? '' : data[field]}`}
6585
</div>
6686
);
6787
};

app/components/DataTable/components/CivicCellRenderer/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ const CivicCellRenderer = ({
5353
}
5454
}, [data, externalStatementId, externalSource]);
5555

56-
const menuItems = links.map((linkId) => (
57-
<MenuItem
58-
key={linkId}
59-
onClick={handleMenuClose}
60-
>
61-
<NewTabLink link={`https://civicdb.org/links/evidence/${linkId}`} text={linkId} />
62-
</MenuItem>
63-
));
64-
6556
if (links.length > 1) {
57+
const menuItems = links.map((linkId) => (
58+
<MenuItem
59+
key={linkId}
60+
onClick={handleMenuClose}
61+
>
62+
<NewTabLink link={`https://civicdb.org/links/evidence/${linkId}`} text={linkId} />
63+
</MenuItem>
64+
));
6665
return (
6766
<>
6867
<span>{text ? `${text},` : ''}</span>
@@ -71,6 +70,8 @@ const CivicCellRenderer = ({
7170
style={{
7271
backgroundColor: 'unset',
7372
border: 'none',
73+
padding: 0,
74+
fontFamily: 'inherit',
7475
}}
7576
aria-label="Open in CIViC"
7677
title="Open in CIViC"

app/components/TumourSummaryEdit/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import useConfirmDialog from '@/hooks/useConfirmDialog';
1919

2020
import './index.scss';
2121
import { ReportType } from '@/context/ReportContext';
22-
import { MutationBurdenType } from '../../../MutationBurden/types';
23-
import { MicrobialType } from '../../types';
22+
import { MicrobialType, MutationBurdenType } from '@/common';
2423

2524
type TumourSummaryEditProps = {
2625
microbial: MicrobialType[];

app/context/ReportContext/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type ReportType = {
5353
users: UserRoleType[];
5454
oncotreeTumourType: string;
5555
kbDiseaseMatch: string;
56+
m1m2Score: number;
5657
} & RecordDefaults;
5758

5859
type ReportContextType = {

app/views/PrintView/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,21 @@ const Print = (): JSX.Element => {
112112
<PageBreak />
113113
</>
114114
)}
115-
{template?.sections.includes('analyst-comments') && (
115+
{template?.sections.includes('therapeutic-targets') && (
116116
<>
117-
<AnalystComments report={report} isPrint loadedDispatch={dispatch} />
117+
<TherapeuticTargets isPrint loadedDispatch={dispatch} />
118118
<PageBreak />
119119
</>
120120
)}
121-
{template?.sections.includes('pathway-analysis') && (
121+
{template?.sections.includes('analyst-comments') && (
122122
<>
123-
<PathwayAnalysis report={report} isPrint loadedDispatch={dispatch} />
123+
<AnalystComments report={report} isPrint loadedDispatch={dispatch} />
124124
<PageBreak />
125125
</>
126126
)}
127-
{template?.sections.includes('therapeutic-targets') && (
127+
{template?.sections.includes('pathway-analysis') && (
128128
<>
129-
<TherapeuticTargets isPrint loadedDispatch={dispatch} />
129+
<PathwayAnalysis report={report} isPrint loadedDispatch={dispatch} />
130130
<PageBreak />
131131
</>
132132
)}

app/views/ReportView/components/GenomicSummary/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ import withLoading, { WithLoadingInjectedProps } from '@/hoc/WithLoading';
2323
import PatientEdit from '@/components/PatientEdit';
2424
import useConfirmDialog from '@/hooks/useConfirmDialog';
2525
import TumourSummaryEdit from '@/components/TumourSummaryEdit';
26-
import { TumourSummaryType, TmburType, MsiType } from '@/common';
26+
import {
27+
TumourSummaryType, MicrobialType, ImmuneType, MutationBurdenType, TmburType, MsiType,
28+
} from '@/common';
29+
2730
import VariantChips from './components/VariantChips';
2831
import VariantCounts from './components/VariantCounts';
2932
import {
3033
PatientInformationType,
3134
GeneVariantType,
32-
MicrobialType,
3335
} from './types';
3436
import {
35-
MutationBurdenType, ComparatorType,
37+
ComparatorType,
3638
} from '../MutationBurden/types';
3739
import MutationSignatureType from '../MutationSignatures/types';
38-
import { ImmuneType } from '../Immune/types';
3940

4041
import './index.scss';
4142

app/views/ReportView/components/GenomicSummary/types.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ type GeneVariantType = {
1010
type?: string;
1111
} & RecordDefaults;
1212

13-
type MicrobialType = {
14-
integrationSite: string | null;
15-
species: string | null;
16-
} & RecordDefaults;
17-
1813
export {
1914
PatientInformationType,
2015
GeneVariantType,
21-
MicrobialType,
2216
};

app/views/ReportView/components/Immune/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import ReportContext from '@/context/ReportContext';
77
import api, { ApiCallSet } from '@/services/api';
88
import snackbar from '@/services/SnackbarUtils';
99
import withLoading, { WithLoadingInjectedProps } from '@/hoc/WithLoading';
10+
import { ImmuneType } from '@/common';
1011
import { hlaColumnDefs, cellTypesColumnDefs } from './columnDefs';
11-
import { ImmuneType, HlaType } from './types';
12+
import { HlaType } from './types';
1213

1314
import './index.scss';
1415

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import { RecordDefaults } from '@/common';
22

3-
type ImmuneType = {
4-
cellType: string | null;
5-
kbCategory: string | null;
6-
percentile: number | null;
7-
score: number | null;
8-
} & RecordDefaults;
9-
103
type HlaType = {
114
a1: string;
125
a2: string;
@@ -22,6 +15,5 @@ type HlaType = {
2215
} & RecordDefaults;
2316

2417
export {
25-
ImmuneType,
2618
HlaType,
2719
};

0 commit comments

Comments
 (0)