Skip to content

Commit d9c8598

Browse files
Merge pull request #447 from bcgsc/release/v6.29.0
Release/v6.29.0
2 parents d686662 + a4275a8 commit d9c8598

File tree

32 files changed

+816
-239
lines changed

32 files changed

+816
-239
lines changed

app/common.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ type CopyNumberType = {
156156
kbMatches?: KbMatchType<'cnv'>[];
157157
log2Cna: string | null;
158158
lohState: string | null;
159+
selected: boolean;
159160
size: number | null;
160161
start: number | null;
161162
variantType: 'cnv';
@@ -182,6 +183,7 @@ type StructuralVariantType = {
182183
ntermGene: string | null;
183184
ntermTranscript: string | null;
184185
omicSupport: boolean;
186+
selected: boolean;
185187
svg: string | null;
186188
svgTitle: string | null;
187189
variantType: 'sv';
@@ -209,6 +211,7 @@ type SmallMutationType = {
209211
rnaAltCount: number | null;
210212
rnaDepth: number | null;
211213
rnaRefCount: number | null;
214+
selected: boolean;
212215
startPosition: number | null;
213216
transcript: string | null;
214217
tumourAltCopies: number | null;
@@ -242,11 +245,14 @@ type ExpOutliersType = {
242245
primarySitekIQR: number | null;
243246
rnaReads: number | null;
244247
rpkm: number | null;
248+
selected: boolean;
245249
tpm: number | null;
246250
variantType: 'exp';
247251
} & RecordDefaults;
248252

249253
type TmburType = {
254+
adjustedTmb: number | null;
255+
adjustedTmbComment: string | null;
250256
cdsBasesIn1To22AndXAndY: string;
251257
cdsIndels: number;
252258
cdsIndelTmb: number;
@@ -255,8 +261,6 @@ type TmburType = {
255261
comments: string;
256262
genomeSnvTmb: number;
257263
genomeIndelTmb: number;
258-
adjustedTmb: number | null;
259-
adjustedTmbComment: string | null;
260264
tmbHidden: boolean;
261265
kbCategory: string | null;
262266
kbMatches: KbMatchType[];
@@ -314,6 +318,10 @@ type ImmuneType = {
314318
kbCategory: string | null;
315319
percentile: number | null;
316320
score: number | null;
321+
pedsPercentile: number | null;
322+
pedsScore: number | null;
323+
pedsScoreComment: string | null;
324+
percentileHidden: boolean;
317325
} & RecordDefaults;
318326

319327
type MicrobialType = {

app/components/PrintTable/index.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@
2323

2424
&__row {
2525
font-size: 10pt;
26-
border-bottom: 1px solid $palette__text--hint;
27-
page-break-inside: avoid;
26+
border-bottom: 0.5px solid lightgray;
2827

2928
& td {
30-
padding: 10px 4px;
29+
padding: 3px 4px;
3130
max-width: 300px;
3231
overflow-wrap: break-word;
32+
break-inside: avoid;
3333
}
3434
}
3535

3636
&__none {
3737
border-bottom: 1px solid $palette__text--hint;
38-
padding: 10px 0;
38+
padding: 3px 4px;
3939
text-align: center;
40+
border-bottom: 0.5px solid lightgray;
41+
font-size: 10pt;
4042
}
4143

4244
&__cell {

app/components/SignatureCard/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
}
2121

2222
&-print {
23+
2324
&__group {
2425
display: inline-flex;
2526
flex-direction: column;
2627
margin: 0 auto;
28+
max-width: 33%;
2729
}
2830

2931
&__value {

app/components/SummaryPrintTable/index.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
Table, TableCell, TableRow, Typography,
33
} from '@mui/material';
4+
import { Dictionary } from 'lodash';
45
import React from 'react';
56

67
type SummaryPrintTableProps = {
@@ -11,16 +12,27 @@ type SummaryPrintTableProps = {
1112
renderValue?: (value: any) => unknown;
1213
};
1314

15+
const variantTypes = ['cnv', 'smallMutation', 'structuralVariant', 'expression'];
16+
17+
const variantToStrings: Dictionary<string> = {
18+
cnv: 'CNV',
19+
smallMutation: 'Small Mutation',
20+
structuralVariant: 'Structural Variant',
21+
expression: 'Expression Outlier',
22+
};
23+
1424
const SummaryPrintTable = ({
1525
data,
1626
labelKey,
1727
valueKey,
1828
renderValue = null,
1929
}: SummaryPrintTableProps) => (
2030
<Table padding="none" size="small">
21-
{data.map(({ [labelKey]: label, [valueKey]: value }) => (
31+
{data.filter((key) => (key.value !== null && key.value !== '')).map(({ [labelKey]: label, [valueKey]: value }) => (
2232
<TableRow>
23-
<TableCell><Typography variant="body2" fontWeight="bold">{label}</Typography></TableCell>
33+
<TableCell>
34+
<Typography variant="body2" fontWeight="bold">{variantTypes.includes(String(label)) ? `${variantToStrings[String(label)]}${Object.values(value).length > 1 ? 's' : ''}` : label}</Typography>
35+
</TableCell>
2436
<TableCell sx={{ paddingLeft: 1 }}>
2537
{renderValue ? renderValue(value) : value}
2638
</TableCell>

app/components/TumourSummaryEdit/index.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
&__check-box {
1111
color: gray;
12-
padding-top: 2px;
12+
margin-top: -12px;
13+
font-size: 2;
1314
}
15+
}
16+
17+
.checkbox-label {
18+
font-size: 10pt;
1419
}

app/components/TumourSummaryEdit/index.tsx

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ const TumourSummaryEdit = ({
8787
setNewTCellCd8Data({
8888
score: tCellCd8.score,
8989
percentile: tCellCd8.percentile,
90+
percentileHidden: tCellCd8.percentileHidden,
91+
pedsScore: tCellCd8.pedsScore,
92+
pedsPercentile: tCellCd8.pedsPercentile,
93+
pedsScoreComment: tCellCd8.pedsScoreComment,
9094
});
9195
}
9296
}, [tCellCd8]);
@@ -95,7 +99,6 @@ const TumourSummaryEdit = ({
9599
if (mutationBurden) {
96100
setNewMutationBurdenData({
97101
role: mutationBurden.role,
98-
totalMutationsPerMb: mutationBurden.totalMutationsPerMb,
99102
qualitySvCount: mutationBurden.qualitySvCount,
100103
qualitySvPercentile: mutationBurden.qualitySvPercentile,
101104
});
@@ -126,6 +129,30 @@ const TumourSummaryEdit = ({
126129
setTCellCd8Dirty(true);
127130
}, []);
128131

132+
const handleTCellCd8PercentileVisibleChange = useCallback(({ target: { checked, name } }) => {
133+
setNewTCellCd8Data((prevVal) => ({
134+
...prevVal,
135+
[name]: checked,
136+
}));
137+
setTCellCd8Dirty(true);
138+
}, []);
139+
140+
const handlePedsCd8tChange = useCallback(({ target: { value, name } }) => {
141+
setNewTCellCd8Data((cd8t) => ({
142+
...cd8t,
143+
[name]: parseFloat(value),
144+
}));
145+
setTCellCd8Dirty(true);
146+
}, []);
147+
148+
const handlePedsCd8tCommentChange = useCallback(({ target: { value, name } }) => {
149+
setNewTCellCd8Data((cd8t) => ({
150+
...cd8t,
151+
[name]: value,
152+
}));
153+
setTCellCd8Dirty(true);
154+
}, []);
155+
129156
const handleMutationBurdenChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
130157
const { target: { value, name } } = event;
131158
setNewMutationBurdenData((prevVal) => ({ ...prevVal, [name]: value }));
@@ -158,11 +185,16 @@ const TumourSummaryEdit = ({
158185

159186
const handleClose = useCallback(async (isSaved) => {
160187
let callSet = null;
161-
if (!!newTmburMutData.adjustedTmb && !newTmburMutData.adjustedTmbComment) {
188+
if (!!newTmburMutData?.adjustedTmb && !newTmburMutData?.adjustedTmbComment) {
162189
snackbar.warning('Please add a comment on the adjusted TMB');
163190
isSaved = false;
164191
onClose(false);
165192
}
193+
if (!!newTCellCd8Data?.pedsScore && !newTCellCd8Data?.pedsScoreComment) {
194+
snackbar.warning('Please add a comment on the added pediatric CD8+ t cell score');
195+
isSaved = false;
196+
onClose(false);
197+
}
166198
if (isSaved) {
167199
setIsApiCalling(true);
168200
const apiCalls = [];
@@ -359,7 +391,7 @@ const TumourSummaryEdit = ({
359391
return (
360392
<TextField
361393
className="tumour-dialog__text-field"
362-
label="Captiv 8 Score"
394+
label="CAPTIV-8 Score"
363395
value={newReportData.captiv8Score}
364396
name="captiv8Score"
365397
onChange={handleReportChange}
@@ -430,21 +462,66 @@ const TumourSummaryEdit = ({
430462
fullWidth
431463
type="number"
432464
/>
433-
</>
434-
), [newTCellCd8Data, handleTCellCd8Change]);
435-
436-
const mutBurDataSection = useMemo(() => (
437-
<>
465+
<FormControlLabel
466+
className="tumour-dialog__check-box"
467+
control={(
468+
<Checkbox
469+
size="small"
470+
icon={<Visibility />}
471+
checkedIcon={<VisibilityOff />}
472+
checked={newTCellCd8Data?.percentileHidden}
473+
name="percentileHidden"
474+
onChange={handleTCellCd8PercentileVisibleChange}
475+
sx={{
476+
color: 'default',
477+
'&.Mui-checked': {
478+
color: pink[800],
479+
},
480+
marginLeft: 1,
481+
}}
482+
/>
483+
)}
484+
label={<div className="checkbox-label">Show/Hide CD8+ Percentile</div>}
485+
/>
438486
<TextField
439487
className="tumour-dialog__text-field"
440-
label="Mutation Burden (Mut/Mb)"
441-
value={newMutationBurdenData?.totalMutationsPerMb ?? null}
442-
name="totalMutationsPerMb"
443-
onChange={handleMutationBurdenChange}
488+
label="Pediatric CD8+ T Cell Score"
489+
value={newTCellCd8Data?.pedsScore ?? null}
490+
name="pedsScore"
491+
disabled={report.patientInformation.caseType !== 'Pediatric'}
492+
onChange={handlePedsCd8tChange}
444493
variant="outlined"
445494
fullWidth
446495
type="number"
447496
/>
497+
<TextField
498+
className="tumour-dialog__text-field"
499+
label="Pediatric CD8+ T Cell Percentile"
500+
value={newTCellCd8Data?.pedsPercentile ?? null}
501+
name="pedsPercentile"
502+
disabled={report.patientInformation.caseType !== 'Pediatric'}
503+
onChange={handlePedsCd8tChange}
504+
variant="outlined"
505+
fullWidth
506+
type="number"
507+
/>
508+
<TextField
509+
className="tumour-dialog__text-field"
510+
label="Pediatric CD8+ T Cell Comment"
511+
value={newTCellCd8Data?.pedsScoreComment ?? ''}
512+
name="pedsScoreComment"
513+
disabled={!newTCellCd8Data?.pedsScore && !newTCellCd8Data?.pedsScoreComment}
514+
required={!!newTCellCd8Data?.pedsScore}
515+
onChange={handlePedsCd8tCommentChange}
516+
variant="outlined"
517+
fullWidth
518+
type="text"
519+
/>
520+
</>
521+
), [newTCellCd8Data?.score, newTCellCd8Data?.percentile, newTCellCd8Data?.percentileHidden, newTCellCd8Data?.pedsScore, newTCellCd8Data?.pedsPercentile, newTCellCd8Data?.pedsScoreComment, handleTCellCd8Change, handleTCellCd8PercentileVisibleChange, report.patientInformation.caseType, handlePedsCd8tChange, handlePedsCd8tCommentChange]);
522+
523+
const mutBurDataSection = useMemo(() => (
524+
<>
448525
<TextField
449526
className="tumour-dialog__text-field"
450527
label="SV Burden (POG average)"
@@ -516,6 +593,7 @@ const TumourSummaryEdit = ({
516593
className="tumour-dialog__check-box"
517594
control={(
518595
<Checkbox
596+
size="small"
519597
icon={<Visibility />}
520598
checkedIcon={<VisibilityOff />}
521599
checked={newTmburMutData?.tmbHidden}
@@ -526,10 +604,11 @@ const TumourSummaryEdit = ({
526604
'&.Mui-checked': {
527605
color: pink[800],
528606
},
607+
marginLeft: 1,
529608
}}
530609
/>
531610
)}
532-
label="Show/Hide TMB Score"
611+
label={<div className="checkbox-label">Show/Hide TMB Information</div>}
533612
/>
534613
</>
535614
), [newTmburMutData?.genomeSnvTmb, newTmburMutData?.genomeIndelTmb, newTmburMutData?.adjustedTmb, newTmburMutData?.adjustedTmbComment, newTmburMutData?.tmbHidden, handleTmburChange, handleAdjustedTmbCommentChange, handleAdjustedTmbVisibleChange]);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.variant-edit-dialog {
2+
&__form-control {
3+
min-width: 160px;
4+
margin: 0 0 16px;
5+
}
6+
}

0 commit comments

Comments
 (0)