about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbin/genenetwork22
-rw-r--r--wqflask/maintenance/generate_kinship_from_bimbam.py4
-rw-r--r--wqflask/maintenance/geno_to_json.py6
-rw-r--r--wqflask/wqflask/show_trait/SampleList.py5
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py8
-rw-r--r--wqflask/wqflask/static/new/css/show_trait.css4
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json96
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js80
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js29
-rw-r--r--wqflask/wqflask/static/new/javascript/stats.js12
-rw-r--r--wqflask/wqflask/templates/mapping_results.html5
-rw-r--r--wqflask/wqflask/templates/search_result_page.html9
-rw-r--r--wqflask/wqflask/templates/show_trait.html33
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html9
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html12
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html67
-rw-r--r--wqflask/wqflask/templates/show_trait_statistics.html10
-rw-r--r--wqflask/wqflask/templates/show_trait_transform_and_filter.html79
18 files changed, 323 insertions, 147 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 10e99d8b..21f0db13 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -25,7 +25,7 @@
 # webserver) run from the base-dir with settings file and add that
 # script with a -c switch, e.g.
 #
-#   env GN2_PROFILE=/usr/local/guix-profiles/gn2-latest SQL_URI=mysql://webqtlout:webqtlout@lily.uthsc.edu/db_webqtl ./bin/genenetwork2 ./etc/default_settings.py -c ./maintenance/gen_select_dataset.py
+#   env GN2_PROFILE=/usr/local/guix-profiles/gn-latest-20181119 TMPDIR=/export/local/home/zas1024/gn2-zach/tmp WEBSERVER_MODE=DEBUG LOG_LEVEL=DEBUG SERVER_PORT=5002 GENENETWORK_FILES=/export/local/home/zas1024/gn2-zach/genotype_files SQL_URI=mysql://webqtlout:webqtlout@lily.uthsc.edu/db_webqtl ./bin/genenetwork2 ./etc/default_settings.py -c ./maintenance/gen_select_dataset.py
 #
 # To run any script in the environment
 #
diff --git a/wqflask/maintenance/generate_kinship_from_bimbam.py b/wqflask/maintenance/generate_kinship_from_bimbam.py
index ad0eb036..b53f5dda 100644
--- a/wqflask/maintenance/generate_kinship_from_bimbam.py
+++ b/wqflask/maintenance/generate_kinship_from_bimbam.py
@@ -54,8 +54,8 @@ class GenerateKinshipMatrices(object):
     
     
 if __name__=="__main__":
-    Geno_Directory = """/home/zas1024/genotype_files/genotype/"""
-    Bimbam_Directory = """/home/zas1024/genotype_files/genotype/bimbam/"""
+    Geno_Directory = """/export/local/home/zas1024/genotype_files/genotype/"""
+    Bimbam_Directory = """/export/local/home/zas1024/genotype_files/genotype/bimbam/"""
     GenerateKinshipMatrices.process_all(Geno_Directory, Bimbam_Directory)
     
     #./gemma -g /home/zas1024/genotype_files/genotype/bimbam/BXD_geno.txt -p /home/zas1024/genotype_files/genotype/bimbam/BXD_pheno.txt -gk 1 -o BXD
\ No newline at end of file
diff --git a/wqflask/maintenance/geno_to_json.py b/wqflask/maintenance/geno_to_json.py
index 789a1691..9579812a 100644
--- a/wqflask/maintenance/geno_to_json.py
+++ b/wqflask/maintenance/geno_to_json.py
@@ -24,6 +24,8 @@ import simplejson as json
 
 from pprint import pformat as pf
 
+#from utility.tools import flat_files
+
 class EmptyConfigurations(Exception): pass
 
         
@@ -183,8 +185,8 @@ class ConvertGenoFile(object):
 
 
 if __name__=="__main__":
-    Old_Geno_Directory = """/home/zas1024/genotype_files/genotype/"""
-    New_Geno_Directory = """/home/zas1024/genotype_files/genotype/json/"""
+    Old_Geno_Directory = """/export/local/home/zas1024/gn2-zach/genotype_files/genotype"""
+    New_Geno_Directory = """/export/local/home/zas1024/gn2-zach/genotype_files/genotype/json"""
     #Input_File = """/home/zas1024/gene/genotype_files/genotypes/BXD.geno"""
     #Output_File = """/home/zas1024/gene/wqflask/wqflask/pylmm/data/bxd.snps"""
     #convertob = ConvertGenoFile("/home/zas1024/gene/genotype_files/genotypes/SRxSHRSPF2.geno", "/home/zas1024/gene/genotype_files/new_genotypes/SRxSHRSPF2.json")
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py
index 31d47ff2..6d9f07a0 100644
--- a/wqflask/wqflask/show_trait/SampleList.py
+++ b/wqflask/wqflask/show_trait/SampleList.py
@@ -63,10 +63,7 @@ class SampleList(object):
                 sample.extra_info['url'] = "/mouseCross.html#AXB/BXA"
                 sample.extra_info['css_class'] = "fs12"
 
