Skip to content

Commit

Permalink
Merge pull request #447 from bcgsc/release/v6.29.0
Browse files Browse the repository at this point in the history
Release/v6.29.0
  • Loading branch information
bnguyen-bcgsc authored Apr 5, 2024
2 parents d686662 + a4275a8 commit d9c8598
Show file tree
Hide file tree
Showing 32 changed files with 816 additions and 239 deletions.
12 changes: 10 additions & 2 deletions app/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ type CopyNumberType = {
kbMatches?: KbMatchType<'cnv'>[];
log2Cna: string | null;
lohState: string | null;
selected: boolean;
size: number | null;
start: number | null;
variantType: 'cnv';
Expand All @@ -182,6 +183,7 @@ type StructuralVariantType = {
ntermGene: string | null;
ntermTranscript: string | null;
omicSupport: boolean;
selected: boolean;
svg: string | null;
svgTitle: string | null;
variantType: 'sv';
Expand Down Expand Up @@ -209,6 +211,7 @@ type SmallMutationType = {
rnaAltCount: number | null;
rnaDepth: number | null;
rnaRefCount: number | null;
selected: boolean;
startPosition: number | null;
transcript: string | null;
tumourAltCopies: number | null;
Expand Down Expand Up @@ -242,11 +245,14 @@ type ExpOutliersType = {
primarySitekIQR: number | null;
rnaReads: number | null;
rpkm: number | null;
selected: boolean;
tpm: number | null;
variantType: 'exp';
} & RecordDefaults;

type TmburType = {
adjustedTmb: number | null;
adjustedTmbComment: string | null;
cdsBasesIn1To22AndXAndY: string;
cdsIndels: number;
cdsIndelTmb: number;
Expand All @@ -255,8 +261,6 @@ type TmburType = {
comments: string;
genomeSnvTmb: number;
genomeIndelTmb: number;
adjustedTmb: number | null;
adjustedTmbComment: string | null;
tmbHidden: boolean;
kbCategory: string | null;
kbMatches: KbMatchType[];
Expand Down Expand Up @@ -314,6 +318,10 @@ type ImmuneType = {
kbCategory: string | null;
percentile: number | null;
score: number | null;
pedsPercentile: number | null;
pedsScore: number | null;
pedsScoreComment: string | null;
percentileHidden: boolean;
} & RecordDefaults;

type MicrobialType = {
Expand Down
10 changes: 6 additions & 4 deletions app/components/PrintTable/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@

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

& td {
padding: 10px 4px;
padding: 3px 4px;
max-width: 300px;
overflow-wrap: break-word;
break-inside: avoid;
}
}

&__none {
border-bottom: 1px solid $palette__text--hint;
padding: 10px 0;
padding: 3px 4px;
text-align: center;
border-bottom: 0.5px solid lightgray;
font-size: 10pt;
}

&__cell {
Expand Down
2 changes: 2 additions & 0 deletions app/components/SignatureCard/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
}

&-print {

&__group {
display: inline-flex;
flex-direction: column;
margin: 0 auto;
max-width: 33%;
}

&__value {
Expand Down
16 changes: 14 additions & 2 deletions app/components/SummaryPrintTable/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Table, TableCell, TableRow, Typography,
} from '@mui/material';
import { Dictionary } from 'lodash';
import React from 'react';

type SummaryPrintTableProps = {
Expand All @@ -11,16 +12,27 @@ type SummaryPrintTableProps = {
renderValue?: (value: any) => unknown;
};

const variantTypes = ['cnv', 'smallMutation', 'structuralVariant', 'expression'];

const variantToStrings: Dictionary<string> = {
cnv: 'CNV',
smallMutation: 'Small Mutation',
structuralVariant: 'Structural Variant',
expression: 'Expression Outlier',
};

const SummaryPrintTable = ({
data,
labelKey,
valueKey,
renderValue = null,
}: SummaryPrintTableProps) => (
<Table padding="none" size="small">
{data.map(({ [labelKey]: label, [valueKey]: value }) => (
{data.filter((key) => (key.value !== null && key.value !== '')).map(({ [labelKey]: label, [valueKey]: value }) => (
<TableRow>
<TableCell><Typography variant="body2" fontWeight="bold">{label}</Typography></TableCell>
<TableCell>
<Typography variant="body2" fontWeight="bold">{variantTypes.includes(String(label)) ? `${variantToStrings[String(label)]}${Object.values(value).length > 1 ? 's' : ''}` : label}</Typography>
</TableCell>
<TableCell sx={{ paddingLeft: 1 }}>
{renderValue ? renderValue(value) : value}
</TableCell>
Expand Down
7 changes: 6 additions & 1 deletion app/components/TumourSummaryEdit/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

&__check-box {
color: gray;
padding-top: 2px;
margin-top: -12px;
font-size: 2;
}
}

.checkbox-label {
font-size: 10pt;
}
105 changes: 92 additions & 13 deletions app/components/TumourSummaryEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ const TumourSummaryEdit = ({
setNewTCellCd8Data({
score: tCellCd8.score,
percentile: tCellCd8.percentile,
percentileHidden: tCellCd8.percentileHidden,
pedsScore: tCellCd8.pedsScore,
pedsPercentile: tCellCd8.pedsPercentile,
pedsScoreComment: tCellCd8.pedsScoreComment,
});
}
}, [tCellCd8]);
Expand All @@ -95,7 +99,6 @@ const TumourSummaryEdit = ({
if (mutationBurden) {
setNewMutationBurdenData({
role: mutationBurden.role,
totalMutationsPerMb: mutationBurden.totalMutationsPerMb,
qualitySvCount: mutationBurden.qualitySvCount,
qualitySvPercentile: mutationBurden.qualitySvPercentile,
});
Expand Down Expand Up @@ -126,6 +129,30 @@ const TumourSummaryEdit = ({
setTCellCd8Dirty(true);
}, []);

const handleTCellCd8PercentileVisibleChange = useCallback(({ target: { checked, name } }) => {
setNewTCellCd8Data((prevVal) => ({
...prevVal,
[name]: checked,
}));
setTCellCd8Dirty(true);
}, []);

const handlePedsCd8tChange = useCallback(({ target: { value, name } }) => {
setNewTCellCd8Data((cd8t) => ({
...cd8t,
[name]: parseFloat(value),
}));
setTCellCd8Dirty(true);
}, []);

const handlePedsCd8tCommentChange = useCallback(({ target: { value, name } }) => {
setNewTCellCd8Data((cd8t) => ({
...cd8t,
[name]: value,
}));
setTCellCd8Dirty(true);
}, []);

const handleMutationBurdenChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
const { target: { value, name } } = event;
setNewMutationBurdenData((prevVal) => ({ ...prevVal, [name]: value }));
Expand Down Expand Up @@ -158,11 +185,16 @@ const TumourSummaryEdit = ({

const handleClose = useCallback(async (isSaved) => {
let callSet = null;
if (!!newTmburMutData.adjustedTmb && !newTmburMutData.adjustedTmbComment) {
if (!!newTmburMutData?.adjustedTmb && !newTmburMutData?.adjustedTmbComment) {
snackbar.warning('Please add a comment on the adjusted TMB');
isSaved = false;
onClose(false);
}
if (!!newTCellCd8Data?.pedsScore && !newTCellCd8Data?.pedsScoreComment) {
snackbar.warning('Please add a comment on the added pediatric CD8+ t cell score');
isSaved = false;
onClose(false);
}
if (isSaved) {
setIsApiCalling(true);
const apiCalls = [];
Expand Down Expand Up @@ -359,7 +391,7 @@ const TumourSummaryEdit = ({
return (
<TextField
className="tumour-dialog__text-field"
label="Captiv 8 Score"
label="CAPTIV-8 Score"
value={newReportData.captiv8Score}
name="captiv8Score"
onChange={handleReportChange}
Expand Down Expand Up @@ -430,21 +462,66 @@ const TumourSummaryEdit = ({
fullWidth
type="number"
/>
</>
), [newTCellCd8Data, handleTCellCd8Change]);

const mutBurDataSection = useMemo(() => (
<>
<FormControlLabel
className="tumour-dialog__check-box"
control={(
<Checkbox
size="small"
icon={<Visibility />}
checkedIcon={<VisibilityOff />}
checked={newTCellCd8Data?.percentileHidden}
name="percentileHidden"
onChange={handleTCellCd8PercentileVisibleChange}
sx={{
color: 'default',
'&.Mui-checked': {
color: pink[800],
},
marginLeft: 1,
}}
/>
)}
label={<div className="checkbox-label">Show/Hide CD8+ Percentile</div>}
/>
<TextField
className="tumour-dialog__text-field"
label="Mutation Burden (Mut/Mb)"
value={newMutationBurdenData?.totalMutationsPerMb ?? null}
name="totalMutationsPerMb"
onChange={handleMutationBurdenChange}
label="Pediatric CD8+ T Cell Score"
value={newTCellCd8Data?.pedsScore ?? null}
name="pedsScore"
disabled={report.patientInformation.caseType !== 'Pediatric'}
onChange={handlePedsCd8tChange}
variant="outlined"
fullWidth
type="number"
/>
<TextField
className="tumour-dialog__text-field"
label="Pediatric CD8+ T Cell Percentile"
value={newTCellCd8Data?.pedsPercentile ?? null}
name="pedsPercentile"
disabled={report.patientInformation.caseType !== 'Pediatric'}
onChange={handlePedsCd8tChange}
variant="outlined"
fullWidth
type="number"
/>
<TextField
className="tumour-dialog__text-field"
label="Pediatric CD8+ T Cell Comment"
value={newTCellCd8Data?.pedsScoreComment ?? ''}
name="pedsScoreComment"
disabled={!newTCellCd8Data?.pedsScore && !newTCellCd8Data?.pedsScoreComment}
required={!!newTCellCd8Data?.pedsScore}
onChange={handlePedsCd8tCommentChange}
variant="outlined"
fullWidth
type="text"
/>
</>
), [newTCellCd8Data?.score, newTCellCd8Data?.percentile, newTCellCd8Data?.percentileHidden, newTCellCd8Data?.pedsScore, newTCellCd8Data?.pedsPercentile, newTCellCd8Data?.pedsScoreComment, handleTCellCd8Change, handleTCellCd8PercentileVisibleChange, report.patientInformation.caseType, handlePedsCd8tChange, handlePedsCd8tCommentChange]);

const mutBurDataSection = useMemo(() => (
<>
<TextField
className="tumour-dialog__text-field"
label="SV Burden (POG average)"
Expand Down Expand Up @@ -516,6 +593,7 @@ const TumourSummaryEdit = ({
className="tumour-dialog__check-box"
control={(
<Checkbox
size="small"
icon={<Visibility />}
checkedIcon={<VisibilityOff />}
checked={newTmburMutData?.tmbHidden}
Expand All @@ -526,10 +604,11 @@ const TumourSummaryEdit = ({
'&.Mui-checked': {
color: pink[800],
},
marginLeft: 1,
}}
/>
)}
label="Show/Hide TMB Score"
label={<div className="checkbox-label">Show/Hide TMB Information</div>}
/>
</>
), [newTmburMutData?.genomeSnvTmb, newTmburMutData?.genomeIndelTmb, newTmburMutData?.adjustedTmb, newTmburMutData?.adjustedTmbComment, newTmburMutData?.tmbHidden, handleTmburChange, handleAdjustedTmbCommentChange, handleAdjustedTmbVisibleChange]);
Expand Down
6 changes: 6 additions & 0 deletions app/components/VariantEditDialog/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.variant-edit-dialog {
&__form-control {
min-width: 160px;
margin: 0 0 16px;
}
}
Loading

0 comments on commit d9c8598

Please sign in to comment.