about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/db_info.py127
-rw-r--r--wqflask/wqflask/marker_regression/run_mapping.py10
-rw-r--r--wqflask/wqflask/static/new/css/marker_regression.css4
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js22
-rw-r--r--wqflask/wqflask/templates/base.html4
-rw-r--r--wqflask/wqflask/templates/gsearch_gene.html16
-rw-r--r--wqflask/wqflask/templates/gsearch_pheno.html17
-rw-r--r--wqflask/wqflask/templates/info_page.html92
-rw-r--r--wqflask/wqflask/templates/mapping_results.html139
-rw-r--r--wqflask/wqflask/templates/search_result_page.html15
-rw-r--r--wqflask/wqflask/templates/tutorials.html1
-rw-r--r--wqflask/wqflask/user_login.py4
-rw-r--r--wqflask/wqflask/views.py13
13 files changed, 336 insertions, 128 deletions
diff --git a/wqflask/wqflask/db_info.py b/wqflask/wqflask/db_info.py
new file mode 100644
index 00000000..f04e38bf
--- /dev/null
+++ b/wqflask/wqflask/db_info.py
@@ -0,0 +1,127 @@
+import httplib, urllib2

+import re

+

+from flask import Flask, g

+

+from utility.logger import getLogger

+logger = getLogger(__name__ )

+

+class InfoPage(object):

+    def __init__(self, start_vars):

+        self.info = None

+        self.gn_accession_id = None

+        if 'gn_accession_id' in start_vars:

+            self.gn_accession_id = start_vars['gn_accession_id']

+        self.info_page_name = start_vars['info_page_name']

+

+        self.get_info()

+        self.get_datasets_list()

+

+    def get_info(self, create=False):

+        query_base = ("SELECT InfoPageName, GN_AccesionId, Species.MenuName, Species.TaxonomyId, Tissue.Name, InbredSet.Name, " +

+                      "GeneChip.GeneChipName, GeneChip.GeoPlatform, AvgMethod.Name, Datasets.DatasetName, Datasets.GeoSeries, " +

+                      "Datasets.PublicationTitle, DatasetStatus.DatasetStatusName, Datasets.Summary, Datasets.AboutCases, " +

+                      "Datasets.AboutTissue, Datasets.AboutDataProcessing, Datasets.Acknowledgment, Datasets.ExperimentDesign, " +

+                      "Datasets.Contributors, Datasets.Citation, Datasets.Notes, Investigators.FirstName, Investigators.LastName, " +

+                      "Investigators.Address, Investigators.City, Investigators.State, Investigators.ZipCode, Investigators.Country, " +

+                      "Investigators.Phone, Investigators.Email, Investigators.Url, Organizations.OrganizationName, " +

+                      "InvestigatorId, DatasetId, DatasetStatusId, Datasets.AboutPlatform, InfoFileTitle, Specifics " +

+                      "FROM InfoFiles " +

+                      "LEFT JOIN Species USING (SpeciesId) " +

+                      "LEFT JOIN Tissue USING (TissueId) " +

+                      "LEFT JOIN InbredSet USING (InbredSetId) " +

+                      "LEFT JOIN GeneChip USING (GeneChipId) " +

+                      "LEFT JOIN AvgMethod USING (AvgMethodId) " +

+                      "LEFT JOIN Datasets USING (DatasetId) " +

+                      "LEFT JOIN Investigators USING (InvestigatorId) " +

+                      "LEFT JOIN Organizations USING (OrganizationId) " +

+                      "LEFT JOIN DatasetStatus USING (DatasetStatusId) WHERE ")

+

+        if self.gn_accession_id:

+            final_query = query_base + "GN_AccesionId = {}".format(self.gn_accession_id)

+            results = g.db.execute(final_query).fetchone()

+            if self.info_page_name and not results:

+				final_query = query_base + "InfoPageName={}".format(self.info_page_name)

+        elif self.info_page_name:

+            final_query = query_base + "InfoPageName={}".format(self.info_page_name)

+            results = g.db.execute(final_query).fetchone()

