diff options
author | Alexander_Kabui | 2022-08-16 12:26:35 +0300 |
---|---|---|
committer | Alexander_Kabui | 2022-08-16 12:26:35 +0300 |
commit | 56928f087caaa7021a34a1186d0316a9e35e3e9c (patch) | |
tree | d79598c9a8bb9c9fef80ef6781170fcefe5a5edc /wqflask | |
parent | fa8ef3e466e3919648e1d4cf9c38ed30328fc7a6 (diff) | |
download | genenetwork2-56928f087caaa7021a34a1186d0316a9e35e3e9c.tar.gz |
remove flask g object
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/correlation/rust_correlation.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index 2a2ad4a0..ce1b5fda 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -1,7 +1,6 @@ """module contains integration code for rust-gn3""" import json from functools import reduce -from flask import g from utility.db_tools import mescape from utility.db_tools import create_in_clause from wqflask.correlation.correlation_functions import get_trait_symbol_and_tissue_values @@ -29,8 +28,12 @@ def chunk_dataset(dataset,steps,name): ProbeSetXRef.ProbeSetId = ProbeSet.Id """.format(name) - traits_name_dict = dict(g.db.execute(query).fetchall()) + with database_connector() as conn: + curr = conn.cursor() + curr.execute(query) + + traits_name_dict = curr.fetchall() for i in range(0, len(dataset), steps): matrix = list(dataset[i:i + steps]) @@ -45,7 +48,7 @@ def chunk_dataset(dataset,steps,name): def compute_top_n_sample(start_vars, dataset, trait_list): """check if dataset is of type probeset""" - if dataset.type!= "Probeset": + if dataset.type.lower()!= "probeset": return {} def __fetch_sample_ids__(samples_vals, samples_group): @@ -248,6 +251,8 @@ def compute_correlation_rust( top_a = top_b = {} + compute_all = True + if compute_all: if corr_type == "sample": |