Skip to content

Commit

Permalink
Mutation pie chart and multi-selection table (#4794)
Browse files Browse the repository at this point in the history
* group gene selection options by alteration type

* add mutation-data-counts endpoint and revamp renderAttributes giant switch statements

* add sub menu options for mutation profile

* get mutation data and fix display text on add chart

* fix filter and show pill tags for mutation count data

* add mutation type table and disable group comparison

* get mutation table download data

* support and fix intersect and union selection on mutation table

* ui update for mutation chart

* fix pilltags, apis, and select

* cleanup code

* resolve comments from Karthik

* resolve Aaron's comments

* resolve Study View Page missing data

* fix selecting more rows in mutation counts table

* fix pilltag errors on intersection selection

* rename wild type to mutation type

* fix type errors and conflicts

* fix GenomicDataCount

* fix e2e tests on SummaryTab

* update any to Partial in SummaryTab

* resolve Aaron's comments

* remove categories grouping and change colors for mutation pie chart

* fix mutation categories type assertion

* revert colors.ts changes and add callback to change Mutated vs Wild Type pie chart

---------

Co-authored-by: Qi-Xuan Lu <qlu@carisls.com>
  • Loading branch information
7xuanlu and qlu-cls authored Apr 5, 2024
1 parent c9f73d8 commit 075074e
Show file tree
Hide file tree
Showing 13 changed files with 2,082 additions and 1,147 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,10 @@ export type GenomicDataBinFilter = {
export type GenomicDataCount = {
'count': number

'label': string

'uniqueCount': number

'label': string

'value': string

};
Expand Down Expand Up @@ -907,9 +907,8 @@ export type MutationDataFilter = {

'profileType': string

'values': Array < Array < DataFilterValue >
>

'values': Array < Array< DataFilterValue > >

};
export type MutationPositionIdentifier = {
'entrezGeneId': number
Expand Down Expand Up @@ -4815,6 +4814,85 @@ export default class CBioPortalAPIInternal {
return response.body;
});
};

fetchMutationDataCountsUsingPOSTURL(parameters: {
'genomicDataCountFilter': GenomicDataCountFilter,
$queryParameters ? : any
}): string {
let queryParameters: any = {};
let path = '/api/mutation-data-counts/fetch';

if (parameters.$queryParameters) {
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
var parameter = parameters.$queryParameters[parameterName];
queryParameters[parameterName] = parameter;
});
}
let keys = Object.keys(queryParameters);
return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '');
};

/**
* Fetch mutation data counts by GenomicDataCountFilter
* @method
* @name CBioPortalAPIInternal#fetchMutationDataCountsUsingPOST
* @param {} genomicDataCountFilter - Genomic data count filter
*/
fetchMutationDataCountsUsingPOSTWithHttpInfo(parameters: {
'genomicDataCountFilter': GenomicDataCountFilter,
$queryParameters ? : any,
$domain ? : string
}): Promise < request.Response > {
const domain = parameters.$domain ? parameters.$domain : this.domain;
const errorHandlers = this.errorHandlers;
const request = this.request;
let path = '/api/mutation-data-counts/fetch';
let body: any;
let queryParameters: any = {};
let headers: any = {};
let form: any = {};
return new Promise(function(resolve, reject) {
headers['Accept'] = 'application/json';
headers['Content-Type'] = 'application/json';

if (parameters['genomicDataCountFilter'] !== undefined) {
body = parameters['genomicDataCountFilter'];
}

if (parameters['genomicDataCountFilter'] === undefined) {
reject(new Error('Missing required parameter: genomicDataCountFilter'));
return;
}

if (parameters.$queryParameters) {
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
var parameter = parameters.$queryParameters[parameterName];
queryParameters[parameterName] = parameter;
});
}

request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers);

});
};

/**
* Fetch mutation data counts by GenomicDataCountFilter
* @method
* @name CBioPortalAPIInternal#fetchMutationDataCountsUsingPOST
* @param {} genomicDataCountFilter - Genomic data count filter
*/
fetchMutationDataCountsUsingPOST(parameters: {
'genomicDataCountFilter': GenomicDataCountFilter,
$queryParameters ? : any,
$domain ? : string
}): Promise < Array < GenomicDataCountItem >
> {
return this.fetchMutationDataCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) {
return response.body;
});
};