+        else:

+            raise 'No correct parameter found'

+

+        if results:

+            self.info = process_query_results(results)

+

+        if (not results or len(results) < 1) and self.info_page_name and create:

+            insert_sql = "INSERT INTO InfoFiles SET InfoFiles.InfoPageName={}".format(self.info_page_name)

+            return self.get_info()

+

+        if not self.gn_accession_id and self.info:

+            self.gn_accession_id = self.info['accession_id']

+        if not self.info_page_name and self.info:

+            self.info_page_name = self.info['info_page_name'] 

+

+    def get_datasets_list(self):

+        self.filelist = []

+        try:

+            response = urllib2.urlopen("http://datafiles.genenetwork.org/download/GN%s" % self.gn_accession_id)

+            data = response.read()

+

+            matches = re.findall(r"<tr>.+?</tr>", data, re.DOTALL)

+            for i, match in enumerate(matches):

+                if i == 0:

+                    continue

+                cells = re.findall(r"<td.+?>.+?</td>", match, re.DOTALL)

+                full_filename = re.search(r"<a href=\"(.+?)\"", cells[1], re.DOTALL).group(1).strip()

+                filename = full_filename.split("/")[-1]

+                filesize = re.search(r">(.+?)<", cells[2]).group(1).strip()

+                filedate = "N/A" #ZS: Since we can't get it for now

+

+                self.filelist.append([filename, filedate, filesize])

+        except Exception, e:

+            pass

+

+def process_query_results(results):

+    info_ob = {

+        'info_page_name': results[0],

+        'accession_id': results[1],

+        'menu_name': results[2],

+        'taxonomy_id': results[3],

+        'tissue_name': results[4],

+        'group_name': results[5],

+        'gene_chip_name': results[6],

+        'geo_platform': results[7],

+        'avg_method_name': results[8],

+        'dataset_name': results[9],

+        'geo_series': results[10],

+        'publication_title': results[11],

+        'dataset_status_name': results[12],

+        'dataset_summary': results[13],

+        'about_cases': results[14],

+        'about_tissue': results[15],

+        'about_data_processing': results[16],

+        'acknowledgement': results[17],

+        'experiment_design': results[18],

+        'contributors': results[19],

+        'citation': results[20],

+        'notes': results[21],

+        'investigator_firstname': results[22],

+        'investigator_lastname': results[23],

+        'investigator_address': results[24],

+        'investigator_city': results[25],

+        'investigator_state': results[26],

+        'investigator_zipcode': results[27],

+        'investigator_country': results[28],

+        'investigator_phone': results[29],

+        'investigator_email': results[30],

+        'investigator_url': results[31],

+        'organization_name': results[32],

+        'investigator_id': results[33],

+        'dataset_id': results[34],

+        'dataset_status_is': results[35],

+        'about_platform': results[36],

+        'info_file_title': results[37],

+        'specifics': results[38]

+    }

+

+    return info_ob

+        
\ No newline at end of file
diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py
index 9bde343c..8a44b3fd 100644
--- a/wqflask/wqflask/marker_regression/run_mapping.py
+++ b/wqflask/wqflask/marker_regression/run_mapping.py
@@ -401,9 +401,7 @@ class RunMapping(object):
                           rs  = marker['name'],
                           pos  = this_ps
                       )
-                  #if 'p_value' in marker:
-                  #    logger.debug("P EXISTS:", marker['p_value'])
-                  #else:
+
                   if 'lrs_value' in marker and marker['lrs_value'] > 0:
                       browser_marker['p_wald'] = 10**-(marker['lrs_value']/4.61)
                   elif 'lod_score' in marker and marker['lod_score'] > 0:
@@ -417,6 +415,12 @@ class RunMapping(object):
                       if marker['chr'] > highest_chr or marker['chr'] == "X" or marker['chr'] == "X/Y":
                           highest_chr = marker['chr']
                       if ('lod_score' in marker.keys()) or ('lrs_value' in marker.keys()):
