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

Made the transcript summary URL configurable in the mutations tab #2885

Merged
merged 1 commit into from
Nov 20, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"react-markdown": "^3.4.1",
"react-mfb": "^0.6.0",
"react-motion": "^0.4.7",
"react-mutation-mapper": "^0.3.0",
"react-mutation-mapper": "^0.3.1",
"react-overlays": "0.7.4",
"react-portal": "^4.2.0",
"react-rangeslider": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export interface IServerConfig {
default_cross_cancer_study_session_id: string | null;
study_view: StudyView;
uniprot_id_url: string | null;
ensembl_transcript_url: string | null;
studiesWithGermlineConsentedSamples: string[] | undefined;
mdacc_heatmap_study_meta_url: string | null;
mdacc_heatmap_study_url: string | null;
Expand Down
3 changes: 3 additions & 0 deletions src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ const ServerConfigDefaults: Partial<IServerConfig> = {
uniprot_id_url:
'https://www.uniprot.org/uniprot/?query=accession:<%= swissProtAccession %>&format=tab&columns=entry+name',

ensembl_transcript_url:
'http://grch37.ensembl.org/homo_sapiens/Transcript/Summary?t=<%= transcriptId %>',

query_product_limit: 1000000,

skin_show_gsva: false,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/resultsView/mutation/Mutations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {observer} from "mobx-react";
import {MSKTabs, MSKTab} from "shared/components/MSKTabs/MSKTabs";
import {ResultsViewPageStore} from "../ResultsViewPageStore";
import ResultsViewMutationMapper from "./ResultsViewMutationMapper";
import {convertToMutationMapperProps} from "shared/components/mutationMapper/MutationMapperConfig";
import MutationMapperUserSelectionStore from "shared/components/mutationMapper/MutationMapperUserSelectionStore";
import {observable} from "mobx";
import AppConfig from 'appConfig';
Expand Down Expand Up @@ -108,6 +109,7 @@ export default class Mutations extends React.Component<IMutationsPageProps, {}>
/>
</div>
<ResultsViewMutationMapper
{...convertToMutationMapperProps(AppConfig.serverConfig)}
store={mutationMapperStore}
trackVisibility={this.userSelectionStore.trackVisibility}
discreteCNACache={this.props.store.discreteCNACache}
Expand All @@ -119,7 +121,6 @@ export default class Mutations extends React.Component<IMutationsPageProps, {}>
genomeNexusMyVariantInfoCache={this.props.store.genomeNexusMyVariantInfoCache}
pdbHeaderCache={this.props.store.pdbHeaderCache}
myCancerGenomeData={this.props.store.myCancerGenomeData}
config={AppConfig.serverConfig}
userEmailAddress={this.props.appStore.userName!}
/>
</MSKTab>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/resultsView/mutation/ResultsViewMutationMapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ export default class ResultsViewMutationMapper extends MutationMapper<IResultsVi
civicGenes={this.props.store.civicGenes}
civicVariants={this.props.store.civicVariants}
userEmailAddress={this.props.userEmailAddress}
enableOncoKb={this.props.config.show_oncokb}
enableFunctionalImpact={this.props.config.show_genomenexus}
enableHotspot={this.props.config.show_hotspot}
enableMyCancerGenome={this.props.config.mycancergenome_show}
enableCivic={this.props.config.show_civic}
enableOncoKb={this.props.enableOncoKb}
enableFunctionalImpact={this.props.enableGenomeNexus}
enableHotspot={this.props.enableHotspot}
enableMyCancerGenome={this.props.enableMyCancerGenome}
enableCivic={this.props.enableCivic}
totalNumberOfExons={this.totalExonNumber}
/>
);
Expand Down
28 changes: 14 additions & 14 deletions src/pages/staticPages/tools/mutationMapper/MutationMapperTool.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as React from 'react';
import { inject, observer } from "mobx-react";
import {action, computed, observable} from "mobx";
import {bind} from "bind-decorator";
import autobind from 'autobind-decorator';
import {Collapse} from 'react-collapse';
import {ControlLabel, FormControl, FormGroup} from "react-bootstrap";
import {PageLayout} from "shared/components/PageLayout/PageLayout";
import Helmet from "react-helmet";

import Loader from "shared/components/loadingIndicator/LoadingIndicator";
import {MSKTab, MSKTabs} from "shared/components/MSKTabs/MSKTabs";
import {convertToMutationMapperProps} from "shared/components/mutationMapper/MutationMapperConfig";
import MutationMapperUserSelectionStore from "shared/components/mutationMapper/MutationMapperUserSelectionStore";
import {parseInput} from "shared/lib/MutationInputParser";

import StandaloneMutationMapper from "./StandaloneMutationMapper";
import MutationMapperToolStore from "./MutationMapperToolStore";

import AppConfig from "appConfig";
import autobind from 'autobind-decorator';

interface IMutationMapperToolProps {
routing: any;
Expand Down Expand Up @@ -374,6 +374,7 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
tabs.push(
<MSKTab key={gene} id={gene} linkText={gene}>
<StandaloneMutationMapper
{...convertToMutationMapperProps(AppConfig.serverConfig)}
store={mutationMapperStore}
trackVisibility={this.userSelectionStore.trackVisibility}
downloadDataFetcher={this.store.downloadDataFetcher}
Expand All @@ -382,7 +383,6 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
pubMedCache={this.store.pubMedCache}
pdbHeaderCache={this.store.pdbHeaderCache}
myCancerGenomeData={this.store.myCancerGenomeData}
config={AppConfig.serverConfig}
showTranscriptDropDown={true}
showOnlyAnnotatedTranscriptsInDropdown={!this.store.hasInputWithProteinChanges}
/>
Expand All @@ -394,7 +394,7 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
return tabs;
}

@bind
@autobind
@action
protected handleFileSelect(e: any)
{
Expand All @@ -411,7 +411,7 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
}
}

@bind
@autobind
@action
protected fileLoadEndHandler(e: any)
{
Expand All @@ -424,14 +424,14 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
}
}

