diff options
author | zsloan | 2019-08-01 15:16:39 -0500 |
---|---|---|
committer | zsloan | 2019-08-01 15:16:39 -0500 |
commit | eb2fb5c936ff8e2351ef3c1f9cf4968790528bdb (patch) | |
tree | 7679ed0f5ec300bc4f91ceca57855d471d35c6ea /wqflask/base | |
parent | d49507350119c79c1ffb09b054d08b7545703a18 (diff) | |
download | genenetwork2-eb2fb5c936ff8e2351ef3c1f9cf4968790528bdb.tar.gz |
Added wikidata aliases
Fixed year to not be a hyperlink when no pubmed id
Fixed first column width so it doesn't go onto two lines for trait details
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/trait.py | 16 |
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 |