Skip to content

Commit

Permalink
(draft) fix some issues and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Djokovic0311 committed Aug 22, 2023
1 parent e683c97 commit ef4a91e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export default class GenericAssayEnrichmentCollections extends React.Component<
profileMap,
this.props.genericAssayType
);
if (type == 'BINARY') {
if (type === 'BINARY') {
this.isBinary = true;
this.isCategorical = false;
this.isNumerical = false;
} else if (type == 'CATEGORICAL') {
} else if (type === 'CATEGORICAL') {
this.isBinary = false;
this.isCategorical = true;
this.isNumerical = false;
Expand Down
85 changes: 0 additions & 85 deletions src/pages/groupComparison/GroupComparisonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,91 +314,6 @@ export default class GroupComparisonPage extends React.Component<
<MethylationEnrichments store={this.store} />
</MSKTab>
)}
{/* {this.store.showGenericAssayTab &&
getSortedGenericAssayTabSpecs(
this.store
.genericAssayEnrichmentProfilesGroupedByGenericAssayType
.result
).map(genericAssayTabSpecs => {
return (
<MSKTab
id={`${
GroupComparisonTab.GENERIC_ASSAY_PREFIX
}_${genericAssayTabSpecs.genericAssayType.toLowerCase()}`}
linkText={genericAssayTabSpecs.linkText}
anchorClassName={
this.store.genericAssayTabUnavailable
? 'greyedOut'
: ''
}
>
<GenericAssayEnrichments
store={this.store}
genericAssayType={
genericAssayTabSpecs.genericAssayType
}
/>
</MSKTab>
);
})}
{this.store.showGenericAssayBinaryTab &&
getSortedGenericAssayBinaryTabSpecs(
this.store
.genericAssayBinaryEnrichmentProfilesGroupedByGenericAssayType
.result
).map(genericAssayBinaryTabSpecs => {
return (
<MSKTab
id={`${
GroupComparisonTab.GENERIC_ASSAY_BINARY_PREFIX
}_${genericAssayBinaryTabSpecs.genericAssayType.toLowerCase()}`}
linkText={genericAssayBinaryTabSpecs.linkText}
anchorClassName={
this.store.genericAssayBinaryTabUnavailable
? 'greyedOut'
: ''
}
>
<GenericAssayBinaryEnrichments
store={this.store}
genericAssayType={
genericAssayBinaryTabSpecs.genericAssayType
}
/>
</MSKTab>
);
})}
{this.store.showGenericAssayCategoricalTab &&
getSortedGenericAssayCategoricalTabSpecs(
this.store
.genericAssayCategoricalEnrichmentProfilesGroupedByGenericAssayType
.result
).map(genericAssayCategoricalTabSpecs => {
return (
<MSKTab
id={`${
GroupComparisonTab.GENERIC_ASSAY_CATEGORICAL_PREFIX
}_${genericAssayCategoricalTabSpecs.genericAssayType.toLowerCase()}`}
linkText={genericAssayCategoricalTabSpecs.linkText}
anchorClassName={
this.store.genericAssayCategoricalTabUnavailable
? 'greyedOut'
: ''
}
>
<GenericAssayCategoricalEnrichments
store={this.store}
genericAssayType={
genericAssayCategoricalTabSpecs.genericAssayType
}
/>
</MSKTab>
);
})} */}

