diff options
author | Artem Tarasov | 2015-05-12 14:10:04 +0300 |
---|---|---|
committer | Artem Tarasov | 2015-05-12 14:10:04 +0300 |
commit | 2eeaf2f6df9deb3f89db0b5821d784b93eb4bc36 (patch) | |
tree | 8e632066dc0ad270d0b065c7d408b3bc4671019b /wqflask/base | |
parent | 3f3469d007c3e5ff229425911b28f24211c84301 (diff) | |
download | genenetwork2-2eeaf2f6df9deb3f89db0b5821d784b93eb4bc36.tar.gz |
Fix #35
* 'aliases' and 'location' are shown only where relevant
* descriptions for phenotype datasets are provided at the top
Diffstat (limited to 'wqflask/base')
-rwxr-xr-x | wqflask/base/trait.py | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index f3648b80..8930c917 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -53,7 +53,8 @@ class GeneralTrait(object): self.pvalue = None self.mean = None self.num_overlap = None - + self.strand_probe = None + self.symbol = None if kw.get('fullname'): name2 = value.split("::") @@ -533,12 +534,27 @@ class GeneralTrait(object): return setDescription @property + def name_header_fmt(self): + '''Return a human-readable name for use in page header''' + if self.dataset.type == 'ProbeSet': + return self.symbol + elif self.dataset.type == 'Geno': + return self.name + elif self.dataset.type == 'Publish': + return self.post_publication_abbreviation + else: + return "unnamed" + + @property def description_fmt(self): '''Return a text formated description''' - if self.description: - formatted = self.description - if self.probe_target_description: - formatted += "; " + self.probe_target_description + if self.dataset.type == 'ProbeSet': + if self.description: + formatted = self.description + if self.probe_target_description: + formatted += "; " + self.probe_target_description + elif self.dataset.type == 'Publish': + formatted = self.post_publication_description else: formatted = "Not available" return formatted.capitalize() @@ -652,4 +668,4 @@ def get_sample_data(): # jsonable_sample_data[sample] = trait_ob.data[sample].value # #return jsonable_sample_data -
\ No newline at end of file + |