Skip to content

Commit d414ec9

Browse files
committed
a
1 parent dc6ba05 commit d414ec9

File tree

3 files changed

+288
-30
lines changed

3 files changed

+288
-30
lines changed

src/main/webapp/app/pages/annotationPage/AnnotationPage.tsx

+32-28
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
} from 'app/config/constants';
2121
import styles from 'app/pages/alterationPage/AlterationPage.module.scss';
2222
import { AlterationInfo } from 'app/pages/annotationPage/AlterationInfo';
23-
import { Col, Row, Alert } from 'react-bootstrap';
23+
import { Col, Row, Alert, Container } from 'react-bootstrap';
2424
import classnames from 'classnames';
2525
import { action, computed, observable } from 'mobx';
2626
import * as QueryString from 'querystring';
@@ -752,33 +752,37 @@ export default class AnnotationPage extends React.Component<
752752
this.props.store.gene.result === DEFAULT_GENE) ? (
753753
<UnknownGeneAlert />
754754
) : (
755-
<>
756-
{this.navBreadcrumbs}
757-
{this.pageShouldBeRendered ? (
758-
this.props.store.annotationData.result.query.hugoSymbol ? (
759-
this.getAnnotationComponents()
760-
) : (
761-
<Alert variant="warning" className={'text-center'}>
762-
We do not have any information for this variant
763-
</Alert>
764-
)
765-
) : (
766-
<If condition={this.props.store.annotationData.isError}>
767-
<Then>
768-
<Alert variant="warning" className={'text-center'}>
769-
An error occurred while annotating your variant.
770-
</Alert>
771-
</Then>
772-
<Else>
773-
<LoadingIndicator
774-
size={LoaderSize.LARGE}
775-
center={true}
776-
isLoading={true}
777-
/>
778-
</Else>
779-
</If>
780-
)}
781-
</>
755+
<Container>
756+
<Row className="justify-content-center">
757+
<Col md={11}>
758+
{this.navBreadcrumbs}
759+
{this.pageShouldBeRendered ? (
760+
this.props.store.annotationData.result.query.hugoSymbol ? (
761+
this.getAnnotationComponents()
762+
) : (
763+
<Alert variant="warning" className={'text-center'}>
764+
We do not have any information for this variant
765+
</Alert>
766+
)
767+
) : (
768+
<If condition={this.props.store.annotationData.isError}>
769+
<Then>
770+
<Alert variant="warning" className={'text-center'}>
771+
An error occurred while annotating your variant.
772+
</Alert>
773+
</Then>
774+
<Else>
775+
<LoadingIndicator
776+
size={LoaderSize.LARGE}
777+
center={true}
778+
isLoading={true}
779+
/>
780+
</Else>
781+
</If>
782+
)}
783+
</Col>
784+
</Row>
785+
</Container>
782786
);
783787
}
784788
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
import React from 'react';
2+
import { observer } from 'mobx-react';
3+
4+
import { OncoTreeLink } from 'app/shared/utils/UrlUtils';
5+
import {
6+
ANNOTATION_PAGE_TAB_KEYS,
7+
DEFAULT_MARGIN_BOTTOM_LG,
8+
OTHER_BIOMARKERS,
9+
} from 'app/config/constants';
10+
import styles from 'app/pages/alterationPage/AlterationPage.module.scss';
11+
import InfoIcon from 'app/shared/icons/InfoIcon';
12+
import { Col, Row } from 'react-bootstrap';
13+
import classnames from 'classnames';
14+
import { action, computed } from 'mobx';
15+
import autobind from 'autobind-decorator';
16+
import {
17+
BiologicalVariant,
18+
VariantAnnotation,
19+
} from 'app/shared/api/generated/OncoKbPrivateAPI';
20+
import {
21+
FdaImplication,
22+
TherapeuticImplication,
23+
} from 'app/store/AnnotationStore';
24+
import { isCategoricalAlteration } from 'app/shared/utils/Utils';
25+
import CancerTypeSelect from 'app/shared/dropdown/CancerTypeSelect';
26+
import AlterationTableTabs from 'app/pages/annotationPage/AlterationTableTabs';
27+
import { getSummaries, SummaryKey } from 'app/pages/annotationPage/Utils';
28+
import AppStore from 'app/store/AppStore';
29+
import { Alteration } from 'app/shared/api/generated/OncoKbAPI';
30+
31+
export type IAlterationView = {
32+
appStore?: AppStore;
33+
hugoSymbol: string;
34+
alteration: string;
35+
matchedAlteration: Alteration | undefined;
36+
tumorType: string;
37+
onChangeTumorType: (newTumorType: string) => void;
38+
annotation: VariantAnnotation;
39+
biologicalAlterations?: BiologicalVariant[];
40+
relevantAlterations?: Alteration[];
41+
fdaImplication: FdaImplication[];
42+
therapeuticImplications: TherapeuticImplication[];
43+
diagnosticImplications: TherapeuticImplication[];
44+
prognosticImplications: TherapeuticImplication[];
45+
defaultSelectedTab?: ANNOTATION_PAGE_TAB_KEYS;
46+
onChangeTab?: (
47+
selectedTabKey: ANNOTATION_PAGE_TAB_KEYS,
48+
newTabKey: ANNOTATION_PAGE_TAB_KEYS
49+
) => void;
50+
};
51+
@observer
52+
export default class SomaticGermlineAlterationView extends React.Component<
53+
IAlterationView,
54+
{}
55+
> {
56+
@autobind
57+
@action
58+
updateTumorTypeQuery(selectedOption: any) {
59+
this.props.onChangeTumorType(selectedOption ? selectedOption.value : '');
60+
}
61+
62+
@computed
63+
get tumorTypeSummaries() {
64+
const orderedSummaries = this.props.tumorType
65+
? [
66+
SummaryKey.TUMOR_TYPE_SUMMARY,
67+
SummaryKey.DIAGNOSTIC_SUMMARY,
68+
SummaryKey.PROGNOSTIC_SUMMARY,
69+
]
70+
: [];
71+
return getSummaries(this.props.annotation, orderedSummaries);
72+
}
73+
74+
@computed get isCategoricalAlteration() {
75+
return isCategoricalAlteration(this.props.alteration);
76+
}
77+
78+
@computed
79+
get showGeneNameLink() {
80+
const lHugo = this.props.hugoSymbol.toLowerCase();
81+
const altNameIncludesGene = this.props.alteration
82+
.toLowerCase()
83+
.includes(lHugo);
84+
const isOtherBiomarkers = lHugo === OTHER_BIOMARKERS.toLowerCase();
85+
return !altNameIncludesGene && !isOtherBiomarkers;
86+
}
87+
88+
@computed
89+
get relevantBiologicalVariants(): BiologicalVariant[] {
90+
if (
91+
this.isCategoricalAlteration &&
92+
this.props.biologicalAlterations &&
93+
this.props.relevantAlterations
94+
) {
95+
const relevantAltNames = this.props.relevantAlterations.map(
96+
alt => alt.alteration
97+
);
98+
return this.props.biologicalAlterations.filter(variant =>
99+
relevantAltNames.includes(variant.variant.alteration)
100+
);
101+
} else {
102+
return [];
103+
}
104+
}
105+
106+
render() {
107+
const dropdownColor = '#0968C3';
108+
return (
109+
<>
110+
<Row className="mt-4">
111+
<Col>
112+
<div
113+
className={classnames(
114+
'd-flex',
115+
'align-items-center',
116+
'justify-content-left',
117+
'flex-wrap',
118+
DEFAULT_MARGIN_BOTTOM_LG
119+
)}
120+
>
121+
<span className={classnames('mr-3', 'h6')}>
122+
Filter this list by:
123+
</span>
124+
<span
125+
className={classnames(styles.headerTumorTypeSelection, 'mr-2')}
126+
>
127+
<span>
128+
<CancerTypeSelect
129+
styles={{
130+
control: base => ({
131+
...base,
132+
height: '30px',
133+
minHeight: '30px',
134+
borderBottomWidth: '1px',
135+
borderBottomColor: dropdownColor,
136+
borderStyle: 'none',
137+
borderBottomStyle: 'solid',
138+
borderRadius: '0px',
139+
'&:hover': {
140+
borderBottomColor: dropdownColor,
141+
},
142+
}),
143+
indicatorsContainer: base => ({
144+
...base,
145+
'& div': {
146+
color: dropdownColor,
147+
},
148+
'& div:hover': {
149+
color: dropdownColor,
150+
},
151+
}),
152+
indicatorSeparator: base => ({
153+
...base,
154+
width: '0px',
155+
}),
156+
dropdownIndicator: base => ({
157+
...base,
158+
padding: 4,
159+
}),
160+
clearIndicator: base => ({
161+
...base,
162+
padding: 4,
163+
}),
164+
valueContainer: base => ({
165+
...base,
166+
padding: '0px 6px',
167+
}),
168+
input: base => ({
169+
...base,
170+
margin: 0,
171+
padding: 0,
172+
}),
173+
menu: base => ({ ...base, zIndex: 10 }),
174+
}}
175+
cancerType={this.props.tumorType}
176+
onChange={(selectedOption: any) =>
177+
this.updateTumorTypeQuery(selectedOption)
178+
}
179+
/>
180+
</span>
181+
</span>
182+
<InfoIcon
183+
overlay={
184+
<span>
185+
For cancer type specific information, please select a cancer
186+
type from the dropdown. The cancer type is curated using{' '}
187+
<OncoTreeLink />
188+
</span>
189+
}
190+
placement="top"
191+
/>
192+
</div>
193+
</Col>
194+
</Row>
195+
{this.props.tumorType && !this.isCategoricalAlteration ? (
196+
<Row>
197+
<Col>
198+
{this.tumorTypeSummaries.map((summary, index) => {
199+
return (
200+
<div
201+
className={DEFAULT_MARGIN_BOTTOM_LG}
202+
key={`summary-${index}`}
203+
>
204+
<h6 className={'mb-0'}>{summary.title}</h6>
205+
{summary.content}
206+
</div>
207+
);
208+
})}
209+
</Col>
210+
</Row>
211+
) : null}
212+
<Row className="mt-2">
213+
<Col>
214+
<AlterationTableTabs
215+
selectedTab={this.props.defaultSelectedTab}
216+
appStore={this.props.appStore}
217+
hugoSymbol={this.props.hugoSymbol}
218+
alteration={
219+
this.props.matchedAlteration
220+
? {
221+
alteration: this.props.matchedAlteration.alteration,
222+
name: this.props.matchedAlteration.name,
223+
}
224+
: {
225+
alteration: this.props.alteration,
226+
name: this.props.alteration,
227+
}
228+
}
229+
cancerType={this.props.tumorType}
230+
biological={[]}
231+
tx={this.props.therapeuticImplications}
232+
dx={this.props.diagnosticImplications}
233+
px={this.props.prognosticImplications}
234+
fda={this.props.fdaImplication}
235+
onChangeTab={this.props.onChangeTab}
236+
/>
237+
</Col>
238+
</Row>
239+
</>
240+
);
241+
}
242+
}

