diff options
author | zsloan | 2023-04-24 19:20:21 +0000 |
---|---|---|
committer | zsloan | 2023-04-28 13:35:17 -0500 |
commit | 9e4219ccdfbbf8f77c1c55fc6bc6ef0fad35a960 (patch) | |
tree | 9704ae13390a12668dbcaf30c3a3f3db5d795e5f /wqflask | |
parent | 9c526589575c0f0f1f4de5941d85f0c5adeccff6 (diff) | |
download | genenetwork2-9e4219ccdfbbf8f77c1c55fc6bc6ef0fad35a960.tar.gz |
Cache trait sample data for mapping
This is so edited sample values can be used in the additive effect scatterplots
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/marker_regression/display_mapping_results.py | 1 | ||||
-rw-r--r-- | wqflask/wqflask/marker_regression/run_mapping.py | 1 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 10 |
3 files changed, 11 insertions, 1 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index b0bb5db0..d23ef7b1 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -244,6 +244,7 @@ class DisplayMappingResults: def __init__(self, start_vars): self.temp_uuid = start_vars['temp_uuid'] self.hash_of_inputs = start_vars['hash_of_inputs'] + self.dataid = start_vars['dataid'] self.dataset = start_vars['dataset'] self.this_trait = start_vars['this_trait'] diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index 9161f283..952d9749 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -55,6 +55,7 @@ class RunMapping: self.group = self.dataset.group.name self.hash_of_inputs = start_vars['hash_of_inputs'] + self.dataid = start_vars['dataid'] self.json_data = {} self.json_data['lodnames'] = ['lod.hk'] diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 24426539..90747fc2 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -754,7 +754,8 @@ def mapping_results_page(): 'temp_trait', 'n_samples', 'transform', - 'hash_of_inputs' + 'hash_of_inputs', + 'dataid' ) start_vars = {} for key, value in list(initial_start_vars.items()): @@ -763,6 +764,13 @@ def mapping_results_page(): start_vars['hash_of_inputs'] = hash_of_inputs + # Store trait sample data in Redis, so additive effect scatterplots can include edited values + dhash = hashlib.md5() + dhash.update(start_vars['sample_vals'].encode()) + samples_hash = dhash.hexdigest() + Redis.set(samples_hash, start_vars['sample_vals'], ex=7*24*60*60) + start_vars['dataid'] = samples_hash + version = "v3" key = "mapping_results:{}:".format( version) + json.dumps(start_vars, sort_keys=True) |