From 4bd5534658fe7ed2a9ffd50c137be81d7a7b190b Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 30 Sep 2020 13:32:54 -0500 Subject: Removed unused code from TempDataSet class * wqflask/base/data_set.py - TempDataSet class contained some code referring to the SQL DB, but temp traits aren't stored in the SQL DB anymore --- wqflask/base/data_set.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index afffe780..e0ef559c 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -1173,40 +1173,6 @@ class TempDataSet(DataSet): self.fullname = 'Temporary Storage' self.shortname = 'Temp' - @staticmethod - def handle_pca(desc): - if 'PCA' in desc: - # Todo: Modernize below lines - desc = desc[desc.rindex(':')+1:].strip() - else: - desc = desc[:desc.index('entered')].strip() - return desc - - def get_desc(self): - query = 'SELECT description FROM Temp WHERE Name=%s' % self.name - logger.sql(query) - g.db.execute(query) - desc = g.db.fetchone()[0] - desc = self.handle_pca(desc) - return desc - - def retrieve_sample_data(self, trait): - query = """ - SELECT - Strain.Name, TempData.value, TempData.SE, TempData.NStrain, TempData.Id - FROM - TempData, Temp, Strain - WHERE - TempData.StrainId = Strain.Id AND - TempData.Id = Temp.DataId AND - Temp.name = '%s' - Order BY - Strain.Name - """ % escape(trait.name) - - logger.sql(query) - results = g.db.execute(query).fetchall() - def geno_mrna_confidentiality(ob): dataset_table = ob.type + "Freeze" -- cgit v1.2.3 From 8a01dca227aa03e794ced5f99513355f2a035f2f Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 30 Sep 2020 15:37:10 -0500 Subject: Changed the logic for adding 0 to the PCA results to do so when the shared samples are < 2 instead of 0; this fixed the error when running the correlation matrix, but results in the PCA traits having no values * wqflask/wqflask/correlation_matrx/show_corr_matrix.py - changed "if num_overlap == 0" to "if num_overlap < 2" because correlations can't be run if there are fewer than 2 shared samples (and previously would throw an error if there was exactly 1 shared sample) --- wqflask/wqflask/correlation_matrix/show_corr_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py index 0ac94139..3beee84f 100644 --- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py +++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py @@ -147,7 +147,7 @@ class CorrelationMatrix(object): if num_overlap < self.lowest_overlap: self.lowest_overlap = num_overlap - if num_overlap == 0: + if num_overlap < 2: corr_result_row.append([target_trait, 0, num_overlap]) pca_corr_result_row.append(0) else: -- cgit v1.2.3 From 8c0ab33592e29bf6bae14ba4831dde8a53a27363 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 2 Oct 2020 14:54:09 -0500 Subject: Checked if owner_id is "none" to avoid an error when trying to access the resource manager page with newly added datasets * wqflask/wqflask/resource_manager.py - Only get owner user info conditional on owner_id not being "none" (which it will be by default for newly added datasets). Previously it would throw an error due to "owner_info" being None --- wqflask/wqflask/resource_manager.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py index 39a07310..14ff2183 100644 --- a/wqflask/wqflask/resource_manager.py +++ b/wqflask/wqflask/resource_manager.py @@ -25,16 +25,16 @@ def manage_resource(): group_masks_with_names = get_group_names(group_masks) default_mask = resource_info['default_mask']['data'] owner_id = resource_info['owner_id'] - owner_info = get_user_by_unique_column("user_id", owner_id) - - if 'name' in owner_info: - owner_display_name = owner_info['full_name'] - elif 'user_name' in owner_info: - owner_display_name = owner_info['user_name'] - elif 'email_address' in owner_info: - owner_display_name = owner_info['email_address'] - else: - owner_display_name = None + + owner_display_name = None + if owner_id != "none": + owner_info = get_user_by_unique_column("user_id", owner_id) + if 'name' in owner_info: + owner_display_name = owner_info['full_name'] + elif 'user_name' in owner_info: + owner_display_name = owner_info['user_name'] + elif 'email_address' in owner_info: + owner_display_name = owner_info['email_address'] return render_template("admin/manage_resource.html", owner_name = owner_display_name, resource_id = resource_id, resource_info=resource_info, default_mask=default_mask, group_masks=group_masks_with_names, admin_status=admin_status) -- cgit v1.2.3 From 17fe50912ee358dbacaaa402a55e1fcfa14f7e85 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 6 Oct 2020 14:19:21 -0500 Subject: Fixed issue where drop-down arrows and textarea corners couldn't be clicked with certain window widths * wqflask/wqflask/templates/index_page_orig.html - Changed the left/right div's padding to prevent them from overlapping and changed the textareas' styles to make them only expandable vertically --- wqflask/wqflask/templates/index_page_orig.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 06b71f53..6b3bec9a 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -17,13 +17,13 @@ --> -
+
{{ flash_me() }}
-
+
@@ -184,7 +184,7 @@
-
+