aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorBonfaceKilz2021-05-11 10:06:15 +0300
committerGitHub2021-05-11 10:06:15 +0300
commit54abe9cce76f620088954bc614d739abecb1ed21 (patch)
treea91841aff9b883eb6ec04372ea73606e81c994e3 /wqflask/base
parent4f826611242080089856ccb4e3a7cda398e57b0d (diff)
parent56fc1a2a53496a8b3720515f61e54a74cc95821e (diff)
downloadgenenetwork2-54abe9cce76f620088954bc614d739abecb1ed21.tar.gz
Merge pull request #563 from Alexanderlacuna/feature/integrate-correlation-api
Feature/integrate correlation api
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/data_set.py4
-rw-r--r--wqflask/base/mrna_assay_tissue_data.py14
2 files changed, 13 insertions, 5 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index e20f2f98..75ddf278 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -124,6 +124,7 @@ class DatasetType:
self.datasets[short_dataset_name] = new_type
except Exception: # Do nothing
pass
+
self.redis_instance.set("dataset_structure",
json.dumps(self.datasets))
self.data = data
@@ -165,6 +166,7 @@ class DatasetType:
if t in ['pheno', 'other_pheno']:
group_name = name.replace("Publish", "")
+
results = g.db.execute(sql_query_mapping[t] % group_name).fetchone()
if results:
self.datasets[name] = dataset_name_mapping[t]
@@ -646,6 +648,8 @@ class DataSet:
"Dataset {} is not yet available in GeneNetwork.".format(self.name))
pass
+
+
def get_trait_data(self, sample_list=None):
if sample_list:
self.samplelist = sample_list
diff --git a/wqflask/base/mrna_assay_tissue_data.py b/wqflask/base/mrna_assay_tissue_data.py
index 882ae911..8f8e2b0a 100644
--- a/wqflask/base/mrna_assay_tissue_data.py
+++ b/wqflask/base/mrna_assay_tissue_data.py
@@ -6,6 +6,7 @@ from utility import db_tools
from utility import Bunch
from utility.db_tools import escape
+from gn3.db_utils import database_connector
from utility.logger import getLogger
@@ -45,16 +46,18 @@ class MrnaAssayTissueData:
and t.Mean = x.maxmean;
'''.format(in_clause)
- results = g.db.execute(query).fetchall()
- lower_symbols = []
+ # lower_symbols = []
+ lower_symbols = {}
for gene_symbol in gene_symbols:
+ # lower_symbols[gene_symbol.lower()] = True
if gene_symbol != None:
- lower_symbols.append(gene_symbol.lower())
-
+ lower_symbols[gene_symbol.lower()] = True
+ results = list(g.db.execute(query).fetchall())
for result in results:
symbol = result[0]
- if symbol.lower() in lower_symbols:
+ if symbol is not None and lower_symbols.get(symbol.lower()):
+
symbol = symbol.lower()
self.data[symbol].gene_id = result.GeneId
@@ -83,6 +86,7 @@ class MrnaAssayTissueData:
WHERE TissueProbeSetData.Id IN {} and
TissueProbeSetXRef.DataId = TissueProbeSetData.Id""".format(db_tools.create_in_clause(id_list))
+
results = g.db.execute(query).fetchall()
for result in results:
if result.Symbol.lower() not in symbol_values_dict: