import { DefaultTooltip } from 'cbioportal-frontend-commons'; import { observer } from 'mobx-react'; import * as React from 'react'; import { GnomadFrequency, HotspotAnnotation } from 'react-mutation-mapper'; import { MyVariantInfo, VariantAnnotation } from 'genome-nexus-ts-api-client'; import featureTableStyle from '../featureTable/FeatureTable.module.scss'; import { extractGenomicLocation, genomicLocationString, IHotspotIndex, is3dHotspot, isLinearClusterHotspot, Mutation, } from 'cbioportal-utils'; import { computed, makeObservable } from 'mobx'; import MskImpact from './MskImpact'; interface IGenralPopulationPrevalenceProps { myVariantInfo?: MyVariantInfo; chromosome: string | null; mutation: Mutation; variantAnnotation?: VariantAnnotation; } interface IVcf { chrom: string; ref: string; alt: string; pos: number; } @observer class GenralPopulationPrevalence extends React.Component< IGenralPopulationPrevalenceProps > { constructor(props: IGenralPopulationPrevalenceProps) { super(props); makeObservable(this); } @computed get indexedHotspots() { const indexHotspot: IHotspotIndex = {}; const genomicLocation = extractGenomicLocation(this.props.mutation); if ( genomicLocation && this.props.variantAnnotation?.hotspots?.annotation?.[0] ) { const aggregatedHotspots = { genomicLocation: genomicLocation, hotspots: this.props.variantAnnotation.hotspots.annotation[0], }; indexHotspot[ genomicLocationString(genomicLocation) ] = aggregatedHotspots; } return indexHotspot; } public gnomad( myVariantInfo: MyVariantInfo | undefined, chromosome: string | null ) { // generate gnomad url let gnomadUrl = 'https://gnomad.broadinstitute.org/'; if (myVariantInfo && myVariantInfo.vcf && chromosome) { const vcfVariant: IVcf = { chrom: chromosome, ref: myVariantInfo.vcf.ref, alt: myVariantInfo.vcf.alt, pos: Number(myVariantInfo.vcf.position), }; gnomadUrl = `https://gnomad.broadinstitute.org/variant/${vcfVariant.chrom}-${vcfVariant.pos}-${vcfVariant.ref}-${vcfVariant.alt}`; } if ( this.props.myVariantInfo && (this.props.myVariantInfo.gnomadExome || this.props.myVariantInfo.gnomadGenome) ) { return (
); } else { return (