Skip to content
Permalink
Browse files

Code/project cleanup, UI changes, and minor bug fixes

  • Loading branch information
csw11004 committed Sep 15, 2015
1 parent a4616f0 commit eae14a203266bf972c375eb4991e2b9517ee6fe6
Showing with 82 additions and 260,319 deletions.
  1. BIN DeleteTrack.png
  2. BIN ExportTrack.png
  3. +0 −1,887 Tile2contentsnpplotter.txt
  4. +75 −19 VQI_GenomeBrowser.js
  5. +0 −4 VQI_GenomeBrowserDemo.html
  6. +0 −65,700 cpg_site_hg19.txt
  7. +0 −280 d3.tip.v0.6.3.js
  8. +7 −6 dynamic_loading.php
  9. +0 −30,500 hg19_refgene.txt
  10. +0 −30,500 hg19_refgene2.txt
  11. +0 −65,699 shelve_hg19.txt
  12. +0 −65,699 shoer_hg19.txt
  13. +0 −25 tipsy.css
BIN +94.7 KB DeleteTrack.png
Binary file not shown.
BIN +29.4 KB ExportTrack.png
Binary file not shown.

This file was deleted.

@@ -275,6 +275,18 @@ function VQI_GenomeBrowser(id, serviceURL) {
reorderTracks();
updateAllTracksSelectBoxes();
}

var removeTrack = function (track_name) {
for (var i = trackList.length - 1; i >= 0; i--) {
if (trackList[i].name == track_name)
{
trackList[i].group.remove();
trackList.splice(i, 1);
}
}
reorderTracks();
updateAllTracksSelectBoxes();
}

