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

Restructuring Genomic Data Loaders #287

Open
wants to merge 5 commits into
base: unstable
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion packages/pathway-mapper/dist/index.es5.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ export default class EditorActionsManager {
getGenomicDataSVG(node: any): any;
getOncoprintDataSVG(node: any): any;
removeGenomicData(): void;
addGenomicData(genomicData: any): void;
addGenomicData(genomicData: any, isFromPortal: boolean, groupID?: any, activeGroups?: any[]): void;
adjustVisibilityShareDB(profileId: string, isEnabled: boolean): void;
addToProfiles(profileId: string): void;
addPortalGenomicData(genomicData: any, groupID: any, activeGroups?: any[]): void;
shareDBGenomicDataHandler(op: any): void;
shareDBGenomicDataGroupChangeHandler(op: any): void;
shareDBGenomicDataVisibilityHandler(op: any): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,15 @@ export default class GenomicDataOverlayManager {
private colorScheme;
constructor(cy: any);
getEmptyGroupID(): number;
addGenomicDataLocally(genomicData: any, groupID: any): void;
preparePortalGenomicDataShareDB(genomicData: any): {
genomicDataMap: {};
visibilityMap: {};
};
addGenomicDataLocally(genomicData: any, groupID: any, isFromPortal: boolean, activeGroups?: any[]): void;
addGenomicData(data: any): void;
removeGenomicVisData(): void;
addGenomicDataWithGeneSymbol(geneSymbol: any, data: any): void;
addGenomicGroupData(groupID: any, data: any): void;
addPortalGenomicData(data: any, groupID: any, groupsToBeRendered?: any): void;
clearAllGenomicData: () => void;
removeGenomicData(): void;
removeGenomicDataWithGeneSymbol(geneSymbol: any): void;
addGenomicVisData(key: any, data: any): void;
prepareGenomicDataShareDB: (genomicData: any) => {
genomicDataMap: {};
visibilityMap: {};
};
updateGenomicDataVisibility: (_key: any, isVisible: any) => void;
hideGenomicData: () => void;
countVisibleGenomicDataByType(): number;
Expand All @@ -42,7 +33,10 @@ export default class GenomicDataOverlayManager {
showGenomicData(resizeNodeCallback?: (node: any) => void): void;
generateHTMLContentForComparisonNodeTooltip(ele: any, groupsToBeRendered: any): JQuery<HTMLElement>;
showGroupComparisonData(groupsToBeRendered: any[], resizeNodeCallback?: (node: any) => void): void;
parseGenomicData(genomicData: any, groupID: any): void;
prepareGenomicData: (genomicData: any, groupID: any, isCollaborative: boolean, isFromPortal: boolean) => {
genomicDataMap: any;
visibilityMap: any;
};
registerObserver(observer: any): void;
notifyObservers(): void;
getAlterationCountForPatient(geneData: any): number;
Expand Down
4 changes: 2 additions & 2 deletions packages/pathway-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"cytoscape-fcose": "github:iVis-at-Bilkent/cytoscape.js-fcose#unstable",
"cytoscape-grid-guide": "github:iVis-at-Bilkent/cytoscape.js-grid-guide#unstable",
"cytoscape-layout-utilities": "github:iVis-at-Bilkent/cytoscape.js-layout-utilities#unstable",
"cytoscape-navigator": "^2.0.2",
"cytoscape-navigator": "^1.3.3",
"cytoscape-node-editing": "github:iVis-at-Bilkent/cytoscape.js-node-editing#unstable",
"cytoscape-panzoom": "~2.5.3",
"cytoscape-panzoom": "~2.5.2",
"cytoscape-popper": "^2.0.0",
"cytoscape-undo-redo": "github:iVis-at-Bilkent/cytoscape.js-undo-redo#unstable",
"cytoscape-view-utilities": "github:iVis-at-Bilkent/cytoscape.js-view-utilities#unstable",
Expand Down
92 changes: 44 additions & 48 deletions packages/pathway-mapper/src/managers/EditorActionsManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1797,34 +1797,52 @@ export default class EditorActionsManager {

}

addGenomicData(genomicData: any)
{
const groupID = this.getEmptyGroupID();

if(this.isCollaborative)
{
var parsedGenomicData = this.genomicDataOverlayManager.prepareGenomicDataShareDB(genomicData);
this.shareDBManager.addGenomicData(parsedGenomicData.genomicDataMap);
this.shareDBManager.groupGenomicData(Object.keys(parsedGenomicData.visibilityMap),
groupID);

let currentVisibleGenomicDataCount = this.genomicDataOverlayManager.countVisibleGenomicDataByType();
Object.keys(parsedGenomicData.visibilityMap).forEach(study => {
if (parsedGenomicData.visibilityMap[study] && (currentVisibleGenomicDataCount >= 6)) {
parsedGenomicData.visibilityMap[study] = false;
}
else if(parsedGenomicData.visibilityMap[study]) {
currentVisibleGenomicDataCount++;
}
addGenomicData(genomicData: any, isFromPortal: boolean, groupID?: any, activeGroups?: any[])
{
if (!isFromPortal) {
groupID = this.getEmptyGroupID();
}

if (this.isCollaborative) {
var parsedGenomicData = this.genomicDataOverlayManager.prepareGenomicData(
genomicData,
null,
this.isCollaborative,
isFromPortal
);
this.shareDBManager.addGenomicData(parsedGenomicData.genomicDataMap);
this.shareDBManager.groupGenomicData(
Object.keys(parsedGenomicData.visibilityMap),
groupID
);

if (!isFromPortal) {
let currentVisibleGenomicDataCount =
this.genomicDataOverlayManager.countVisibleGenomicDataByType();
Object.keys(parsedGenomicData.visibilityMap).forEach((study) => {
if (
parsedGenomicData.visibilityMap[study] &&
currentVisibleGenomicDataCount >= 6
) {
parsedGenomicData.visibilityMap[study] = false;
} else if (parsedGenomicData.visibilityMap[study]) {
currentVisibleGenomicDataCount++;
}
});

this.shareDBManager.addGenomicVisibilityData(parsedGenomicData.visibilityMap);
}
else
{
this.genomicDataOverlayManager.addGenomicDataLocally(genomicData, groupID);
}

this.shareDBManager.addGenomicVisibilityData(
parsedGenomicData.visibilityMap
);
} else {
if (activeGroups !== undefined) {
this.genomicDataOverlayManager.addGenomicDataLocally(genomicData, groupID, isFromPortal, activeGroups);
} else {
this.genomicDataOverlayManager.addGenomicDataLocally(genomicData, groupID, isFromPortal);
}

}
}
}

adjustVisibilityShareDB(profileId: string, isEnabled: boolean){
const targetProfileIndex = this.profiles.map(profile => profile.profileId).indexOf(profileId);
Expand All @@ -1846,28 +1864,6 @@ export default class EditorActionsManager {
});
}

addPortalGenomicData(genomicData: any, groupID: any, activeGroups?: any[])
{

if(this.isCollaborative)
{
var parsedGenomicData = this.genomicDataOverlayManager.preparePortalGenomicDataShareDB(genomicData);
this.shareDBManager.addGenomicData(parsedGenomicData.genomicDataMap);
this.shareDBManager.groupGenomicData(Object.keys(parsedGenomicData.visibilityMap),
groupID);
this.shareDBManager.addGenomicVisibilityData(parsedGenomicData.visibilityMap);
}
else
{
if( activeGroups !== undefined){
this.genomicDataOverlayManager.addPortalGenomicData(genomicData, groupID, activeGroups);
}
else {
this.genomicDataOverlayManager.addPortalGenomicData(genomicData, groupID);
}
}
}

shareDBGenomicDataHandler(op: any)
{
var isRemove = Object.keys(op)[1] === 'od';
Expand Down
Loading