aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Sloan2013-01-09 18:14:49 -0600
committerZachary Sloan2013-01-09 18:14:49 -0600
commit1ded9e2c78174399845dcf96beebe78114e09927 (patch)
treecf94eaf8105ef7257c0d6728858d19be9521f908
parent10709f9d6761de7c99379eb707df7283cd03cea8 (diff)
downloadgenenetwork2-1ded9e2c78174399845dcf96beebe78114e09927.tar.gz
Manhattan plot results are appearing correctly for chromosome 1
-rwxr-xr-xwqflask/wqflask/marker_regression/marker_regression.py3
-rw-r--r--wqflask/wqflask/static/new/javascript/marker_regression.coffee40
-rw-r--r--wqflask/wqflask/static/new/javascript/marker_regression.js50
-rw-r--r--wqflask/wqflask/templates/marker_regression.html1
4 files changed, 81 insertions, 13 deletions
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index 9bf97f93..5d319006 100755
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -471,7 +471,8 @@ class MarkerRegression(object):
suggestive_results = []
self.pure_qtl_results = []
for result in self.qtl_results:
- self.pure_qtl_results.append(dict(locus=dict(mb=result.locus.Mb,
+ self.pure_qtl_results.append(dict(locus=dict(name=result.locus.name,
+ mb=result.locus.Mb,
chromosome=result.locus.chr),
lrs=result.lrs,
additive=result.additive))
diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.coffee b/wqflask/wqflask/static/new/javascript/marker_regression.coffee
index 07a10119..fe7264da 100644
--- a/wqflask/wqflask/static/new/javascript/marker_regression.coffee
+++ b/wqflask/wqflask/static/new/javascript/marker_regression.coffee
@@ -41,21 +41,13 @@ $ ->
#return bars_ordered
display_graph: ->
- # Figure out the largest key, so we can make sure the x axis max is one larger later on
- #max_lrs = bars_ordered[bars_ordered.length-1][0]
- #console.log("max_key is:", max_lrs)
$.jqplot('permutation_histogram', [@bars_ordered],
title: 'Permutation Histogram'
seriesDefaults:
renderer:$.jqplot.BarRenderer
rendererOptions:
- #barPadding: 30
- #barMargin: 30
barWidth: 15
- #shadowOffset: 2
- #shadowDepth: 5
- #shadowAlpha: 0.8
pointLabels:
show: true
axesDefaults:
@@ -63,7 +55,6 @@ $ ->
axes:
xaxis:
min: 0
- #max: max_lrs + 2
label: "LRS"
pad: 1.1
yaxis:
@@ -81,4 +72,33 @@ $ ->
#bars_ordered = process_lrs_array()
#display_permutation_histogram(bars_ordered)
- new Permutation_Histogram \ No newline at end of file
+ class Manhattan_Plot
+ constructor: ->
+ @process_data()
+ @display_graph()
+
+ process_data: ->
+ qtl_results = js_data.qtl_results
+ #console.log("qtl_results: ", qtl_results)
+ @plot_points = []
+ for result in qtl_results
+ if result.locus.chromosome == '1'
+ @plot_points.push([result.locus.mb, result.lrs])
+
+ display_graph: ->
+ #console.log("@plot_points is:", @plot_points)
+ $.jqplot('manhattan_plot', [@plot_points],
+ title: '1'
+ axesDefaults:
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer
+ axes:
+ xaxis:
+ min: 0
+ label: "Megabases"
+ yaxis:
+ min: 0
+ label: "LRS"
+ )
+
+ new Permutation_Histogram
+ new Manhattan_Plot \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.js b/wqflask/wqflask/static/new/javascript/marker_regression.js
index 26f0dba4..a9e0024c 100644
--- a/wqflask/wqflask/static/new/javascript/marker_regression.js
+++ b/wqflask/wqflask/static/new/javascript/marker_regression.js
@@ -2,7 +2,7 @@
(function() {
$(function() {
- var Permutation_Histogram, sort_number;
+ var Manhattan_Plot, Permutation_Histogram, sort_number;
sort_number = function(a, b) {
return a - b;
};
@@ -72,7 +72,53 @@
return Permutation_Histogram;
})();
- return new Permutation_Histogram;
+ Manhattan_Plot = (function() {
+
+ function Manhattan_Plot() {
+ this.process_data();
+ this.display_graph();
+ }
+
+ Manhattan_Plot.prototype.process_data = function() {
+ var qtl_results, result, _i, _len, _results;
+ qtl_results = js_data.qtl_results;
+ this.plot_points = [];
+ _results = [];
+ for (_i = 0, _len = qtl_results.length; _i < _len; _i++) {
+ result = qtl_results[_i];
+ if (result.locus.chromosome === '1') {
+ _results.push(this.plot_points.push([result.locus.mb, result.lrs]));
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ };
+
+ Manhattan_Plot.prototype.display_graph = function() {
+ return $.jqplot('manhattan_plot', [this.plot_points], {
+ title: '1',
+ axesDefaults: {
+ labelRenderer: $.jqplot.CanvasAxisLabelRenderer
+ },
+ axes: {
+ xaxis: {
+ min: 0,
+ label: "Megabases"
+ },
+ yaxis: {
+ min: 0,
+ label: "LRS"
+ }
+ }
+ });
+ };
+
+ return Manhattan_Plot;
+
+ })();
+ new Permutation_Histogram;
+ return new Manhattan_Plot;
});
}).call(this);
diff --git a/wqflask/wqflask/templates/marker_regression.html b/wqflask/wqflask/templates/marker_regression.html
index 479464ab..ab1cb43b 100644
--- a/wqflask/wqflask/templates/marker_regression.html
+++ b/wqflask/wqflask/templates/marker_regression.html
@@ -14,6 +14,7 @@
</div>
</header>
+ <div id="manhattan_plot" style="height:400px;width:900px; "></div>
<div id="permutation_histogram" style="height:400px;width:900px; "></div>