import * as React from 'react'; import { observer } from 'mobx-react'; import { MSKTabs, MSKTab } from 'shared/components/MSKTabs/MSKTabs'; import { ResultsViewPageStore } from '../ResultsViewPageStore'; import ResultsViewMutationMapper from './ResultsViewMutationMapper'; import { convertToMutationMapperProps } from 'shared/components/mutationMapper/MutationMapperServerConfig'; import MutationMapperUserSelectionStore from 'shared/components/mutationMapper/MutationMapperUserSelectionStore'; import { computed, action, makeObservable } from 'mobx'; import { getServerConfig } from 'config/config'; import OqlStatusBanner from '../../../shared/components/banners/OqlStatusBanner'; import autobind from 'autobind-decorator'; import { AppStore } from '../../../AppStore'; import './mutations.scss'; import AlterationFilterWarning from '../../../shared/components/banners/AlterationFilterWarning'; import { getMutationAlignerUrlTemplate, getOncoKbApiUrl, } from 'shared/api/urls'; import CaseFilterWarning from '../../../shared/components/banners/CaseFilterWarning'; import { Mutation } from 'cbioportal-ts-api-client'; import _ from 'lodash'; import ResultsViewURLWrapper from '../ResultsViewURLWrapper'; import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator'; import { updateOncoKbIconStyle } from 'shared/lib/AnnotationColumnUtils'; import { AnnotatedMutation } from 'shared/model/AnnotatedMutation'; export interface IMutationsPageProps { routing?: any; store: ResultsViewPageStore; appStore: AppStore; urlWrapper: ResultsViewURLWrapper; } @observer export default class Mutations extends React.Component< IMutationsPageProps, {} > { private userSelectionStore: MutationMapperUserSelectionStore; @computed get selectedGeneSymbol() { return this.props.urlWrapper.query.mutations_gene && this.props.store.hugoGeneSymbols.includes( this.props.urlWrapper.query.mutations_gene ) ? this.props.urlWrapper.query.mutations_gene : this.props.store.hugoGeneSymbols[0]; } @computed get selectedGene() { return _.find( this.props.store.genes.result, gene => gene.hugoGeneSymbol === this.selectedGeneSymbol ); } constructor(props: IMutationsPageProps) { super(props); makeObservable(this); this.userSelectionStore = new MutationMapperUserSelectionStore(); } @autobind private onToggleOql() { this.props.store.mutationsTabFilteringSettings.useOql = !this.props .store.mutationsTabFilteringSettings.useOql; } @autobind private onToggleVUS() { this.props.store.mutationsTabFilteringSettings.excludeVus = !this.props .store.mutationsTabFilteringSettings.excludeVus; } @autobind private onToggleGermline() { this.props.store.mutationsTabFilteringSettings.excludeGermline = !this .props.store.mutationsTabFilteringSettings.excludeGermline; } @action public setSelectedGeneSymbol(hugoGeneSymbol: string) { this.props.urlWrapper.updateURL({ mutations_gene: hugoGeneSymbol, }); } public render() { const activeTabId = this.selectedGeneSymbol; return (