Skip to content

Commit

Permalink
Add AlphaMissense in Functional prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
JunheZoooo committed Aug 20, 2024
1 parent 562cc0d commit 89c36f8
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"classnames": "^2.2.6",
"file-loader": "^4.3.0",
"font-awesome": "^4.7.0",
"genome-nexus-ts-api-client": "1.1.32",
"genome-nexus-ts-api-client": "1.1.33",
"lodash": "^4.17.21",
"mobx": "^6.0.0",
"mobx-react": "^6.0.0",
Expand Down
45 changes: 29 additions & 16 deletions src/component/variantPage/FunctionalPrediction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
import MutationAssessor from './functionalPrediction/MutationAssesor';
import Sift from './functionalPrediction/Sift';
import PolyPhen2 from './functionalPrediction/PolyPhen2';
import { SHOW_MUTATION_ASSESSOR } from '../../config/configDefaults';
import AlphaMissense from './functionalPrediction/AlphaMissense';
import { SHOW_ALPHAMISSENSE } from '../../config/configDefaults';
import Separator from '../Separator';
import { GENOME_BUILD } from '../../util/SearchUtils';

Expand All @@ -25,6 +26,8 @@ interface IFunctionalImpactData {
siftPrediction: string | undefined;
polyPhenScore: number | undefined;
polyPhenPrediction: string | undefined;
amClass: string | undefined;
amPathogenicityScore: number | undefined;
}

@observer
Expand Down Expand Up @@ -52,8 +55,16 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].polyphen_prediction;
const amClass =
genomeNexusData?.annotation_summary?.transcriptConsequenceSummary
?.alphaMissense?.pathogenicity || undefined;
const amPathogenicityScore =
genomeNexusData?.annotation_summary?.transcriptConsequenceSummary
?.alphaMissense?.score || undefined;

return {
amClass,
amPathogenicityScore,
mutationAssessor,
siftScore,
siftPrediction,
Expand All @@ -63,32 +74,34 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
}
public render() {
const data = this.getData(this.props.variantAnnotation);
// Mutation Assessor only available in grch37
const shouldShowMutationAssessor =
SHOW_MUTATION_ASSESSOR &&
this.props.genomeBuild === GENOME_BUILD.GRCh37;
const shouldShowAlphaMissense = SHOW_ALPHAMISSENSE;
return (
<div>
<PolyPhen2
polyPhenScore={data.polyPhenScore}
polyPhenPrediction={data.polyPhenPrediction}
/>
<Separator />
{shouldShowMutationAssessor && (
<>
<MutationAssessor
mutationAssessor={data.mutationAssessor}
isCanonicalTranscriptSelected={
this.props.isCanonicalTranscriptSelected
}
/>
<Separator />
</>
)}
<>
<MutationAssessor
mutationAssessor={data.mutationAssessor}
isCanonicalTranscriptSelected={
this.props.isCanonicalTranscriptSelected
}
/>
<Separator />
</>
<Sift
siftScore={data.siftScore}
siftPrediction={data.siftPrediction}
/>
<Separator />
{shouldShowAlphaMissense && (
<AlphaMissense
amClass={data.amClass}
amPathogenicityScore={data.amPathogenicityScore}
/>
)}
</div>
);
}
Expand Down
120 changes: 120 additions & 0 deletions src/component/variantPage/functionalPrediction/AlphaMissense.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import * as React from 'react';
import { DefaultTooltip } from 'cbioportal-frontend-commons';
import { makeObservable, observable } from 'mobx';
import { observer } from 'mobx-react';
import functionalGroupsStyle from '../functionalGroups.module.scss';

export interface IAlphaMissenseProps {
amClass?: string;
amPathogenicityScore?: number;
}

const ALPHAMISSENSE_URL = 'https://www.science.org/doi/10.1126/science.adg7492';

const AlphaMissenseInfo: React.FunctionComponent = () => {
return (
<div>
<a
href={ALPHAMISSENSE_URL}
target="_blank"
rel="noopener noreferrer"
>
AlphaMissense
</a>{' '}
uses deep learning to assess the pathogenicity of missense variants,
indicating how they might affect gene function and contribute to
disease.
<div>
<b>Scores:</b>
<ul>
<li>
<b>Pathogenic:</b> Score &gt; 0.564 – likely to cause
disease.
</li>
<li>
<b>Benign:</b> Score &lt; 0.34 – unlikely to cause
disease.
</li>
<li>
<b>Ambiguous:</b> Score between 0.34 and 0.564 – unclear
impact; insufficient data.
</li>
</ul>
</div>
</div>
);
};

