Skip to content

Commit

Permalink
Undefined percentage iVis-at-Bilkent#288
Browse files Browse the repository at this point in the history
  • Loading branch information
gorkemsolun committed Aug 25, 2023
1 parent add9492 commit 6043de9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 44 deletions.
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 @@ -33,7 +33,7 @@ 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, isCollaborative: boolean, isFromPortal: boolean) => {
prepareGenomicData: (genomicData: any, groupID: any, isCollaborative: boolean, isFromPortal: boolean) => {
genomicDataMap: any;
visibilityMap: any;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/pathway-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"cytoscape-layout-utilities": "github:iVis-at-Bilkent/cytoscape.js-layout-utilities#unstable",
"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
58 changes: 19 additions & 39 deletions packages/pathway-mapper/src/managers/GenomicDataOverlayManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,37 +366,34 @@ export default class GenomicDataOverlayManager {
y: eleBBox.h / 2 + overlayRecBoxH / 2 - 18,
};

const genomicFrequencyData = this.genomicDataMap[nodeLabel];

let maxGenomicDataBoxCount = /*(genomicDataBoxCount > 3) ? 3:*/ genomicDataBoxCount;
let genomicBoxCounter = 0;

for (let i in this.groupedGenomicDataMap) {
for (let j in this.groupedGenomicDataMap[i]) {
const cancerType = this.groupedGenomicDataMap[i][j];
if (!this.visibleGenomicDataMapByType[cancerType]) {
if (!this.visibleGenomicDataMapByType[this.groupedGenomicDataMap[i][j]]) {
continue;
}

genomicDataRectangleGenerator(
overLayRectBBox.x +
(genomicBoxCounter * overLayRectBBox.w) / maxGenomicDataBoxCount,
overLayRectBBox.y,
overLayRectBBox.w / maxGenomicDataBoxCount,
overLayRectBBox.h,
genomicFrequencyData[cancerType] !== undefined ? genomicFrequencyData[cancerType] : null,
svg,
this.colorScheme
);
if (!this.genomicDataMap[nodeLabel][this.groupedGenomicDataMap[i][j]]) {
this.genomicDataMap[nodeLabel][this.groupedGenomicDataMap[i][j]] = "0.00";
}
genomicDataRectangleGenerator(
overLayRectBBox.x +
(genomicBoxCounter * overLayRectBBox.w) / maxGenomicDataBoxCount,
overLayRectBBox.y,
overLayRectBBox.w / maxGenomicDataBoxCount,
overLayRectBBox.h,
this.genomicDataMap[nodeLabel][this.groupedGenomicDataMap[i][j]],
svg,
this.colorScheme
);

genomicBoxCounter++;
}
}
return svg;
}
generateSVGForGroupComparisonNode(ele, groupsToBeRendered? ) {
const genomicDataBoxCount = 0;

// Experimental data overlay part !
const dataURI = "data:image/svg+xml;utf8,";
const svgNameSpace = "http://www.w3.org/2000/svg";
Expand Down Expand Up @@ -431,42 +428,25 @@ export default class GenomicDataOverlayManager {
let maxGenomicDataBoxCount = groupsToBeRendered.length;
let genomicBoxCounter = 0;

/* for (let i in this.groupComparisonData) {
if( i !== nodeLabel)
continue;*/
let i = nodeLabel;
for (let j in this.groupComparisonData[i]) {
const percentageInGroup = this.groupComparisonData[i][j];
if (percentageInGroup !== undefined && i === nodeLabel) {
if (!this.groupComparisonData[i][j]) {
this.groupComparisonData[i][j] = 0;
}
if (i === nodeLabel) {
genomicDataRectangleGenerator(
overLayRectBBox.x +
(genomicBoxCounter * overLayRectBBox.w) / maxGenomicDataBoxCount,
overLayRectBBox.y,
(overLayRectBBox.w ) / maxGenomicDataBoxCount - 2,
overLayRectBBox.h,
percentageInGroup,
this.groupComparisonData[i][j],
svg,
this.colorScheme,
groupsToBeRendered[genomicBoxCounter].color
);
genomicBoxCounter++;
} else if( i === nodeLabel ){
genomicDataRectangleGenerator(
overLayRectBBox.x +
(genomicBoxCounter * overLayRectBBox.w) / maxGenomicDataBoxCount,
overLayRectBBox.y,
(overLayRectBBox.w ) / maxGenomicDataBoxCount - 4,
overLayRectBBox.h,
0,
svg,
this.colorScheme,
groupsToBeRendered[genomicBoxCounter].color
);
genomicBoxCounter++;
}



}
return svg;
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5447,7 +5447,7 @@ cytoscape-navigator@^1.3.3:
version "3.2.1"
resolved "https://codeload.github.com/iVis-at-Bilkent/cytoscape.js-node-editing/tar.gz/2ea4f63a0da8f13b5e7462d2380e48964d9c042f"

cytoscape-panzoom@~2.5.3:
cytoscape-panzoom@~2.5.2:
version "2.5.3"
resolved "https://registry.yarnpkg.com/cytoscape-panzoom/-/cytoscape-panzoom-2.5.3.tgz#edf041b5aa8be1cbe3c001f16a8b2193b46127a7"
integrity sha512-//qLOqbbFUCGddarNKHDZArItOJHgnkQ1TvxI9nV2/8aOOl/5wuEOHmra3fL/aWSjB4AYpYTG4LX7w96uWfRTQ==
Expand Down

0 comments on commit 6043de9

Please sign in to comment.