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 0669165
Show file tree
Hide file tree
Showing 5 changed files with 180 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
60 changes: 44 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,28 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].polyphen_prediction;
const amClass =
genomeNexusData &&
genomeNexusData.annotation_summary &&
genomeNexusData.annotation_summary.transcriptConsequenceSummary &&
genomeNexusData.annotation_summary.transcriptConsequenceSummary
.alphaMissense
? genomeNexusData.annotation_summary
.transcriptConsequenceSummary.alphaMissense.pathogenicity
: 'N/A';

const amPathogenicityScore =
genomeNexusData &&
genomeNexusData.annotation_summary &&
genomeNexusData.annotation_summary.transcriptConsequenceSummary &&
genomeNexusData.annotation_summary.transcriptConsequenceSummary
.alphaMissense
? genomeNexusData.annotation_summary
.transcriptConsequenceSummary.alphaMissense.score
: undefined;
return {
amClass,
amPathogenicityScore,
mutationAssessor,
siftScore,
siftPrediction,
Expand All @@ -63,32 +86,37 @@ 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 &&
(this.props.genomeBuild === GENOME_BUILD.GRCh37 ||
this.props.genomeBuild === GENOME_BUILD.GRCh38);
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}
></AlphaMissense>
)}
</div>
);
}
Expand Down
118 changes: 118 additions & 0 deletions src/component/variantPage/functionalPrediction/AlphaMissense.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import * as React from 'react';
import { DefaultTooltip } from 'cbioportal-frontend-commons';
import { action, 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>{' '}
is a feature within the VEP plugin used to predict the pathogenicity
of missense variants. Missense variants refer to changes in a single
base of the gene that result in a change in the encoded amino acid,
potentially affecting the function of the protein. AlphaMissense
utilizes deep learning algorithms to assess the potential impact of
these variants, aiding researchers in better understanding the
relationship between the variant, gene function, and disease.{' '}
<b>Pathogenic:</b> Score &gt; 0.564; significant impact; may cause
disease.
<b>Benign:</b> Score &lt; 0.34; minor impact; unlikely to cause
disease.
<b>Ambiguous:</b> Score between 0.34 and 0.564; intermediate score;
insufficient data.-{' '}
</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>
);
}

@action
onToggleDetails = () => {
this.showDetails = !this.showDetails;
};
}
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==

canvg@1.5.3:
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"

genome-nexus-ts-api-client@1.1.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==
genome-nexus-ts-api-client@1.1.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 0669165

Please sign in to comment.