Skip to content

Commit

Permalink
Restyle oncoprint annotation menu
Browse files Browse the repository at this point in the history
Fix logic for disable VUS filtering checkbox

Remove obsolete test for annotations setting menu checkbox logic

Restyle oncoprint annotation menu

Update src/shared/alterationFiltering/SettingsMenu.tsx

Replace samples with mutations in exclude-germline tooltip explanation

Co-authored-by: Ino de Bruijn <ino@ino.bio>
  • Loading branch information
Bas Leenknegt and inodb committed Aug 31, 2023
1 parent 494bafa commit 0f5d99f
Show file tree
Hide file tree
Showing 9 changed files with 315 additions and 269 deletions.
4 changes: 2 additions & 2 deletions end-to-end-test/local/runtime-config/portal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ ucsc.build=hg19
oncoprint.defaultview=patient

# OncoPrint driver mutation annotations
oncoprint.custom_driver_annotation.binary.menu_label=Custom driver annotation
oncoprint.custom_driver_annotation.tiers.menu_label=Custom driver tiers
oncoprint.custom_driver_annotation.binary.menu_label=Custom driver annotations
oncoprint.custom_driver_annotation.tiers.menu_label=Driver tiers
oncoprint.custom_driver_annotation.binary.default=true
oncoprint.custom_driver_annotation.tiers.default=true
oncoprint.oncokb.default=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,6 @@ describe('custom driver annotations feature in result view', function() {
waitForOncoprint();
assert(!$('div.alert-info').isExisting());
});

it('(de-)selects custom driver checkboxes with main annotation select option', () => {
$('input[data-test=ColorByDriver]').click();
waitForOncoprint();

$('input[data-test=annotateCustomBinary]').waitForExist();
var topCheckBox = $('input[data-test=annotateCustomBinary]');
var tiersCheckboxes = $('span[data-test=annotateCustomTiers]').$$(
'input'
);
assert(!topCheckBox.isSelected());
assert(!tiersCheckboxes[0].isSelected());
assert(!tiersCheckboxes[1].isSelected());

$('input[data-test=ColorByDriver]').click();
assert(topCheckBox.isSelected());
assert(tiersCheckboxes[0].isSelected());
assert(tiersCheckboxes[1].isSelected());
});
});

describe('oncoprint tab - discrete CNA', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const ServerConfigDefaults: Partial<IServerConfig> = {
'https://mygene.info/v3/gene/<%= entrezGeneId %>?fields=uniprot',

oncoprint_custom_driver_annotation_binary_menu_label:
'Custom driver annotation',
oncoprint_custom_driver_annotation_tiers_menu_label: 'Custom driver tiers',
'Custom driver annotations',
oncoprint_custom_driver_annotation_tiers_menu_label: 'Driver tiers',
oncoprint_custom_driver_annotation_binary_default: true,
oncoprint_custom_driver_annotation_tiers_default: true,
oncoprint_oncokb_default: true,
Expand Down
4 changes: 2 additions & 2 deletions src/shared/alterationFiltering/AnnotationFilteringSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function buildDriverAnnotationSettings(
this._includeDriver = val;
},
get includeVUS() {
return this._includeVUS;
return this._includeVUS || !this.driversAnnotated;
},
set includeVUS(val: boolean) {
this._includeVUS = val;
Expand All @@ -124,7 +124,7 @@ export function buildDriverAnnotationSettings(
this.oncoKb ||
this.hotspots ||
this.customBinary ||
_.some(this.driverTiers.entries(), entry => entry[1]);
_.some([...this.driverTiers.entries()], entry => entry[1]);
return anySelected;
},

Expand Down
82 changes: 58 additions & 24 deletions src/shared/alterationFiltering/SettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
buildDriverAnnotationControlsHandlers,
} from './AnnotationFilteringSettings';
import styles from 'shared/components/driverAnnotations/styles.module.scss';
import InfoIcon from 'shared/components/InfoIcon';

enum EVENT_KEY {
hidePutativePassengers = '0',
Expand Down Expand Up @@ -110,22 +111,20 @@ export default class SettingsMenu extends React.Component<
style={{ padding: 5 }}
>
{this.props.annotationTitleComponent}
<div style={{ marginLeft: 10 }}>
<DriverAnnotationControls
state={this.driverSettingsState}
handlers={this.driverSettingsHandlers}
showOnckbAnnotationControls={
this.props.showOnckbAnnotationControls
}
/>
</div>
<DriverAnnotationControls
state={this.driverSettingsState}
handlers={this.driverSettingsHandlers}
showOnckbAnnotationControls={
this.props.showOnckbAnnotationControls
}
/>
{this.props.showFilterControls && (
<>
<hr />
<h5 style={{ marginTop: 'auto', marginBottom: 'auto' }}>
Filter Data
</h5>
<div style={{ marginLeft: 10 }}>
<div>
<div className="checkbox">
<label>
<input
Expand All @@ -143,9 +142,20 @@ export default class SettingsMenu extends React.Component<
.distinguishDrivers
}
/>{' '}
Exclude alterations (mutations, structural
variants and copy number) of unknown
significance
Show only drivers
<InfoIcon
style={{ color: 'grey' }}
divStyle={{
display: 'inline-block',
marginLeft: 6,
}}
tooltip={
<>
Exclude VUS: Drivers are defined
through the options above
</>
}
/>
</label>
</div>
<div className="checkbox">
Expand All @@ -160,11 +170,19 @@ export default class SettingsMenu extends React.Component<
}
onClick={this.onInputClick}
/>{' '}
Exclude germline mutations
Show only somatic
<InfoIcon
style={{ color: 'grey' }}
divStyle={{
display: 'inline-block',
marginLeft: 6,
}}
tooltip={<>Exclude germline mutations</>}
/>
</label>
</div>
{this.props.showExcludeUnprofiledSamplesControl && (
<div>
<>
<div className="checkbox">
<label>
<input
Expand All @@ -180,10 +198,28 @@ export default class SettingsMenu extends React.Component<
}
onClick={this.onInputClick}
/>{' '}
Exclude unprofiled samples
Show only profiled
<InfoIcon
style={{ color: 'grey' }}
divStyle={{
display: 'inline-block',
marginLeft: 6,
}}
tooltip={
<>
Exclude unprofiled
samples
</>
}
/>
</label>
</div>
<div style={{ marginLeft: 10 }}>
<div
style={{
marginLeft: 10,
marginTop: -5,
}}
>
<div className="radio">
<label>
<input
Expand All @@ -198,9 +234,8 @@ export default class SettingsMenu extends React.Component<
}
onClick={this.onInputClick}
/>
Exclude samples that are
unprofiled in any queried gene
or profile
Profiled in <strong>all</strong>{' '}
queried genes/profiles
</label>
<label>
<input
Expand All @@ -215,13 +250,12 @@ export default class SettingsMenu extends React.Component<
}
onClick={this.onInputClick}
/>
Exclude samples that are
unprofiled in every queried gene
and profile.
Profiled in <strong>any</strong>{' '}
queried genes/profiles
</label>
</div>
</div>
</div>
</>
)}
</div>
</>
Expand Down
Loading

0 comments on commit 0f5d99f

Please sign in to comment.