Skip to content

Commit

Permalink
oncoprint - allow adding gaps to string-valued clinical tracks
Browse files Browse the repository at this point in the history
Signed-off-by: Abeshouse, Adam A./Sloan Kettering Institute <[email protected]>
  • Loading branch information
Abeshouse, Adam A./Sloan Kettering Institute committed Feb 10, 2020
1 parent 8c01b25 commit b33a3cf
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions end-to-end-test/remote/specs/core/oncoprint.screenshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,36 @@ describe('oncoprint screenshot tests', function() {
var res = checkOncoprintElement('.oncoprintContainer');
assertScreenShotMatch(res);
});
it('coadread_tcga_pub with column gaps inserted based on clinical track', function() {
goToUrlAndSetLocalStorage(
`${CBIOPORTAL_URL}/results?Z_SCORE_THRESHOLD=2.0&cancer_study_id=coadread_tcga_pub&cancer_study_list=coadread_tcga_pub&case_ids=&case_set_id=coadread_tcga_pub_nonhypermut&clinicallist=CANCER_TYPE_DETAILED&gene_list=KRAS%20NRAS%20BRAF&gene_set_choice=user-defined-list&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=coadread_tcga_pub_gistic&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=coadread_tcga_pub_mutations&oncoprint_cluster_profile=&oncoprint_sortby=`
);
waitForOncoprint(ONCOPRINT_TIMEOUT);

const cancerTypeDetailedElements = getNthTrackOptionsElements(1);
setDropdownOpen(
true,
cancerTypeDetailedElements.button_selector,
cancerTypeDetailedElements.dropdown_selector,
'Failed to open cancer type detailed track menu'
);
browser.click(
`${cancerTypeDetailedElements.dropdown_selector} li:nth-child(9)`
); // Click "show gaps"
browser.pause(100); // give time to sort and insert gaps

// open minimap
browser.waitForExist('[data-test="ShowMinimapButton"]');
browser.click('[data-test="ShowMinimapButton"]');

// zoom to fit
browser.waitForVisible('.oncoprint-zoomtofit-btn');
browser.click('.oncoprint-zoomtofit-btn');
browser.pause(100); // give time to rezoom

const res = checkOncoprintElement('.oncoprintContainer');
assertScreenShotMatch(res);
});
});

describe('track group headers', function() {
Expand Down
10 changes: 7 additions & 3 deletions src/pages/staticPages/tools/oncoprinter/Oncoprinter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,17 @@ export default class Oncoprinter extends React.Component<
}
},
onSetHorzZoom: (z: number) => {
this.oncoprint.setHorzZoom(z);
this.oncoprint.setHorzZoomCentered(z);
},
onClickZoomIn: () => {
this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() / 0.7);
this.oncoprint.setHorzZoomCentered(
this.oncoprint.getHorzZoom() / 0.7
);
},
onClickZoomOut: () => {
this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() * 0.7);
this.oncoprint.setHorzZoomCentered(
this.oncoprint.getHorzZoom() * 0.7
);
},
onClickNGCHM: () => {}, // do nothing in oncoprinter mode
};
Expand Down
3 changes: 2 additions & 1 deletion src/shared/components/oncoprint/DeltaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ function transitionClinicalTrack(
rule_set_params.legend_label = nextSpec.label;
rule_set_params.exclude_from_legend = !nextProps.showClinicalTrackLegends;
rule_set_params.na_legend_label = nextSpec.na_legend_label;
const clinicalTrackParams = {
const clinicalTrackParams: UserTrackSpec<any> = {
rule_set_params,
data: nextSpec.data,
data_id_key: 'uid',
Expand All @@ -1199,6 +1199,7 @@ function transitionClinicalTrack(
target_group: CLINICAL_TRACK_GROUP_INDEX,
onSortDirectionChange: nextProps.onTrackSortDirectionChange,
custom_track_options: nextSpec.custom_options,
track_can_show_gaps: nextSpec.datatype === 'string',
};
trackSpecKeyToTrackId[nextSpec.key] = oncoprint.addTracks([
clinicalTrackParams,
Expand Down
10 changes: 7 additions & 3 deletions src/shared/components/oncoprint/ResultsViewOncoprint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,17 @@ export default class ResultsViewOncoprint extends React.Component<
}
},
onSetHorzZoom: (z: number) => {
this.oncoprint.setHorzZoom(z);
this.oncoprint.setHorzZoomCentered(z);
},
onClickZoomIn: () => {
this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() / 0.7);
this.oncoprint.setHorzZoomCentered(
this.oncoprint.getHorzZoom() / 0.7
);
},
onClickZoomOut: () => {
this.oncoprint.setHorzZoom(this.oncoprint.getHorzZoom() * 0.7);
this.oncoprint.setHorzZoomCentered(
this.oncoprint.getHorzZoom() * 0.7
);
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,7 @@ export default class OncoprintControls extends React.Component<
onClick={this.toggleShowMinimap}
>
<img
data-test="ShowMinimapButton"
src={require('./toggle-minimap.svg')}
alt="icon"
style={{ width: 15, height: 15 }}
Expand Down

0 comments on commit b33a3cf

Please sign in to comment.