@bind
@autobind
@action
protected handleInputChange(e: any)
{
this.inputText = e.target.value;
}

@bind
@autobind
@action
protected handleTabChange(id: string|undefined) {
// update the hash if routing exits
Expand All @@ -444,7 +444,7 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
}
}

@bind
@autobind
@action
protected handleModifyInput()
{
Expand All @@ -455,7 +455,7 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
this.inputControlsVisible = true;
}

@bind
@autobind
@action
protected handleVisualize()
{
Expand All @@ -471,31 +471,31 @@ export default class MutationMapperTool extends React.Component<IMutationMapperT
this.inputControlsVisible = false;
}

@bind
@autobind
@action
protected handleDataFormatToggle()
{
this.dataFormatCollapsed = !this.dataFormatCollapsed;
}

@bind
@autobind
@action
protected handleLoadExamplePartiallyAnnotated()
{
this.inputText = require('raw-loader!./resources/standaloneMutationDataExample.txt');
}

@bind
@autobind
@action
protected handleLoadExampleGenomicCoordinates()
{
this.inputText = require('raw-loader!./resources/standaloneMutationDataExampleWithGenomicCoordinatesOnly.txt');
}

@bind
@autobind
@action
protected handleLoadExampleGeneAndProteinChange()
{
this.inputText = require('raw-loader!./resources/standaloneMutationDataExampleWithGeneAndProteinChangeOnly.txt');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export default class StandaloneMutationMapper extends MutationMapper<IStandalone
myCancerGenomeData={this.props.myCancerGenomeData}
hotspotData={this.props.store.indexedHotspotData}
oncoKbData={this.props.store.oncoKbData}
enableOncoKb={this.props.config.show_oncokb}
enableFunctionalImpact={this.props.config.show_genomenexus}
enableHotspot={this.props.config.show_hotspot}
enableMyCancerGenome={this.props.config.mycancergenome_show}
enableOncoKb={this.props.enableOncoKb}
enableFunctionalImpact={this.props.enableGenomeNexus}
enableHotspot={this.props.enableHotspot}
enableMyCancerGenome={this.props.enableMyCancerGenome}
enableCivic={false}
/>
);
Expand Down
28 changes: 12 additions & 16 deletions src/shared/components/mutationMapper/MutationMapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ import WindowStore from "../window/WindowStore";

import styles from "./mutationMapper.module.scss";

export interface IMutationMapperConfig {
show_oncokb?: boolean;
show_genomenexus?: boolean;
show_hotspot?: boolean;
mycancergenome_show?: boolean;
show_civic?: boolean;
isoformOverrideSource?: string;
mygene_info_url: string | null;
uniprot_id_url: string | null;
genomenexus_url: string | null;
oncokb_public_api_url: string | null;
}

