aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorzsloan2017-07-06 12:01:52 -0500
committerGitHub2017-07-06 12:01:52 -0500
commitd86f07f616d6892707dd26c87bf70db1a50f070a (patch)
tree2111574cac4f9408aa6223e10391d2a9a3f15244 /wqflask/base
parent5c7b50d579dcf08a16a45ccde4a299b6cce6aaab (diff)
parent0661ddd38fd53a2c3724c4144f3b4b4fd3e4f236 (diff)
downloadgenenetwork2-d86f07f616d6892707dd26c87bf70db1a50f070a.tar.gz
Merge pull request #256 from genenetwork/development
Variety of changes
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/data_set.py7
-rw-r--r--wqflask/base/trait.py3
-rw-r--r--wqflask/base/webqtlCaseData.py8
3 files changed, 11 insertions, 7 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 4959457a..dbdbb51c 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -169,7 +169,7 @@ def mescape(*items):
class Markers(object):
"""Todo: Build in cacheing so it saves us reading the same file more than once"""
def __init__(self, name):
- json_data_fh = open(locate(name + '.json','genotype/json'))
+ json_data_fh = open(locate(name + ".json",'genotype/json'))
try:
markers = json.load(json_data_fh)
except:
@@ -334,7 +334,10 @@ class DatasetGroup(object):
else:
marker_class = Markers
- self.markers = marker_class(self.name)
+ if self.genofile:
+ self.markers = marker_class(self.genofile[:-5])
+ else:
+ self.markers = marker_class(self.name)
def get_f1_parent_strains(self):
try:
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index e22a51e4..acc055d8 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -206,6 +206,8 @@ class GeneralTrait(object):
formatted = self.description
if self.probe_target_description:
formatted += "; " + self.probe_target_description
+ else:
+ formatted = "Not available"
elif self.dataset.type == 'Publish':
if self.confidential:
formatted = self.pre_publication_description
@@ -290,7 +292,6 @@ def retrieve_sample_data(trait, dataset, samplelist=None):
name, value, variance, num_cases, name2 = item
if not samplelist or (samplelist and name in samplelist):
trait.data[name] = webqtlCaseData(*item) #name, value, variance, num_cases)
-
return trait
def convert_location_to_value(chromosome, mb):
diff --git a/wqflask/base/webqtlCaseData.py b/wqflask/base/webqtlCaseData.py
index 845a7224..24de8dcb 100644
--- a/wqflask/base/webqtlCaseData.py
+++ b/wqflask/base/webqtlCaseData.py
@@ -44,9 +44,9 @@ class webqtlCaseData(object):
def __repr__(self):
str = "<webqtlCaseData> "
- if self.value:
+ if self.value != None:
str += "value=%2.3f" % self.value
- if self.variance:
+ if self.variance != None:
str += " variance=%2.3f" % self.variance
if self.num_cases:
str += " ndata=%d" % self.num_cases
@@ -66,14 +66,14 @@ class webqtlCaseData(object):
@property
def display_value(self):
- if self.value:
+ if self.value != None:
return "%2.3f" % self.value
else:
return "x"
@property
def display_variance(self):
- if self.variance:
+ if self.variance != None:
return "%2.3f" % self.variance
else:
return "x"