diff options
author | Frederick Muriuki Muriithi | 2022-09-09 13:41:03 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-09-09 13:41:03 +0300 |
commit | a3c0a12584a22a834ece5baa08702320db74242f (patch) | |
tree | 3429d01a9f61841341bb67d6050fdaf1f1875052 | |
parent | 8eec2b879273b9e1a83f946bc784c03383a20595 (diff) | |
download | genenetwork2-a3c0a12584a22a834ece5baa08702320db74242f.tar.gz |
Check whether trait_list and sample_data exist before operations
-rw-r--r-- | wqflask/wqflask/correlation/rust_correlation.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py index 775f4ee9..ef3988e5 100644 --- a/wqflask/wqflask/correlation/rust_correlation.py +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -20,6 +20,9 @@ from gn3.db_utils import database_connector def query_probes_metadata(dataset, trait_list): """query traits metadata in bulk for probeset""" + if not bool(trait_list): + return [] + with database_connector() as conn: with conn.cursor() as cursor: @@ -221,6 +224,8 @@ def __compute_sample_corr__( sample_data = get_sample_corr_data( sample_type=start_vars["corr_samples_group"], all_samples=all_samples, dataset_samples=this_dataset.group.all_samples_ordered()) + if not bool(sample_data): + return {} if target_dataset.type == "ProbeSet": with database_connector() as conn: |