aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/elasticsearch_tools.py
diff options
context:
space:
mode:
authorzsloan2018-05-17 16:32:44 +0000
committerzsloan2018-05-17 16:32:44 +0000
commit67e8f12e103f48329d8b3e38125c0e84b9dc089d (patch)
tree067d4bcb5b6469b81cbd4c4f68d00f656a02a465 /wqflask/utility/elasticsearch_tools.py
parent42df24ad10354f28215ff52ff045538fea566940 (diff)
downloadgenenetwork2-67e8f12e103f48329d8b3e38125c0e84b9dc089d.tar.gz
Added script to quantile normalize a data set and enter its normalized sample data into ElasticSearch
Added option to replace trait page sample/strain values with normalized ones Began editing Lei's scatterplot code Changed elasticsearch_tools' get_elasticsearch_connection so that it can also be used for purposes other than user authentication (by adding a "for_user" parameter)
Diffstat (limited to 'wqflask/utility/elasticsearch_tools.py')
-rw-r--r--wqflask/utility/elasticsearch_tools.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py
index cce210c3..293a9ae6 100644
--- a/wqflask/utility/elasticsearch_tools.py
+++ b/wqflask/utility/elasticsearch_tools.py
@@ -52,7 +52,7 @@ def test_elasticsearch_connection():
if not es.ping():
logger.warning("Elasticsearch is DOWN")
-def get_elasticsearch_connection():
+def get_elasticsearch_connection(for_user=True):
"""Return a connection to ES. Returns None on failure"""
logger.info("get_elasticsearch_connection")
es = None
@@ -65,7 +65,8 @@ def get_elasticsearch_connection():
"host": ELASTICSEARCH_HOST, "port": ELASTICSEARCH_PORT
}]) if (ELASTICSEARCH_HOST and ELASTICSEARCH_PORT) else None
- setup_users_index(es)
+ if for_user:
+ setup_users_index(es)
es_logger = logging.getLogger("elasticsearch")
es_logger.setLevel(logging.INFO)