diff options
-rw-r--r-- | wqflask/wqflask/show_trait/SampleList.py | 7 | ||||
-rw-r--r-- | wqflask/wqflask/show_trait/show_trait.py | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py index f9d30dba..67768308 100644 --- a/wqflask/wqflask/show_trait/SampleList.py +++ b/wqflask/wqflask/show_trait/SampleList.py @@ -8,7 +8,6 @@ from pprint import pformat as pf from utility import Plot from utility import Bunch - class SampleList: def __init__(self, dataset, @@ -92,8 +91,10 @@ class SampleList: self.sample_list.append(sample) self.se_exists = any(sample.variance for sample in self.sample_list) - self.num_cases_exists = any( - sample.num_cases for sample in self.sample_list) + self.num_cases_exists = False + if (any(sample.num_cases for sample in self.sample_list) and + any((sample.num_cases and sample.num_cases != "1") for sample in self.sample_list)): + self.num_cases_exists = True first_attr_col = self.get_first_attr_col() for sample in self.sample_list: diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 424b8ee5..837c7a54 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -631,7 +631,7 @@ def has_num_cases(this_trait): has_n = False if this_trait.dataset.type != "ProbeSet" and this_trait.dataset.type != "Geno": for name, sample in list(this_trait.data.items()): - if sample.num_cases: + if sample.num_cases and sample.num_cases != "1": has_n = True break |