Skip to content

Commit

Permalink
Merge pull request #4201 from leexgh/genie-na
Browse files Browse the repository at this point in the history
Customize "NA" category on GENIE comparison clinical tab
  • Loading branch information
dippindots authored Mar 22, 2022
2 parents fdd45cd + e5fc6c6 commit 468491c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 2 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.
1 change: 1 addition & 0 deletions src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,5 @@ export interface IServerConfig {
skin_home_page_show_unauthorized_studies: boolean;
skin_home_page_unauthorized_studies_global_message: string;
skin_mutation_table_namespace_column_show_by_default: boolean;
comparison_categorical_na_values: string;
}
1 change: 1 addition & 0 deletions src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const ServerConfigDefaults: Partial<IServerConfig> = {

skin_home_page_unauthorized_studies_global_message:
'The study is unauthorized. You need to request access.',
comparison_categorical_na_values: 'NA',
};

export default ServerConfigDefaults;
10 changes: 8 additions & 2 deletions src/pages/groupComparison/ClinicalData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import ComplexKeyMap from 'shared/lib/complexKeyDataStructures/ComplexKeyMap';
import { Sample } from 'cbioportal-ts-api-client';
import ComparisonStore from '../../shared/lib/comparison/ComparisonStore';
import { createSurvivalAttributeIdsDict } from 'pages/resultsView/survival/SurvivalUtil';
import { getComparisonCategoricalNaValue } from './ClinicalDataUtils';

export interface IClinicalDataProps {
store: ComparisonStore;
Expand Down Expand Up @@ -246,7 +247,7 @@ export default class ClinicalData extends React.Component<
@observable logScaleFunction: IAxisLogScaleParams | undefined;
@observable swapAxes = false;
@observable horizontalBars = false;
@observable showNA = false;
@observable showNA = true;

@action.bound
private onClickLogScale() {
Expand Down Expand Up @@ -314,7 +315,12 @@ export default class ClinicalData extends React.Component<
data: axisData.data.filter(
x =>
typeof x.value !== 'string' ||
x.value.toLowerCase() !== 'unknown'
_.every(
getComparisonCategoricalNaValue(),
naValue =>
naValue.toLowerCase() !==
(x.value as string).toLowerCase()
)
),
});
}
Expand Down
7 changes: 7 additions & 0 deletions src/pages/groupComparison/ClinicalDataUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getServerConfig } from 'config/config';

export function getComparisonCategoricalNaValue(): string[] {
const rawString = getServerConfig().comparison_categorical_na_values;
const naValues = rawString.split(',');
return naValues;
}

0 comments on commit 468491c

Please sign in to comment.