+                          if 'Mb' in marker.keys():
+                              marker['display_pos'] = "Chr" + str(marker['chr']) + ": " + "{:.3f}".format(marker['Mb'])
+                          elif 'cM' in marker.keys():
+                              marker['display_pos'] = "Chr" + str(marker['chr']) + ": " + "{:.3f}".format(marker['cM'])
+                          else:
+                              marker['display_pos'] = "N/A"
                           self.qtl_results.append(marker)
 
               with Bench("Exporting Results"):
diff --git a/wqflask/wqflask/static/new/css/marker_regression.css b/wqflask/wqflask/static/new/css/marker_regression.css
index f1a26a83..e0a5ceea 100644
--- a/wqflask/wqflask/static/new/css/marker_regression.css
+++ b/wqflask/wqflask/static/new/css/marker_regression.css
@@ -62,6 +62,10 @@ table.dataTable tbody td {
   padding: 4px 20px 2px 10px;
 }
 
+table.dataTable tbody tr.selected {
+  background-color: #ffee99;
+}
+
 table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td {
   border-top: 1px solid #ccc;
   border-right: 1px solid #ccc;
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js
index 4e87d67a..685d6291 100644
--- a/wqflask/wqflask/static/new/javascript/search_results.js
+++ b/wqflask/wqflask/static/new/javascript/search_results.js
@@ -259,14 +259,16 @@ $(function() {
   let naturalAsc = $.fn.dataTableExt.oSort["natural-ci-asc"]
   let naturalDesc = $.fn.dataTableExt.oSort["natural-ci-desc"]
 
+  let na_equivalent_vals = ["N/A", "--", ""]; //ZS: Since there are multiple values that should be treated the same as N/A
+
   function sort_NAs(a, b, sort_function){
-    if (a === "N/A" && b === "N/A") {
+    if ( na_equivalent_vals.includes(a) && na_equivalent_vals.includes(b)) {
       return 0;
     }
-    if (a === "N/A"){
+    if (na_equivalent_vals.includes(a)){
       return 1
     }
-    if (b === "N/A") {
+    if (na_equivalent_vals.includes(b)) {
       return -1;
     }
     return sort_function(a, b)
@@ -281,4 +283,18 @@ $(function() {
     }
   });
 
+  $.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
+  {
+      return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
+          return $('input', td).prop('checked') ? '1' : '0';
+      } );
+  };
+
+  $.fn.dataTable.ext.order['dom-inner-text'] = function  ( settings, col )
+  {
+      return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
+          return $(td).text();
+      } );
+  }
+
 });
\ No newline at end of file
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 50562200..e6802cc4 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -4,7 +4,9 @@
 
 <head>
     <meta charset="utf-8">
-    <title>{% block title %}{% endblock %}</title>
+
+    <title>{% block title %}{% endblock %} GeneNetwork 2</title>
+
     <meta name="description" content="">
     <meta name="author" content="">
     <link rel="icon" type="image/png" sizes="64x64" href="/static/new/images/CITGLogo.png">
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html
index 478d6f5f..d2c78d65 100644
--- a/wqflask/wqflask/templates/gsearch_gene.html
+++ b/wqflask/wqflask/templates/gsearch_gene.html
@@ -59,20 +59,6 @@
     </script>
 
     <script type="text/javascript" charset="utf-8">