fetchMolecularProfileSampleCountsUsingPOSTURL(parameters: {
'studyViewFilter' ? : StudyViewFilter,
$queryParameters ? : any
Expand Down Expand Up @@ -5542,89 +5620,6 @@ export default class CBioPortalAPIInternal {
return response.body;
});
};
fetchMutationDataCountsUsingPOSTURL(parameters: {
'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META",
'genomicDataCountFilter' ? : GenomicDataCountFilter,
$queryParameters ? : any
}): string {
let queryParameters: any = {};
let path = '/api/mutation-data-counts/fetch';
if (parameters['projection'] !== undefined) {
queryParameters['projection'] = parameters['projection'];
}

if (parameters.$queryParameters) {
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
var parameter = parameters.$queryParameters[parameterName];
queryParameters[parameterName] = parameter;
});
}
let keys = Object.keys(queryParameters);
return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : '');
};

/**
* Fetch mutation data counts by GenomicDataCountFilter
* @method
* @name CBioPortalAPIInternal#fetchMutationDataCountsUsingPOST
* @param {string} projection - Level of detail of the response
* @param {} genomicDataCountFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change.
*/
fetchMutationDataCountsUsingPOSTWithHttpInfo(parameters: {
'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META",
'genomicDataCountFilter' ? : GenomicDataCountFilter,
$queryParameters ? : any,
$domain ? : string
}): Promise < request.Response > {
const domain = parameters.$domain ? parameters.$domain : this.domain;
const errorHandlers = this.errorHandlers;
const request = this.request;
let path = '/api/mutation-data-counts/fetch';
let body: any;
let queryParameters: any = {};
let headers: any = {};
let form: any = {};
return new Promise(function(resolve, reject) {
headers['Accept'] = 'application/json';
headers['Content-Type'] = 'application/json';

if (parameters['projection'] !== undefined) {
queryParameters['projection'] = parameters['projection'];
}

if (parameters['genomicDataCountFilter'] !== undefined) {
body = parameters['genomicDataCountFilter'];
}

if (parameters.$queryParameters) {
Object.keys(parameters.$queryParameters).forEach(function(parameterName) {
var parameter = parameters.$queryParameters[parameterName];
queryParameters[parameterName] = parameter;
});
}

request('POST', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers);

});
};

/**
* Fetch mutation data counts by GenomicDataCountFilter
* @method
* @name CBioPortalAPIInternal#fetchMutationDataCountsUsingPOST
* @param {string} projection - Level of detail of the response
* @param {} genomicDataCountFilter - A web service for supplying JSON formatted data to cBioPortal clients. Please note that this API is currently in beta and subject to change.
*/
fetchMutationDataCountsUsingPOST(parameters: {
'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META",
'genomicDataCountFilter' ? : GenomicDataCountFilter,
$queryParameters ? : any,
$domain ? : string
}): Promise < ResponseEntityListGenomicDataCountItem > {
return this.fetchMutationDataCountsUsingPOSTWithHttpInfo(parameters).then(function(response: request.Response) {
return response.body;
});
};
getAllReferenceGenomeGenesUsingGETURL(parameters: {
'genomeName': string,
$queryParameters ? : any
Expand Down
7 changes: 7 additions & 0 deletions src/pages/studyView/StudyViewConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export enum ChartTypeEnum {
SCATTER = 'SCATTER',
VIOLIN_PLOT_TABLE = 'VIOLIN_PLOT_TABLE',
MUTATED_GENES_TABLE = 'MUTATED_GENES_TABLE',
MUTATION_TYPE_COUNTS_TABLE = 'MUTATION_TYPE_COUNTS_TABLE',
STRUCTURAL_VARIANT_GENES_TABLE = 'STRUCTURAL_VARIANT_GENES_TABLE',
STRUCTURAL_VARIANTS_TABLE = 'STRUCTURAL_VARIANTS_TABLE',
CNA_GENES_TABLE = 'CNA_GENES_TABLE',
Expand All @@ -92,6 +93,7 @@ export enum ChartTypeNameEnum {
SCATTER = 'density plot',
VIOLIN_PLOT_TABLE = 'table',
MUTATED_GENES_TABLE = 'table',
MUTATION_TYPE_COUNTS_TABLE = 'table',
STRUCTURAL_VARIANT_GENES_TABLE = 'table',
STRUCTURAL_VARIANTS_TABLE = 'table',
CNA_GENES_TABLE = 'table',
Expand Down Expand Up @@ -207,6 +209,11 @@ const studyViewFrontEnd = {
h: 2,
minW: 2,
},
[ChartTypeEnum.MUTATION_TYPE_COUNTS_TABLE]: {
w: 2,
h: 2,
minW: 2,
},
[ChartTypeEnum.STRUCTURAL_VARIANT_GENES_TABLE]: {
w: 2,
h: 2,
Expand Down
Loading

0 comments on commit 075074e

Please sign in to comment.