aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorZachary Sloan2013-11-25 23:17:34 +0000
committerZachary Sloan2013-11-25 23:17:34 +0000
commit29a8396d1def9a883483a1b98e1815c6a0101147 (patch)
tree2baae6fb3b3640d49ef76bad40dff1e39380c39f /wqflask/base/trait.py
parent8d1187e8aa1ff1ec151aa95742c2c660d74447e8 (diff)
parente7142c0785a9680b56d789f1db0a738d6172de55 (diff)
downloadgenenetwork2-29a8396d1def9a883483a1b98e1815c6a0101147.tar.gz
Merge branch 'temp'
Diffstat (limited to 'wqflask/base/trait.py')
-rwxr-xr-xwqflask/base/trait.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 731f99eb..74bc07bb 100755
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -154,7 +154,7 @@ class GeneralTrait(object):
result.append(None)
return result
- def export_informative(self, incVar=0):
+ def export_informative(self, include_variance=0):
"""
export informative sample
mostly used in qtl regression
@@ -163,12 +163,12 @@ class GeneralTrait(object):
samples = []
vals = []
the_vars = []
- for sample, value in self.data.items():
- if value.val != None:
- if not incVar or value.var != None:
- samples.append(sample)
- vals.append(value.val)
- the_vars.append(value.var)
+ for sample_name, sample_data in self.data.items():
+ if sample_data.value != None:
+ if not include_variance or sample_data.variance != None:
+ samples.append(sample_name)
+ vals.append(sample_data.value)
+ the_vars.append(sample_data.variance)
return samples, vals, the_vars
@@ -235,11 +235,19 @@ class GeneralTrait(object):
# Todo: is this necessary? If not remove
self.data.clear()
+ if self.dataset.group.parlist:
+ all_samples_ordered = (self.dataset.group.parlist +
+ self.dataset.group.f1list +
+ self.dataset.group.samplelist)
+ elif self.dataset.group.f1list:
+ all_samples_ordered = self.dataset.group.f1list + self.dataset.group.samplelist
+ else:
+ all_samples_ordered = self.dataset.group.samplelist
+
if results:
for item in results:
- #name, value, variance, num_cases = item
+ name, value, variance, num_cases = item
if not samplelist or (samplelist and name in samplelist):
- name = item[0]
self.data[name] = webqtlCaseData(*item) #name, value, variance, num_cases)
#def keys(self):