Skip to content

Commit

Permalink
Merge pull request #573 from bcgsc/feat/DEVSU-2461-hide-SVburden-by-d…
Browse files Browse the repository at this point in the history
…efault

[DEVSU-2461] add svBurdenHidden field for tumoursummary
  • Loading branch information
kttkjl authored Nov 20, 2024
2 parents 274096a + 6a4f144 commit 57ee760
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ type MutationBurdenType = {
qualitySvExpressedCount: number | null;
qualitySvPercentile: number | null;
role: string;
svBurdenHidden: boolean | null;
totalIndelCount: number | null;
totalMutationsPerMb: number | null;
totalSnvCount: number | null;
Expand Down
32 changes: 30 additions & 2 deletions app/components/TumourSummaryEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const TumourSummaryEdit = ({
role: mutationBurden.role,
qualitySvCount: mutationBurden.qualitySvCount,
qualitySvPercentile: mutationBurden.qualitySvPercentile,
svBurdenHidden: mutationBurden.svBurdenHidden,
});
}
}, [mutationBurden]);
Expand Down Expand Up @@ -173,6 +174,12 @@ const TumourSummaryEdit = ({
setMutationBurdenDirty(true);
}, []);

const handleSVBurdenVisibility = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
const { target: { checked, name } } = event;
setNewMutationBurdenData((prevVal) => ({ ...prevVal, [name]: checked }));
setMutationBurdenDirty(true);
}, []);

const handleTmburChange = useCallback(({ target: { value, name } }) => {
setNewTmburMutData((tmb) => ({
...tmb,
Expand Down Expand Up @@ -554,7 +561,7 @@ const TumourSummaryEdit = ({
<>
<TextField
className="tumour-dialog__text-field"
label="SV Burden (POG average)"
label="SV Burden (Count)"
value={newMutationBurdenData?.qualitySvCount ?? null}
name="qualitySvCount"
onChange={handleMutationBurdenChange}
Expand All @@ -572,8 +579,29 @@ const TumourSummaryEdit = ({
fullWidth
type="number"
/>
<FormControlLabel
className="tumour-dialog__check-box"
control={(
<Checkbox
size="small"
icon={<Visibility />}
checkedIcon={<VisibilityOff />}
checked={newMutationBurdenData?.svBurdenHidden}
name="svBurdenHidden"
onChange={handleSVBurdenVisibility}
sx={{
color: 'default',
'&.Mui-checked': {
color: pink[800],
},
marginLeft: 1,
}}
/>
)}
label={<div className="checkbox-label">Show/Hide SV Burden</div>}
/>
</>
), [newMutationBurdenData, handleMutationBurdenChange]);
), [newMutationBurdenData?.qualitySvCount, newMutationBurdenData?.qualitySvPercentile, newMutationBurdenData?.svBurdenHidden, handleMutationBurdenChange, handleSVBurdenVisibility]);

const tmburMutBurSection = useMemo(() => (
<>
Expand Down
13 changes: 8 additions & 5 deletions app/views/ReportView/components/RapidSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,14 @@ const RapidSummary = ({
msiStatus = null;
}

let svBurden: null | string;
if (primaryBurden && primaryBurden.qualitySvCount !== null) {
svBurden = `${primaryBurden.qualitySvCount} ${primaryBurden.qualitySvPercentile ? `(${primaryBurden.qualitySvPercentile}%)` : ''}`;
} else {
svBurden = null;
let svBurden: null | string = null;
if (primaryBurden) {
const { qualitySvCount, svBurdenHidden, qualitySvPercentile } = primaryBurden;
if (qualitySvCount !== null && !svBurdenHidden) {
svBurden = `${qualitySvCount} ${qualitySvPercentile ? `(${qualitySvPercentile}%)` : ''}`;
} else {
svBurden = null;
}
}

let tCell: null | string;
Expand Down

0 comments on commit 57ee760

Please sign in to comment.