-            if sample_group_type == 'primary':
-                sample.this_id = "Primary_" + str(counter)
-            else:
-                sample.this_id = "Other_" + str(counter)
+            sample.this_id = str(counter)
 
             #### For extra attribute columns; currently only used by several datasets - Zach
             if self.sample_attribute_values:
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 34447853..7d6dd74e 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -153,7 +153,8 @@ class ShowTrait(object):
            hddn['group'] = self.temp_group
            hddn['species'] = self.temp_species
         hddn['use_outliers'] = False
-        hddn['method'] = "pylmm"
+        hddn['method'] = "gemma"
+        hddn['selected_chr'] = -1
         hddn['mapping_display_all'] = True
         hddn['suggestive'] = 0
         hddn['num_perm'] = 0
@@ -182,6 +183,11 @@ class ShowTrait(object):
             self.sample_group_types['samples_primary'] = self.dataset.group.name
         sample_lists = [group.sample_list for group in self.sample_groups]
 
+        #ZS: Get list of chromosomes to select for mapping
+        self.chr_list = [["All", -1]]
+        for i, this_chr in enumerate(self.species.chromosomes.chromosomes):
+            self.chr_list.append([self.species.chromosomes.chromosomes[this_chr].name, i])
+
         self.genofiles = get_genofiles(self.dataset)
 
         self.has_num_cases = has_num_cases(self.this_trait)
diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css
index aa47d13f..c03b6103 100644
--- a/wqflask/wqflask/static/new/css/show_trait.css
+++ b/wqflask/wqflask/static/new/css/show_trait.css
@@ -27,6 +27,10 @@ table.dataTable thead .sorting_desc {
   background-image: url("../packages/DataTables/images/sort_desc_disabled.png");
 }
 
+table.dataTable thead th {
+  padding: 4px 18px 4px 10px;
+}
+
 table.dataTable tbody td {
   padding: 3px 20px 1px 10px;
 }
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index 9c806a7f..72008225 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -1557,6 +1557,42 @@
                ]
             ]
          },
