aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
diff options
context:
space:
mode:
authorzsloan2020-05-28 20:24:01 -0500
committerzsloan2020-05-28 20:24:01 -0500
commitff94904574c51eeb7aecb327d6f2679fa4a60fb4 (patch)
tree9f439523b55dc9531cfee96147e996d280e05a30 /wqflask/base/trait.py
parent55b654a9f40bb247272c45671c58c772874f43f6 (diff)
downloadgenenetwork2-ff94904574c51eeb7aecb327d6f2679fa4a60fb4.tar.gz
Added lines calling proxy for publish datasets + added some resource redis queries and a missing import for the hmac functions
Diffstat (limited to 'wqflask/base/trait.py')
-rw-r--r--wqflask/base/trait.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index e454c593..1b7cb23c 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -5,9 +5,6 @@ import resource
import codecs
import requests
-import redis
-Redis = redis.StrictRedis()
-
from base import webqtlConfig
from base.webqtlCaseData import webqtlCaseData
from base.data_set import create_dataset
@@ -15,6 +12,8 @@ from db import webqtlDatabaseFunction
from utility import webqtlUtil
from utility import hmac
from utility.tools import GN2_BASE_URL
+from utility.redis_tools import get_redis_conn
+Redis = get_redis_conn()
from wqflask import app
@@ -349,8 +348,13 @@ def jsonable_table_row(trait, dataset_name, index):
def retrieve_trait_info(trait, dataset, get_qtl_info=False):
assert dataset, "Dataset doesn't exist"
-
+
if dataset.type == 'Publish':
+ resource_id = hmac.data_hmac("{}:{}".format(dataset.id, trait.name))
+
+ the_url = "http://localhost:8080/run_action/?resource={}&user={}&branch=data&action=view".format(resource_id, g.user_session.user_id)
+ trait_data = json.loads(requests.get("http://localhost:8080/run_action/?resource={}&user={}&branch=data&action=view".format(resource_id, g.user_session.user_id)))
+
query = """
SELECT
PublishXRef.Id, InbredSet.InbredSetCode, Publication.PubMed_ID,