diff options
author | Zachary Sloan | 2012-09-25 15:44:51 -0500 |
---|---|---|
committer | Zachary Sloan | 2012-09-25 15:44:51 -0500 |
commit | 73fe24131cbd89cdeb6c4c1027c75ca0b6bba3d5 (patch) | |
tree | aa6ebde4ce57b4fecedbf5278f6d251a5950e52b /wqflask/base/webqtlTrait.py | |
parent | 16f2d99bbeb693d3ac190d6977701a5450e9c2c0 (diff) | |
download | genenetwork2-73fe24131cbd89cdeb6c4c1027c75ca0b6bba3d5.tar.gz |
Fixed issue with parent strains appearing twice and began replacing variable names (strain -> sample, for example)
Diffstat (limited to 'wqflask/base/webqtlTrait.py')
-rwxr-xr-x | wqflask/base/webqtlTrait.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/wqflask/base/webqtlTrait.py b/wqflask/base/webqtlTrait.py index 8240eafc..4d642ffe 100755 --- a/wqflask/base/webqtlTrait.py +++ b/wqflask/base/webqtlTrait.py @@ -160,20 +160,20 @@ class webqtlTrait: __str__ = getName __repr__ = __str__ - def exportData(self, strainlist, type="val"): + def exportData(self, samplelist, type="val"): """ - export data according to strainlist + export data according to samplelist mostly used in calculating correlation """ result = [] - for strain in strainlist: - if self.data.has_key(strain): + for sample in samplelist: + if self.data.has_key(sample): if type=='val': - result.append(self.data[strain].val) + result.append(self.data[sample].val) elif type=='var': - result.append(self.data[strain].var) + result.append(self.data[sample].var) elif type=='N': - result.append(self.data[strain].N) + result.append(self.data[sample].N) else: raise KeyError, `type`+' type is incorrect.' else: @@ -182,19 +182,19 @@ class webqtlTrait: def exportInformative(self, incVar=0): """ - export informative strain + export informative sample mostly used in qtl regression """ - strains = [] + samples = [] vals = [] vars = [] - for strain, value in self.data.items(): + for sample, value in self.data.items(): if value.val != None: if not incVar or value.var != None: - strains.append(strain) + samples.append(sample) vals.append(value.val) vars.append(value.var) - return strains, vals, vars + return samples, vals, vars # @@ -225,10 +225,10 @@ class webqtlTrait: - def retrieveData(self, strainlist=None): + def retrieveData(self, samplelist=None): - if strainlist == None: - strainlist = [] + if samplelist == None: + samplelist = [] assert self.db and self.cursor if self.db.type == 'Temp': @@ -334,10 +334,10 @@ class webqtlTrait: if results: self.mysqlid = results[0][-1] - #if strainlist: + #if samplelist: for item in results: #name, value, variance, num_cases = item - if not strainlist or (strainlist and name in strainlist): + if not samplelist or (samplelist and name in samplelist): #if value != None: # num_cases = None # if self.db.type in ('Publish', 'Temp'): |