diff options
author | Alexander_Kabui | 2022-08-31 01:41:10 +0300 |
---|---|---|
committer | Alexander_Kabui | 2022-08-31 01:41:10 +0300 |
commit | 0718d987f1b15838d45a9c414ec6d2318ed65e90 (patch) | |
tree | 97833624ca8738c72bebc4b121605a91614a3f0d | |
parent | 33fd250d57fd8fa68a6241aa8c0ab3e477a7a515 (diff) | |
download | genenetwork2-0718d987f1b15838d45a9c414ec6d2318ed65e90.tar.gz |
add function to fetch probeset text files
-rw-r--r-- | wqflask/wqflask/correlation/pre_computes.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wqflask/wqflask/correlation/pre_computes.py b/wqflask/wqflask/correlation/pre_computes.py index cb2f4470..95047fc7 100644 --- a/wqflask/wqflask/correlation/pre_computes.py +++ b/wqflask/wqflask/correlation/pre_computes.py @@ -167,3 +167,14 @@ def get_datasets_data(base_dataset, target_dataset_data): samples_fetched, base_traits_data) return (target_results, base_results) + +def fetch_text_file(dataset_name, text_dir, conn): + """fetch textfiles with strain vals if exists""" + with conn.cursor() as cursor: + query = 'SELECT Id, FullName FROM ProbeSetFreeze WHERE Name = "%s"' % dataset_name + cursor.execute(query) + results = cursor.fetchone() + if (results): + for file in os.listdir(text_dir): + if file.startswith(f"ProbeSetFreezeId_{results[0]}_"): + return os.path.join(text_dir, file) |