about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArtem Tarasov2015-05-23 18:23:21 +0300
committerArtem Tarasov2015-05-23 18:23:21 +0300
commit15fa73bf1de40a6f1c8f1866e8c691b2842abdd9 (patch)
tree73e83f64b83050535f4e3216dafb87ac07cd4dba
parentd7269c74a55c17555a0616444d2e6933ea2f5eb4 (diff)
downloadgenenetwork2-15fa73bf1de40a6f1c8f1866e8c691b2842abdd9.tar.gz
Fix trait grouping
-rwxr-xr-xwqflask/wqflask/show_trait/show_trait.py22
-rw-r--r--wqflask/wqflask/static/new/css/show_trait.css4
-rwxr-xr-xwqflask/wqflask/templates/show_trait_edit_data.html2
-rwxr-xr-xwqflask/wqflask/templates/show_trait_statistics_new.html4
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 @@
 
     <div id="edit_sample_lists">
     {% for sample_type in sample_groups %}
-        <div>
+        <div class="sample_group">
             <h3>{{ sample_type.header }}</h3>
 
             <table cellpadding="0" cellspacing="0" border="0" class="table table-hover table-striped table-bordered"
diff --git a/wqflask/wqflask/templates/show_trait_statistics_new.html b/wqflask/wqflask/templates/show_trait_statistics_new.html
index f33b6aa4..e5f16f9b 100755
--- a/wqflask/wqflask/templates/show_trait_statistics_new.html
+++ b/wqflask/wqflask/templates/show_trait_statistics_new.html
@@ -32,7 +32,7 @@
                 </div>   
                 <div class="tab-pane" id="histogram_tab">
                     <div style="padding: 20px" class="form-horizontal">
-                        {% if sample_groups|length == 1 %}
+                        {% if sample_groups|length != 1 %}
                         <select class="histogram_samples_group">
                             {% for group, pretty_group in sample_group_types.items() %}
                                 <option value="{{ group }}">{{ pretty_group }}</option>
@@ -47,7 +47,7 @@
                 </div>   
                 <div class="tab-pane" id="bar_chart_tab">
                     <div style="padding: 20px" class="form-horizontal">
-                        {% if sample_groups|length == 1 %}
+                        {% if sample_groups|length != 1 %}
                         <select class="bar_chart_samples_group">
                             {% for group, pretty_group in sample_group_types.items() %}
                                 <option value="{{ group }}">{{ pretty_group }}</option>