From 15fa73bf1de40a6f1c8f1866e8c691b2842abdd9 Mon Sep 17 00:00:00 2001 From: Artem Tarasov Date: Sat, 23 May 2015 18:23:21 +0300 Subject: Fix trait grouping --- wqflask/wqflask/show_trait/show_trait.py | 22 +++------------------- wqflask/wqflask/static/new/css/show_trait.css | 4 ++++ .../wqflask/templates/show_trait_edit_data.html | 2 +- .../templates/show_trait_statistics_new.html | 4 ++-- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 3c47b7d6..7ad824fa 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -1153,11 +1153,9 @@ class ShowTrait(object): elif self.dataset.group.f1list: all_samples_ordered = self.dataset.group.f1list + self.dataset.group.samplelist else: - all_samples_ordered = self.dataset.group.samplelist + all_samples_ordered = list(self.dataset.group.samplelist) - this_trait_samples = set(this_trait.data.keys()) - - primary_sample_names = all_samples_ordered + primary_sample_names = list(all_samples_ordered) print("self.dataset.group", pf(self.dataset.group.__dict__)) print("-*- primary_samplelist is:", pf(primary_sample_names)) @@ -1168,14 +1166,10 @@ class ShowTrait(object): all_samples_ordered.append(sample) other_sample_names.append(sample) - other_sample_names, all_samples_ordered = get_samplelist_from_trait_data(this_trait, - all_samples_ordered) - - print("species:", self.dataset.group.species) if self.dataset.group.species == "human": primary_sample_names += other_sample_names - + primary_samples = SampleList(dataset = self.dataset, sample_names=primary_sample_names, this_trait=this_trait, @@ -1211,16 +1205,6 @@ class ShowTrait(object): # print("hjs") self.dataset.group.allsamples = all_samples_ordered - -def get_samplelist_from_trait_data(this_trait, all_samples_ordered): - other_sample_names = [] - for sample in this_trait.data.keys(): - if sample not in all_samples_ordered: - all_samples_ordered.append(sample) - other_sample_names.append(sample) - - return other_sample_names, all_samples_ordered - def get_nearest_marker(this_trait, this_db): this_chr = this_trait.locus_chr print("this_chr:", this_chr) diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css index 9fc82a85..1e9fd4df 100644 --- a/wqflask/wqflask/static/new/css/show_trait.css +++ b/wqflask/wqflask/static/new/css/show_trait.css @@ -4,4 +4,8 @@ tr .outlier { #bar_chart_container { overflow-x:scroll; +} + +div.sample_group { + overflow: auto; # needed because it contains float dataTable wrapper } \ No newline at end of file diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index 12a6a48e..2798b6e9 100755 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -75,7 +75,7 @@