aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-12-08 17:04:41 -0600
committerzsloan2020-12-08 17:04:41 -0600
commit28223e97e3e24c0ac759d7523d701b875cd6df7b (patch)
tree16d20116045400dd273e33be7be475394c6e0afc /wqflask
parent0edd6f931c0204f9cc2a0e64cc5fd7a983e6767d (diff)
downloadgenenetwork2-28223e97e3e24c0ac759d7523d701b875cd6df7b.tar.gz
Added method as a parameter for the correlation scatterplot so that it will default to the Spearman tab when the link is from a Spearman correlation
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation/corr_scatter_plot.py2
-rw-r--r--wqflask/wqflask/templates/corr_scatterplot.html8
-rw-r--r--wqflask/wqflask/templates/correlation_matrix.html3
3 files changed, 8 insertions, 5 deletions
diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py
index 6ab8c3d8..c87776bb 100644
--- a/wqflask/wqflask/correlation/corr_scatter_plot.py
+++ b/wqflask/wqflask/correlation/corr_scatter_plot.py
@@ -29,6 +29,8 @@ class CorrScatterPlot(object):
self.trait_2 = create_trait(name=params['trait_2'], dataset=self.dataset_2)
#self.trait_3 = create_trait(name=params['trait_3'], dataset=self.dataset_3)
+ self.method = params['method']
+
primary_samples = self.dataset_1.group.samplelist
if self.dataset_1.group.parlist != None:
primary_samples += self.dataset_1.group.parlist
diff --git a/wqflask/wqflask/templates/corr_scatterplot.html b/wqflask/wqflask/templates/corr_scatterplot.html
index 1133fcd2..cd1998fa 100644
--- a/wqflask/wqflask/templates/corr_scatterplot.html
+++ b/wqflask/wqflask/templates/corr_scatterplot.html
@@ -118,17 +118,17 @@
{% endif %}
<ul class="nav nav-tabs">
- <li class="active">
+ <li {% if method == 'pearson' %}class="active"{% endif %}>
<a href="#tp1" data-toggle="tab">Pearson</a>
</li>
- <li>
+ <li {% if method == 'spearman' %}class="active"{% endif %}>
<a href="#tp2" data-toggle="tab">Spearman Rank</a>
</li>
</ul>
<div class="tab-content" style="min-width: 800px;">
- <div class="tab-pane active" id="tp1">
+ <div class="tab-pane {% if method == 'pearson' %}active{% endif %}" id="tp1">
<br>
<div id="scatterplot2"></div>
<br>
@@ -243,7 +243,7 @@
</div>
</div>
- <div class="tab-pane" id="tp2">
+ <div class="tab-pane {% if method == 'spearman' %}active{% endif %}" id="tp2">
<br>
<div id="srscatterplot2"></div>
<br>
diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html
index 96ad9c35..fb0380c9 100644
--- a/wqflask/wqflask/templates/correlation_matrix.html
+++ b/wqflask/wqflask/templates/correlation_matrix.html
@@ -32,6 +32,7 @@
{% endfor %}
</tr>
{% for trait in traits %}
+ {% set outer_loop = loop.index %}
<tr>
<td align="center"><input type="checkbox" class="checkbox" style="margin-left: 3px; margin-right: 1px;"></td>
<td align="right" style="padding-right: 4px;" >
@@ -54,7 +55,7 @@
{% if result[1] == 0 %}
<td nowrap="ON" align="middle" bgcolor="#eeeeee" style="padding: 3px; line-height: 1.1;">N/A</td>
{% else %}
- <td nowrap="ON" align="middle" class="corr_cell" style="padding: 3px; line-height: 1.1;"><a href="/corr_scatter_plot?dataset_1={% if trait.dataset.name == 'Temp' %}Temp_{{ trait.dataset.group.name }}{% else %}{{ trait.dataset.name }}{% endif %}&dataset_2={% if result[0].dataset.name == 'Temp' %}Temp_{{ result[0].dataset.group.name }}{% else %}{{ result[0].dataset.name }}{% endif %}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #3071a9; font-weight: bold;" ><span class="corr_value">{{ '%0.2f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
+ <td nowrap="ON" align="middle" class="corr_cell" style="padding: 3px; line-height: 1.1;"><a href="/corr_scatter_plot?method={% if loop.index > outer_loop %}spearman{% else %}pearson{% endif %}&dataset_1={% if trait.dataset.name == 'Temp' %}Temp_{{ trait.dataset.group.name }}{% else %}{{ trait.dataset.name }}{% endif %}&dataset_2={% if result[0].dataset.name == 'Temp' %}Temp_{{ result[0].dataset.group.name }}{% else %}{{ result[0].dataset.name }}{% endif %}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #3071a9; font-weight: bold;" ><span class="corr_value">{{ '%0.2f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
{% endif %}
{% endif %}
{% endfor %}