aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorPjotr Prins2017-03-05 11:20:07 +0000
committerPjotr Prins2017-03-05 11:20:07 +0000
commit1c72c2ff02eb571368051464543caf0b44521666 (patch)
tree9fc0ce5d1acf15b52f0f1016a3767883d247adc1 /wqflask/utility
parent55bbc368c6a02ebfb8f754dfbe7ee5f60edea66b (diff)
parent2b14b0d04387a262f9895ddd87ce465c6835fa8c (diff)
downloadgenenetwork2-1c72c2ff02eb571368051464543caf0b44521666.tar.gz
Merge branch 'master' of github.com:zsloan/genenetwork2 into zsloan
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/helper_functions.py20
-rw-r--r--wqflask/utility/tools.py2
2 files changed, 22 insertions, 0 deletions
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py
index 377f6b26..cf16879f 100644
--- a/wqflask/utility/helper_functions.py
+++ b/wqflask/utility/helper_functions.py
@@ -5,6 +5,9 @@ from base import data_set
from base.species import TheSpecies
from wqflask import user_manager
+
+from flask import Flask, g
+
import logging
logger = logging.getLogger(__name__ )
@@ -41,3 +44,20 @@ def get_trait_db_obs(self, trait_db_list):
name=trait_name,
cellid=None)
self.trait_list.append((trait_ob, dataset_ob))
+
+def get_species_groups():
+
+ species_query = "SELECT SpeciesId, MenuName FROM Species"
+ species_ids_and_names = g.db.execute(species_query).fetchall()
+
+ species_and_groups = []
+ for species_id, species_name in species_ids_and_names:
+ this_species_groups = {}
+ this_species_groups['species'] = species_name
+ groups_query = "SELECT InbredSetName FROM InbredSet WHERE SpeciesId = %s" % (species_id)
+ groups = [group[0] for group in g.db.execute(groups_query).fetchall()]
+
+ this_species_groups['groups'] = groups
+ species_and_groups.append(this_species_groups)
+
+ return species_and_groups
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 9860f63e..82ef136f 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -217,9 +217,11 @@ USE_REDIS = get_setting_bool('USE_REDIS')
USE_GN_SERVER = get_setting_bool('USE_GN_SERVER')
GENENETWORK_FILES = get_setting('GENENETWORK_FILES')
+TEMP_TRAITS = get_setting('TEMP_TRAITS')
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = gemma_command()
+GEMMA_RESULTS_PATH = get_setting('GEMMA_RESULTS_PATH')
PLINK_COMMAND = plink_command()
TEMPDIR = tempdir() # defaults to UNIX TMPDIR