aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Sloan2013-01-10 14:34:38 -0600
committerZachary Sloan2013-01-10 14:34:38 -0600
commit8bd9680680c8df07bfc0286905ff6b9c0231ee5b (patch)
tree02153315f9f572044ff13aafae5cdd38dfb0cf83
parent1ded9e2c78174399845dcf96beebe78114e09927 (diff)
downloadgenenetwork2-8bd9680680c8df07bfc0286905ff6b9c0231ee5b.tar.gz
Worked with the manhattan plot coffeescript to set x-axis and change
the plot point sizes and remove lines
-rw-r--r--wqflask/wqflask/static/new/javascript/marker_regression.coffee33
-rw-r--r--wqflask/wqflask/static/new/javascript/marker_regression.js32
-rw-r--r--wqflask/wqflask/templates/marker_regression.html4
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html2
4 files changed, 63 insertions, 8 deletions
diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.coffee b/wqflask/wqflask/static/new/javascript/marker_regression.coffee
index fe7264da..cb19712f 100644
--- a/wqflask/wqflask/static/new/javascript/marker_regression.coffee
+++ b/wqflask/wqflask/static/new/javascript/marker_regression.coffee
@@ -81,23 +81,46 @@ $ ->
qtl_results = js_data.qtl_results
#console.log("qtl_results: ", qtl_results)
@plot_points = []
+ @max_mb = 0
for result in qtl_results
if result.locus.chromosome == '1'
+ if parseInt(result.locus.mb) > @max_mb
+ @max_mb = result.locus.mb
@plot_points.push([result.locus.mb, result.lrs])
display_graph: ->
+ x_axis_max = Math.ceil(@max_mb/25) * 25
+ x_axis_ticks = []
+ x_tick = 0
+ while (x_tick <= x_axis_max)
+ x_axis_ticks.push(x_tick)
+ x_tick += 25
#console.log("@plot_points is:", @plot_points)
$.jqplot('manhattan_plot', [@plot_points],
- title: '1'
+ title: '1'
+ seriesDefaults:
+ showLine: false
+ markerRenderer: $.jqplot.MarkerRenderer
+ markerOptions:
+ style: "filledCircle"
+ size: 3
axesDefaults:
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
axes:
xaxis:
- min: 0
- label: "Megabases"
+ min: 0
+ max: x_axis_max
+ ticks: x_axis_ticks
+ tickOptions:
+ angle: 90
+ showGridline: false
+ label: "Megabases"
yaxis:
- min: 0
- label: "LRS"
+ min: 0
+ label: "LRS"
+ tickOptions:
+ showGridline: false
)
new Permutation_Histogram
diff --git a/wqflask/wqflask/static/new/javascript/marker_regression.js b/wqflask/wqflask/static/new/javascript/marker_regression.js
index a9e0024c..30e287dd 100644
--- a/wqflask/wqflask/static/new/javascript/marker_regression.js
+++ b/wqflask/wqflask/static/new/javascript/marker_regression.js
@@ -83,10 +83,14 @@
var qtl_results, result, _i, _len, _results;
qtl_results = js_data.qtl_results;
this.plot_points = [];
+ this.max_mb = 0;
_results = [];
for (_i = 0, _len = qtl_results.length; _i < _len; _i++) {
result = qtl_results[_i];
if (result.locus.chromosome === '1') {
+ if (parseInt(result.locus.mb) > this.max_mb) {
+ this.max_mb = result.locus.mb;
+ }
_results.push(this.plot_points.push([result.locus.mb, result.lrs]));
} else {
_results.push(void 0);
@@ -96,19 +100,45 @@
};
Manhattan_Plot.prototype.display_graph = function() {
+ var x_axis_max, x_axis_ticks, x_tick;
+ x_axis_max = Math.ceil(this.max_mb / 25) * 25;
+ x_axis_ticks = [];
+ x_tick = 0;
+ while (x_tick <= x_axis_max) {
+ x_axis_ticks.push(x_tick);
+ x_tick += 25;
+ }
return $.jqplot('manhattan_plot', [this.plot_points], {
title: '1',
+ seriesDefaults: {
+ showLine: false,
+ markerRenderer: $.jqplot.MarkerRenderer,
+ markerOptions: {
+ style: "filledCircle",
+ size: 3
+ }
+ },
axesDefaults: {
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer,
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
axes: {
xaxis: {
min: 0,
+ max: x_axis_max,
+ ticks: x_axis_ticks,
+ tickOptions: {
+ angle: 90,
+ showGridline: false
+ },
label: "Megabases"
},
yaxis: {
min: 0,
- label: "LRS"
+ label: "LRS",
+ tickOptions: {
+ showGridline: false
+ }
}
}
});
diff --git a/wqflask/wqflask/templates/marker_regression.html b/wqflask/wqflask/templates/marker_regression.html
index ab1cb43b..68effbd5 100644
--- a/wqflask/wqflask/templates/marker_regression.html
+++ b/wqflask/wqflask/templates/marker_regression.html
@@ -14,7 +14,7 @@
</div>
</header>
- <div id="manhattan_plot" style="height:400px;width:900px; "></div>
+ <div id="manhattan_plot" style="height:400px;width:150px; "></div>
<div id="permutation_histogram" style="height:400px;width:900px; "></div>
@@ -32,7 +32,9 @@
<![endif]-->
<script language="javascript" type="text/javascript" src="/static/packages/jqplot/jquery.jqplot.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.pointLabels.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.barRenderer.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.markerRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/javascript/marker_regression.js"></script>
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 15e2efe9..84196959 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -30,7 +30,7 @@
<div class="control-group">
<label for="mapping_permutations" class="control-label">Permutations (n)</label>
<div class="controls">
- <input name="num_perm" value="2000" type="text" />
+ <input name="num_perm1" value="2000" type="text" />
</div>
</div>