Skip to content

Commit

Permalink
Merge pull request #578 from bcgsc/feat/DEVSU-2465-rapid-intersecttmb…
Browse files Browse the repository at this point in the history
…score

[DEVSU-2465] add intersectTMBscore to EditDialog
  • Loading branch information
kttkjl authored Jan 7, 2025
2 parents 7884233 + f2a934d commit 27eb944
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ type TmburType = {
comments: string;
genomeSnvTmb: number;
genomeIndelTmb: number;
tmbHidden: boolean;
kbCategory: string | null;
kbMatches: KbMatchType[];
msiScore: number;
Expand All @@ -318,6 +317,7 @@ type TmburType = {
proteinIndelTmb: number;
proteinSnvs: number;
proteinSnvTmb: number;
tmbHidden: boolean;
totalGenomeIndels: number;
totalGenomeSnvs: number;
tumour: string;
Expand Down
9 changes: 9 additions & 0 deletions app/components/TumourSummaryEdit/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
margin: 12px 0;
}

&__number-field {
margin: 12px 0;
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}

&__check-box {
color: gray;
margin-top: -12px;
Expand Down
48 changes: 36 additions & 12 deletions app/components/TumourSummaryEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const TumourSummaryEdit = ({
tumourContent: report.tumourContent,
subtyping: report.subtyping,
captiv8Score: report.captiv8Score,
genomeTmb: report.genomeTmb,
});
}
}, [report]);
Expand Down Expand Up @@ -398,7 +399,7 @@ const TumourSummaryEdit = ({
if (newReportData) {
const captiv8Section = (
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label={`${reportType === 'rapid' ? 'Preliminary ' : ''}CAPTIV-8 Score`}
value={newReportData.captiv8Score}
name="captiv8Score"
Expand Down Expand Up @@ -436,7 +437,21 @@ const TumourSummaryEdit = ({
);
}
if (reportType === 'rapid') {
return captiv8Section;
return (
<>
<TextField
className="tumour-dialog__number-field"
label="Intersect TMB Score"
value={newReportData?.genomeTmb ?? ''}
name="genomeTmb"
onChange={handleReportChange}
variant="outlined"
fullWidth
type="number"
/>
{captiv8Section}
</>
);
}
}
return null;
Expand Down Expand Up @@ -480,7 +495,7 @@ const TumourSummaryEdit = ({
const tCellCd8DataSection = useMemo(() => (
<>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="CD8+ T Cell Score"
value={newTCellCd8Data?.score ?? null}
name="score"
Expand All @@ -490,7 +505,7 @@ const TumourSummaryEdit = ({
type="number"
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="CD8+ T Cell Percentile"
value={newTCellCd8Data?.percentile ?? null}
name="percentile"
Expand Down Expand Up @@ -521,7 +536,7 @@ const TumourSummaryEdit = ({
label={<div className="checkbox-label">Show/Hide CD8+ Percentile</div>}
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="Pediatric CD8+ T Cell Score"
value={newTCellCd8Data?.pedsScore ?? null}
name="pedsScore"
Expand All @@ -532,7 +547,7 @@ const TumourSummaryEdit = ({
type="number"
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="Pediatric CD8+ T Cell Percentile"
value={newTCellCd8Data?.pedsPercentile ?? null}
name="pedsPercentile"
Expand Down Expand Up @@ -560,7 +575,7 @@ const TumourSummaryEdit = ({
const mutBurDataSection = useMemo(() => (
<>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="SV Burden (Count)"
value={newMutationBurdenData?.qualitySvCount ?? null}
name="qualitySvCount"
Expand All @@ -570,7 +585,7 @@ const TumourSummaryEdit = ({
type="number"
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="SV Burden (Percentile)"
value={newMutationBurdenData?.qualitySvPercentile ?? null}
name="qualitySvPercentile"
Expand Down Expand Up @@ -606,7 +621,7 @@ const TumourSummaryEdit = ({
const tmburMutBurSection = useMemo(() => (
<>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="genomeSnvTmb"
value={newTmburMutData?.genomeSnvTmb ?? null}
name="genomeSnvTmb"
Expand All @@ -616,7 +631,7 @@ const TumourSummaryEdit = ({
type="number"
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="genomeIndelTmb"
value={newTmburMutData?.genomeIndelTmb ?? null}
name="genomeIndelTmb"
Expand All @@ -626,7 +641,7 @@ const TumourSummaryEdit = ({
type="number"
/>
<TextField
className="tumour-dialog__text-field"
className="tumour-dialog__number-field"
label="Adjusted TMB"
value={newTmburMutData?.adjustedTmb ?? null}
name="adjustedTmb"
Expand Down Expand Up @@ -669,7 +684,16 @@ const TumourSummaryEdit = ({
label={<div className="checkbox-label">Show/Hide TMB Information</div>}
/>
</>
), [newTmburMutData?.genomeSnvTmb, newTmburMutData?.genomeIndelTmb, newTmburMutData?.adjustedTmb, newTmburMutData?.adjustedTmbComment, newTmburMutData?.tmbHidden, handleTmburChange, handleAdjustedTmbCommentChange, handleAdjustedTmbVisibleChange]);
), [
newTmburMutData?.genomeSnvTmb,
newTmburMutData?.genomeIndelTmb,
newTmburMutData?.adjustedTmb,
newTmburMutData?.adjustedTmbComment,
newTmburMutData?.tmbHidden,
handleTmburChange,
handleAdjustedTmbCommentChange,
handleAdjustedTmbVisibleChange,
]);

return (
<Dialog open={isOpen}>
Expand Down
15 changes: 8 additions & 7 deletions app/context/ReportContext/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ type UserRoleType = {

type ReportType = {
alternateIdentifier?: string;
pediatricIds?: string;
analysisStartedAt: string | null;
appendix?: string;
biopsyName?: string;
captiv8Score: number;
createdBy?: UserType;
expression_matrix: string;
genomeTmb?: number;
kbDiseaseMatch: string;
kbVersion: string;
m1m2Score: number;
oncotreeTumourType: string;
patientId: string;
patientInformation: PatientInformationType,
patientInformation: PatientInformationType;
pediatricIds?: string;
ploidy: string;
projects?: ProjectType[];
reportVersion: string;
Expand All @@ -53,11 +59,6 @@ type ReportType = {
tumourContent?: number;
type: string;
users: UserRoleType[];
oncotreeTumourType: string;
kbDiseaseMatch: string;
m1m2Score: number;
captiv8Score: number;
appendix?: string;
} & RecordDefaults;

type ReportContextType = {
Expand Down
13 changes: 11 additions & 2 deletions app/views/ReportView/components/RapidSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,22 @@ const RapidSummary = ({
value:
tmburMutBur?.adjustedTmbComment && !tmburMutBur.tmbHidden ? tmburMutBur.adjustedTmbComment : null,
},
{
term: 'Intersect TMB Score',
value:
report?.genomeTmb ?? null,
},
{
term: 'MSI Status',
value: msiStatus,
},
]);
}, [microbial, primaryBurden, tmburMutBur, report.m1m2Score, report.sampleInfo, report.tumourContent, tCellCd8?.percentile, tCellCd8?.score, report.captiv8Score,
tCellCd8?.percentileHidden, tCellCd8, tCellCd8?.pedsScoreComment, tmburMutBur?.adjustedTmb, tmburMutBur?.tmbHidden, tCellCd8?.pedsScore, tCellCd8?.pedsPercentile]);
}, [
microbial, primaryBurden, tmburMutBur, tCellCd8,
report.m1m2Score, report.sampleInfo, report.tumourContent, report?.genomeTmb, report.captiv8Score,
tCellCd8?.percentile, tCellCd8?.score, tCellCd8?.percentileHidden, tCellCd8?.pedsScoreComment, tCellCd8?.pedsScore, tCellCd8?.pedsPercentile,
tmburMutBur?.adjustedTmb, tmburMutBur?.tmbHidden,
]);

const handleSign = useCallback(async (signed: boolean, updatedSignature: SignatureType) => {
setIsSigned(signed);
Expand Down

0 comments on commit 27eb944

Please sign in to comment.