diff --git a/src/shared/components/annotation/genomeNexus/AlphaMissense.tsx b/src/shared/components/annotation/genomeNexus/AlphaMissense.tsx new file mode 100644 index 00000000000..edde9db856a --- /dev/null +++ b/src/shared/components/annotation/genomeNexus/AlphaMissense.tsx @@ -0,0 +1,95 @@ +import React from 'react'; +import { DefaultTooltip } from 'cbioportal-frontend-commons'; +import annotationStyles from './../styles/annotation.module.scss'; +import classNames from 'classnames'; +import tooltipStyles from './styles/alphaMissenseTooltip.module.scss'; + +export interface IAlphaMissenseProps { + alphaMissensePrediction: string | undefined; // benign, pathogenic, ambiguous + alphaMissenseScore: number | undefined; +} + +export function hideArrow(tooltipEl: any) { + const arrowEl = tooltipEl.querySelector('.rc-tooltip-arrow'); + arrowEl.style.display = 'none'; +} + +export const AlphaMissenseUrl: string = 'https://alphamissense.hegelab.org/'; + +export const AlphaMissense: React.FC = ({ + alphaMissensePrediction, + alphaMissenseScore, +}) => { + const tooltipContent = () => { + const impact = alphaMissensePrediction ? ( +
+ + + + + + + + + + {(alphaMissenseScore || alphaMissenseScore === 0) && ( + + + + + )} +
Source + AlphaMissense +
Impact + + {alphaMissensePrediction} + +
Score + {alphaMissenseScore.toFixed(2)} +
+
+ ) : null; + + return {impact}; + }; + + let content: JSX.Element = ( + + ); + + if (alphaMissensePrediction && alphaMissensePrediction.length > 0) { + content = ( + + + + ); + const arrowContent =
; + content = ( + + {content} + + ); + } + + return content; +}; diff --git a/src/shared/components/annotation/genomeNexus/MutationAssessor.tsx b/src/shared/components/annotation/genomeNexus/MutationAssessor.tsx index d9749083751..76dfb84eb66 100644 --- a/src/shared/components/annotation/genomeNexus/MutationAssessor.tsx +++ b/src/shared/components/annotation/genomeNexus/MutationAssessor.tsx @@ -28,16 +28,6 @@ export default class MutationAssessor extends React.Component< this.tooltipContent = this.tooltipContent.bind(this); } - public static download( - mutationAssessorData: MutationAssessorData | undefined - ): string { - if (mutationAssessorData) { - return `impact: ${mutationAssessorData.functionalImpactPrediction}, score: ${mutationAssessorData.functionalImpactScore}`; - } else { - return 'NA'; - } - } - public render() { let maContent: JSX.Element = ( diff --git a/src/shared/components/annotation/genomeNexus/PolyPhen2.tsx b/src/shared/components/annotation/genomeNexus/PolyPhen2.tsx index f532af56679..5e7485ac07c 100644 --- a/src/shared/components/annotation/genomeNexus/PolyPhen2.tsx +++ b/src/shared/components/annotation/genomeNexus/PolyPhen2.tsx @@ -22,17 +22,6 @@ export default class PolyPhen2 extends React.Component { this.tooltipContent = this.tooltipContent.bind(this); } - public static download( - polyPhenScore: number | undefined, - polyPhenPrediction: string | undefined - ): string { - if (polyPhenScore || polyPhenPrediction) { - return `impact: ${polyPhenPrediction}, score: ${polyPhenScore}`; - } else { - return 'NA'; - } - } - public render() { let content: JSX.Element = ( diff --git a/src/shared/components/annotation/genomeNexus/Sift.tsx b/src/shared/components/annotation/genomeNexus/Sift.tsx index 92bf19734f2..70de4cf5d8b 100644 --- a/src/shared/components/annotation/genomeNexus/Sift.tsx +++ b/src/shared/components/annotation/genomeNexus/Sift.tsx @@ -22,17 +22,6 @@ export default class Sift extends React.Component { this.tooltipContent = this.tooltipContent.bind(this); } - public static download( - siftScore: number | undefined, - siftPrediction: string | undefined - ): string { - if (siftScore || siftPrediction) { - return `impact: ${siftPrediction}, score: ${siftScore}`; - } else { - return 'NA'; - } - } - public render() { let siftContent: JSX.Element = ( diff --git a/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss b/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss new file mode 100644 index 00000000000..969f009fe00 --- /dev/null +++ b/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss @@ -0,0 +1,22 @@ +@import 'functionalImpact'; + +.alphaMissense-pathogenic { + color: $high; + font-weight: bold; +} +.alphaMissense-ambiguous { + color: $low; + font-weight: bold; +} +.alphaMissense-benign { + color: $neutral; + font-weight: bold; +} +.alphaMissense-unknown { + display: none; +} +.alphaMissense-tooltip-table { + td:first-child { + padding-right: 5px; + } +} diff --git a/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss.d.ts b/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss.d.ts new file mode 100644 index 00000000000..82eec6b1f18 --- /dev/null +++ b/src/shared/components/annotation/genomeNexus/styles/alphaMissenseTooltip.module.scss.d.ts @@ -0,0 +1,9 @@ +declare const styles: { + readonly "alphaMissense-ambiguous": string; + readonly "alphaMissense-benign": string; + readonly "alphaMissense-pathogenic": string; + readonly "alphaMissense-tooltip-table": string; + readonly "alphaMissense-unknown": string; +}; +export = styles; + diff --git a/src/shared/components/mutationTable/MutationTable.tsx b/src/shared/components/mutationTable/MutationTable.tsx index f11417d8a46..cd3350961ed 100644 --- a/src/shared/components/mutationTable/MutationTable.tsx +++ b/src/shared/components/mutationTable/MutationTable.tsx @@ -899,13 +899,9 @@ export default class MutationTable< this._columns[MutationTableColumnType.FUNCTIONAL_IMPACT] = { name: MutationTableColumnType.FUNCTIONAL_IMPACT, render: (d: Mutation[]) => { - if ( - this.props.genomeNexusCache || - this.props.genomeNexusMutationAssessorCache - ) { + if (this.props.genomeNexusMutationAssessorCache) { return FunctionalImpactColumnFormatter.renderFunction( d, - this.props.genomeNexusCache, this.props.genomeNexusMutationAssessorCache, this.props.selectedTranscriptId ); @@ -916,7 +912,6 @@ export default class MutationTable< download: (d: Mutation[]) => FunctionalImpactColumnFormatter.download( d, - this.props.genomeNexusCache as GenomeNexusCache, this.props .genomeNexusMutationAssessorCache as GenomeNexusMutationAssessorCache, this.props.selectedTranscriptId diff --git a/src/shared/components/mutationTable/column/FunctionalImpactColumnFormatter.tsx b/src/shared/components/mutationTable/column/FunctionalImpactColumnFormatter.tsx index de8360e1a58..c7d5ef26f4e 100644 --- a/src/shared/components/mutationTable/column/FunctionalImpactColumnFormatter.tsx +++ b/src/shared/components/mutationTable/column/FunctionalImpactColumnFormatter.tsx @@ -6,38 +6,33 @@ import { TableCellStatusIndicator, TableCellStatus, } from 'cbioportal-frontend-commons'; -import { - MutationAssessor as MutationAssessorData, - VariantAnnotation, -} from 'genome-nexus-ts-api-client'; +import { MutationAssessor as MutationAssessorData } from 'genome-nexus-ts-api-client'; import 'rc-tooltip/assets/bootstrap_white.css'; -import { Mutation, DiscreteCopyNumberData } from 'cbioportal-ts-api-client'; +import { Mutation } from 'cbioportal-ts-api-client'; import MutationAssessor from 'shared/components/annotation/genomeNexus/MutationAssessor'; import Sift from 'shared/components/annotation/genomeNexus/Sift'; import PolyPhen2 from 'shared/components/annotation/genomeNexus/PolyPhen2'; -import siftStyles from 'shared/components/annotation/genomeNexus/styles/siftTooltip.module.scss'; -import polyPhen2Styles from 'shared/components/annotation/genomeNexus/styles/polyPhen2Tooltip.module.scss'; -import mutationAssessorStyles from 'shared/components/annotation/genomeNexus/styles/mutationAssessorColumn.module.scss'; +import { + AlphaMissense, + AlphaMissenseUrl, +} from 'shared/components/annotation/genomeNexus/AlphaMissense'; +import functionalImpactStyles from 'shared/components/annotation/genomeNexus/styles/mutationAssessorColumn.module.scss'; import annotationStyles from 'shared/components/annotation/styles/annotation.module.scss'; -import GenomeNexusMutationAssessorCache from 'shared/cache/GenomeNexusMutationAssessorCache'; import GenomeNexusCache, { GenomeNexusCacheDataType, -} from 'shared/cache/GenomeNexusCache'; +} from 'shared/cache/GenomeNexusMutationAssessorCache'; import _ from 'lodash'; import { shouldShowMutationAssessor } from 'shared/lib/genomeNexusAnnotationSourcesUtils'; type FunctionalImpactColumnTooltipProps = { - active: 'mutationAssessor' | 'sift' | 'polyPhen2'; + active: FunctionalImpactColumnName; }; -interface IFunctionalImpactColumnTooltipState { - active: 'mutationAssessor' | 'sift' | 'polyPhen2'; -} - -enum FunctionalImpactColumnsName { - MUTATION_ASSESSOR, - SIFT, - POLYPHEN2, +enum FunctionalImpactColumnName { + MUTATION_ASSESSOR = 'MUTATION_ASSESSOR', + SIFT = 'SIFT', + POLYPHEN2 = 'POLYPHEN2', + ALPHAMISSENSE = 'ALPHAMISSENSE', } interface FunctionalImpactData { @@ -46,333 +41,235 @@ interface FunctionalImpactData { siftPrediction: string | undefined; polyPhenScore: number | undefined; polyPhenPrediction: string | undefined; + alphaMissenseScore: number | undefined; + alphaMissensePrediction: string | undefined; } -class FunctionalImpactColumnTooltip extends React.Component< - FunctionalImpactColumnTooltipProps, - IFunctionalImpactColumnTooltipState -> { - constructor(props: FunctionalImpactColumnTooltipProps) { - super(props); - this.state = { - active: this.props.active, - }; - } +const FunctionalImpactColumnTooltip: React.FC = ({ + active: initialActive, +}) => { + const [active, setActive] = React.useState( + initialActive + ); + + const showMutationAssessor = shouldShowMutationAssessor(); + + const renderHeaderIcon = ( + title: string, + imageSrc: string, + onMouseOver: () => void + ) => { + return ( + + + {title} + + + ); + }; + + const renderImpactRow = ( + iconClass: string, + impactData: string[], + showMutationAssessor: boolean, + key: number + ) => { + return ( + + + + + + + {showMutationAssessor && ( + {impactData[0]} + )} + {impactData[1]} + {impactData[2]} + {impactData[3]} + + ); + }; + + const legend = () => { + // Each line in the legend table uses the same style + const impactData = [ + { + level: 'high', + iconClass: functionalImpactStyles['ma-high'], + mutationAssessor: 'high', + sift: 'deleterious', + polyPhen2: 'probably_damaging', + alphaMissense: 'pathogenic', + }, + { + level: 'medium', + iconClass: functionalImpactStyles['ma-medium'], + mutationAssessor: 'medium', + sift: '-', + polyPhen2: '-', + alphaMissense: '-', + }, + { + level: 'low', + iconClass: functionalImpactStyles['ma-low'], + mutationAssessor: 'low', + sift: 'deleterious_low_confidence', + polyPhen2: 'possibly_damaging', + alphaMissense: 'ambiguous', + }, + { + level: 'neutral', + iconClass: functionalImpactStyles['ma-neutral'], + mutationAssessor: 'neutral', + sift: 'tolerated_low_confidence', + polyPhen2: 'benign', + alphaMissense: 'benign', + }, + { + level: 'NA', + iconClass: functionalImpactStyles['ma-neutral'], + mutationAssessor: '-', + sift: 'tolerated', + polyPhen2: '-', + alphaMissense: '-', + }, + ]; - legend() { - const showMutationAssessor = shouldShowMutationAssessor(); return (
- {showMutationAssessor && ( - + {showMutationAssessor && + renderHeaderIcon( + FunctionalImpactColumnName.MUTATION_ASSESSOR, + require('./mutationAssessor.png'), + () => + setActive( + FunctionalImpactColumnName.MUTATION_ASSESSOR + ) + )} + {renderHeaderIcon( + FunctionalImpactColumnName.SIFT, + require('./siftFunnel.png'), + () => setActive(FunctionalImpactColumnName.SIFT) + )} + {renderHeaderIcon( + FunctionalImpactColumnName.POLYPHEN2, + require('./polyPhen-2.png'), + () => + setActive( + FunctionalImpactColumnName.POLYPHEN2 + ) + )} + {renderHeaderIcon( + FunctionalImpactColumnName.ALPHAMISSENSE, + require('./alphaMissenseGoogleDeepmind.png'), + () => + setActive( + FunctionalImpactColumnName.ALPHAMISSENSE + ) )} - - - - - {showMutationAssessor && ( - - )} - - - - {showMutationAssessor && ( - - - - - - + {impactData.map((data, index) => + renderImpactRow( + data.iconClass, + [ + data.mutationAssessor, + data.sift, + data.polyPhen2, + data.alphaMissense, + ], + showMutationAssessor, + index + ) )} - - - {showMutationAssessor && ( - - )} - - - - - - {showMutationAssessor && ( - - )} - - - - - - {showMutationAssessor && } - - -
Legend - - this.setState({ - active: 'mutationAssessor', - }) - } - > - Mutation Assessor - - - - this.setState({ active: 'sift' }) - } - > - SIFT - - - - this.setState({ active: 'polyPhen2' }) - } - > - PolyPhen-2 - -
- - - - - high - - deleterious - - probably_damaging -
- - - - - medium - --
- - - - - low - - deleterious_low_confidence - - possibly_damaging -
- - - - - neutral - - tolerated_low_confidence - - benign -
- - - - - - tolerated - -
); - } - - public static mutationAssessorText() { - return ( -
- Mutation Assessor predicts the functional impact of amino-acid - substitutions in proteins, such as mutations discovered in - cancer or missense polymorphisms. The functional impact is - assessed based on evolutionary conservation of the affected - amino acid in protein homologs. The method has been validated on - a large set of disease associated and polymorphic variants ( - - ClinVar - - ). -
- - Mutation Assessor V4 data is available in the portal since - Oct. 8, 2024. - {' '} - New manuscript is in progress. Click{` `} - - here - - {` `} to see information about V3 data. -
- ); - } - - public static siftText() { - return ( -
- - SIFT - {' '} - predicts whether an amino acid substitution affects protein - function based on sequence homology and the physical properties - of amino acids. SIFT can be applied to naturally occurring - nonsynonymous polymorphisms and laboratory-induced missense - mutations. -
- ); - } - - public static polyPhen2Text() { - return ( -
- - PolyPhen-2 - {' '} - (Polymorphism Phenotyping v2) is a tool which predicts possible - impact of an amino acid substitution on the structure and - function of a human protein using straightforward physical and - comparative considerations. -
- ); - } + }; - public render() { - return ( -
- {this.state.active === 'mutationAssessor' && - FunctionalImpactColumnTooltip.mutationAssessorText()} - {this.state.active === 'sift' && - FunctionalImpactColumnTooltip.siftText()} - {this.state.active === 'polyPhen2' && - FunctionalImpactColumnTooltip.polyPhen2Text()} - {this.legend()} -
- ); - } -} + return ( +
+ {active === FunctionalImpactColumnName.MUTATION_ASSESSOR && ( +
+ Mutation Assessor predicts the functional impact of + amino-acid substitutions in proteins, such as mutations + discovered in cancer or missense polymorphisms. The + functional impact is assessed based on evolutionary + conservation of the affected amino acid in protein homologs. + The method has been validated on a large set of disease + associated and polymorphic variants ( + + ClinVar + + ). +
+ + Mutation Assessor V4 data is available in the portal + since Oct. 8, 2024. + {' '} + New manuscript is in progress. Click{` `} + + here + + {` `} to see information about V3 data. +
+ )} + {active === FunctionalImpactColumnName.SIFT && ( +
+ + SIFT + {' '} + predicts whether an amino acid substitution affects protein + function based on sequence homology and the physical + properties of amino acids. SIFT can be applied to naturally + occurring nonsynonymous polymorphisms and laboratory-induced + missense mutations. +
+ )} + {active === FunctionalImpactColumnName.POLYPHEN2 && ( +
+ + PolyPhen-2 + {' '} + (Polymorphism Phenotyping v2) is a tool which predicts + possible impact of an amino acid substitution on the + structure and function of a human protein using + straightforward physical and comparative considerations. +
+ )} + {active === FunctionalImpactColumnName.ALPHAMISSENSE && ( +
+ + AlphaMissense + {' '} + predicts the probability of a missense single nucleotide + variant being pathogenic and classifies it as either likely + benign, likely pathogenic, or uncertain. +
+ )} + {legend()} +
+ ); +}; export function placeArrow(tooltipEl: any) { const arrowEl = tooltipEl.querySelector('.rc-tooltip-arrow'); @@ -391,7 +288,11 @@ export default class FunctionalImpactColumnFormatter { {showMutationAssessor && ( + } placement="topLeft" trigger={['hover', 'focus']} @@ -413,7 +314,9 @@ export default class FunctionalImpactColumnFormatter { )} + } placement="topLeft" trigger={['hover', 'focus']} @@ -432,7 +335,9 @@ export default class FunctionalImpactColumnFormatter { + } placement="topLeft" trigger={['hover', 'focus']} @@ -449,190 +354,146 @@ export default class FunctionalImpactColumnFormatter { />
+ + } + placement="topLeft" + trigger={['hover', 'focus']} + arrowContent={arrowContent} + destroyTooltipOnHide={true} + onPopupAlign={placeArrow} + > + + alphaMissense + +
); } - public static getData( + static getData( data: Mutation[], - siftPolyphenCache: GenomeNexusCache, - mutationAssessorCache: GenomeNexusMutationAssessorCache, + cache?: GenomeNexusCache, selectedTranscriptId?: string ): FunctionalImpactData { - const siftPolyphenCacheData = FunctionalImpactColumnFormatter.getDataFromCache( - data, - siftPolyphenCache - ); - const mutationAssessorCacheData = shouldShowMutationAssessor() - ? FunctionalImpactColumnFormatter.getDataFromCache( - data, - mutationAssessorCache - ) - : null; + const cacheData = this.getDataFromCache(data, cache); + if (!cacheData?.data) { + return {} as FunctionalImpactData; + } - const siftData = siftPolyphenCacheData - ? this.getSiftData(siftPolyphenCacheData.data, selectedTranscriptId) - : undefined; - const polyphenData = siftPolyphenCacheData - ? this.getPolyphenData( - siftPolyphenCacheData.data, - selectedTranscriptId + const transcript = selectedTranscriptId + ? cacheData.data.transcript_consequences.find( + tc => tc.transcript_id === selectedTranscriptId ) : undefined; - const mutationAssessor = mutationAssessorCacheData - ? this.getMutationAssessorData(mutationAssessorCacheData.data) - : undefined; - - const siftScore = siftData && siftData.siftScore; - const siftPrediction = siftData && siftData.siftPrediction; - const polyPhenScore = polyphenData && polyphenData.polyPhenScore; - const polyPhenPrediction = - polyphenData && polyphenData.polyPhenPrediction; - - const functionalImpactData: FunctionalImpactData = { - mutationAssessor, - siftScore, - siftPrediction, - polyPhenScore, - polyPhenPrediction, - }; - return functionalImpactData; - } - - public static getSiftData( - siftDataCache: VariantAnnotation | null, - selectedTranscriptId?: string - ) { - let siftScore: number | undefined = undefined; - let siftPrediction: string | undefined = undefined; - if (siftDataCache && selectedTranscriptId) { - // find transcript consequence that matches the selected transcript - const transcriptConsequence = siftDataCache.transcript_consequences.find( - tc => tc.transcript_id === selectedTranscriptId - ); - if (transcriptConsequence) { - siftScore = transcriptConsequence.sift_score; - siftPrediction = transcriptConsequence.sift_prediction; - } - } return { - siftScore, - siftPrediction, + mutationAssessor: shouldShowMutationAssessor() + ? cacheData.data.mutation_assessor + : undefined, + siftScore: transcript?.sift_score, + siftPrediction: transcript?.sift_prediction, + polyPhenScore: transcript?.polyphen_score, + polyPhenPrediction: transcript?.polyphen_prediction, + alphaMissenseScore: transcript?.alphaMissense?.score, + alphaMissensePrediction: transcript?.alphaMissense?.pathogenicity, }; } - public static getPolyphenData( - polyphenDataCache: VariantAnnotation | null, - selectedTranscriptId?: string - ) { - let polyPhenScore: number | undefined = undefined; - let polyPhenPrediction: string | undefined = undefined; - - if (polyphenDataCache && selectedTranscriptId) { - // find transcript consequence that matches the selected transcript - const transcriptConsequence = polyphenDataCache.transcript_consequences.find( - tc => tc.transcript_id === selectedTranscriptId - ); - if (transcriptConsequence) { - polyPhenScore = transcriptConsequence.polyphen_score; - polyPhenPrediction = transcriptConsequence.polyphen_prediction; - } - } - - return { - polyPhenScore, - polyPhenPrediction, - }; - } - - public static getMutationAssessorData( - mutationAssessorDataCache: VariantAnnotation | null - ): MutationAssessorData | undefined { - return mutationAssessorDataCache?.mutation_assessor; - } - public static renderFunction( data: Mutation[], - siftPolyphenCache: GenomeNexusCache | undefined, - mutationAssessorCache: GenomeNexusMutationAssessorCache | undefined, + genomeNexusCache: GenomeNexusCache | undefined, selectedTranscriptId?: string ) { const showMutationAssessor = shouldShowMutationAssessor(); - const siftPolyphenCacheData = FunctionalImpactColumnFormatter.getDataFromCache( - data, - siftPolyphenCache - ); - const mutationAssessorCacheData = showMutationAssessor - ? FunctionalImpactColumnFormatter.getDataFromCache( - data, - mutationAssessorCache - ) - : null; return (
{showMutationAssessor && FunctionalImpactColumnFormatter.makeFunctionalImpactViz( - mutationAssessorCacheData, - FunctionalImpactColumnsName.MUTATION_ASSESSOR + data, + FunctionalImpactColumnName.MUTATION_ASSESSOR, + genomeNexusCache, + selectedTranscriptId )} {FunctionalImpactColumnFormatter.makeFunctionalImpactViz( - siftPolyphenCacheData, - FunctionalImpactColumnsName.SIFT, + data, + FunctionalImpactColumnName.SIFT, + genomeNexusCache, selectedTranscriptId )} {FunctionalImpactColumnFormatter.makeFunctionalImpactViz( - siftPolyphenCacheData, - FunctionalImpactColumnsName.POLYPHEN2, + data, + FunctionalImpactColumnName.POLYPHEN2, + genomeNexusCache, + selectedTranscriptId + )} + {FunctionalImpactColumnFormatter.makeFunctionalImpactViz( + data, + FunctionalImpactColumnName.ALPHAMISSENSE, + genomeNexusCache, selectedTranscriptId )}
); } - public static download( + static download( data: Mutation[], - siftPolyphenCache: GenomeNexusCache, - mutationAssessorCache: GenomeNexusMutationAssessorCache, + cache: GenomeNexusCache, selectedTranscriptId?: string ): string { - if (siftPolyphenCache || mutationAssessorCache) { - const functionalImpactData = FunctionalImpactColumnFormatter.getData( - data, - siftPolyphenCache, - mutationAssessorCache, - selectedTranscriptId - ); - let downloadData = []; - if (functionalImpactData) { - if (shouldShowMutationAssessor()) { - downloadData.push( - `MutationAssessor: ${MutationAssessor.download( - functionalImpactData.mutationAssessor - )}` - ); - } - downloadData = downloadData.concat([ - `SIFT: ${Sift.download( - functionalImpactData.siftScore, - functionalImpactData.siftPrediction - )}`, - `Polyphen-2: ${PolyPhen2.download( - functionalImpactData.polyPhenScore, - functionalImpactData.polyPhenPrediction - )}`, - ]); - return downloadData.join(';'); - } - } - return ''; + const functionalImpactData = this.getData( + data, + cache, + selectedTranscriptId + ); + if (!functionalImpactData) return ''; + + const downloadData = [ + shouldShowMutationAssessor() && + `MutationAssessor: ${ + functionalImpactData.mutationAssessor + ? `impact: ${functionalImpactData.mutationAssessor.functionalImpactPrediction}, score: ${functionalImpactData.mutationAssessor.functionalImpactScore}` + : 'NA' + }`, + `SIFT: ${ + functionalImpactData.siftScore || + functionalImpactData.siftPrediction + ? `impact: ${functionalImpactData.siftPrediction}, score: ${functionalImpactData.siftScore}` + : 'NA' + }`, + `Polyphen-2: ${ + functionalImpactData.polyPhenScore || + functionalImpactData.polyPhenPrediction + ? `impact: ${functionalImpactData.polyPhenPrediction}, score: ${functionalImpactData.polyPhenScore}` + : 'NA' + }`, + `AlphaMissense: ${ + functionalImpactData.alphaMissenseScore || + functionalImpactData.alphaMissensePrediction + ? `pathogenicity: ${functionalImpactData.alphaMissensePrediction}, score: ${functionalImpactData.alphaMissenseScore}` + : 'NA' + }`, + ]; + + return downloadData.join(';'); } private static getDataFromCache( data: Mutation[], - cache: GenomeNexusCache | GenomeNexusMutationAssessorCache | undefined + cache: GenomeNexusCache | GenomeNexusCache | undefined ): GenomeNexusCacheDataType | null { if (data.length === 0 || !cache) { return null; @@ -641,12 +502,13 @@ export default class FunctionalImpactColumnFormatter { } private static makeFunctionalImpactViz( - cacheData: GenomeNexusCacheDataType | null, - column: FunctionalImpactColumnsName, + mutation: Mutation[], + column: FunctionalImpactColumnName, + genomeNexusCache?: GenomeNexusCache, selectedTranscriptId?: string ) { let status: TableCellStatus | null = null; - + const cacheData = this.getDataFromCache(mutation, genomeNexusCache); if (cacheData === null) { status = TableCellStatus.LOADING; } else if (cacheData.status === 'error') { @@ -654,38 +516,38 @@ export default class FunctionalImpactColumnFormatter { } else if (cacheData.data === null) { status = TableCellStatus.NA; } else { - let functionalImpactData; + const data = this.getData( + mutation, + genomeNexusCache, + selectedTranscriptId + ); switch (column) { - case FunctionalImpactColumnsName.MUTATION_ASSESSOR: - functionalImpactData = FunctionalImpactColumnFormatter.getMutationAssessorData( - cacheData.data - ); + case FunctionalImpactColumnName.MUTATION_ASSESSOR: return ( ); - case FunctionalImpactColumnsName.SIFT: - functionalImpactData = FunctionalImpactColumnFormatter.getSiftData( - cacheData.data, - selectedTranscriptId - ); + case FunctionalImpactColumnName.SIFT: return ( ); - case FunctionalImpactColumnsName.POLYPHEN2: - functionalImpactData = FunctionalImpactColumnFormatter.getPolyphenData( - cacheData.data, - selectedTranscriptId - ); + case FunctionalImpactColumnName.POLYPHEN2: return ( + ); + case FunctionalImpactColumnName.ALPHAMISSENSE: + return ( + ); diff --git a/src/shared/components/mutationTable/column/alphaMissenseGoogleDeepmind.png b/src/shared/components/mutationTable/column/alphaMissenseGoogleDeepmind.png new file mode 100644 index 00000000000..360dce5d2f9 Binary files /dev/null and b/src/shared/components/mutationTable/column/alphaMissenseGoogleDeepmind.png differ