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 21, 2024
1 parent 89c36f8 commit 5442d52
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
33 changes: 20 additions & 13 deletions src/component/variantPage/FunctionalPrediction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import MutationAssessor from './functionalPrediction/MutationAssesor';
import Sift from './functionalPrediction/Sift';
import PolyPhen2 from './functionalPrediction/PolyPhen2';
import AlphaMissense from './functionalPrediction/AlphaMissense';
import { SHOW_ALPHAMISSENSE } from '../../config/configDefaults';
import {
SHOW_ALPHAMISSENSE,
SHOW_MUTATION_ASSESSOR,
} from '../../config/configDefaults';
import Separator from '../Separator';
import { GENOME_BUILD } from '../../util/SearchUtils';

Expand Down Expand Up @@ -61,7 +64,6 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
const amPathogenicityScore =
genomeNexusData?.annotation_summary?.transcriptConsequenceSummary
?.alphaMissense?.score || undefined;

return {
amClass,
amPathogenicityScore,
Expand All @@ -74,29 +76,34 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
}
public render() {
const data = this.getData(this.props.variantAnnotation);
const shouldShowAlphaMissense = SHOW_ALPHAMISSENSE;
// Mutation Assessor only available in grch37
const shouldShowMutationAssessor =
SHOW_MUTATION_ASSESSOR &&
this.props.genomeBuild === GENOME_BUILD.GRCh37;
return (
<div>
<PolyPhen2
polyPhenScore={data.polyPhenScore}
polyPhenPrediction={data.polyPhenPrediction}
/>
<Separator />
<>
<MutationAssessor
mutationAssessor={data.mutationAssessor}
isCanonicalTranscriptSelected={
this.props.isCanonicalTranscriptSelected
}
/>
<Separator />
</>
{shouldShowMutationAssessor && (
<>
<MutationAssessor
mutationAssessor={data.mutationAssessor}
isCanonicalTranscriptSelected={
this.props.isCanonicalTranscriptSelected
}
/>
<Separator />
</>
)}
<Sift
siftScore={data.siftScore}
siftPrediction={data.siftPrediction}
/>
<Separator />
{shouldShowAlphaMissense && (
{SHOW_ALPHAMISSENSE && (
<AlphaMissense
amClass={data.amClass}
amPathogenicityScore={data.amPathogenicityScore}
Expand Down
20 changes: 5 additions & 15 deletions src/component/variantPage/functionalPrediction/AlphaMissense.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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 {
Expand Down Expand Up @@ -45,13 +44,10 @@ const AlphaMissenseInfo: React.FunctionComponent = () => {
);
};

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

constructor(props: IAlphaMissenseProps) {
super(props);
makeObservable(this);
Expand All @@ -66,18 +62,12 @@ export default class AlphaMissense extends React.Component<
<i className="fas fa-external-link-alt" />
</>
);
if (
this.props.amClass &&
this.props.amClass.length > 0 &&
this.props.amClass !== 'N/A'
) {
if (this.props.amClass) {
alphaMissenseContent = (
<span>
<p>
{this.props.amClass + ' '}(
{this.props.amPathogenicityScore})
</p>{' '}
</span>
<p>
{this.props.amClass + ' '}({this.props.amPathogenicityScore}
)
</p>
);
} else {
alphaMissenseContent = <span> N/A </span>;
Expand Down

0 comments on commit 5442d52

Please sign in to comment.