Skip to content

Commit

Permalink
Merge stable version for Cbioportal
Browse files Browse the repository at this point in the history
  • Loading branch information
msalihaltun committed Jan 12, 2021
2 parents ca4b9c7 + 921401e commit 36c2c6c
Show file tree
Hide file tree
Showing 35 changed files with 11,073 additions and 7,322 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ PathwayMapper is a web based pathway curation tool for interactive creation, edi
<img src="assets/sample-screenshot.png" width="600"/>
</p>

A special, viewer edition of PathwayMapper was built for use in cBioPortal ([example](https://www.cbioportal.org/results/pathways?Action=Submit&Z_SCORE_THRESHOLD=1.0&cancer_study_id=gbm_tcga_pub&cancer_study_list=gbm_tcga_pub&case_set_id=gbm_tcga_pub_sequenced&gene_list=TP53%20MDM2%20MDM4&gene_set_choice=user-defined_list&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=gbm_tcga_pub_cna_rae&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=gbm_tcga_pub_mutations), [tutorial](https://www.cbioportal.org/tutorials)).
<p align="center">
<img src="assets/sample-screenshot-cBioPortal.png" width="600"/>
</p>

Below is a video tutorial on basics of PathwayMapper:
<a href="https://youtu.be/jvEueUqZZPI" target="_blank"><p align="center"><img src="assets/basics-of-PM.jpg" width="340" title="Click to watch video"/></p></a>

Expand Down Expand Up @@ -260,7 +265,7 @@ Icons made by [Freepik](http://www.freepik.com),

## Team

* [Ziya Erkoc](https://github.com/Rgtemze), [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis), [Ozgun Babur](https://github.com/ozgunbabur) of OHSU, and Konnor C. La, [Jianjiong Gao](https://github.com/jjgao), Nikolaus Schultz of [The Nikolaus Schultz lab at MSKCC](https://www.mskcc.org/research-areas/labs/nikolaus-schultz).
* [Ziya Erkoc](https://github.com/Rgtemze), [Ugur Dogrusoz](https://github.com/ugurdogrusoz) of [i-Vis at Bilkent University](http://www.cs.bilkent.edu.tr/~ivis), [Ozgun Babur](https://github.com/ozgunbabur) of OHSU, and [S. Onur Sumer](https://github.com/onursumer), Konnor C. La, [Jianjiong Gao](https://github.com/jjgao), Nikolaus Schultz of [The Nikolaus Schultz lab at MSKCC](https://www.mskcc.org/research-areas/labs/nikolaus-schultz).

#### Alumni

Expand Down
Binary file added assets/sample-screenshot-cBioPortal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<!-- TODO this is a quick fix for the excluded 3rd party css dependencies, it is probably not a good idea to have direct references to github cdn -->
<link rel="stylesheet" href="https://cdn.rawgit.com/cytoscape/cytoscape.js-panzoom/master/cytoscape.js-panzoom.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/cytoscape/cytoscape.js-navigator/master/cytoscape.js-navigator.css">
<link href="./base.css?96ffa502a2d64c3c1fe4" rel="stylesheet"></head>
<link href="./base.css?6d5c79b49d0b53c6b522" rel="stylesheet"></head>

<body class="pathwayMapper">
<div>
<div id="app"></div>
</div>
<script type="text/javascript" src="react-pathway-mapper.es5.js?96ffa502a2d64c3c1fe4"></script></body>
<script type="text/javascript" src="react-pathway-mapper.es5.js?6d5c79b49d0b53c6b522"></script></body>

</html>
1 change: 1 addition & 0 deletions dist/managers/EditorActionsManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default class EditorActionsManager {
updateVisibility(ele: any, isHidden: boolean): void;
updateElementCallback(op: any): void;
getGenomicDataSVG(node: any): any;
getOncoprintDataSVG(node: any): any;
removeGenomicData(): void;
addGenomicData(genomicData: any): void;
adjustVisibilityShareDB(profileId: string, isEnabled: boolean): void;
Expand Down
2 changes: 1 addition & 1 deletion dist/managers/FileOperationsManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface IPathwayInfo {
export default class FileOperationsManager {
pathwayInfo: IPathwayInfo;
constructor();
readonly getPathwayInfo: IPathwayInfo;
get getPathwayInfo(): IPathwayInfo;
setPathwayInfo(other: IPathwayInfo): void;
b64toBlob(b64Data: any, contentType: any, sliceSize?: number): Blob;
saveAsJPEG(cy: any): void;
Expand Down
10 changes: 10 additions & 0 deletions dist/managers/GenomicDataOverlayManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// <reference types="jquery" />
export default class GenomicDataOverlayManager {
genomicDataMap: {};
visibleGenomicDataMapByType: {};
groupedGenomicDataCount: number;
groupedGenomicDataMap: {};
patientData: any;
private DEFAULT_VISIBLE_GENOMIC_DATA_COUNT;
private MAX_VISIBLE_GENOMIC_DATA_COUNT;
private observers;
Expand Down Expand Up @@ -36,4 +38,12 @@ export default class GenomicDataOverlayManager {
parseGenomicData(genomicData: any, groupID: any): void;
registerObserver(observer: any): void;
notifyObservers(): void;
getAlterationCountForPatient(geneData: any): number;
showPatientData(): void;
getOncoprintColors(selectedGene: any): any;
generateSVGForPatientNode(ele: any, patientData: any): any;
generateOncoprintForPatientNode(ele: any): any;
getCNADisplayString(alterationTypeKey: number): string;
generateSvgIconForSample(iconColor: string, iconText: string): string;
generateHTMLContentForNodeTooltip(ele: any, patientData: any): JQuery<HTMLElement>;
}
1 change: 1 addition & 0 deletions dist/managers/QtipManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="jquery" />
import EditorActionsManager from "./EditorActionsManager";
export default class QtipManager {
private cy;
Expand Down
2 changes: 2 additions & 0 deletions dist/modals/CBioHelpModal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { EModalType } from '../ui/react-pathway-mapper';
interface ICBioHelpModalProps {
isModalShown: boolean;
handleClose: (modalId: EModalType) => void;
patientView?: boolean;
}
export default class CBioHelpModal extends React.Component<ICBioHelpModalProps> {
constructor(props: ICBioHelpModalProps);
generateOncoprintLegend(): SVGSVGElement;
render(): JSX.Element;
}
export {};
2 changes: 1 addition & 1 deletion dist/modals/ProfilesModal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface IProfilesModalProps {
}
export default class ProfilesModal extends React.Component<IProfilesModalProps, {}> {
constructor(props: IProfilesModalProps);
readonly profileEnabledMap: {};
get profileEnabledMap(): {};
render(): JSX.Element;
}
export {};
17,243 changes: 10,054 additions & 7,189 deletions dist/react-pathway-mapper.es5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-pathway-mapper.es5.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/ui/Ranking.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface IRankingProps {
pathwayActions: PathwayActions;
bestPathwaysAlgos: any[][];
tableComponent: (data: IPathwayMapperTable[], selectedPathway: string, onPathwaySelect: (pathway: string) => void) => JSX.Element;
patientView?: boolean;
}
export default class Ranking extends React.Component<IRankingProps, {}> {
bestPathways: any[];
Expand All @@ -14,7 +15,7 @@ export default class Ranking extends React.Component<IRankingProps, {}> {
isAlterationEnabled: number;
isExpanded: boolean;
readonly COUNT_PERC_EXPLANATION = "Whether we should favor the number of genes of interest matching the ones in a pathway or the percentage of such genes in that pathway. For instance, suppose genes of interest are A, B, and C, and the pathway contains genes B, C, D, and E. When we consider count, the score is 2 (for the two genes that match). However, when we consider percentage the score will be 50% as 2 of the 4 genes in the pathway are among genes of interest.";
readonly ALTERATION_EXPLANATION = "When this is checked, each matching gene will not directly contribute to the score as 1 unit but with the alteration frequency percentage of that gene. For instance, suppose genes of interest are A, B, and C with alteration frequencies of 0.5, 0.2, and 0.3, respectively, and the pathway contains genes B, C, D, and E. When this is option isn't checked, the score will be 2 for match count and %50 for the match percentage. However, when this option is checked, the scores will be 0.2+0.3=0.5 and (0.2+0.3)/4=%12.5 for match count and percentage, respectively.";
readonly ALTERATION_EXPLANATION = "When this is checked, each matching gene will not directly contribute to the score as 1 unit but with the alteration frequency percentage of that gene. For instance, suppose genes of interest are A, B, and C with alteration frequencies of 0.5, 0.2, and 0.3, respectively, and the pathway contains genes B, C, D, and E. When this is option isn't checked, the score will be 2 for match count and 50% for the match percentage. However, when this option is checked, the scores will be 0.2+0.3=0.5 and (0.2+0.3)/4=12.5% for match count and percentage, respectively.";
constructor(props: IRankingProps);
setBestPathwayMethod(i: number): void;
onPathwayClick(pathway: string): void;
Expand Down
3 changes: 2 additions & 1 deletion dist/ui/Toolbar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ interface IToolbarProps {
handleOpen: (modalId: number) => void;
genes: any[];
validGenes: any;
toast: any;
showMessage: (message: string) => void;
pathwayGenes: string[];
onAddGenes: (selectedGenes: string[]) => void;
patientView?: boolean;
}
export default class Toolbar extends React.Component<IToolbarProps, {}> {
selectedGenes: string[];
Expand Down
22 changes: 21 additions & 1 deletion dist/ui/react-pathway-mapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import EditorActionsManager from "../managers/EditorActionsManager";
import FileOperationsManager from '../managers/FileOperationsManager';
import PathwayActions from '../utils/PathwayActions';
import CBioPortalAccessor from '../utils/CBioPortalAccessor';
import { IGeneticAlterationRuleSetParams } from 'oncoprintjs';
import ViewOperationsManager from '../managers/ViewOperationsManager';
import GridOptionsManager from '../managers/GridOptionsManager';
import "../css/pmv1.css";
Expand All @@ -13,6 +14,7 @@ interface IPathwayMapperProps {
genes: any[];
isCollaborative?: boolean;
cBioAlterationData?: ICBioData[];
sampleIconData?: ISampleIconData;
pathwayName?: string;
alterationData?: IAlterationData;
onAddGenes?: (selectedGenes: string[]) => void;
Expand All @@ -21,12 +23,25 @@ interface IPathwayMapperProps {
tableComponent?: (data: IPathwayMapperTable[], selectedPathway: string, onPathwaySelect: (pathway: string) => void) => JSX.Element;
validGenes?: any;
toast: any;
showMessage: (message: string) => void;
patientView?: boolean;
messageBanner?: () => JSX.Element;
}
export interface ICBioData {
altered: number;
gene: string;
percentAltered: string;
sequenced: number;
geneticTrackData?: any[];
geneticTrackRuleSetParams?: IGeneticAlterationRuleSetParams;
}
export interface ISampleIconData {
sampleIndex: {
[s: string]: number;
};
sampleColors: {
[s: string]: string;
};
}
export declare enum EModalType {
STUDY = 0,
Expand Down Expand Up @@ -75,6 +90,7 @@ export default class PathwayMapper extends React.Component<IPathwayMapperProps,
isModalShown: boolean[];
portalAcessor: CBioPortalAccessor;
alterationData: IAlterationData;
patientData: any[][];
pathwayGeneMap: {
[key: string]: {
[key: string]: string;
Expand All @@ -87,7 +103,11 @@ export default class PathwayMapper extends React.Component<IPathwayMapperProps,
viewOperationsManager: ViewOperationsManager;
gridOptionsManager: GridOptionsManager;
constructor(props: IPathwayMapperProps);
setSelectedPathway(pathway: string): void;
setEditor(editor: EditorActionsManager): void;
calculateAlterationData(cBioAlterationData: ICBioData[]): void;
calculatePatientData(cBioAlterationData: ICBioData[]): void;
addSampleIconData(sampleIconData: any): void;
getGeneStudyMap(studyGeneMap: any): any;
getAlterationAveragePerGene(genomicDataMap: any): any;
/**
Expand All @@ -99,7 +119,7 @@ export default class PathwayMapper extends React.Component<IPathwayMapperProps,
includePathway(pathwayData?: IPathwayData, pathwayName?: string): void;
extractAllGenes(): void;
loadRedirectedPortalData(): void;
readonly profileEnabledMap: {};
get profileEnabledMap(): {};
doesProfileExist(profileId: string): boolean;
loadFromCBio(dataTypes: {
[dataType: string]: IDataTypeMetaData;
Expand Down
2 changes: 1 addition & 1 deletion dist/utils/PathwayActions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class PathwayActions {
merge(): void;
setOverlayUploader(inputRef: any): void;
setUploaders(inputRef: any, isMerge: boolean): void;
readonly getPathwayInfo: IPathwayInfo;
get getPathwayInfo(): IPathwayInfo;
setPathwayInfo(other: IPathwayInfo): void;
undo(): void;
redo(): void;
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pathway-mapper",
"version": "2.0.1",
"version": "2.0.3",
"description": "",
"keywords": [],
"main": "dist/react-pathway-mapper.es5.js",
Expand Down Expand Up @@ -62,8 +62,8 @@
"peerDependencies": {
"bootstrap": "^3.0.0 || ^4.0.0",
"jquery": "^1.4 || ^2.0 || ^3.0",
"mobx": "^3.0.0 || ^4.0.0 || ^5.0.0",
"mobx-react": "^4.0.0 || ^5.0.0",
"mobx": "^6.0.0",
"mobx-react": "^6.0.0",
"react": "^15.0.0 || ^16.0.0",
"react-bootstrap": "^0.30.0",
"react-dom": "^15.0.0 || ^16.0.0"
Expand All @@ -86,6 +86,7 @@
"file-saver": "^2.0.2",
"jquery-ui-dist": "^1.12.1",
"konva": "^1.6.3",
"oncoprintjs": "4.2.3",
"react-loader-spinner": "^2.3.0",
"react-scrollbar": "^0.5.6",
"react-table": "^6.10.0",
Expand Down Expand Up @@ -126,8 +127,8 @@
"jquery": "latest",
"lint-staged": "^8.0.0",
"lodash.camelcase": "^4.3.0",
"mobx": "^5.10.1",
"mobx-react": "^5.4.3",
"mobx": "^6.0.0",
"mobx-react": "^6.0.0",
"multer": "^1.4.1",
"prettier": "^1.14.3",
"prompt": "^1.0.0",
Expand All @@ -150,7 +151,7 @@
"tslint-config-standard": "^8.0.1",
"ttf-loader": "^1.0.2",
"typedoc": "^0.12.0",
"typescript": "3.2.2",
"typescript": "4.1.3",
"sharedb-mongo": "latest",
"websocket-json-stream": "0.0.3",
"ws": "latest",
Expand Down
Binary file added src/images/toolbar/PatientViewHelp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion src/managers/EditorActionsManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CBioPortalAccessor from "../utils/CBioPortalAccessor";
import SVGExporter from "../utils/SVGExporter";
import GenomicDataOverlayManager from "./GenomicDataOverlayManager";
import { IProfileMetaData, IPathwayData } from "../ui/react-pathway-mapper";
import { observable } from "mobx";
import { observable, makeObservable } from "mobx";
import LayoutProperties, { ILayoutProperties } from "../modals/LayoutProperties";

const _ = require('underscore');
Expand Down Expand Up @@ -61,6 +61,7 @@ export default class EditorActionsManager{
undoRedoManager: any, portalAccessor: CBioPortalAccessor, profiles: IProfileMetaData[])
{
// Set cy instance and set real time manager reference if collaborative mode
makeObservable(this);
this.cy = cyInst;
this.isCollaborative = isCollaborative;
this.isCbioPortal = isCBioPortal;
Expand Down Expand Up @@ -1676,6 +1677,11 @@ export default class EditorActionsManager{
return this.genomicDataOverlayManager.generateSVGForNode(node);
}

getOncoprintDataSVG(node: any)
{
return this.genomicDataOverlayManager.generateOncoprintForPatientNode(node);
}

removeGenomicData()
{
if(this.isCollaborative)
Expand Down
3 changes: 2 additions & 1 deletion src/managers/FileOperationsManager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SaveLoadUtilities from '../utils/SaveLoadUtility.js';
import {saveAs} from 'file-saver';
import EditorActionsManager from './EditorActionsManager.js';
import { observable, computed } from 'mobx';
import { observable, computed, makeObservable } from 'mobx';
import SaveLoadUtility from '../utils/SaveLoadUtility';


Expand All @@ -18,6 +18,7 @@ export default class FileOperationsManager{
pathwayInfo: IPathwayInfo;

constructor(){
makeObservable(this);
this.pathwayInfo = {pathwayTitle: "New Pathway", pathwayDetails: "", fileName: "pathway.txt"};
}

Expand Down
Loading

0 comments on commit 36c2c6c

Please sign in to comment.