@observer
export default class AlphaMissense extends React.Component<
IAlphaMissenseProps,
{}
> {
@observable showDetails = false;

constructor(props: IAlphaMissenseProps) {
super(props);
makeObservable(this);
}

public render() {
let alphaMissenseContent: JSX.Element;

const dataSource = (
<>
AlphaMissense&nbsp;
<i className="fas fa-external-link-alt" />
</>
);
if (
this.props.amClass &&
this.props.amClass.length > 0 &&
this.props.amClass !== 'N/A'
) {
alphaMissenseContent = (
<span>
<p>
{this.props.amClass + ' '}(
{this.props.amPathogenicityScore})
</p>{' '}
</span>
);
} else {
alphaMissenseContent = <span> N/A </span>;
}

return (
<div className={functionalGroupsStyle['functional-group']}>
<div className={functionalGroupsStyle['data-source']}>
<DefaultTooltip
placement="top"
overlay={
<div style={{ maxWidth: 450 }}>
<AlphaMissenseInfo />
</div>
}
>
<a
href={ALPHAMISSENSE_URL}
target="_blank"
rel="noopener noreferrer"
>
{dataSource}
</a>
</DefaultTooltip>
</div>
<div>
<span className={functionalGroupsStyle['data-with-link']}>
<a
href={ALPHAMISSENSE_URL}
target="_blank"
rel="noopener noreferrer"
>
{alphaMissenseContent}
</a>
</span>
</div>
</div>
);
}
}
3 changes: 1 addition & 2 deletions src/config/configDefaults.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
export const SHOW_MUTATION_ASSESSOR = true;

export const SHOW_ALPHAMISSENSE = true;
export function annotationQueryFields() {
const fields = DEFAULT_ANNOTATION_QUERY_FIELDS;
if (SHOW_MUTATION_ASSESSOR) {
fields.push('mutation_assessor');
}
return fields;
}

export const DEFAULT_ANNOTATION_QUERY_FIELDS = [
'hotspots',
'annotation_summary',
Expand Down
29 changes: 16 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4260,15 +4260,10 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000985.tgz#208c723beb15123eb27cc6ad9bc285b4f27a3f87"
integrity sha512-1m3CC9+dYNh/FHd0V1/McOB73CxjmzzrcXi360x8mKoApUY8QIOYXg4bU5QeJmlenn++20GBI38EKw6qQpJ3kQ==

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000984:
version "1.0.30000985"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000985.tgz#0eb40f6c8a8c219155cbe43c4975c0efb4a0f77f"
integrity sha512-1ngiwkgqAYPG0JSSUp3PUDGPKKY59EK7NrGGX+VOxaKCNzRbNc7uXMny+c3VJfZxtoK3wSImTvG9T9sXiTw2+w==

caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219:
version "1.0.30001245"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001245.tgz#45b941bbd833cb0fa53861ff2bae746b3c6ca5d4"
integrity sha512-768fM9j1PKXpOCKws6eTo3RHmvTUsG9UrpT4WoREFeZgJBTi4/X9g565azS/rVUGtqb8nt7FjLeF5u4kukERnA==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30000984, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219:
version "1.0.30001643"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz"
integrity sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==

[email protected]:
version "1.5.3"
Expand Down Expand Up @@ -7038,10 +7033,10 @@ gauge@~2.7.3:
strip-ansi "^3.0.1"
wide-align "^1.1.0"

[email protected].32, genome-nexus-ts-api-client@^1.1.32:
version "1.1.32"
resolved "https://registry.yarnpkg.com/genome-nexus-ts-api-client/-/genome-nexus-ts-api-client-1.1.32.tgz#e8a9c70d6644e17ae7f76c803ecb0d3e1720c7d9"
integrity sha512-ELXH+50alvUVnRioxCOLvxf5VcN57YVheF80kEVFBXT5cnO178tvDLHdaqbmAlEvezHwptercQ9kqh8d9TTm5Q==
[email protected].33:
version "1.1.33"
resolved "https://registry.yarnpkg.com/genome-nexus-ts-api-client/-/genome-nexus-ts-api-client-1.1.33.tgz#aea3eafe6ca59e0187c25c487b7fb9f9b704bdde"
integrity sha512-wrbDKoVjw9etDChfacrNStlORqWlS/k2dA5DzlxFEfen3WYO7QtXAFLVSxpjanA/3sGQnVqaxreZzjTPDXhs1A==
dependencies:
superagent "^3.8.3"
typescript "4.0.3"
Expand All @@ -7054,6 +7049,14 @@ genome-nexus-ts-api-client@^1.1.28:
superagent "^3.8.3"
typescript "4.0.3"

genome-nexus-ts-api-client@^1.1.32:
version "1.1.32"
resolved "https://registry.yarnpkg.com/genome-nexus-ts-api-client/-/genome-nexus-ts-api-client-1.1.32.tgz#e8a9c70d6644e17ae7f76c803ecb0d3e1720c7d9"
integrity sha512-ELXH+50alvUVnRioxCOLvxf5VcN57YVheF80kEVFBXT5cnO178tvDLHdaqbmAlEvezHwptercQ9kqh8d9TTm5Q==
dependencies:
superagent "^3.8.3"
typescript "4.0.3"

gensync@^1.0.0-beta.1:
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
Expand Down

0 comments on commit 89c36f8

Please sign in to comment.