export interface IMutationMapperProps {
store: MutationMapperStore;
trackVisibility?: TrackVisibility;
Expand All @@ -56,19 +43,28 @@ export interface IMutationMapperProps {
showPlotDownloadControls?: boolean;
mutationTable?: JSX.Element;
pubMedCache?: PubMedCache;
genomeNexusUrl?: string;
showTranscriptDropDown?: boolean;
showOnlyAnnotatedTranscriptsInDropdown?: boolean;
filterMutationsBySelectedTranscript?: boolean;
isoformOverrideSource?: string;
mainLoadingIndicator?: JSX.Element;
geneSummaryLoadingIndicator?: JSX.Element;
config: IMutationMapperConfig;
studyId?: string;
myCancerGenomeData?: IMyCancerGenomeData;
pdbHeaderCache?: PdbHeaderCache;
oncoKbEvidenceCache?:OncoKbEvidenceCache;
genomeNexusCache?:GenomeNexusCache;
// server config properties
genomeNexusUrl?: string;
oncoKbPublicApiUrl?: string;
isoformOverrideSource?: string;
myGeneInfoUrlTemplate?: string;
uniprotIdUrlTemplate?: string;
transcriptSummaryUrlTemplate?: string;
enableOncoKb?: boolean;
enableGenomeNexus?: boolean;
enableHotspot?: boolean;
enableMyCancerGenome?: boolean;
enableCivic?: boolean;
}

@observer
Expand Down
33 changes: 33 additions & 0 deletions src/shared/components/mutationMapper/MutationMapperConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {IMutationMapperProps} from "./MutationMapper";

// This is a subset of IServerConfig containing config values used only in Mutation Mapper
export interface IMutationMapperConfig {
show_oncokb?: boolean;
show_genomenexus?: boolean;
show_hotspot?: boolean;
mycancergenome_show?: boolean;
show_civic?: boolean;
isoformOverrideSource?: string;
mygene_info_url: string | null;
uniprot_id_url: string | null;
ensembl_transcript_url: string | null;
genomenexus_url: string | null;
oncokb_public_api_url: string | null;
}

export function convertToMutationMapperProps(config: IMutationMapperConfig): Partial<IMutationMapperProps>
{
return {
genomeNexusUrl: config.genomenexus_url || undefined,
oncoKbPublicApiUrl: config.oncokb_public_api_url || undefined,
isoformOverrideSource: config.isoformOverrideSource,
myGeneInfoUrlTemplate: config.mygene_info_url || undefined,
uniprotIdUrlTemplate: config.uniprot_id_url || undefined,
transcriptSummaryUrlTemplate: config.ensembl_transcript_url || undefined,
enableOncoKb: config.show_oncokb,
enableGenomeNexus: config.show_genomenexus,
enableHotspot: config.show_hotspot,
enableMyCancerGenome: config.mycancergenome_show,
enableCivic: config.show_civic
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
} from "shared/lib/MutationUtils";
import {defaultOncoKbIndicatorFilter} from "shared/lib/OncoKbUtils";

import {IMutationMapperConfig} from "./MutationMapper";
import {IMutationMapperConfig} from "./MutationMapperConfig";
import autobind from "autobind-decorator";
import {normalizeMutation, normalizeMutations} from "./MutationMapperUtils";

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12623,10 +12623,10 @@ react-motion@^0.5.2:
prop-types "^15.5.8"
raf "^3.1.0"

react-mutation-mapper@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/react-mutation-mapper/-/react-mutation-mapper-0.3.0.tgz#145db33bbfd29a112d36a7f425e565247c37e6d5"
integrity sha512-H1mX5awL9bS8/9x9ARxz7fHp8MxclexGq/I8Bimkn8+y1bv2mgi7ubLtNjcAqAMpqyMqm8Jw0lb0tyhvaK9LaQ==
react-mutation-mapper@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/react-mutation-mapper/-/react-mutation-mapper-0.3.1.tgz#a7cb97b5babd2f8001f74b927c3b986ff5f1085e"
integrity sha512-4eNNt7IPJTsbIzJrPiL471wIvGiG8xGG2lWqwld+TYOK8C7cqcit4BOjz7mkngPLix/CcanflPQQnnH/cCtDsg==
dependencies:
autobind-decorator "^2.4.0"
cbioportal-frontend-commons "^0.0.23"
Expand Down