From b09fc33754dd8f250332180eefa988e77a6f898c Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 8 Oct 2020 13:21:27 -0500 Subject: When generating links to correlation scatterplots (in corr results and corr matrix), append the group name to Temp dataset names so temp traits can be used in scatterplot * wqflask/wqflask/correlation/corr_scatter_plot.py - Create the dataset object using the group name included with Temp dataset names (which take the form "Temp_(group_name)") * wqflask/wqflask/templates/correlation_matrix.html - Change scatterplot links to include the group name if the dataset name is "Temp" * wqflask/wqflask/templates/correlation_page.html - Change scatterplot links to include the group name if the dataset name is "Temp" + a couple minor style changes --- wqflask/wqflask/correlation/corr_scatter_plot.py | 11 +++++++++-- wqflask/wqflask/templates/correlation_matrix.html | 2 +- wqflask/wqflask/templates/correlation_page.html | 12 ++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/wqflask/wqflask/correlation/corr_scatter_plot.py b/wqflask/wqflask/correlation/corr_scatter_plot.py index 819836b1..0f3d455c 100644 --- a/wqflask/wqflask/correlation/corr_scatter_plot.py +++ b/wqflask/wqflask/correlation/corr_scatter_plot.py @@ -17,8 +17,15 @@ class CorrScatterPlot(object): """Page that displays a correlation scatterplot with a line fitted to it""" def __init__(self, params): - self.dataset_1 = data_set.create_dataset(params['dataset_1']) - self.dataset_2 = data_set.create_dataset(params['dataset_2']) + if "Temp" in params['dataset_1']: + self.dataset_1 = data_set.create_dataset(dataset_name = "Temp", dataset_type = "Temp", group_name = params['dataset_1'].split("_")[1]) + else: + self.dataset_1 = data_set.create_dataset(params['dataset_1']) + if "Temp" in params['dataset_2']: + self.dataset_2 = data_set.create_dataset(dataset_name = "Temp", dataset_type = "Temp", group_name = params['dataset_2'].split("_")[1]) + else: + self.dataset_2 = data_set.create_dataset(params['dataset_2']) + #self.dataset_3 = data_set.create_dataset(params['dataset_3']) self.trait_1 = create_trait(name=params['trait_1'], dataset=self.dataset_1) self.trait_2 = create_trait(name=params['trait_2'], dataset=self.dataset_2) diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index 9b96de1c..d556f31a 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -51,7 +51,7 @@ {% if result[0].name == trait.name and result[0].dataset == trait.dataset %}