import _ from 'lodash'; import * as React from 'react'; import { MolecularProfile } from 'cbioportal-ts-api-client'; import FontAwesome from 'react-fontawesome'; import styles from './styles/styles.module.scss'; import { observer } from 'mobx-react'; import { FlexRow } from '../flexbox/FlexBox'; import { QueryStoreComponent } from './QueryStore'; import { DefaultTooltip } from 'cbioportal-frontend-commons'; import SectionHeader from '../sectionHeader/SectionHeader'; import { getServerConfig } from 'config/config'; import { getSuffixOfMolecularProfile } from 'shared/lib/molecularProfileUtils'; @observer export default class MolecularProfileSelector extends QueryStoreComponent< {}, {} > { private get showGSVA() { return getServerConfig().skin_show_gsva; } render() { if (this.store.selectableSelectedStudyIds.length !== 1) return null; return ( Select Genomic Profiles:
{this.renderGroup('MUTATION_EXTENDED', 'Mutation')} {this.renderGroup( 'STRUCTURAL_VARIANT', 'Structural Variant' )} {this.renderGroup('COPY_NUMBER_ALTERATION', 'Copy Number')} {this.showGSVA && this.renderGroup('GENESET_SCORE', 'GSVA scores')} {this.renderGroup('MRNA_EXPRESSION', 'mRNA Expression')} {this.renderGroup('METHYLATION', 'DNA Methylation')} {this.renderGroup('METHYLATION_BINARY', 'DNA Methylation')} {this.renderGroup( 'PROTEIN_LEVEL', 'Protein/phosphoprotein level' )} {!!( this.store.molecularProfilesInSelectedStudies .isComplete && !this.store.molecularProfilesInSelectedStudies.result .length ) && ( No Genomic Profiles available for this Cancer Study )}
); } ProfileToggle = ({ profile, type, label, checked, isGroupToggle, }: { profile: MolecularProfile; type: 'radio' | 'checkbox'; label: string; checked: boolean; isGroupToggle: boolean; }) => ( ); renderGroup( molecularAlterationType: MolecularProfile['molecularAlterationType'], groupLabel: string ) { let profiles = this.store.getFilteredProfiles(molecularAlterationType); if (!profiles.length) return null; const isGroupSelected = _.some(profiles, profile => this.store.isProfileTypeSelected( getSuffixOfMolecularProfile(profile) ) ); let output: JSX.Element[] = []; if (profiles.length > 1 && !this.store.forDownloadTab) output.push( ); let profileToggles = profiles.map(profile => ( 1 ? 'radio' : 'checkbox' } label={ profile.molecularAlterationType === 'STRUCTURAL_VARIANT' ? groupLabel : profile.name } checked={this.store.isProfileTypeSelected( getSuffixOfMolecularProfile(profile) )} isGroupToggle={false} /> )); if (this.store.forDownloadTab || profiles.length == 1) output.push(...profileToggles); else output.push(
{profileToggles}
); if (this.store.forDownloadTab) return output; if (isGroupSelected && molecularAlterationType == 'MRNA_EXPRESSION') { output.push(
Enter a z-score threshold{' '} { this.store.zScoreThreshold = (event.target as HTMLInputElement).value; }} />
); } if (isGroupSelected && molecularAlterationType == 'PROTEIN_LEVEL') { output.push(
Enter a z-score threshold{' '} { this.store.rppaScoreThreshold = (event.target as HTMLInputElement).value; }} />
); } return output; } }