From 823169d970d8b64e955f7316e6df87c5204b4864 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 1 Aug 2019 12:08:33 -0500 Subject: Made some more aesthetic changes to various pages and charts/figures Added some information to the mapping loading page --- wqflask/base/trait.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'wqflask/base') diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 0527449b..39dd075e 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function import string import resource import codecs +import requests import redis Redis = redis.StrictRedis() @@ -120,11 +121,17 @@ class GeneralTrait(object): @property def alias_fmt(self): '''Return a text formatted alias''' - if self.alias: - alias = string.replace(self.alias, ";", " ") - alias = string.join(string.split(alias), ", ") - else: - alias = 'Not available' + + 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 -- cgit v1.2.3