Skip to content

Commit 91300e0

Browse files
committed
Allow numeric data type for custom data charts
1 parent 5e8d6a1 commit 91300e0

File tree

11 files changed

+676
-71
lines changed

11 files changed

+676
-71
lines changed

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

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

2526
describe('study view generic assay categorical/binary features', function() {
2627
it('generic assay pie chart should be added in the summary tab', () => {
@@ -81,6 +82,47 @@ describe('study view generic assay categorical/binary features', function() {
8182
});
8283
});
8384

85+
describe('Test the Custom data tab', function() {
86+
it('Add custom data tab should have numerical and categorical selector', () => {
87+
const url = `${CBIOPORTAL_URL}/study?id=lgg_ucsf_2014_test_generic_assay`;
88+
goToUrlAndSetLocalStorage(url, true);
89+
waitForNetworkQuiet();
90+
91+
$(ADD_CHART_BUTTON).waitForDisplayed({
92+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
93+
});
94+
$(ADD_CHART_BUTTON).click();
95+
96+
waitForNetworkQuiet();
97+
// Change to custom tab
98+
$(ADD_CUSTOM_CHART_TAB).waitForDisplayed({
99+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
100+
});
101+
$(ADD_CUSTOM_CHART_TAB).click();
102+
const res = browser.checkElement('div.msk-tab.custom');
103+
assertScreenShotMatch(res);
104+
});
105+
it('Selecting numerical for custom data should return a bar chart', () => {
106+
const url = `${CBIOPORTAL_URL}/study?id=lgg_ucsf_2014_test_generic_assay`;
107+
goToUrlAndSetLocalStorage(url, true);
108+
waitForNetworkQuiet();
109+
110+
$(ADD_CHART_BUTTON).waitForDisplayed({
111+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
112+
});
113+
$(ADD_CHART_BUTTON).click();
114+
115+
waitForNetworkQuiet();
116+
// Change to custom tab
117+
$(ADD_CUSTOM_CHART_TAB).waitForDisplayed({
118+
timeout: WAIT_FOR_VISIBLE_TIMEOUT,
119+
});
120+
$(ADD_CUSTOM_CHART_TAB).click();
121+
CUSTOM_CHART_TAB = $('div.msk-tab.custom');
122+
// Add values to the input form
123+
});
124+
});
125+
84126
describe('study view x vs y charts', () => {
85127
const X_VS_Y_CHART = `div[data-test="chart-container-X-VS-Y-AGE-MUTATION_COUNT"]`;
86128
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
@@ -2387,6 +2387,97 @@ export default class CBioPortalAPIInternal {
23872387
return response.body;
23882388
});
23892389
};
2390+
2391+
fetchCustomDataBinCountsUsingPOSTURL(parameters: {
2392+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2393+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2394+
$queryParameters ? : any
2395+
}): string {
2396+
let queryParameters: any = {};
2397+
let path = '/custom-data-bin-counts/fetch';
2398+
2399+
if (parameters['dataBinMethod'] !== undefined) {
2400+
queryParameters['dataBinMethod'] = parameters['dataBinMethod'];
2401+
}
2402+
2403+
if (parameters.$queryParameters) {
2404+
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
2405+
var parameter = parameters.$queryParameters[parameterName];
2406+
queryParameters[parameterName] = parameter;
2407+
});
2408+
}
2409+
let keys = Object.keys(queryParameters);
2410+
return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '');
2411+
};
2412+
2413+
/**
2414+
* Fetch custom data bin counts by study view filter
2415+
* @method
2416+
* @name CBioPortalAPIInternal#fetchCustomDataBinCountsUsingPOST
2417+
* @param {} clinicalDataBinCountFilter - Clinical data bin count filter
2418+
* @param {string} dataBinMethod - Method for data binning
2419+
*/
2420+
fetchCustomDataBinCountsUsingPOSTWithHttpInfo(parameters: {
2421+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2422+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2423+
$queryParameters ? : any,
2424+
$domain ? : string
2425+
}): Promise < request.Response > {
2426+
const domain = parameters.$domain ? parameters.$domain : this.domain;
2427+
const errorHandlers = this.errorHandlers;
2428+
const request = this.request;
2429+
let path = '/custom-data-bin-counts/fetch';
2430+
let body: any;
2431+
let queryParameters: any = {};
2432+
let headers: any = {};
2433+
let form: any = {};
2434+
return new Promise(function(resolve, reject) {
2435+
headers['Accept'] = 'application/json';
2436+
headers['Content-Type'] = 'application/json';
2437+
2438+
if (parameters['clinicalDataBinCountFilter'] !== undefined) {
2439+
body = parameters['clinicalDataBinCountFilter'];
2440+
}
2441+
2442+
if (parameters['clinicalDataBinCountFilter'] === undefined) {
2443+
reject(new Error('Missing required parameter: clinicalDataBinCountFilter'));
2444+
return;
2445+
}
2446+
2447+
if (parameters['dataBinMethod'] !== undefined) {
2448+
queryParameters['dataBinMethod'] = parameters['dataBinMethod'];
2449+
}
2450+
2451+
if (parameters.$queryParameters) {
2452+
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
2453+
var parameter = parameters.$queryParameters[parameterName];
2454+
queryParameters[parameterName] = parameter;
2455+
});
2456+
}
2457+
2458+
request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers);
2459+
2460+
});
2461+
};
2462+
2463+
/**
2464+
* Fetch custom data bin counts by study view filter
2465+
* @method
2466+
* @name CBioPortalAPIInternal#fetchCustomDataBinCountsUsingPOST
2467+
* @param {} clinicalDataBinCountFilter - Clinical data bin count filter
2468+
* @param {string} dataBinMethod - Method for data binning
2469+
*/
2470+
fetchCustomDataBinCountsUsingPOST(parameters: {
2471+
'clinicalDataBinCountFilter': ClinicalDataBinCountFilter,
2472+
'dataBinMethod' ? : "DYNAMIC" | "STATIC",
2473+
$queryParameters ? : any,
2474+
$domain ? : string
2475+
}): Promise < Array < ClinicalDataBin >
2476+
> {
2477+
return this.fetchCustomDataBinCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) {
2478+
return response.body;
2479+
});
2480+
};
23902481
fetchCustomDataCountsUsingPOSTURL(parameters: {
23912482
'clinicalDataCountFilter': ClinicalDataCountFilter,
23922483
$queryParameters ? : any

0 commit comments

Comments
 (0)