Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reVUE revised effect for one KIT variant #139

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/component/variantPage/BasicInfo.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
align-items: center;
}

.vue-wrapper {
border: 1px dotted transparent;
border-radius: 5;

&:hover {
border: 1px dotted #8e7cc3;
}
}

.missense-mutation {
color: #008000;
font-weight: bold;
Expand Down
123 changes: 107 additions & 16 deletions src/component/variantPage/BasicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import basicInfo from './BasicInfo.module.scss';
import { Link } from 'react-router-dom';
import { annotationQueryFields } from '../../config/configDefaults';
import Toggle from '../Toggle';
import { RevisedProteinEffectRecord, VUE } from './biologicalFunction/ReVUE';
import { ReVUEContent } from './biologicalFunction/ReVUE';

interface IBasicInfoProps {
annotation: VariantAnnotationSummary | undefined;
Expand All @@ -31,6 +33,8 @@ interface IBasicInfoProps {
isCanonicalTranscriptSelected?: boolean | undefined;
allValidTranscripts: string[];
onTranscriptSelect(transcriptId: string): void;
vue: VUE | undefined;
revisedProteinEffectRecord: RevisedProteinEffectRecord | undefined;
}

type MutationTypeFormat = {
Expand Down Expand Up @@ -141,15 +145,23 @@ export default class BasicInfo extends React.Component<IBasicInfoProps> {
if (this.props.annotation) {
let renderData: BasicInfoData[] | null =
this.getDataFromTranscriptConsequenceSummary(
selectedTranscript || canonicalTranscript
selectedTranscript || canonicalTranscript,
this.props.variant
);
if (renderData === null) {
return null;
}
if (renderData) {
renderData = renderData.filter((data) => data.value != null); // remove null fields
}
let basicInfoList = _.map(renderData, (data) => {
let basicInfoBeforeVUE = _.map(renderData.slice(0, 2), (data) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to find by name or id

return this.generateBasicInfoPills(
data.value,
data.key,
data.category
);
});
let basicInfoAfterVUE = _.map(renderData.slice(2), (data) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

return this.generateBasicInfoPills(
data.value,
data.key,
Expand All @@ -160,7 +172,14 @@ export default class BasicInfo extends React.Component<IBasicInfoProps> {
return (
<div className={basicInfo['basic-info-container']}>
<span className={basicInfo['basic-info-pills']}>
{basicInfoList}
{basicInfoBeforeVUE}
{this.props.revisedProteinEffectRecord &&
this.props.vue &&
this.generateBasicInfoReVUE(
this.props.vue,
this.props.revisedProteinEffectRecord
)}
{basicInfoAfterVUE}
{this.jsonButton()}
{haveTranscriptTable &&
this.transcriptsButton(this.showAllTranscripts)}
Expand Down Expand Up @@ -204,7 +223,8 @@ export default class BasicInfo extends React.Component<IBasicInfoProps> {
}

public getDataFromTranscriptConsequenceSummary(
transcript: TranscriptConsequenceSummary | undefined
transcript: TranscriptConsequenceSummary | undefined,
variant: string
): BasicInfoData[] | null {
// no canonical transcript, return null
if (transcript === undefined) {
Expand Down Expand Up @@ -235,18 +255,23 @@ export default class BasicInfo extends React.Component<IBasicInfoProps> {
key: 'tsg',
category: 'tsg',
});
// protein change
parsedData.push({
value: transcript.hgvspShort,
key: 'hgvsShort',
category: 'default',
});
// variant classification
parsedData.push({
value: transcript.variantClassification,
key: 'variantClassification',
category: getMutationTypeClassName(transcript),
});

// Check if variant is a VUE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, the logic here is trying to say, check if this variant is VUE, if it's VUE, don't add protein change and variant classification, and read from VUE component instead. If it's not VUE, add default protein change and variant classification.

So better to change the comment to indicate this is the situation that "add default protein change and variant classification when it is not VUE"

if (!this.props.revisedProteinEffectRecord) {
// protein change
parsedData.push({
value: transcript.hgvspShort,
key: 'hgvsShort',
category: 'default',
});
// variant classification
parsedData.push({
value: transcript.variantClassification,
key: 'variantClassification',
category: getMutationTypeClassName(transcript),
});
}

// variant type
parsedData.push({
value: this.props.annotation!.variantType,
Expand Down Expand Up @@ -342,6 +367,72 @@ export default class BasicInfo extends React.Component<IBasicInfoProps> {
);
}

public generateBasicInfoReVUE(
vue: VUE,
revisedProteinEffectRecord: RevisedProteinEffectRecord
) {
return (
<DefaultTooltip
placement="bottom"
overlay={
<span>
<ReVUEContent vue={vue} /> | Source:{' '}
<a
href="https://cancerrevue.org"
target="_blank"
rel="noopener noreferrer"
>
reVUE <i className="fa fa-external-link" />
</a>
</span>
}
>
<span
className={classNames(basicInfo[`vue-wrapper`])}
style={{
paddingLeft: 3,
paddingTop: 2,
paddingBottom: 2,
paddingRight: 0,
marginLeft: -2,
marginRight: 4,
}}
Comment on lines +392 to +399
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to add in css

>
<a
href="https://cancerrevue.org"
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: 'none' }}
>
<img
src="https://www.cancerrevue.org/static/media/vue_logo.f7904d3925e95ec147ad.png"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we store the icon somewhere locally in case the URL changes? E.g. we have oncokb logo here https://github.com/genome-nexus/genome-nexus-frontend/blob/master/src/component/variantPage/biologicalFunction/oncokb.png

alt="reVUE logo"
width={22}
style={{ paddingRight: 5, marginTop: -2 }}
/>
<span
style={{ color: '#8e7cc3' }}
className={classNames(basicInfo[`data-pills`])}
>
VUE
</span>
<span className={classNames(basicInfo[`data-pills`])}>
{revisedProteinEffectRecord.revisedProteinEffect}
</span>
<span
className={classNames(
basicInfo[`data-pills`],
basicInfo[`inframe-mutation`]
)}
>
{revisedProteinEffectRecord.variantClassification}
</span>
</a>
</span>
</DefaultTooltip>
);
}

public generateBasicInfoPills(
value: string | null,
key: string,
Expand Down
17 changes: 4 additions & 13 deletions src/component/variantPage/BiologicalFunction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,18 @@ import { IndicatorQueryResp } from 'oncokb-ts-api-client';
import Separator from '../Separator';
import Oncokb from './biologicalFunction/Oncokb';
import ClinvarInterpretation from './biologicalFunction/ClinvarInterpretation';
import CuriousCase from './biologicalFunction/CuriousCase';
import { CuriousCases } from 'genome-nexus-ts-api-client/dist/generated/GenomeNexusAPIInternal';
import ReVUE, { VUE } from './biologicalFunction/ReVUE';

interface IBiologicalFunctionProps {
oncokb: IndicatorQueryResp | undefined;
isCanonicalTranscriptSelected: boolean;
clinvar?: Clinvar;
curiousCases?: CuriousCases;
vue?: VUE;
}

@observer
class BiologicalFunction extends React.Component<IBiologicalFunctionProps> {
public render() {
// only show curious case when URL has "curious"
const showCuriousCase =
window.location.search.split('curious').length > 1 ? true : false;

return (
<>
<Oncokb
Expand All @@ -39,12 +34,8 @@ class BiologicalFunction extends React.Component<IBiologicalFunctionProps> {
this.props.isCanonicalTranscriptSelected
}
/>
{showCuriousCase && (
<>
<Separator />
<CuriousCase curiousCases={this.props.curiousCases} />
</>
)}
<Separator />
<ReVUE vue={this.props.vue} />
</>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/component/variantPage/FunctionalGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import functionalGroupsStyle from './functionalGroups.module.scss';
import ClinicalImplication from './ClinicalImplication';
import { RemoteData } from 'cbioportal-utils';
import PrevalenceInCancer from './PrevalenceInCancer';
import { CuriousCases } from 'genome-nexus-ts-api-client/dist/generated/GenomeNexusAPIInternal';
import { VUE } from './biologicalFunction/ReVUE';

interface IFunctionalGroupsProps {
annotationInternal?: VariantAnnotationSummary;
Expand All @@ -28,8 +28,8 @@ interface IFunctionalGroupsProps {
indexAnnotationsByGenomicLocationPromise: RemoteData<{
[genomicLocation: string]: VariantAnnotation;
}>;
curiousCases?: CuriousCases;
genomeBuild?: string;
vue?: VUE;
}

@observer
Expand Down Expand Up @@ -67,7 +67,7 @@ class FunctionalGroups extends React.Component<IFunctionalGroupsProps> {
this.props.isCanonicalTranscriptSelected
}
clinvar={this.clinvar}
curiousCases={this.props.curiousCases}
vue={this.props.vue}
/>
</td>
</tr>
Expand Down
68 changes: 0 additions & 68 deletions src/component/variantPage/biologicalFunction/CuriousCase.tsx

This file was deleted.

Loading