this.getSelectedTrackNames = function(){
var tracknames = []
@@ -375,9 +387,9 @@ function VQI_GenomeBrowser(id, serviceURL) {
var exportButton = "<input type='button' id='exporttrackbutton' value='Export Selected Track'>";
var mcScoreButton = "<input type='button' id='mcscoreTracks' value='MC System' onclick='VQI_ControlPanel.scoreButtonClicked()'>";
var entScoreButton = "<input type='button' id='entscoreTracks' value='EMT Score' onclick='VQI_ControlPanel.EMTScoreButtonClicked()'>";
var removeExportform = "<form id='removeExportForm'>" + removeButton + "&nbsp&nbsp&nbsp"+exportButton +"</form>";
//var removeExportform = "<form id='removeExportForm'>" + removeButton + "&nbsp&nbsp&nbsp"+exportButton +"</form>";
var mcEntForm = "<form id='mcEntForm'>" + mcScoreButton + "&nbsp&nbsp&nbsp"+entScoreButton +"</form>";
$("#" + divId +" #exportRemoveContainer").append(removeExportform);
//$("#" + divId +" #exportRemoveContainer").append(removeExportform);
$("#" + divId +" #mcEntContainer").append(mcEntForm);
$("#" + divId + " #removetrackbutton").on("click", removeSelectedTracks.bind(this));
$("#" + divId + " #exporttrackbutton").on("click", exportSelectedTracks.bind(this));
@@ -602,6 +614,10 @@ function VQI_GenomeBrowser(id, serviceURL) {
svg.call(zoom).on("dblclick.zoom", null);

var scale = (panExtent[1] - panExtent[0]) / (xMax - xMin) / initialZoom;
if(scale > (panExtent[1] - panExtent[0]) / 50 / initialZoom)
scale = (panExtent[1] - panExtent[0]) / 50 / initialZoom;
if(scale < 1 / initialZoom)
scale = 1 / initialZoom;

zoom.scale(scale)

@@ -719,7 +735,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
}

var reorderTracks = function () {
svg.attr("height", height + 2 * margin + trackList.length * (trackHeight + bufferSpace));
svg.transition().attr("height", height + 2 * margin + trackList.length * (trackHeight + bufferSpace));
for (var i in trackList) {
trackList[i].group.transition().attr("transform", "translate(" + 0 + "," + (margin + bufferSpace + i * (trackHeight + bufferSpace)) + ")");
}
@@ -787,7 +803,6 @@ function VQI_GenomeBrowser(id, serviceURL) {
data.unshift(["chrom", "chrom_start", "chrom_end", "name", "score", "strand"])
}
data = addOneTrack(data, name, type, fileHandle);
//console.log("addtrack");

reorderTracks();
updateAllTracksSelectBoxes();
@@ -1034,13 +1049,23 @@ function VQI_GenomeBrowser(id, serviceURL) {
group.append("foreignObject")
.attr("width", 50)
.attr("height", 20)
.attr("x", width)
.attr("y", -10)
.attr("class", "checkbox")
.attr("x", width+5)
.attr("y", -7.5)
.append("xhtml:div")
.html("<form><input type=checkbox id='check'/></form>")
.html("<form><input type=image src=DeleteTrack.png width=15 height=15 onclick='return false;'></form>")
.on("click", function () {
xAxisSelection.call(xAxis);//I have no idea why it won't redraw the checkbox unless I call this
removeTrack(name);
});

group.append("foreignObject")
.attr("width", 50)
.attr("height", 20)
.attr("x", width+25)
.attr("y", -7.5)
.append("xhtml:div")
.html("<form><input type=image src=ExportTrack.png width=15 height=15 onclick='return false;'></form>")
.on("click", function () {
exportTrack(name);
});


@@ -1105,7 +1130,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
var shelveFileHandle = tempHandles[1];
var shoreFileHandle = tempHandles[2];
var data;
var redrawCutoff = 1000;
var redrawCutoff = 1000; //Scale at which rectangles will be drawn individually

var getScale = function(){
if(zoom.scale() < redrawCutoff)
@@ -1240,6 +1265,22 @@ function VQI_GenomeBrowser(id, serviceURL) {
var fileHandles = [fileHandle];
var name = [this.name];

var LoadingText = group.append("g")
LoadingText.append("rect")
.attr("x", 450)
.attr("width", 100)
.attr("y", -10)
.attr("height", 20)
.attr("rx", 6)
.attr("ry", 6)
.style("fill-opacity", .6)
.style("fill", "white")

LoadingText.append("text")
.text("Loading...")
.attr("x", 475)
.attr("y", 5);

$.ajax({
url: serviceURL,
type: 'POST',
@@ -1257,6 +1298,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
drawTrack(returnData[name]);

data = returnData;
LoadingText.remove();
}
).error(function (req, status, error) {
$("body").append(status + ": " + error);
@@ -1306,7 +1348,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
this.fileHandle = fileHandle;
var tempHandles = fileHandle.split(",");
var data;
var redrawCutoff = 1000;
var redrawCutoff = 1000; //Scale at which rectangles will be drawn individually

var getScale = function(){
if(zoom.scale() < redrawCutoff)
@@ -1472,6 +1514,22 @@ function VQI_GenomeBrowser(id, serviceURL) {
var fileHandles = [fileHandle];
var name = [this.name];

var LoadingText = group.append("g")
LoadingText.append("rect")
.attr("x", 450)
.attr("width", 100)
.attr("y", -10)
.attr("height", 20)
.attr("rx", 6)
.attr("ry", 6)
.style("fill-opacity", .6)
.style("fill", "white")

LoadingText.append("text")
.text("Loading...")
.attr("x", 475)
.attr("y", 5);

$.ajax({
url: serviceURL,
type: 'POST',
@@ -1486,15 +1544,13 @@ function VQI_GenomeBrowser(id, serviceURL) {
}

}).success(function (returnData) {
if(returnData[name].length > 0)
{
if(returnData[name][0][0].length === 4) //if no exons exist
drawTrack(returnData[name]);
else
drawTrack(returnData[name][0], returnData[name][1]);
if(returnData.length === 1) //if no exons exist
drawTrack(returnData[name]);
else
drawTrack(returnData[name][0], returnData[name][1]);

data = returnData;
}
data = returnData;
LoadingText.remove();
}
).error(function (req, status, error) {
$("body").append(status + ": " + error);
@@ -2,15 +2,11 @@
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://labratrevenge.com/d3-tip/javascripts/d3.tip.v0.6.3.js"></script>
<script src="../VQI_Publisher.js"></script>
<script src="./jquery.tipsy.js"></script>
<script src="./d3.tip.v0.6.3.js"></script>
<script src="VQI_GenomeBrowser.js"></script>
<script src="FileSaver.min.js"></script>
<script src="jquery.qtip.min.js"></script>

<link href="tipsy.css" rel="stylesheet" type="text/css" />
<link href="jquery.qtip.min.css" rel="stylesheet" type="text/css" />
<!-- Latest compiled and minified CSS -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> -->

0 comments on commit eae14a2

Please sign in to comment.
You can’t perform that action at this time.