Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct use of case list by gene set hierarchy selector component #4158

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/shared/components/query/GenesetsHierarchySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import GenesetsHierarchyFilterForm, {
validPercentile,
} from './GenesetsHierarchyFilterForm';
import { getServerConfig } from 'config/config';
import { SampleList } from 'cbioportal-ts-api-client';

export interface GenesetsHierarchySelectorProps {
initialSelection: string[];
gsvaProfile: string;
sampleListId: string | undefined;
sampleList: SampleList | undefined;
onSelect: (map_geneSet_selected: ObservableMap<string, boolean>) => void;
}

Expand Down Expand Up @@ -47,6 +48,20 @@ export default class GenesetsHierarchySelector extends React.Component<
render() {
return (
<div>
<div style={{ marginBottom: 15 }}>
<text>
Selected sample set:{' '}
<i>
{this.props.sampleList?.name} (
{this.props.sampleList?.sampleCount})
</i>
</text>
<br />
<text>
The outcome of score-based selection depends on the
geneset scores of samples included in the analysis.
</text>
</div>
<text>Search hierarchy</text>
<div
className={`form-group has-feedback input-group-sm`}
Expand Down Expand Up @@ -79,7 +94,7 @@ export default class GenesetsHierarchySelector extends React.Component<
pvalueThreshold={this.pvalueThreshold}
percentile={this.percentile}
gsvaProfile={this.props.gsvaProfile}
sampleListId={this.props.sampleListId}
sampleListId={this.props.sampleList?.sampleListId}
searchValue={this.searchValue}
onSelect={this.props.onSelect}
/>
Expand Down
4 changes: 1 addition & 3 deletions src/shared/components/query/GenesetsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ export default class GenesetsSelector extends QueryStoreComponent<
'GENESET_SCORE'
)[0].molecularProfileId
}
sampleListId={
this.store.defaultSelectedSampleListId
}
sampleList={this.store.selectedSampleList}
onSelect={map_geneset_selected => {
this.store.applyGenesetSelection(
map_geneset_selected
Expand Down
9 changes: 8 additions & 1 deletion src/shared/components/query/QueryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,13 @@ export class QueryStore {
this._selectedSampleListId = value;
}

@computed
public get selectedSampleList() {
return this.selectedSampleListId
? this.dict_sampleListId_sampleList[this.selectedSampleListId]
: undefined;
}

@observable caseIds = '';

// this variable is used to set set custom case ids if the query is a shared virtual study query
Expand Down Expand Up @@ -1759,7 +1766,7 @@ export class QueryStore {
Number(this.volcanoPlotSelectedPercentile.value),
0,
1,
this.defaultSelectedSampleListId
this.selectedSampleListId
);
return hierarchyData;
},
Expand Down