import { DefaultTooltip } from 'cbioportal-frontend-commons'; import classNames from 'classnames'; import { observer } from 'mobx-react'; import * as React from 'react'; import { Table } from 'react-bootstrap'; import featureTableStyle from '../featureTable/FeatureTable.module.scss'; import functionalImpactColor from '../featureTable/FunctionalImpactTooltip.module.scss'; import tooltipStyles from './SiftTooltip.module.scss'; import siftLogo from '../../image/siftFunnel.png'; // Most of this component comes from cBioPortal-frontend export interface ISiftProps { siftPrediction: string | undefined; // deleterious, deleterious_low_confidence, tolerated, tolerated_low_confidence siftScore: number | undefined; } @observer export default class Sift extends React.Component { private static SIFT_URL: string = 'http://sift.bii.a-star.edu.sg/'; private 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.
); } private static siftTooltipTable() { return (
Legend SIFT  Qualitative prediction
deleterious
deleterious_low_confidence
tolerated_low_confidence
tolerated
); } constructor(props: ISiftProps) { super(props); this.siftData = this.siftData.bind(this); } public render() { let siftContent: JSX.Element = ; const dataSource = ( <> SIFT  ); if (this.props.siftPrediction && this.props.siftPrediction.length > 0) { siftContent = {this.props.siftPrediction}; } else { siftContent = N/A; } return (
{this.siftTooltip( {dataSource} )}
{this.siftTooltip( {siftContent} )}
); } private siftData() { const impact = this.props.siftPrediction ? (
{(this.props.siftScore || this.props.siftScore === 0) && ( )}
Score {this.props.siftScore.toFixed(2)}
Please refer to the score range{' '} here .
) : null; return (
{impact}
); } private siftTooltip(tooltipTrigger: JSX.Element) { return ( {Sift.siftText()} {this.siftData()} {Sift.siftTooltipTable()} } > {tooltipTrigger} ); } }