From ec1e37331e320ed674f184b738b9917753b6071f Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 16 Dec 2020 15:45:53 -0600 Subject: Made change to the way sample table width is calculated to account for sample name width --- wqflask/wqflask/show_trait/show_trait.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 0c6ae198..4c6dd005 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -186,8 +186,6 @@ class ShowTrait(object): self.has_num_cases = has_num_cases(self.this_trait) - self.stats_table_width, self.trait_table_width = get_table_widths(self.sample_groups, self.has_num_cases) - #ZS: Needed to know whether to display bar chart + get max sample name length in order to set table column width self.num_values = 0 self.binary = "true" #ZS: So it knows whether to display the Binary R/qtl mapping method, which doesn't work unless all values are 0 or 1 @@ -206,6 +204,8 @@ class ShowTrait(object): sample_column_width = max_samplename_width * 8 + self.stats_table_width, self.trait_table_width = get_table_widths(self.sample_groups, sample_column_width, self.has_num_cases) + if self.num_values >= 5000: self.maf = 0.01 else: @@ -547,12 +547,12 @@ def get_nearest_marker(this_trait, this_db): return result[0][0] -def get_table_widths(sample_groups, has_num_cases=False): +def get_table_widths(sample_groups, sample_column_width, has_num_cases=False): stats_table_width = 250 if len(sample_groups) > 1: stats_table_width = 450 - trait_table_width = 380 + trait_table_width = 300 + sample_column_width if sample_groups[0].se_exists: trait_table_width += 80 if has_num_cases: -- cgit v1.2.3