aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2022-07-27 18:12:26 +0000
committerzsloan2022-07-27 18:12:37 +0000
commita08d91a234f700043d1d31164c7e2bacda4729da (patch)
treef8323dd89ba5426740e638fba2b9344e567b053e /wqflask
parent93f866cb6b3ad0011c7fb8f6a26901f5b732e2a3 (diff)
downloadgenenetwork2-a08d91a234f700043d1d31164c7e2bacda4729da.tar.gz
Disable PCA when fewer than 3 traits
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index cf37b9e9..17c174b1 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -77,7 +77,7 @@ class CorrelationMatrix:
self.sample_data.append(this_trait_vals)
# Shouldn't do PCA if there are more traits than observations/samples
- if len(this_trait_vals) < len(self.trait_list):
+ if len(this_trait_vals) < len(self.trait_list) or len(self.trait_list) < 3:
self.do_PCA = False
# ZS: Variable set to the lowest overlapping samples in order to notify user, or 8, whichever is lower (since 8 is when we want to display warning)
@@ -85,6 +85,7 @@ class CorrelationMatrix:
self.corr_results = []
self.pca_corr_results = []
+ self.scree_data = []
self.shared_samples_list = self.all_sample_list
for trait_db in self.trait_list:
this_trait = trait_db[0]