Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added above/below colored genes based on score
  • Loading branch information
csw11004 committed Apr 17, 2015
1 parent 01e8d97 commit 9e9c22a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
14 changes: 7 additions & 7 deletions Tile2contentsnpplotter.txt
Expand Up @@ -10,27 +10,27 @@ chr9_gl000198_random 77493 77494 . 0 +
chr4_gl000193_random 86356 86357 . 0 +
chr4_gl000193_random 86519 86520 . 0 +
chr1 896004 896005 . 0 +
chr1 976170 976171 . 0 +
chr1 976170 976171 . -.4 +
chr1 1198674 1198675 . 0 +
chr1 1250433 1250434 . 0 +
chr1 1250433 1250434 . 1 +
chr1 1597292 1597293 rs79791328 0 +
chr1 1597292 1597293 rs79791328 0 +
chr1 1688189 1688190 . 0 +
chr1 1897981 1897982 . 0 +
chr1 1987060 1987061 . 0 +
chr1 1987060 1987061 . -3 +
chr1 3555382 3555383 . 0 +
chr1 3692443 3692444 . 0 +
chr1 3692443 3692444 . 1 +
chr1 6142182 6142183 . 0 +
chr1 9027765 9027766 . 0 +
chr1 9785114 9785115 . 0 +
chr1 12025665 12025666 . 0 +
chr1 12320683 12320684 . 0 +
chr1 12780679 12780680 . 0 +
chr1 12780679 12780680 . 1 +
chr1 16053894 16053895 . 0 +
chr1 16580123 16580124 . 0 +
chr1 17555405 17555406 . 0 +
chr1 17555405 17555406 . .5 +
chr1 18016317 18016318 . 0 +
chr1 18017563 18017564 . 0 +
chr1 18017563 18017564 . 1 +
chr1 21103040 21103041 . 0 +
chr1 21582581 21582582 rs79178176 0 +
chr1 22055122 22055123 rs151180337 0 +
Expand Down
40 changes: 22 additions & 18 deletions VQI_GenomeBrowser.js
Expand Up @@ -603,11 +603,20 @@ function VQI_GenomeBrowser(id) {
})
//.attr("transform", "translate(" + 0 + "," + thisY + ")");

//Just a line
trackGroup.selectAll("line").data([name], function (d) {
return d;
}).enter().append("line")
.attr("x1", 0)
.attr("y1", 0)
.attr("x2", width)
.attr("y2", 0)
.style("stroke", "blue")
.style("stroke-opacity" , 0.5);

trackGroup.selectAll("text").data([name], function (d) {
return d;
}).enter().append("text")
.attr("class", name)
.attr("x", 0)
.attr("y", -trackHeight / 2 - bufferSpace / 2)
.attr("font-family", "sans-serif")
Expand Down Expand Up @@ -647,7 +656,7 @@ function VQI_GenomeBrowser(id) {
.append("xhtml:body")
.html("<form><input type=checkbox id=check class=" + name + "/></form>")
.on("click", function (d, i) {
console.log(trackGroup.select("#check").node().checked);
//console.log(trackGroup.select("#check").node().checked);
xAxisSelection.call(xAxis);//I have no idea why it won't redraw the checkbox unless I call this
});
}
Expand Down Expand Up @@ -722,17 +731,6 @@ function VQI_GenomeBrowser(id) {

var addCpgTrack = function (data, name) {

//Just a line
graphRegion.selectAll("g").data([name], function (d) {
return d;
})
.append("line")
.attr("x1", 0)
.attr("y1", 0)
.attr("x2", width)
.attr("y2", 0)
.style("stroke", "blue");

var trackScalableGroup = graphRegion.selectAll("g").data([name], function (d) {
return d;
}).select("g.scalable");
Expand Down Expand Up @@ -846,14 +844,20 @@ function VQI_GenomeBrowser(id) {
.attr("x", function (d) {
return fullXScale(d[indexArray.start]);
})
.attr("y", -1)
.attr("y", function (d) {
return d[indexArray.score] > 0 ? -5 : 0;
})
.attr("height", 5)
.attr("width", function (d) {
return fullXScale(d[indexArray.end]) - fullXScale(d[indexArray.start]);
})
.style("fill-opacity", "1")
.style("stroke", "black")
.style("fill", "black")
.style("stroke", function (d) {
return d[indexArray.score] > 0 ? "red" : "green";
})
.style("fill", function (d) {
return d[indexArray.score] > 0 ? "red" : "green";
})
.style("vector-effect", "non-scaling-stroke")
.attr("class", "scalable")
/*.attr("x1", function (d) {
Expand Down Expand Up @@ -914,8 +918,8 @@ function VQI_GenomeBrowser(id) {
.attr("x", function (d) {
return fullXScale(d[indexArray.start]);
})
.attr("y", -trackHeight / 2)
.attr("height", trackHeight)
.attr("y", -2.5)
.attr("height", 5)
.attr("width", function (d) {
return fullXScale(d[indexArray.end]) - fullXScale(d[indexArray.start]);
})
Expand Down

0 comments on commit 9e9c22a

Please sign in to comment.