diff options
author | zsloan | 2016-05-23 22:23:51 +0000 |
---|---|---|
committer | zsloan | 2016-05-23 22:23:51 +0000 |
commit | 29b50856ab9b9ef87b81228b782dd6bebe28b7c1 (patch) | |
tree | 5dd197acac06dfaea5aae7823b6e903695207c00 /wqflask/base/trait.py | |
parent | f7520d9a6e05b103bab983c31ef0e53fad59f5e6 (diff) | |
download | genenetwork2-29b50856ab9b9ef87b81228b782dd6bebe28b7c1.tar.gz |
Reaper mapping results are now correct and account for samples with two names (like BXD65a)
R/qtl and PYLMM still not working with the change and bootstrap results are also still wrong, so need to fix those issues.
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r-- | wqflask/base/trait.py | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index af22b5a1..05ee3d96 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -180,13 +180,15 @@ class GeneralTrait(object): samples = [] vals = [] the_vars = [] + sample_aliases = [] 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 + sample_aliases.append(sample_data.name2) + return samples, vals, the_vars, sample_aliases # @@ -230,7 +232,7 @@ class GeneralTrait(object): if results: for item in results: - name, value, variance, num_cases = item + name, value, variance, num_cases, name2 = item if not samplelist or (samplelist and name in samplelist): self.data[name] = webqtlCaseData(*item) #name, value, variance, num_cases) @@ -308,46 +310,6 @@ class GeneralTrait(object): if isinstance(trait_info[i], basestring): holder = unicode(trait_info[i], "utf8", "ignore") setattr(self, field, holder) -<<<<<<< HEAD - - description_string = unicode(str(self.description).strip(codecs.BOM_UTF8), 'utf-8') - target_string = unicode(str(self.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8') - - if len(description_string) > 1 and description_string != 'None': - description_display = description_string - else: - description_display = self.symbol - - if (len(description_display) > 1 and description_display != 'N/A' and - len(target_string) > 1 and target_string != 'None'): - description_display = description_display + '; ' + target_string.strip() - - # Save it for the jinja2 template - self.description_display = description_display - - #XZ: trait_location_value is used for sorting - trait_location_repr = 'N/A' - trait_location_value = 1000000 - - if self.chr and self.mb: - #Checks if the chromosome number can be cast to an int (i.e. isn't "X" or "Y") - #This is so we can convert the location to a number used for sorting - trait_location_value = convert_location_to_value(self.chr, self.mb) - #try: - # trait_location_value = int(self.chr)*1000 + self.mb - #except ValueError: - # if self.chr.upper() == 'X': - # trait_location_value = 20*1000 + self.mb - # else: - # trait_location_value = (ord(str(self.chr).upper()[0])*1000 + - # self.mb) - - #ZS: Put this in function currently called "convert_location_to_value" - self.location_repr = 'Chr%s: %.6f' % (self.chr, float(self.mb)) - self.location_value = trait_location_value - -======= ->>>>>>> e0c5c1aae3aaaa1d81bcec36835a97e169dcc2e2 if self.dataset.type == 'Publish': self.confidential = 0 |