+         "AIL-LGSM-F34-A": {
+            "Phenotypes": [
+               [
+                  "None",
+                  "AIL-LGSM-F34-APublish",
+                  "AIL-LGSM-F34-A Phenotypes"
+               ]
+            ]
+         },
+         "AIL-LGSM-F34-F39-43-GBS": {
+            "Phenotypes": [
+               [
+                  "None",
+                  "AIL-LGSM-F34-F39-43-GBSPublish",
+                  "AIL-LGSM-F34-F39-43-GBS Phenotypes"
+               ]
+            ]
+         },
+         "AIL-LGSM-F34-GBS": {
+            "Phenotypes": [
+               [
+                  "None",
+                  "AIL-LGSM-F34-GBSPublish",
+                  "AIL-LGSM-F34-GBS Phenotypes"
+               ]
+            ]
+         },
+         "AIL-LGSM-F39-43-GBS": {
+            "Phenotypes": [
+               [
+                  "None",
+                  "AIL-LGSM-F39-43-GBSPublish",
+                  "AIL-LGSM-F39-43-GBS Phenotypes"
+               ]
+            ]
+         },
          "AKXD": {
             "Genotypes": [
                [
@@ -2591,6 +2627,11 @@
             ],
             "Liver mRNA": [
                [
+                  "857",
+                  "EPFLMouseLiverCDHFDRMA0818",
+                  "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Aug18) RMA"
+               ],
+               [
                   "859",
                   "EPFLMouseLiverCDRMA0818",
                   "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Aug18) RMA"
@@ -2621,11 +2662,6 @@
                   "NIA Aging BXD HFD Liver Affy Clariom S Gene Level (Aug18) RMA **"
                ],
                [
-                  "857",
-                  "EPFLMouseLiverCDHFDRMA0818",
-                  "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Aug18) RMA"
-               ],
-               [
                   "430",
                   "EPFLMouseLiverRMA0413",
                   "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
@@ -2641,6 +2677,11 @@
                   "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
                ],
                [
+                  "848",
+                  "EPFLMouseLiverHFCEx0413",
+                  "EPFL/LISP BXD HFC Liver Affy Mouse Gene 1.0 ST (Apr13) RMA Exon Level"
+               ],
+               [
                   "433",
                   "EPFLMouseLiverBothExRMA0413",
                   "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA Exon Level"
@@ -2651,11 +2692,6 @@
                   "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA Exon Level"
                ],
                [
-                  "848",
-                  "EPFLMouseLiverHFCEx0413",
-                  "EPFL/LISP BXD HFC Liver Affy Mouse Gene 1.0 ST (Apr13) RMA Exon Level"
-               ],
-               [
                   "700",
                   "UTHSC-VGX_MmBXDHepatocytesRMA1014",
                   "UT-VGX Hepatocytes Affy Mouse Gene 1.0 ST Gene Level (Oct14) RMA"
@@ -4002,6 +4038,22 @@
             "AIL Advanced Intercross Line"
          ],
          [
+            "AIL-LGSM-F34-A",
+            "AIL LGSM F34 (Array)"
+         ],
+         [
+            "AIL-LGSM-F34-GBS",
+            "AIL LGSM F34 (GBS)"
+         ],
+         [
+            "AIL-LGSM-F34-F39-43-GBS",
+            "AIL LGSM F34 and F39-43 (GBS)"
+         ],
+         [
+            "AIL-LGSM-F39-43-GBS",
+            "AIL LGSM F39-43 (GBS)"
+         ],
+         [
             "AKXD",
             "AKXD RI Family"
          ],
@@ -4929,6 +4981,30 @@
                "Striatum mRNA"
             ]
          ],
+         "AIL-LGSM-F34-A": [
+            [
+               "Phenotypes",
+               "Phenotypes"
+            ]
+         ],
+         "AIL-LGSM-F34-F39-43-GBS": [
+            [
+               "Phenotypes",
+               "Phenotypes"
+            ]
+         ],
+         "AIL-LGSM-F34-GBS": [
+            [
+               "Phenotypes",
+               "Phenotypes"
+            ]
+         ],
+         "AIL-LGSM-F39-43-GBS": [
+            [
+               "Phenotypes",
+               "Phenotypes"
+            ]
+         ],
          "AKXD": [
             [
                "Genotypes",
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index df86e764..717d98b9 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -417,16 +417,27 @@
       }
       console.log("towards end:", sample_sets);
       update_stat_values(sample_sets);
-      console.log("redrawing histogram");
-      redraw_histogram();
-      console.log("redrawing bar chart");
-      redraw_bar_chart();
-      console.log("redrawing box plot");
-      redraw_box_plot();
-      console.log("redrawing violin plot");
-      redraw_violin_plot();
-      console.log("redrawing probability plot");
-      return redraw_prob_plot();
+
+      if ($('#histogram').hasClass('js-plotly-plot')){
+        console.log("redrawing histogram");
+        redraw_histogram();
+      }
+      if ($('#bar_chart').hasClass('js-plotly-plot')){
+        console.log("redrawing bar chart");
+        redraw_bar_chart();
+      }
+      if ($('#box_plot').hasClass('js-plotly-plot')){
+        console.log("redrawing box plot");
+        redraw_box_plot();
+      }
+      if ($('#violin_plot').hasClass('js-plotly-plot')){
+        console.log("redrawing violin plot");
+        redraw_violin_plot();
+      }
+      if ($('#prob_plot_div').hasClass('js-plotly-plot')){
+        console.log("redrawing probability plot");
+        return redraw_prob_plot();
+      }
     };
     show_hide_outliers = function() {
       var label;
@@ -853,7 +864,13 @@
         }
       };
       root.bar_layout = layout
-      Plotly.newPlot('bar_chart', root.bar_data, root.bar_layout, root.modebar_options)
+      $('.bar_chart_tab').click(function() {
+        if ($('#bar_chart').hasClass('js-plotly-plot')){
+          redraw_bar_chart();
+        } else {
+          Plotly.newPlot('bar_chart', root.bar_data, root.bar_layout, root.modebar_options)
+        }
+      });
     }
 
     if (full_sample_lists.length > 1) {
@@ -957,11 +974,18 @@
         ]
     }
 
-    obj = {
+    box_obj = {
       data: box_data,
       layout: root.box_layout
     }
-    Plotly.newPlot('box_plot', obj, root.modebar_options);
+
+    $('.box_plot_tab').click(function() {
+      if ($('#box_plot').hasClass('js-plotly-plot')){
+        redraw_box_plot();
+      } else {
+        Plotly.newPlot('box_plot', box_obj, root.modebar_options);
+      }
+    });
 
     // Violin Plot
 
@@ -1066,12 +1090,18 @@
         ]
     }
 
-    obj = {
+    violin_obj = {
       data: violin_data,
       layout: root.violin_layout
     }
 
-    Plotly.plot('violin_plot', obj, root.modebar_options)
+    $('.violin_plot_tab').click(function() {
+      if ($('#violin_plot').hasClass('js-plotly-plot')){
+        redraw_violin_plot();
+      } else {
+        Plotly.plot('violin_plot', violin_obj, root.modebar_options);
+      }
+    });
 
     // Histogram
     var hist_trace = {
@@ -1091,9 +1121,16 @@
           b: 60
       }
     };
-    Plotly.newPlot('histogram', data, layout, root.modebar_options)
 
