aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorZachary Sloan2013-08-14 17:25:52 -0500
committerZachary Sloan2013-08-14 17:25:52 -0500
commit26b1883a8fe4053b59833178f44e047157f2fc9c (patch)
treed2359e5952f6062d75ba1f43f1804a7b6df284c9 /wqflask/base/trait.py
parenteea1c38a9851f31011787b27c14365211a06ea51 (diff)
parent6379959af53b2ec595b85ccdc099c6f14adf0381 (diff)
downloadgenenetwork2-26b1883a8fe4053b59833178f44e047157f2fc9c.tar.gz
Merge branch 'master' of https://github.com/zsloan/genenetwork
Diffstat (limited to 'wqflask/base/trait.py')
-rwxr-xr-xwqflask/base/trait.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index db76ddea..c893c887 100755
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -319,8 +319,11 @@ class GeneralTrait(object):
#XZ: assign SQL query result to trait attributes.
for i, field in enumerate(self.dataset.display_fields):
- print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i]))
- setattr(self, field, trait_info[i])
+ #print(" mike: {} -> {} - {}".format(field, type(trait_info[i]), trait_info[i]))
+ holder = trait_info[i]
+ if isinstance(trait_info[i], basestring):
+ holder = unicode(trait_info[i], "utf8", "ignore")
+ setattr(self, field, holder)
if self.dataset.type == 'Publish':
self.confidential = 0
@@ -329,9 +332,9 @@ class GeneralTrait(object):
self.homologeneid = None
- print("self.geneid is:", self.geneid)
- print(" type:", type(self.geneid))
- print("self.dataset.group.name is:", self.dataset.group.name)
+ #print("self.geneid is:", self.geneid)
+ #print(" type:", type(self.geneid))
+ #print("self.dataset.group.name is:", self.dataset.group.name)
if self.dataset.type == 'ProbeSet' and self.dataset.group and self.geneid:
#XZ, 05/26/2010: From time to time, this query get error message because some geneid values in database are not number.
#XZ: So I have to test if geneid is number before execute the query.
@@ -600,4 +603,4 @@ class GeneralTrait(object):
else:
ZValue = 0.5*log((1.0+self.correlation)/(1.0-self.correlation))
ZValue = ZValue*sqrt(self.overlap-3)
- self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue)))
+ self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue))) \ No newline at end of file