aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-03-07 11:46:55 -0600
committerzsloan2019-03-07 11:46:55 -0600
commita37bc6e233d49fecd81f7ec3d3f5527c77de12c4 (patch)
tree13ff0c942ca23db0db5ff449551fc81618e538d2
parent92b587824a5d2bc42aab3f4be64f76113e5334eb (diff)
downloadgenenetwork2-a37bc6e233d49fecd81f7ec3d3f5527c77de12c4.tar.gz
Fixed issue where correlation results containing NaN results sorted incorrectly
Set default permutations for R/qtl to 200
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py7
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html2
2 files changed, 6 insertions, 3 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 0b2875cc..c15c3579 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -33,6 +33,7 @@ import resource
import json
import scipy
+import numpy
from pprint import pformat as pf
@@ -175,7 +176,6 @@ class CorrelationResults(object):
self.correlation_data = collections.OrderedDict(sorted(self.correlation_data.items(),
key=lambda t: -abs(t[1][0])))
-
if self.target_dataset.type == "ProbeSet" or self.target_dataset.type == "Geno":
#ZS: Convert min/max chromosome to an int for the location range option
range_chr_as_int = None
@@ -456,7 +456,10 @@ class CorrelationResults(object):
sample_r, sample_p = scipy.stats.spearmanr(self.this_trait_vals, target_vals)
if num_overlap > 5:
- self.correlation_data[trait] = [sample_r, sample_p, num_overlap]
+ if numpy.isnan(sample_r):
+ pass
+ else:
+ self.correlation_data[trait] = [sample_r, sample_p, num_overlap]
def process_samples(self, start_vars, sample_names, excluded_samples=None):
if not excluded_samples:
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index c7fd2612..b5ed1c8f 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -242,7 +242,7 @@
<div class="mapping_method_fields form-group">
<label style="text-align:right;" for="mapping_permutations" class="col-xs-3 control-label">Permutations</label>
<div style="margin-left:20px;" class="col-xs-4 controls">
- <input name="num_perm_rqtl_geno" value="0" type="text" class="form-control">
+ <input name="num_perm_rqtl_geno" value="200" type="text" class="form-control">
</div>
</div>
<div class="mapping_method_fields form-group">