-    update_histogram_width()
+    $('.histogram_tab').click(function() {
+      if ($('#histogram').hasClass('js-plotly-plot')){
+        redraw_histogram();
+        update_histogram_width();
+      } else {
+        Plotly.newPlot('histogram', data, layout, root.modebar_options)
+        update_histogram_width()
+      }
+    });
 
     $('.histogram_samples_group').val(root.stats_group);
     $('.histogram_samples_group').change(function() {
@@ -1119,13 +1156,18 @@
 
     root.prob_plot_group = 'samples_primary';
     $('.prob_plot_samples_group').val(root.prob_plot_group);
+    $('.prob_plot_tab').click(function() {
+      return redraw_prob_plot();
+    });
     $('.prob_plot_samples_group').change(function() {
       root.prob_plot_group = $(this).val();
       return redraw_prob_plot();
     });
 
-    make_table();
-    edit_data_change();
+    $('.stats_panel').click(function() {
+      make_table();
+      edit_data_change();
+    });
     $('#edit_sample_lists').change(edit_data_change);
     $('.edit_sample_value').change(edit_data_change);
     $('#block_by_index').click(edit_data_change);
diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
index daa5b3f2..4e82fff2 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
@@ -154,36 +154,12 @@
     };
   })(this));
 
-  $("#pylmm_mapping_compute").on("mouseover", (function(_this) {
-    return function() {
-      if ($(".outlier").length && $(".outlier-alert").length < 1) {
-        return showalert(outlier_text, "alert-success outlier-alert");
-      }
-    };
-  })(this));
-
-  $("#pylmm_compute").on("click", (function(_this) {
-    return function() {
-      var form_data, url;
-      //$("#progress_bar_container").modal();
-      url = "/loading";
-      $('input[name=method]').val("pylmm");
-      $('input[name=genofile]').val($('#genofile_pylmm').val());
-      $('input[name=num_perm]').val($('input[name=num_perm_pylmm]').val());
-      $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_pylmm]:checked').val());
-      form_data = $('#trait_data_form').serialize();
-      console.log("form_data is:", form_data);
-      return submit_special(url);
-      //return do_ajax_post(url, form_data);
-    };
-  })(this));
-
   $("#rqtl_geno_compute").on("click", (function(_this) {
     return function() {
       var form_data, url;
-      //$("#progress_bar_container").modal();
       url = "/loading";
       $('input[name=method]').val("rqtl_geno");
+      $('input[name=selected_chr]').val($('#chr_rqtl_geno').val());
       $('input[name=genofile]').val($('#genofile_rqtl_geno').val());
       $('input[name=num_perm]').val($('input[name=num_perm_rqtl_geno]').val());
       $('input[name=manhattan_plot]').val($('input[name=manhattan_plot_rqtl]:checked').val());
@@ -203,7 +179,6 @@
       }
       else {
         return submit_special(url);
-        //return do_ajax_post(url, form_data);
       }
     };
   })(this));
@@ -214,6 +189,7 @@
       console.log("RUNNING GEMMA");
       url = "/loading";
       $('input[name=method]').val("gemma");
+      $('input[name=selected_chr]').val($('#chr_gemma').val());
       $('input[name=num_perm]').val(0);
       $('input[name=genofile]').val($('#genofile_gemma').val());
       $('input[name=maf]').val($('input[name=maf_gemma]').val());
@@ -230,6 +206,7 @@
       //$("#progress_bar_container").modal();
       url = "/loading";
       $('input[name=method]').val("reaper");
+      $('input[name=selected_chr]').val($('#chr_reaper').val());
       $('input[name=genofile]').val($('#genofile_reaper').val());
       $('input[name=num_perm]').val($('input[name=num_perm_reaper]').val());
       $('input[name=control_marker]').val($('input[name=control_reaper]').val());
diff --git a/wqflask/wqflask/static/new/javascript/stats.js b/wqflask/wqflask/static/new/javascript/stats.js
index 4f99982e..356d1cb0 100644
--- a/wqflask/wqflask/static/new/javascript/stats.js
+++ b/wqflask/wqflask/static/new/javascript/stats.js
@@ -154,16 +154,4 @@ Stats = (function() {
 
 })();
 
-bxd_only = new Stats([3, 5, 7, 8]);
-
-console.log("[xred] bxd_only mean:", bxd_only.mean());
-
-console.log("[xgreen] bxd_only median:", bxd_only.median());
-
-console.log("[xpurple] bxd_only std_dev:", bxd_only.std_dev());
-
-console.log("[xmagenta] bxd_only std_error:", bxd_only.std_error());
-
-console.log("[xyellow] bxd_only min:", bxd_only.min());
-
 window.Stats = Stats;
diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html
index 5fb2c95e..00d725ea 100644
--- a/wqflask/wqflask/templates/mapping_results.html
+++ b/wqflask/wqflask/templates/mapping_results.html
@@ -257,7 +257,7 @@
         <div style="width: 100%;">
           <h2>Interval Analyst</h2>
           <div id="table_container">