{(this.store.showGenericAssayCategoricalTab ||
this.store.showGenericAssayBinaryTab ||
this.store.showGenericAssayTab) &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/enrichments/EnrichmentsUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export function getFilteredData(
export function getFilteredCategoricalData(
data: GenericAssayCategoricalEnrichmentRow[],
filterFunction: (value: string) => boolean
): any[] {
): GenericAssayCategoricalEnrichmentRow[] {
return data.filter(enrichmentDatum => {
let result = false;
result = filterFunction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default class GenericAssayBinaryEnrichmentsContainer extends React.Compon
}

@computed private get gaBarplotYAxislabel() {
return 'Binary data entity ratio';
return this.props.selectedProfile.name + ' altered ratio';
}

@computed private get categoryToColor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import { observer, Observer } from 'mobx-react';
import { observable, computed, action, makeObservable } from 'mobx';
import styles from './styles.module.scss';
import {
MolecularProfile,
Sample,
Expand All @@ -11,20 +10,15 @@ import client from 'shared/api/cbioportalClientInstance';
import {
getGenericAssayCategoricalEnrichmentRowData,
getGenericAssayCategoricalEnrichmentColumns,
getGenericAssayScatterData,
getFilteredData,
getFilteredCategoricalData,
} from 'pages/resultsView/enrichments/EnrichmentsUtil';
import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator';
import ReactSelect from 'react-select1';
import _ from 'lodash';
import autobind from 'autobind-decorator';
import ScrollBar from 'shared/components/Scrollbar/ScrollBar';
import { MiniOncoprint } from 'shared/components/miniOncoprint/MiniOncoprint';
import {
CheckedSelect,
Option,
DefaultTooltip,
DownloadControls,
remoteData,
} from 'cbioportal-frontend-commons';
Expand All @@ -33,27 +27,17 @@ import GenericAssayCategoricalEnrichmentsTable, {
} from './GenericAssayCategoricalEnrichmentsTable';
import { GenericAssayCategoricalEnrichmentsTableDataStore } from './GenericAssayCategoricalEnrichmentsTableDataStore';
import { GenericAssayCategoricalEnrichmentRow } from 'shared/model/EnrichmentRow';
import ExpressionEnrichmentsBoxPlot from './ExpressionEnrichmentsBoxPlot';
import { getRemoteDataGroupStatus } from 'cbioportal-utils';
import { EnrichmentAnalysisComparisonGroup } from 'pages/groupComparison/GroupComparisonUtils';
import GenericAssayMiniScatterChart from './GenericAssayMiniScatterChart';
import {
basicAppearance,
boxPlotTooltip,
IAxisData,
IAxisLogScaleParams,
IBoxScatterPlotPoint,
INumberAxisData,
isNumberData,
isStringData,
IStringAxisData,
makeBoxScatterPlotData,
} from 'pages/resultsView/plots/PlotsTabUtils';
import CategoryPlot, {
CategoryPlotType,
} from 'pages/groupComparison/CategoryPlot';
import { OncoprintJS } from 'oncoprintjs';
import { MobxPromiseUnionType } from 'mobxpromise';
import ComparisonStore, {
OverlapStrategy,
} from 'shared/lib/comparison/ComparisonStore';
Expand Down Expand Up @@ -135,7 +119,7 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C
@computed get showSwapAxisControls() {
return !this.isTable;
}
// TODO: modify judgement

@computed get isTable() {
return (
this.isNumericalPlot &&
Expand Down Expand Up @@ -282,13 +266,6 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C

@computed get filteredData(): GenericAssayCategoricalEnrichmentRow[] {
return getFilteredCategoricalData(this.data, this.filterByStableId);
// return getFilteredData(
// this.data,
// this._enrichedGroups,
// this.significanceFilter,
// this.filterByStableId,
// true
// );
}

public readonly groupMembershipAxisData = remoteData({
Expand Down Expand Up @@ -394,7 +371,6 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C
_.uniq(sampleList.map(x => x.uniqueSampleKey)),
_.uniq(axisData.data.map(x => x.uniqueSampleKey))
);
console.log(naSamples);
return Promise.resolve({
...axisData,
data: axisData.data.concat(
Expand Down Expand Up @@ -577,6 +553,9 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C
}

@computed get plot() {
if (!this.highlightedRow) {
this.highlightedRow = this.filteredData[0];
}
if (this.filteredData.length === 0 || !this.highlightedRow) {
return <span></span>;
}
Expand Down Expand Up @@ -645,7 +624,6 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C
}
/>
);
// }

return (
<div
Expand Down Expand Up @@ -788,11 +766,6 @@ export default class GenericAssayCategoricalEnrichmentsContainer extends React.C
);
}

const data: any[] = getGenericAssayScatterData(this.data);
const maxData: any = _.maxBy(data, d => {
return Math.ceil(Math.abs(d.x));
});

return (
<div className="clearfix" style={{ display: 'flex' }}>
<div style={{ width: '900px' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ export default class GenericAssayCategoricalEnrichmentsTable extends React.Compo
data={this.props.data}
initialSortColumn={this.props.initialSortColumn}
onRowClick={
this.props.onEntityClick ? this.onRowClick : undefined
// this.props.onEntityClick ? this.onRowClick : undefined
this.onRowClick
}
dataStore={this.props.dataStore}
/>
Expand Down

0 comments on commit ef4a91e

Please sign in to comment.