Skip to content

Commit

Permalink
coloring in no GUI fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ivp08001 committed Dec 16, 2015
1 parent e0c6221 commit 943e7e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 10 additions & 5 deletions VQI_PathwayEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,20 @@ var VQI_PathwayEditor = function (parent) {
function sprayColorNoGUI(lines, obj) {
var lookup = {};
for (var i = 0, len = obj.elements.nodes.length; i < len; i++) {
lookup[obj.elements.nodes[i].data.name] = obj.elements.nodes[i].data;
if(typeof(lookup[obj.elements.nodes[i].data.name]) != "undefined")
lookup[obj.elements.nodes[i].data.name].push(obj.elements.nodes[i].data);
else
lookup[obj.elements.nodes[i].data.name] = [obj.elements.nodes[i].data];
}

for (var line = 1; line < lines.length; line++) {
for(var line = 1; line < lines.length; line++) {
var target = lines[line][0];
if (typeof (lookup[target]) != "undefined") {
lookup[target].mut = lines[line][1];
lookup[target].cnv = lines[line][2];
lookup[target].rna = lines[line][3];
for(entry in lookup[target]){
entry.mut = lines[line][1];
entry.cnv = lines[line][2];
entry.rna = lines[line][3];
}
}
}
console.log("done spraying!");
Expand Down
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
<script>
var objVQI_PathwayEditor = new VQI_PathwayEditor("parent");
function load() {
objVQI_PathwayEditor.loadPathwayExternalNoGUI(302);
objVQI_PathwayEditor.loadPathwayExternalNoGUI(331);
}
function findYue() {
objVQI_PathwayEditor.findPathAndScoreExternalYueNoGUI("n0", "n22", function (result) {
objVQI_PathwayEditor.findPathAndScoreExternalYueNoGUI("n0", "n4", function (result) {
console.log(result)
});
}
function findTham() {
objVQI_PathwayEditor.findPathAndScoreExternalThamNoGUI("n0", "n22", function (result) {
objVQI_PathwayEditor.findPathAndScoreExternalThamNoGUI("n0", "n4", function (result) {
console.log(result)
});
}
function spray() {
var data = [["AKT1", 1, 2, 3], ["AKT1", 1, 2, 3]];
var data = [["n91", 1, 2, 3], ["n7", 1, 2, 3]];
objVQI_PathwayEditor.sprayColorExternalNoGUI(data);
}
function sprayFromFile() {
Expand All @@ -57,7 +57,7 @@ function sprayFromFile() {
reader.readAsText(file);
}
function print() {
objVQI_PathwayEditor.printGraph();
objVQI_PathwayEditor.printGraphNoGUI();
}
function save() {
objVQI_PathwayEditor.produceJSONExternalNoGUI();
Expand Down

0 comments on commit 943e7e3

Please sign in to comment.