-          <table id="interval_analyst" class="table table-hover table-striped nowrap">
+          <table id="interval_analyst" class="table-hover table-striped cell-border" style="float: left; width:100%;">
             <thead>
               <tr>
                 {% for header in gene_table_header %}
@@ -355,9 +355,7 @@
                 "autoWidth": false,
                 "deferRender": true,
                 "bSortClasses": false,
-                "scrollY": "600px",
                 "scrollCollapse": false,
-                "scroller": true,
                 "paging": false
             } );
 
@@ -372,7 +370,6 @@
                 "autoWidth": false,
                 "deferRender": true,
                 "bSortClasses": false,
-                "scrollY": "600px",
                 "scrollCollapse": false,
                 "paging": false
             } );
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 9ad8a53e..a325ec9f 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -4,6 +4,7 @@
     <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" />
     <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/scroller.dataTables.min.css">
     <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.dataTables.css">
+    <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
 {% endblock %}
 {% block content %}
 <!-- Start of body -->
@@ -84,9 +85,9 @@
                         <th></th>
                     {% for header in header_fields %}
                         {% if header == 'Max LRS' %}
-                        <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#LRS" target="_blank"><img style="width: 15px; height: 15px;" src="/static/new/images/question_mark.jpg"></a></th>
+                        <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#LRS" target="_blank" style="color: white;"><sup>?</sup></a></th>
                         {% elif header == 'Additive Effect' %}
-                        <th data-export="Additive Effect">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank"><img style="width: 15px; height: 15px;" src="/static/new/images/question_mark.jpg"></a></th>
+                        <th data-export="Additive Effect">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank" style="color: white;"><sup>?</sup></a></th>
                         {% else %}
                         <th data-export="{{header}}">{{header}}</th>
                         {% endif %}
@@ -99,9 +100,9 @@
                         <th></th>
                     {% for header in header_fields %}
                         {% if header == 'Max LRS' %}
-                        <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#LRS" target="_blank"><img style="width: 15px; height: 15px;" src="/static/new/images/question_mark.jpg"></a></th>
+                        <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#LRS" target="_blank" style="color: white;"><sup>?</sup></a></th>
                         {% elif header == 'Additive Effect' %}
-                        <th data-export="Additive Effect">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank"><img style="width: 15px; height: 15px;" src="/static/new/images/question_mark.jpg"></a></th>
+                        <th data-export="Additive Effect">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank" style="color: white;"><sup>?</sup></a></th>
                         {% else %}
                         <th data-export="{{header}}">{{header}}</th>
                         {% endif %}
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index 8726226c..f5e81060 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -52,7 +52,7 @@
                     </div>
                 </div>    
                 <div class="panel panel-default">
-                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo">
+                    <div class="panel-heading stats_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo">
                         <h3 class="panel-title">
                              <span class="glyphicon glyphicon-chevron-down"></span> Statistics
                         </h3>
@@ -62,26 +62,38 @@
                             {% include 'show_trait_statistics.html' %}
                         </div>
                     </div>
-                </div>                
+                </div>
                 <div class="panel panel-default">
                     <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree">
                         <h3 class="panel-title">
-                             <span class="glyphicon glyphicon-chevron-down"></span> Calculate Correlations
+                             <span class="glyphicon glyphicon-chevron-down"></span> Transform and Filter Data
                         </h3>
                     </div>
                     <div id="collapseThree" class="panel-collapse collapse in">
                         <div class="panel-body">
+                            {% include 'show_trait_transform_and_filter.html' %}
+                        </div>
+                    </div>
+                </div>
+                <div class="panel panel-default">
+                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour">
+                        <h3 class="panel-title">
+                             <span class="glyphicon glyphicon-chevron-down"></span> Calculate Correlations
+                        </h3>
+                    </div>
+                    <div id="collapseFour" class="panel-collapse collapse in">
+                        <div class="panel-body">
                             {% include 'show_trait_calculate_correlations.html' %}
                         </div>
                     </div>
                 </div>                
                 <div class="panel panel-default">
-                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour">
+                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive">
                         <h3 class="panel-title">
                              <span class="glyphicon glyphicon-chevron-down"></span> Mapping Tools
                         </h3>
                     </div>
-                    <div id="collapseFour" class="panel-collapse collapse in">
+                    <div id="collapseFive" class="panel-collapse collapse in">
                         <div class="panel-body">
                             {% include 'show_trait_mapping_tools.html' %}
                         </div>
@@ -89,12 +101,12 @@
                     </div>
                 </div>                
                 <div class="panel panel-default">
-                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive" aria-expanded="true">
+                    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" aria-expanded="true">
                         <h3 class="panel-title">
                              <span class="glyphicon glyphicon-chevron-up"></span> Review and Edit Data
                         </h3>
                     </div>
