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 './PolyPhen2Tooltip.module.scss'; import polyPhen2Logo from '../../image/polyPhen-2.png'; // Most of this component comes from cBioPortal-frontend export interface IPolyPhen2Props { polyPhenPrediction: string | undefined; // benign, possibly_damaging, probably_damging polyPhenScore: number | undefined; } @observer export default class PolyPhen2 extends React.Component { private static POLYPHEN2_URL: string = 'http://genetics.bwh.harvard.edu/pph2/'; private static polyPhenText() { 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.
); } private static polyPhenTooltipTable() { return (
Legend PolyPhen-2  Qualitative prediction
probably_damaging
possibly_damaging
benign
-
); } constructor(props: IPolyPhen2Props) { super(props); this.polyPhenData = this.polyPhenData.bind(this); } public render() { let polyPhen2content: JSX.Element = ; const dataSource = ( <> PolyPhen-2  ); if ( this.props.polyPhenPrediction && this.props.polyPhenPrediction.length > 0 ) { polyPhen2content = {this.props.polyPhenPrediction}; } else { polyPhen2content = N/A; } return (
{this.polyPhenTooltip( {dataSource} )}
{this.polyPhenTooltip( {polyPhen2content} )}
); } private polyPhenData() { const impact = this.props.polyPhenPrediction ? (
{(this.props.polyPhenScore || this.props.polyPhenScore === 0) && ( )}
Score {this.props.polyPhenScore.toFixed(2)}
Please refer to the score range{' '} here .
) : null; return (
{impact}
); } private polyPhenTooltip(tooltipTrigger: JSX.Element) { return ( {PolyPhen2.polyPhenText()} {this.polyPhenData()} {PolyPhen2.polyPhenTooltipTable()} } > {tooltipTrigger} ); } }