aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/trait.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 39dd075e..a0679041 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -123,16 +123,22 @@ class GeneralTrait(object):
'''Return a text formatted alias'''
alias = 'Not available'
+ if self.alias:
+ alias = string.replace(self.alias, ";", " ")
+ alias = string.join(string.split(alias), ", ")
+
+ return alias
+
+ @property
+ def wikidata_alias_fmt(self):
+ '''Return a text formatted alias'''
+
+ alias = 'Not available'
if self.symbol:
response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + self.symbol)
alias_list = json.loads(response.content)
alias = "; ".join(alias_list)
- if alias == 'Not available':
- if self.alias:
- alias = string.replace(self.alias, ";", " ")
- alias = string.join(string.split(alias), ", ")
-
return alias