-                    <div id="collapseFive" class="panel-collapse collapse" aria-expanded="true">
+                    <div id="collapseSix" class="panel-collapse collapse" aria-expanded="true">
                         <div class="panel-body">
                             {% include 'show_trait_edit_data.html' %}
                         </div>
@@ -210,7 +222,7 @@
                     "iDisplayLength": -1,
                     "autoWidth": true,
                     "bLengthChange": true,
-                    "bDeferRender": true,
+                    "deferRender": false,
                     "bSortClasses": false,
                     "scrollY": "600px",
                     "scrollCollapse": false,
@@ -221,7 +233,7 @@
                 } );
 
                 {% else %}
-                    
+
                 $('#samples_primary, #samples_other').DataTable( {
                     "columns": [
                         { "bSortable": false, "width": "8%" },
@@ -242,7 +254,7 @@
                     "iDisplayLength": -1,
                     "autoWidth": true,
                     "bLengthChange": true,
-                    "bDeferRender": true,
+                    "deferRender": false,
                     "bSortClasses": false,
                     "scrollY": "600px",
                     "scrollCollapse": false,
@@ -251,6 +263,7 @@
                     },
                     "paging": false
                 } );
+
                 {% endif %}
 
                 var slider = document.getElementById('p_range_slider');
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index c1f8f824..0192bff1 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -5,10 +5,6 @@
     </tr>
     {% if this_trait.dataset.type == 'Publish' %}
     <tr>
-        <td>Tissue</td>
-        <td>{{ this_trait.dataset.tissue }}</td>
-    </tr>
-    <tr>
         <td>Phenotype</td>
         <td><div style="width:40%;">{{ this_trait.description_fmt }}</div></td>
     </tr>
