Skip to content

Commit f5dc6d5

Browse files
TJMKuijpersalisman
authored andcommitted
Allow numeric data type for custom data charts
1 parent 754c9cc commit f5dc6d5

File tree

11 files changed

+675
-72
lines changed

11 files changed

+675
-72
lines changed

end-to-end-test/local/specs/core/studyview.screenshot.spec.js

+42
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const ADD_CHART_X_VS_Y_TAB = '.addChartTabs a.tabAnchor_X_Vs_Y';
2222
const WAIT_FOR_VISIBLE_TIMEOUT = 30000;
2323
const MUTATIONS_GENES_TABLE = "[data-test='mutations-table']";
2424
const CANCER_GENE_FILTER_ICON = "[data-test='header-filter-icon']";
25+
const ADD_CUSTOM_CHART_TAB = '.addChartTabs a.tabAnchor.tabAnchor_Custom_Data';
2526

2627
describe('study view generic assay categorical/binary features', function() {
2728
it('generic assay pie chart should be added in the summary tab', () => {
@@ -79,6 +80,47 @@ describe('study view generic assay categorical/binary features', function() {
7980
});
8081
});
8182

83+
describe('Test the Custom data tab', function() {
84+
it('Add custom data tab should have numerical and categorical selector', () => {
85+
const url = `${CBIOPORTAL_URL}/study?id=lgg_ucsf_2014_test_generic_assay`;
86+
goToUrlAndSetLocalStorage(url, true);
87+
waitForNetworkQuiet();
88+
89+
$(ADD_CHART_BUTTON).waitForDisplayed({
90+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
91+
});
92+
$(ADD_CHART_BUTTON).click();
93+
94+
waitForNetworkQuiet();
95+
// Change to custom tab
96+
$(ADD_CUSTOM_CHART_TAB).waitForDisplayed({
97+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
98+
});
99+
$(ADD_CUSTOM_CHART_TAB).click();
100+
const res = browser.checkElement('div.msk-tab.custom');
101+
assertScreenShotMatch(res);
102+
});
103+
it('Selecting numerical for custom data should return a bar chart', () => {
104+
const url = `${CBIOPORTAL_URL}/study?id=lgg_ucsf_2014_test_generic_assay`;
105+
goToUrlAndSetLocalStorage(url, true);
106+
waitForNetworkQuiet();
107+
108+
$(ADD_CHART_BUTTON).waitForDisplayed({
109+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
110+
});
111+
$(ADD_CHART_BUTTON).click();
112+
113+
waitForNetworkQuiet();
114+
// Change to custom tab
115+
$(ADD_CUSTOM_CHART_TAB).waitForDisplayed({
116+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
117+
});
118+
$(ADD_CUSTOM_CHART_TAB).click();
119+
CUSTOM_CHART_TAB = $('div.msk-tab.custom');
120+
// Add values to the input form
121+
});
122+
});
123+
82124
describe('study view x vs y charts', () => {
83125
const X_VS_Y_CHART = `div[data-test="chart-container-X-VS-Y-AGE-MUTATION_COUNT"]`;
84126
const X_VS_Y_HAMBURGER_ICON = `${X_VS_Y_CHART} [data-test="chart-header-hamburger-icon"]`;

env/custom.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#export CBIOPORTAL_URL="http://localhost:8080"
2-
#export GENOME_NEXUS_URL="https://www.genomenexus.org"
1+
export CBIOPORTAL_URL="http://localhost:8081"
2+
export GENOME_NEXUS_URL="https://www.genomenexus.org"

packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts

+91
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,97 @@ export default class CBioPortalAPIInternal {
24762476
return response.body;
24772477
});
24782478
};
2479+
2480+
fetchCustomDataBinCountsUsingPOSTURL(parameters: {
2481+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2482+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2483+
$queryParameters ? : any
2484+
}): string {
2485+
let queryParameters: any = {};
2486+
let path = '/custom-data-bin-counts/fetch';
2487+
2488+
if (parameters['dataBinMethod'] !== undefined) {
2489+
queryParameters['dataBinMethod'] = parameters['dataBinMethod'];
2490+
}
2491+
2492+
if (parameters.$queryParameters) {
2493+
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
2494+
var parameter = parameters.$queryParameters[parameterName];
2495+
queryParameters[parameterName] = parameter;
2496+
});
2497+
}
2498+
let keys = Object.keys(queryParameters);
2499+
return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '');
2500+
};
2501+
2502+
/**
2503+
* Fetch custom data bin counts by study view filter
2504+
* @method
2505+
* @name CBioPortalAPIInternal#fetchCustomDataBinCountsUsingPOST
2506+
* @param {} clinicalDataBinCountFilter - Clinical data bin count filter
2507+
* @param {string} dataBinMethod - Method for data binning
2508+
*/
2509+
fetchCustomDataBinCountsUsingPOSTWithHttpInfo(parameters: {
2510+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2511+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2512+
$queryParameters ? : any,
2513+
$domain ? : string
2514+
}): Promise < request.Response > {
2515+
const domain = parameters.$domain ? parameters.$domain : this.domain;
2516+
const errorHandlers = this.errorHandlers;
2517+
const request = this.request;
2518+
let path = '/custom-data-bin-counts/fetch';
2519+
let body: any;
2520+
let queryParameters: any = {};
2521+
let headers: any = {};
2522+
let form: any = {};
2523+
return new Promise(function(resolve, reject) {
2524+
headers['Accept'] = 'application/json';
2525+
headers['Content-Type'] = 'application/json';
2526+
2527+
if (parameters['clinicalDataBinCountFilter'] !== undefined) {
2528+
body = parameters['clinicalDataBinCountFilter'];
2529+
}
2530+
2531+
if (parameters['clinicalDataBinCountFilter'] === undefined) {
2532+
reject(new Error('Missing required parameter: clinicalDataBinCountFilter'));
2533+
return;
2534+
}
2535+
2536+
if (parameters['dataBinMethod'] !== undefined) {
2537+
queryParameters['dataBinMethod'] = parameters['dataBinMethod'];
2538+
}
2539+
2540+
if (parameters.$queryParameters) {
2541+
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
2542+
var parameter = parameters.$queryParameters[parameterName];
2543+
queryParameters[parameterName] = parameter;
2544+
});
2545+
}
2546+
2547+
request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers);
2548+
2549+
});
2550+
};
2551+
2552+
/**
2553+
* Fetch custom data bin counts by study view filter
2554+
* @method
2555+
* @name CBioPortalAPIInternal#fetchCustomDataBinCountsUsingPOST
2556+
* @param {} clinicalDataBinCountFilter - Clinical data bin count filter
2557+
* @param {string} dataBinMethod - Method for data binning
2558+
*/
2559+
fetchCustomDataBinCountsUsingPOST(parameters: {
2560+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2561+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2562+
$queryParameters ? : any,
2563+
$domain ? : string
2564+
}): Promise < Array < ClinicalDataBin >
2565+
> {
2566+
return this.fetchCustomDataBinCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) {
2567+
return response.body;
2568+
});
2569+
};
24792570
fetchCustomDataCountsUsingPOSTURL(parameters: {
24802571
'clinicalDataCountFilter': ClinicalDataCountFilter,
24812572
$queryParameters ? : any

0 commit comments

Comments
 (0)