aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2020-07-06 14:48:32 -0500
committerzsloan2020-07-06 14:48:32 -0500
commit445d976eed7dad4f94febe2b6c768ef6aa1e5acd (patch)
tree7b4acb4bb48f68ccc955d6bf33edc9664e6c69a8 /wqflask
parent0a0d733af4b6c61c381a1c4ec9fa162182a057e9 (diff)
downloadgenenetwork2-445d976eed7dad4f94febe2b6c768ef6aa1e5acd.tar.gz
Fixed issue where the N on the mapping loading page would sometimes be wrong when reloading the page or zooming in, etc
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py2
-rw-r--r--wqflask/wqflask/marker_regression/run_mapping.py5
-rw-r--r--wqflask/wqflask/templates/loading.html2
-rw-r--r--wqflask/wqflask/templates/mapping_results.html4
-rw-r--r--wqflask/wqflask/views.py12
5 files changed, 14 insertions, 11 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index 74fa4329..89f56c30 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -147,7 +147,7 @@ class DisplayMappingResults(object):
self.dataset = start_vars['dataset']
self.this_trait = start_vars['this_trait']
- self.n_samples = start_vars['num_vals']
+ self.n_samples = start_vars['n_samples']
self.species = start_vars['species']
self.genofile_string = ""
if 'genofile_string' in start_vars:
diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py
index c859fdaa..c9d10f7c 100644
--- a/wqflask/wqflask/marker_regression/run_mapping.py
+++ b/wqflask/wqflask/marker_regression/run_mapping.py
@@ -124,7 +124,10 @@ class RunMapping(object):
self.samples.append(sample)
self.vals.append(value)
- self.num_vals = len(self.vals)
+ if 'n_samples' in start_vars:
+ self.n_samples = start_vars['n_samples']
+ else:
+ self.n_samples = len([val for val in self.vals if val != "x"])
#ZS: Check if genotypes exist in the DB in order to create links for markers
diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html
index 49bcbff7..15ab4080 100644
--- a/wqflask/wqflask/templates/loading.html
+++ b/wqflask/wqflask/templates/loading.html
@@ -11,7 +11,7 @@
{% if start_vars.tool_used == "Mapping" %}
<h1>Computing the Maps</h1>
<br>
- <i>n</i> = {{ start_vars.num_vals }}
+ <i>n</i> = {{ start_vars.n_samples }}
<br>
Method = {% if start_vars.method == "gemma" %}GEMMA{% else %}{{ start_vars.method }}{% endif %}
<br>
diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html
index c5d49168..132d5249 100644
--- a/wqflask/wqflask/templates/mapping_results.html
+++ b/wqflask/wqflask/templates/mapping_results.html
@@ -35,7 +35,7 @@
{% for sample in samples %}
<input type="hidden" name="value:{{ sample }}" value="{{ vals[loop.index - 1] }}">
{% endfor %}
- <input type="hidden" name="num_vals" value="{{ n_samples }}">
+ <input type="hidden" name="n_samples" value="{{ n_samples }}">
<input type="hidden" name="maf" value="{{ maf }}">
<input type="hidden" name="use_loco" value="{{ use_loco }}">
<input type="hidden" name="selected_chr" value="{{ selectedChr }}">
@@ -435,7 +435,7 @@
'score_type', 'suggestive', 'significant', 'num_perm', 'permCheck', 'perm_output', 'perm_strata', 'categorical_vars', 'num_bootstrap', 'bootCheck', 'bootstrap_results',
'LRSCheck', 'covariates', 'maf', 'use_loco', 'manhattan_plot', 'control_marker', 'control_marker_db', 'do_control', 'genofile',
'pair_scan', 'startMb', 'endMb', 'graphWidth', 'lrsMax', 'additiveCheck', 'showSNP', 'showGenes', 'viewLegend', 'haplotypeAnalystCheck',
- 'mapmethod_rqtl_geno', 'mapmodel_rqtl_geno', 'temp_trait', 'group', 'species', 'reaper_version', 'primary_samples', 'num_vals']
+ 'mapmethod_rqtl_geno', 'mapmodel_rqtl_geno', 'temp_trait', 'group', 'species', 'reaper_version', 'primary_samples', 'n_samples']
$('input[name=wanted_inputs]').val(mapping_input_list.join(","));
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 80164a22..131345d3 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -630,7 +630,7 @@ def loading_page():
logger.info(request.url)
initial_start_vars = request.form
start_vars_container = {}
- num_vals = 0 #ZS: So it can be displayed on loading page
+ n_samples = 0 #ZS: So it can be displayed on loading page
if 'wanted_inputs' in initial_start_vars:
wanted = initial_start_vars['wanted_inputs'].split(",")
start_vars = {}
@@ -638,8 +638,8 @@ def loading_page():
if key in wanted or key.startswith(('value:')):
start_vars[key] = value
- if 'num_vals' in start_vars:
- num_vals = int(start_vars['num_vals'])
+ if 'n_samples' in start_vars:
+ n_samples = int(start_vars['n_samples'])
else:
if 'group' in start_vars:
dataset = create_dataset(start_vars['dataset'], group_name = start_vars['group'])
@@ -658,9 +658,9 @@ def loading_page():
for sample in samples:
value = start_vars.get('value:' + sample)
if value != "x":
- num_vals += 1
+ n_samples += 1
- start_vars['num_vals'] = num_vals
+ start_vars['n_samples'] = n_samples
start_vars['wanted_inputs'] = initial_start_vars['wanted_inputs']
start_vars_container['start_vars'] = start_vars
@@ -730,7 +730,7 @@ def mapping_results_page():
'mapmodel_rqtl_geno',
'temp_trait',
'reaper_version',
- 'num_vals',
+ 'n_samples',
'transform'
)
start_vars = {}