@@ -24,6 +20,11 @@
         <td>Journal</td>
         <td>{{ this_trait.journal }} (<a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids={{ this_trait.pubmed_id }}&dop=Abstract" title="PubMed">{{ this_trait.year }}</a>)</td>
     </tr>
+    {% else %}
+    <tr>
+        <td>Tissue</td>
+        <td>{{ this_trait.dataset.tissue }}</td>
+    </tr>
     {% endif %}
     {% if this_trait.dataset.type == 'ProbeSet' %}
     {% if this_trait.symbol != None %}
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index cfcf2ce5..ab134663 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -1,6 +1,7 @@
 <div>
     <!--<h2>Review and Edit Data</h2>-->
 
+<!--
     <div class="well form-horizontal">
         <fieldset id="showHideOptions">
             <legend>Block samples</legend>
@@ -59,11 +60,6 @@
                 <option value="sqrt">Square Root</option>
               </select>
               </div>
-              <!--
-              {% if sample_groups[0].sample_qnorm is not none %}
-              <input type="button" id="qnorm" class="btn btn-default" value="Quantile Normalize">
-              {% endif %}
-              -->
             </div>
         </fieldset>
         <br>
@@ -81,7 +77,7 @@
         </div>
     </div>
     <br>
-
+-->
 
     <!--<div id="edit_sample_lists">-->
     {% for sample_type in sample_groups %}
@@ -94,7 +90,7 @@
                 <thead>
                     <tr>
                         <th></th>
-                        <th>Index</th>
+                        <th>ID</th>
                         <th>Sample</th>
                         <th style="text-align: right;">Value</th>
                         {% if sample_type.se_exists() %}
@@ -113,7 +109,7 @@
                 </thead>
                 <tbody>
                     {% for sample in sample_type.sample_list %}
-                    <tr class="{{ sample.class_outlier }} value_se" id="{{ sample.this_id }}">
+                    <tr class="{{ sample.class_outlier }} value_se" id="{% if outer_loop.index == 1 %}Primary_{{ sample.this_id }}{% else %}Other_{{ sample.this_id }}{% endif %}">
                         <td align="center" style="padding-left: 0px; padding-right: 0px;" class="column_name-"><input type="checkbox" name="selectCheck" class="checkbox edit_sample_checkbox" value="{{ sample.name }}" checked="checked">
                         </td>
                         <td class="column_name-Index" align="right">{{ loop.index }}</td>
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 8e003897..e0bc8eb8 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -14,11 +14,6 @@
                 <li>
                     <a href="#rqtl_geno" data-toggle="tab">R/qtl</a>
                 </li>
-<!--
-                <li>
-                    <a href="#pylmm" data-toggle="tab">pyLMM</a>
-                </li>
--->
                 {% endif %}
                 {% for mapping_method in dataset.group.mapping_names %}
                 {% if mapping_method == "GEMMA" %}
@@ -39,6 +34,16 @@
             <div class="tab-content">
                 <div class="tab-pane active" id="gemma">
                     <div style="padding-top: 20px;" class="form-horizontal">
+                        <div class="mapping_method_fields form-group">
+                            <label for="chr_select" style="text-align: right;" class="col-xs-3 control-label">Chromosome</label>
+                            <div style="margin-left:20px;" class="col-xs-2 controls">
+                                <select id="chr_gemma" class="form-control">
+                                    {% for item in chr_list %}
+                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
+                                    {% endfor %}
+                                </select>
+                            </div>
+                        </div>
                         {% if genofiles and genofiles|length>0 %}
                         <div class="mapping_method_fields form-group">
                             <label for="genofiles" style="text-align: right;" class="col-xs-3 control-label">Genotypes</label>
@@ -61,11 +66,11 @@
                             <label style="text-align: right;" class="col-xs-3 control-label">Use LOCO</label>
                             <div style="margin-left:20px;" class="col-xs-6 controls">
                                 <label class="radio-inline">
-                                    <input type="radio" name="use_loco" value="True">
+                                    <input type="radio" name="use_loco" value="True" checked="">
                                     Yes
                                 </label>
                                 <label class="radio-inline">
-                                    <input type="radio" name="use_loco" value="False" checked="">
+                                    <input type="radio" name="use_loco" value="False">
                                     No
                                </label>
                             </div>
@@ -110,6 +115,16 @@
                 {% if dataset.group.mapping_id == "1" %}
                 <div class="tab-pane" id="interval_mapping">
                     <div style="margin-top: 20px" class="form-horizontal">
+                        <div class="mapping_method_fields form-group">
+                            <label for="chr_select" style="text-align: right;" class="col-xs-3 control-label">Chromosome</label>
+                            <div style="margin-left:20px;" class="col-xs-2 controls">
+                                <select id="chr_reaper" class="form-control">
+                                    {% for item in chr_list %}
+                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
+                                    {% endfor %}
+                                </select>
+                            </div>
+                        </div>
                         {% if genofiles and genofiles|length>0 %}
                         <div class="mapping_method_fields form-group">
                             <label style="text-align: right;" for="genofiles" class="col-xs-3 control-label">Genotypes</label>
@@ -202,6 +217,16 @@
                 </div>
                 <div class="tab-pane" id="rqtl_geno">
                     <div style="margin-top: 20px" class="form-horizontal">
+                        <div class="mapping_method_fields form-group">
+                            <label for="chr_select" style="text-align: right;" class="col-xs-3 control-label">Chromosome</label>
+                            <div style="margin-left:20px;" class="col-xs-2 controls">
+                                <select id="chr_rqtl_geno" class="form-control">
+                                    {% for item in chr_list %}
+                                    <option value="{{ item[1] }}">{{ item[0] }}</option>
+                                    {% endfor %}
+                                </select>
+                            </div>
+                        </div>
                         {% if genofiles and genofiles|length>0 %}
                         <div class="mapping_method_fields form-group">
                             <label style="text-align:right;" for="genofiles" class="col-xs-3 control-label">Genotypes</label>
@@ -304,30 +329,6 @@
                         </div>
                     </div>
                 </div>
-                <div class="tab-pane" id="pylmm">
-                    <div style="margin-top: 20px" class="form-horizontal">
-                        {% if genofiles and genofiles|length>0 %}
-                        <div class="mapping_method_fields form-group">
-                            <label style="text-align:right;" class="col-xs-3 control-label">Genotypes</label>
-                            <div style="margin-left: 20px;" class="col-xs-4 controls">
-                                <select id="genofile_pylmm" class="form-control">
-                                    {% for item in genofiles %}
-                                    <option value="{{item['location']}}:{{item['title']}}">{{item['title']}}</option>
-                                    {% endfor %}
-                                </select>
-                            </div>
-                        </div>
-                        {% endif %}
-                        <div class="mapping_method_fields form-group">
-                            <label class="col-xs-3 control-label"></label>
-                            <div style="margin-left:20px;" class="col-xs-6">
-                              <button id="pylmm_compute" class="btn submit_special btn-success" data-url="/marker_regression" title="Compute Interval Mapping">
-                                  Compute
-                              </button>
-                            </div>
-                        </div>
-                    </div>
-                </div>
                 {% endif %}
             </div>
         </div>
@@ -341,10 +342,6 @@
              <dd>Interval mapping is a process in which the statistical significance of a hypothetical QTL is evaluated at regular points across a chromosome, even in the absence of explicit genotype data at those points.</dd>
              <dt>R/qtl</dt>
              <dd>R/qtl is an extensible, interactive environment for mapping quantitative trait loci (QTL) in experimental crosses.</dd>
-<!--
-             <dt>pyLMM</dt>
-             <dd>pyLMM is a fast and lightweight linear mixed-model (LMM) solver for use in genome-wide association studies (GWAS).</dd>
--->
              {% endif %}
         </dl>
     </div>
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
index ac0c753a..a0bdc987 100644
--- a/wqflask/wqflask/templates/show_trait_statistics.html
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -5,15 +5,15 @@
                     <a href="#stats_tab" data-toggle="tab">Basic Statistics</a>
                 </li>
                 <li>
-                    <a href="#histogram_tab" data-toggle="tab">Histogram</a>
+                    <a href="#histogram_tab" class="histogram_tab" data-toggle="tab">Histogram</a>
                 </li>
                 {% if num_values < 256 %}
                 <li>
-                    <a href="#bar_chart_tab" data-toggle="tab">Bar Chart</a>
+                    <a href="#bar_chart_tab" class="bar_chart_tab" data-toggle="tab">Bar Chart</a>
                 </li>
                 {% endif %}
                 <li>
-                    <a href="#probability_plot" data-toggle="tab">Probability Plot</a>
+                    <a href="#probability_plot" class="prob_plot_tab" data-toggle="tab">Probability Plot</a>
                 </li>
                 {% if g.user_session.logged_in %}
                 <li>
@@ -21,10 +21,10 @@
                 </li>
                 {% endif %}
                 <li>
-                    <a href="#box_plot_tab" data-toggle="tab">Box Plot</a>
+                    <a href="#box_plot_tab" class="box_plot_tab" data-toggle="tab">Box Plot</a>
                 </li>
                 <li>
-                    <a href="#violin_plot_tab" data-toggle="tab">Violin Plot</a>
+                    <a href="#violin_plot_tab" class="violin_plot_tab" data-toggle="tab">Violin Plot</a>
                 </li>
             </ul>
 
diff --git a/wqflask/wqflask/templates/show_trait_transform_and_filter.html b/wqflask/wqflask/templates/show_trait_transform_and_filter.html
new file mode 100644
index 00000000..5d14a30e
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_transform_and_filter.html
@@ -0,0 +1,79 @@
+<div>
+    <div class="form-horizontal">
+            <legend>Block samples</legend>
+            <p>Edit or delete values in the Trait Data boxes, and use the
+                <strong>Reset</strong> option as
+                needed.
+            </p>
+
+            <div id="blockMenuSpan" class="input-append" style="margin-bottom: 10px;">
+                <label for="remove_samples_field">Block samples by index:</label>
+                <input type="text" id="remove_samples_field">
+                <select id="block_group" size="1">
+                  <option value="primary">
+                    {{ sample_group_types['samples_primary'] }}
+                  </option>
+                  <option value="other">
+                    {{ sample_group_types['samples_other'] }}
+                  </option>
+                </select>
+                <input type="button" id="block_by_index" class="btn" value="Block">
+            </div>
+            <div id="remove_samples_invalid" class="alert alert-error" style="display:none;">
+                  Please check that your input is formatted correctly, e.g. <strong>3, 5-10, 12</strong>
+            </div>
+            {% if sample_groups[0].attributes %}
+            <div class="input-append" style="margin-top:10px; margin-bottom:10px;">
+                <label for="exclude_menu">Block samples by group:</label>
+                <select id="exclude_menu" size=1>
+                  {% for attribute in sample_groups[0].attributes %}
+                  <option value="{{ sample_groups[0].attributes[attribute].name.replace(' ', '_') }}">
+                      {{ sample_groups[0].attributes[attribute].name }}</option>
+                  {% endfor %}
+                </select>
+                <select id="attribute_values" size=1>
+                </select>
+                <input type="button" id="exclude_group" class="btn" value="Block">
+            </div>
+            {% endif %}
+            <div>
+              <input type="button" id="hide_no_value" class="btn btn-default" value="Hide No Value">
+              <input type="button" id="block_outliers" class="btn btn-default" value="Block Outliers">
+              <input type="button" id="reset" class="btn btn-primary" value="Reset">
+              <span class="input-append">
+                <input type="button" id="export" class="btn btn-default" value="Export">
+                <select id="export_format" class="select optional span2">
+                  <option value="excel">Excel</option>
+                  <option value="csv">CSV</option>
+                </select>
+              </span>
+              <br>
+              <div style="margin-top:10px;">
+              <input type="button" id="normalize" class="btn btn-default" value="Normalize">
+              <select id="norm_method" class="select optional span2">
+                <option value="log2">Log2</option>
+                <option value="qnorm">Quantile</option>
+                <option value="sqrt">Square Root</option>
+              </select>
+              </div>
+              <!--
+              {% if sample_groups[0].sample_qnorm is not none %}
+              <input type="button" id="qnorm" class="btn btn-default" value="Quantile Normalize">
+              {% endif %}
+              -->
+            </div>
+        <br>
+
+        <div>
+            <p>Outliers highlighted in
+                    <strong style="background-color:yellow;">yellow</strong>
+                    can be hidden using
+                    the <strong>Hide Outliers</strong> button.
+            </p>
+
+            <p>Samples with no value (x) can be hidden by clicking
+                    <strong>Hide No Value</strong> button.
+            </p>
+        </div>
+    </div>
+</div>
\ No newline at end of file