From 8bd9680680c8df07bfc0286905ff6b9c0231ee5b Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 10 Jan 2013 14:34:38 -0600 Subject: Worked with the manhattan plot coffeescript to set x-axis and change the plot point sizes and remove lines --- .../static/new/javascript/marker_regression.coffee | 33 ++++++++++++++++++---- .../static/new/javascript/marker_regression.js | 32 ++++++++++++++++++++- wqflask/wqflask/templates/marker_regression.html | 4 ++- .../templates/show_trait_mapping_tools.html | 2 +- 4 files changed, 63 insertions(+), 8 deletions(-) (limited to 'wqflask') 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 @@ -
+ @@ -32,7 +32,9 @@ + + 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 @@