aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorLei Yan2015-05-12 20:47:50 +0000
committerLei Yan2015-05-12 20:47:50 +0000
commitcb5684aa004d59585167804450f64ab74d3a3412 (patch)
tree31aedac7d1fd945c893f07e2e419b4361f00925b /wqflask/base/trait.py
parentd11b71790f5f7c7eb9fe41704e1df7d8447371c9 (diff)
parentf228118ac112f3ebab5faf41ac9e1bc2a6e2c0fa (diff)
downloadgenenetwork2-cb5684aa004d59585167804450f64ab74d3a3412.tar.gz
Merge https://github.com/genenetwork/genenetwork2
Diffstat (limited to 'wqflask/base/trait.py')
-rwxr-xr-xwqflask/base/trait.py31
1 files changed, 25 insertions, 6 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 58bed865..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()
@@ -549,6 +565,9 @@ class GeneralTrait(object):
if self.alias:
alias = string.replace(self.alias, ";", " ")
alias = string.join(string.split(alias), ", ")
+ else:
+ alias = 'Not available'
+
return alias
@@ -649,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
+