src/main/webapp/app/pages/somaticGermlineAlterationPage/SomaticGermlineAlterationPage.tsx

+14-2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {
8585
COLOR_ICON_WITH_INFO,
8686
COLOR_ICON_WITHOUT_INFO,
8787
} from 'app/config/theme';
88+
import SomaticGermlineAlterationView from '../annotationPage/SomaticGermlineAlterationView';
8889

8990
function OncogenicInfo({
9091
isUnknownOncogenicity,
@@ -771,6 +772,11 @@ export class SomaticGermlineAlterationPage extends React.Component<
771772
[
772773
{
773774
title: 'Therapeutic',
775+
show:
776+
!!this.store.geneNumber.result
777+
.highestSensitiveLevel ||
778+
!!this.store.geneNumber.result
779+
.highestResistanceLevel,
774780
value: (
775781
<div
776782
className={classNames('d-flex', 'flex-row')}
@@ -794,6 +800,8 @@ export class SomaticGermlineAlterationPage extends React.Component<
794800
},
795801
{
796802
title: 'Diagnostic',
803+
show: !!this.store.geneNumber.result
804+
.highestDiagnosticImplicationLevel,
797805
value: (
798806
<HighestLevelEvidence
799807
type="DiagnosticImplication"
@@ -808,6 +816,8 @@ export class SomaticGermlineAlterationPage extends React.Component<
808816
[
809817
{
810818
title: 'Prognostic',
819+
show: !!this.store.geneNumber.result
820+
.highestPrognosticImplicationLevel,
811821
value: (
812822
<HighestLevelEvidence
813823
type="PrognosticImplication"
@@ -820,6 +830,8 @@ export class SomaticGermlineAlterationPage extends React.Component<
820830
},
821831
{
822832
title: 'FDA',
833+
show: !!this.store.geneNumber.result
834+
.highestFdaLevel,
823835
value: (
824836
<HighestLevelEvidence
825837
type="Fda"
@@ -848,7 +860,7 @@ export class SomaticGermlineAlterationPage extends React.Component<
848860
isPending={this.store.genomicIndicators.isPending}
849861
/>
850862
<MiniNavBarHeader id="clinical-implications">
851-
Clinical Implications
863+
Clinical Implications For This Biomarker
852864
</MiniNavBarHeader>
853865
{this.store.cancerTypeName ? (
854866
<CancerTypeView
@@ -875,7 +887,7 @@ export class SomaticGermlineAlterationPage extends React.Component<
875887
onChangeTab={this.onChangeTab}
876888
/>
877889
) : (
878-
<AlterationView
890+
<SomaticGermlineAlterationView
879891
appStore={this.props.appStore}
880892
hugoSymbol={this.store.hugoSymbol}
881893
alteration={this.store.alterationName}

0 commit comments

Comments
 (0)