-        $.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $('input', td).prop('checked') ? '1' : '0';
-            } );
-        };
-
-        $.fn.dataTable.ext.order['dom-inner-text'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $(td).text();
-            } );
-        }
-
         $(document).ready( function () {
             
             $('#trait_table tr').click(function(event) {
@@ -252,7 +238,7 @@
                 'sDom': "pitirp",
                 'autoWidth': true,
                 'iDisplayLength': 500,
-                'deferRender': true,
+                'deferRender': false,
                 'paging': true,
                 'orderClasses': true,
                 'processing': true,
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html
index eb998d15..c44231f3 100644
--- a/wqflask/wqflask/templates/gsearch_pheno.html
+++ b/wqflask/wqflask/templates/gsearch_pheno.html
@@ -59,20 +59,6 @@
     </script>
 
     <script type="text/javascript" charset="utf-8">
-        $.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $('input', td).prop('checked') ? '1' : '0';
-            } );
-        };
-
-        $.fn.dataTable.ext.order['dom-inner-text'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $(td).text();
-            } );
-        }
-
         $(document).ready( function () {
 
             $('#trait_table tr').click(function(event) {
@@ -172,6 +158,7 @@
                       'title': "Record",
                       'type': "natural",
                       'data': null,
+                      'orderDataType': "dom-inner-text",
                       'render': function(data, type, row, meta) {
                         return '<a target="_blank" href="/show_trait?trait_id=' + data.name + '&dataset=' + data.dataset + '">' + data.display_name + '</a>'
                       }
@@ -252,7 +239,7 @@
                 'order': [[1, "asc" ]],
                 'sDom': "pitirp",
                 'autoWidth': false,
-                'deferRender': true,
+                'deferRender': false,
                 'iDisplayLength': 500,
                 'paging': true,
                 'orderClasses': true,
diff --git a/wqflask/wqflask/templates/info_page.html b/wqflask/wqflask/templates/info_page.html
new file mode 100644
index 00000000..d8b7d74c
--- /dev/null
+++ b/wqflask/wqflask/templates/info_page.html
@@ -0,0 +1,92 @@
+{% extends "base.html" %}

+{% block title %}Policies{% endblock %}

+{% block content %}

+

+<h1 id="parent-fieldname-title">Data Set Group: {{ info.dataset_name }}

+<!--<a href="/infoshare/manager/member-studies-edit.html?DatasetId=%s"><img src="/images/modify.gif" alt="modify this page" border="0" valign="middle"></a>-->

+<span style="color:red;">{{ info.info_page_name }}</span>

+</h1>

+<table border="0" width="100%">

+<tr>

+<td valign="top" width="50%">

+<table name="info_table" cellSpacing=0 cellPadding=5 width=100% border=0>

+    <tr><td><b>Data Set:</b>  {{ info.info_file_title }} <!--<a href="/infoshare/manager/member-infofile-edit.html?GN_AccesionId=%s"><img src="/images/modify.gif" alt="modify this page" border="0" valign="middle"></a>--></td></tr>

+    <tr><td><b>GN Accession:</b> GN{{ gn_accession_id }}</td></tr>

+    <tr><td><b>GEO Series:</b> <a href="http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={{ info.geo_series }}" target="_blank">{{ info.geo_series }}</a></td></tr>

+    <tr><td><b>Title:</b> {{ info.publication_title }}</td></tr>

+    <tr><td><b>Organism:</b> <a href="http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id={{ info.taxonomy_id }}" target="_blank">{{ info.menu_name }}</a></td></tr>

+    <tr><td><b>Group:</b> {{ info.group_name }}</td></tr>

+    <tr><td><b>Tissue:</b> {{ info.tissue_name }}</td></tr>

+    <tr><td><b>Dataset Status:</b> {{ info.dataset_status_name }}</td></tr>

+    <tr><td><b>Platforms:</b> <a href="http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={{ info.geo_platform }}" target="_blank">{{ info.gene_chip_name }}</a></td></tr>

+    <tr><td><b>Normalization:</b> {{ info.avg_method_name }}</td></tr>

+</table>

+</td>

+<td valign="top" width="50%">

+<table border="0" width="100%">

+    <tr>

+        <td><b>Contact Information</b></td>

+    </tr>

+    <tr>

+        <td>

+            {{ info.investigator_first_name }} {{ info.inveestigator_last_name }}<br>

+            {{ info.organization_name }} <br>

+            {{ info.investigator_address }}<br>

+            {{ info.investigator_city }}, {{ info.investigator_state }} {{ info.investigator_zipcode }} {{ info.investigator_country }}<br>

+            Tel. {{ info.investigator_phone }}<br>

+            {{ info.investigator_email }}<br>

+            <a href="{{ info.investigator_url }}" target="_blank">Website</a>

+        </td>

+    </tr>

+

+<tr>

+    <td><b>Download datasets and supplementary data files</b></td>

+</tr>

+<tr>

+    <td>

+        <ul style="line-height: 160%">

+            {% for file in filelist %}

+            <li><a href="http://datafiles.genenetwork.org/download/GN{{ gn_accession_id }}/{{ file[0] }}">{{ file[0] }} ({{ file[2] }})</a></li>

+            {% endfor %}

+        </ul>

+    </td>

+</tr>

+

+<tr><td>

+</td></tr>

+

+</table>

+</td>

+</tr>

+</table>

+<HR>

+<p>

+<table name="info_table" width="100%" border="0" cellpadding="5" cellspacing="0">

+<tr><td><span style="font-size:115%%;font-weight:bold;">Specifics of this Data Set:</span></td></tr>

+    <tr><td> {{ info.specifics|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%%;font-weight:bold;">Summary:</span></td></tr>

+    <tr><td> {{ info.dataset_summary|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">About the cases used to generate this set of data:</span></td></tr>

+    <tr><td> {{ info.about_cases|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">About the tissue used to generate this set of data:</span></td></tr>

+    <tr><td> {{ info.about_tissue|safe }}<br><br></td></tr>

+    <tr><td><span style="font-size:115%; font-weight:bold;">About the array platform:</span></td></tr>

+    <tr><td> {{ info.about_platform|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">About data values and data processing:</span></td></tr>

+    <tr><td> {{ info.about_data_processing|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Notes:</span></td></tr>

+    <tr><td> {{ info.notes|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Experiment Type:</span></td></tr>

+    <tr><td> {{ info.experiment_design|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Contributor:</span></td></tr>

+    <tr><td> {{ info.contributors|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Citation:</span></td></tr>

+    <tr><td> {{ info.citation|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Data source acknowledgment:</span></td></tr>

+    <tr><td> {{ info.acknowledgement|safe }}<br><br></td></tr>

+<tr><td><span style="font-size:115%; font-weight:bold;">Study Id:</span></td></tr>

+    <tr><td> {{ info.dataset_id }}<br><br></td></tr>

+</table>

+</p>

+ 

+{% endblock %}
\ No newline at end of file
diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html
index 8edda548..41d760c0 100644
--- a/wqflask/wqflask/templates/mapping_results.html
+++ b/wqflask/wqflask/templates/mapping_results.html
@@ -228,71 +228,61 @@
         <button class="btn btn-success" id="add" disabled><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
         <br />
         <br />
-          <div id="table_container" style="width:{% if 'additive' in trimmed_markers[0] %}500{% else %}470{% endif %}px;">
-          <table id="trait_table" class="table-hover table-striped cell-border dataTable no-footer">
-            <thead>
-              <tr>
-                <th></th>
-                <th>Row</th>
-                <th>Marker</th>
-                <th>{{ LRS_LOD }}</th>
-                <th>Chr</th>
-                {% if plotScale != "physic" %}
-                <th>cM</th>
-                {% else %}
-                <th align="right">Mb</th>
-                {% endif %}
-                {% if 'additive' in trimmed_markers[0] %}
-                <th>Add Eff</th>
-                {% endif %}
-                {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
-                <th>Dom Eff</th>
-                {% endif %}
-              </tr>
-            </thead>
-            <tbody>
-              {% for marker in trimmed_markers %}
-              <tr>
-                <td align="center" style="padding: 1px 0px 1px 0px;">
-                  <input type="checkbox" name="selectCheck"
-                         class="checkbox trait_checkbox"
-                         value="{{ data_hmac('{}:{}Geno'.format(marker.name, dataset.group.name)) }}">
-                </td>
-                <td align="right">{{ loop.index }}</td>
-                <td>{% if geno_db_exists == "True" %}<a href="/show_trait?trait_id={{ marker.name }}&dataset={{ dataset.group.name }}Geno">{{ marker.name }}</a>{% else %}{{ marker.name }}{% endif %}</td>
-                {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %}
-                {% if 'lod_score' in marker %}
-                <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td>
-                {% else %}
-                <td align="right">{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }}</td>
-                {% endif %}
-                {% else %}
-                {% if 'lod_score' in marker %}
-                <td align="right">{{ '%0.2f' | format(marker.lod_score|float * 4.61) }}</td>
-                {% else %}
-                <td align="right">{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
-                {% endif %}
-                {% endif %}
-                <td align="right">{{marker.chr}}</td>
-                {% if plotScale != "physic" %}
-                {% if 'cM' in marker %}
-                <td align="right">{{ '%0.3f' | format(marker.cM|float) }}</td>
-                {% else %}
-                <td align="right">{{ '%0.3f' | format(marker.Mb|float) }}</td>
-                {% endif %}
-                {% else %}
-                <td align="right">{{ '%0.6f' | format(marker.Mb|float) }}</td>
-                {% endif %}
-                {% if 'additive' in marker %}
-                <td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
-                {% endif %}
-                {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
-                <td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
-                {% endif %}
-              </tr>
-              {% endfor %}
-            </tbody>
-          </table>
+          <div id="table_container" style="width:{% if 'additive' in trimmed_markers[0] %}600{% else %}550{% endif %}px;">
+            <table id="trait_table" class="table-hover table-striped cell-border dataTable no-footer">
+              <thead>
+                <tr>
+                  <th></th>
+                  <th>Row</th>
+                  <th>Marker</th>
+                  {% if LRS_LOD == "-log(p)" %}
+                  <th>–log(p)</th>
+                  {% else %}
+                  <th>{{ LRS_LOD }}</th>
+                  {% endif %}
+                  <th>Position ({% if plotScale == "physic" %}Mb{% else %}cM{% endif %})</th>
+                  {% if 'additive' in trimmed_markers[0] %}
+                  <th>Add Eff</th>
+                  {% endif %}
+                  {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
+                  <th>Dom Eff</th>
+                  {% endif %}
+                </tr>
+              </thead>
+              <tbody>
+                {% for marker in trimmed_markers %}
+                <tr>
+                  <td align="center" style="padding: 1px 0px 1px 0px;">
+                    <input type="checkbox" name="selectCheck"
+                           class="checkbox trait_checkbox"
+                           value="{{ data_hmac('{}:{}Geno'.format(marker.name, dataset.group.name)) }}">
+                  </td>
+                  <td align="right">{{ loop.index }}</td>
+                  <td>{% if geno_db_exists == "True" %}<a href="/show_trait?trait_id={{ marker.name }}&dataset={{ dataset.group.name }}Geno">{{ marker.name }}</a>{% else %}{{ marker.name }}{% endif %}</td>
+                  {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %}
+                  {% if 'lod_score' in marker %}
+                  <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td>
+                  {% else %}
+                  <td align="right">{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }}</td>
+                  {% endif %}
+                  {% else %}
+                  {% if 'lod_score' in marker %}
+                  <td align="right">{{ '%0.2f' | format(marker.lod_score|float * 4.61) }}</td>
+                  {% else %}
+                  <td align="right">{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
+                  {% endif %}
+                  {% endif %}
+                  <td align="right">{{ marker.display_pos }}</td>
+                  {% if 'additive' in marker %}
+                  <td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
+                  {% endif %}
+                  {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
+                  <td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
+                  {% endif %}
+                </tr>
+                {% endfor %}
+              </tbody>
+            </table>
           </div>
         </div>
         {% elif selectedChr != -1 and plotScale =="physic" and (dataset.group.species == 'mouse' or dataset.group.species == 'rat') %}
@@ -362,8 +352,7 @@
                 "columns": [
                     { "type": "natural", "width": "5%" },
                     { "type": "natural", "width": "8%" },
-                    { "type": "natural", "width": "25%" },
-                    { "type": "natural" },
+                    { "type": "natural", "width": "20%" },
                     { "type": "natural" },
                     { "type": "natural" }{% if 'additive' in qtlresults[0] %},
                     { "type": "natural" }{% endif %}{% if 'dominance' in qtlresults[0] and dataset.group.genetic_type != "riset" %},
@@ -395,16 +384,16 @@
                   $('td', row).eq(9).attr("align", "right");
                 },
                 "columns": [
-                    { "bSortable": false},
-                    { "type": "natural" },
-                    { "type": "natural" },
-                    { "type": "natural" },
-                    { "type": "natural" },
-                    { "type": "natural" },
-                    { "type": "natural" },
-                    { "type": "natural" },
+                    { "orderDataType": "dom-checkbox" },
+                    { "type": "natural"},
+                    { "type": "natural" , "orderDataType": "dom-inner-text" },
+                    { "type": "natural" , "orderDataType": "dom-inner-text" },
+                    { "type": "natural" , "orderDataType": "dom-inner-text" },
                     { "type": "natural" },
                     { "type": "natural" },
+                    { "type": "natural-minus-na" },
+                    { "type": "natural-minus-na" },
+                    { "type": "natural-minus-na" , "orderDataType": "dom-inner-text" },
                     { "type": "natural" }
                 ],
                 "columnDefs": [ {
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 53373b41..282e752d 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -174,21 +174,6 @@
     </script>
 
     <script type="text/javascript" charset="utf-8">
-
-        $.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $('input', td).prop('checked') ? '1' : '0';
-            } );
-        };
-
-        $.fn.dataTable.ext.order['dom-inner-text'] = function  ( settings, col )
-        {
-            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-                return $(td).text();
-            } );
-        }
-
         $(document).ready( function () {
             
             $('#trait_table tr').click(function(event) {
diff --git a/wqflask/wqflask/templates/tutorials.html b/wqflask/wqflask/templates/tutorials.html
index 3e6ef01c..f9d12ba5 100644
--- a/wqflask/wqflask/templates/tutorials.html
+++ b/wqflask/wqflask/templates/tutorials.html
@@ -15,3 +15,4 @@ and initial mapping results for Rat GWAS P50 as implemented in GeneNetwork.org</
 </TR></TABLE>
 
 {% endblock %}
+
diff --git a/wqflask/wqflask/user_login.py b/wqflask/wqflask/user_login.py
index 9331f369..077a799b 100644
--- a/wqflask/wqflask/user_login.py
+++ b/wqflask/wqflask/user_login.py
@@ -453,7 +453,9 @@ def register_user(params):
         user_details['confirmed'] = 1
 
         user_details['registration_info'] = basic_info()
-        save_user(user_details, user_details['user_id'])
+
+        if len(errors) == 0:
+            save_user(user_details, user_details['user_id'])
 
         return errors
 
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index fc9949a8..3d623736 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -37,6 +37,7 @@ from wqflask import gsearch
 from wqflask import update_search_results
 from wqflask import docs
 from wqflask import news
+from wqflask import db_info
 from wqflask.submit_bnw import get_bnw_input
 from base.data_set import create_dataset, DataSet    # Used by YAML in marker_regression
 from wqflask.show_trait import show_trait
@@ -908,12 +909,24 @@ def snp_browser_page():
 
     return render_template("snp_browser.html", **template_vars.__dict__)
 
+@app.route("/db_info", methods=('GET',))
+def db_info_page():
+    template_vars = db_info.InfoPage(request.args)
+
+    return render_template("info_page.html", **template_vars.__dict__)
+
 @app.route("/tutorial/WebQTLTour", methods=('GET',))
 def tutorial_page():
     #ZS: Currently just links to GN1
     logger.info(request.url)
     return redirect("http://gn1.genenetwork.org/tutorial/WebQTLTour/")
 
+@app.route("/tutorial/security", methods=('GET',))
+def security_tutorial_page():
+    #ZS: Currently just links to GN1
+    logger.info(request.url)
+    return render_template("admin/security_help.html")
+
 @app.route("/submit_bnw", methods=('POST',))
 def submit_bnw():
     logger.info(request.url)