-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -31,6 +33,8 @@ interface IBasicInfoProps { | |
isCanonicalTranscriptSelected?: boolean | undefined; | ||
allValidTranscripts: string[]; | ||
onTranscriptSelect(transcriptId: string): void; | ||
vue: VUE | undefined; | ||
revisedProteinEffectRecord: RevisedProteinEffectRecord | undefined; | ||
} | ||
|
||
type MutationTypeFormat = { | ||
|
@@ -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) => { | ||
return this.generateBasicInfoPills( | ||
data.value, | ||
data.key, | ||
data.category | ||
); | ||
}); | ||
let basicInfoAfterVUE = _.map(renderData.slice(2), (data) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
return this.generateBasicInfoPills( | ||
data.value, | ||
data.key, | ||
|
@@ -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)} | ||
|
@@ -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) { | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
This file was deleted.
There was a problem hiding this comment.
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