about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn2/base/trait.py10
-rw-r--r--gn2/debug.py22
-rw-r--r--gn2/tests/unit/wqflask/marker_regression/test_run_mapping.py6
-rw-r--r--gn2/wqflask/api/markdown.py1
-rw-r--r--gn2/wqflask/do_search.py1
-rw-r--r--gn2/wqflask/marker_regression/run_mapping.py26
-rw-r--r--gn2/wqflask/oauth2/client.py5
-rw-r--r--gn2/wqflask/oauth2/jwks.py11
-rw-r--r--gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js8
-rw-r--r--gn2/wqflask/templates/admin/change_resource_owner.html2
-rw-r--r--gn2/wqflask/templates/admin/create_group.html2
-rw-r--r--gn2/wqflask/templates/admin/group_manager.html2
-rw-r--r--gn2/wqflask/templates/admin/ind_user_manager.html2
-rw-r--r--gn2/wqflask/templates/admin/manage_resource.html2
-rw-r--r--gn2/wqflask/templates/admin/manage_user.html2
-rw-r--r--gn2/wqflask/templates/admin/search_for_groups.html2
-rw-r--r--gn2/wqflask/templates/admin/set_group_privileges.html2
-rw-r--r--gn2/wqflask/templates/admin/user_manager.html2
-rw-r--r--gn2/wqflask/templates/admin/view_group.html2
-rw-r--r--gn2/wqflask/templates/authorisation_error.html2
-rw-r--r--gn2/wqflask/templates/base.html639
-rw-r--r--gn2/wqflask/templates/base_macro.html8
-rw-r--r--gn2/wqflask/templates/blogs.html4
-rw-r--r--gn2/wqflask/templates/blogs_list.html2
-rw-r--r--gn2/wqflask/templates/case_attributes.html2
-rw-r--r--gn2/wqflask/templates/collections/list.html2
-rw-r--r--gn2/wqflask/templates/collections/not_logged_in.html2
-rw-r--r--gn2/wqflask/templates/collections/view.html2
-rw-r--r--gn2/wqflask/templates/collections/view_anonymous.html2
-rw-r--r--gn2/wqflask/templates/comparison_bar_chart.html4
-rw-r--r--gn2/wqflask/templates/corr_scatterplot.html2
-rw-r--r--gn2/wqflask/templates/correlation_error_page.html2
-rw-r--r--gn2/wqflask/templates/correlation_matrix.html2
-rw-r--r--gn2/wqflask/templates/correlation_page.html3
-rw-r--r--gn2/wqflask/templates/credits.html2
-rw-r--r--gn2/wqflask/templates/ctl_results.html2
-rw-r--r--gn2/wqflask/templates/ctl_setup.html2
-rw-r--r--gn2/wqflask/templates/data_sharing.html2
-rw-r--r--gn2/wqflask/templates/dataset.html2
-rw-r--r--gn2/wqflask/templates/dataset_history.html2
-rw-r--r--gn2/wqflask/templates/display_diffs.html2
-rw-r--r--gn2/wqflask/templates/display_files.html2
-rw-r--r--gn2/wqflask/templates/docedit.html2
-rw-r--r--gn2/wqflask/templates/docs.html2
-rw-r--r--gn2/wqflask/templates/edit_case_attributes.html2
-rw-r--r--gn2/wqflask/templates/edit_history.html2
-rw-r--r--gn2/wqflask/templates/edit_phenotype.html2
-rw-r--r--gn2/wqflask/templates/edit_probeset.html2
-rw-r--r--gn2/wqflask/templates/empty_collection.html2
-rw-r--r--gn2/wqflask/templates/environment.html2
-rw-r--r--gn2/wqflask/templates/error.html4
-rw-r--r--gn2/wqflask/templates/facilities.html2
-rw-r--r--gn2/wqflask/templates/generic_gn_docs.html2
-rw-r--r--gn2/wqflask/templates/geneweaver_page.html4
-rw-r--r--gn2/wqflask/templates/genotype.html2
-rw-r--r--gn2/wqflask/templates/glossary.html2
-rw-r--r--gn2/wqflask/templates/gn3_ctl_results.html2
-rw-r--r--gn2/wqflask/templates/gn3_wgcna_results.html2
-rw-r--r--gn2/wqflask/templates/gn_docs_errors.html2
-rw-r--r--gn2/wqflask/templates/gn_editor.html2
-rw-r--r--gn2/wqflask/templates/gnqa.html2
-rw-r--r--gn2/wqflask/templates/gnqa_test.html2
-rw-r--r--gn2/wqflask/templates/gsearch.html155
-rw-r--r--gn2/wqflask/templates/gsearch_gene.html30
-rw-r--r--gn2/wqflask/templates/gsearch_pheno.html2
-rw-r--r--gn2/wqflask/templates/heatmap.html4
-rwxr-xr-xgn2/wqflask/templates/index_page.html820
-rw-r--r--gn2/wqflask/templates/info_page.html2
-rw-r--r--gn2/wqflask/templates/jobs/debug.html2
-rw-r--r--gn2/wqflask/templates/jobs/no-such-job.html2
-rw-r--r--gn2/wqflask/templates/jupyter_notebooks.html2
-rw-r--r--gn2/wqflask/templates/links.html2
-rw-r--r--gn2/wqflask/templates/list_case_attribute_diffs.html2
-rw-r--r--gn2/wqflask/templates/list_case_attribute_diffs_error.html2
-rw-r--r--gn2/wqflask/templates/mapping_error.html2
-rw-r--r--gn2/wqflask/templates/mapping_results.html4
-rw-r--r--gn2/wqflask/templates/metadata/editor.html2
-rw-r--r--gn2/wqflask/templates/network_graph.html2
-rw-r--r--gn2/wqflask/templates/new_security/forgot_password.html2
-rw-r--r--gn2/wqflask/templates/new_security/forgot_password_step2.html2
-rw-r--r--gn2/wqflask/templates/new_security/login_user.html2
-rw-r--r--gn2/wqflask/templates/new_security/not_authenticated.html4
-rw-r--r--gn2/wqflask/templates/new_security/password_reset.html2
-rw-r--r--gn2/wqflask/templates/new_security/register_user.html2
-rw-r--r--gn2/wqflask/templates/new_security/registered.html2
-rw-r--r--gn2/wqflask/templates/new_security/thank_you.html2
-rw-r--r--gn2/wqflask/templates/new_security/verification_still_needed.html2
-rw-r--r--gn2/wqflask/templates/news.html2
-rw-r--r--gn2/wqflask/templates/oauth2/confirm-resource-role-unassign-privilege.html2
-rw-r--r--gn2/wqflask/templates/oauth2/create-resource.html2
-rw-r--r--gn2/wqflask/templates/oauth2/create-role.html2
-rw-r--r--gn2/wqflask/templates/oauth2/data-list-genotype.html2
-rw-r--r--gn2/wqflask/templates/oauth2/data-list-mrna.html2
-rw-r--r--gn2/wqflask/templates/oauth2/data-list-phenotype.html2
-rw-r--r--gn2/wqflask/templates/oauth2/data-list.html2
-rw-r--r--gn2/wqflask/templates/oauth2/group.html2
-rw-r--r--gn2/wqflask/templates/oauth2/group_join_or_create.html2
-rw-r--r--gn2/wqflask/templates/oauth2/join-requests.html2
-rw-r--r--gn2/wqflask/templates/oauth2/list_roles.html2
-rw-r--r--gn2/wqflask/templates/oauth2/login.html2
-rw-r--r--gn2/wqflask/templates/oauth2/masquerade.html2
-rw-r--r--gn2/wqflask/templates/oauth2/register_user.html2
-rw-r--r--gn2/wqflask/templates/oauth2/request_error.html2
-rw-r--r--gn2/wqflask/templates/oauth2/resources.html2
-rw-r--r--gn2/wqflask/templates/oauth2/role.html2
-rw-r--r--gn2/wqflask/templates/oauth2/view-resource-role.html2
-rw-r--r--gn2/wqflask/templates/oauth2/view-resource.html2
-rw-r--r--gn2/wqflask/templates/oauth2/view-user.html2
-rw-r--r--gn2/wqflask/templates/pair_scan_results.html2
-rw-r--r--gn2/wqflask/templates/partial_correlations/pcorrs_error.html2
-rw-r--r--gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html2
-rw-r--r--gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html2
-rw-r--r--gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html2
-rw-r--r--gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html2
-rw-r--r--gn2/wqflask/templates/phenotype.html2
-rw-r--r--gn2/wqflask/templates/policies.html2
-rw-r--r--gn2/wqflask/templates/probeset.html2
-rw-r--r--gn2/wqflask/templates/publication.html2
-rw-r--r--gn2/wqflask/templates/references.html2
-rw-r--r--gn2/wqflask/templates/search-syntax.html2
-rw-r--r--gn2/wqflask/templates/search_error.html2
-rw-r--r--gn2/wqflask/templates/search_result_page.html30
-rw-r--r--gn2/wqflask/templates/set_group_privileges.html2
-rw-r--r--gn2/wqflask/templates/show_trait.html2
-rw-r--r--gn2/wqflask/templates/show_trait_details.html1
-rw-r--r--gn2/wqflask/templates/show_trait_error.html2
-rw-r--r--gn2/wqflask/templates/snp_browser.html2
-rw-r--r--gn2/wqflask/templates/startup_errors.html2
-rw-r--r--gn2/wqflask/templates/submit_trait.html2
-rw-r--r--gn2/wqflask/templates/test_correlation_page.html4
-rw-r--r--gn2/wqflask/templates/tool_buttons.html4
-rw-r--r--gn2/wqflask/templates/tutorials.html2
-rw-r--r--gn2/wqflask/templates/view_case_attribute_diff.html2
-rw-r--r--gn2/wqflask/templates/view_case_attribute_diff_error.html2
-rw-r--r--gn2/wqflask/templates/webgestalt_page.html2
-rw-r--r--gn2/wqflask/templates/wgcna_results.html2
-rw-r--r--gn2/wqflask/templates/wgcna_setup.html4
-rw-r--r--gn2/wqflask/templates/wiki/edit_wiki.html2
-rw-r--r--gn2/wqflask/templates/wiki/genewiki.html43
-rw-r--r--gn2/wqflask/templates/wiki/history.html2
-rw-r--r--gn2/wqflask/templates/wiki/search.html2
-rw-r--r--gn2/wqflask/views.py81
-rwxr-xr-xscripts/maintenance/QTL_Reaper_v6.py249
143 files changed, 1438 insertions, 977 deletions
diff --git a/gn2/base/trait.py b/gn2/base/trait.py
index 24288ba1..8375c682 100644
--- a/gn2/base/trait.py
+++ b/gn2/base/trait.py
@@ -27,15 +27,10 @@ def create_trait(**kw):
 
     if bool(kw.get('dataset')):
         dataset = kw.get('dataset')
-
-
     else:
         if kw.get('dataset_name') != "Temp":
-
-
             dataset = create_dataset(kw.get('dataset_name'))
         else:
-
             dataset = create_dataset(
                     dataset_name="Temp",
                     dataset_type="Temp",
@@ -49,9 +44,8 @@ def create_trait(**kw):
         permissions = check_resource_availability(
             dataset, g.user_session.user_id)
 
-
     if permissions['data'] != "no-access":
-        
+
         the_trait = GeneralTrait(**dict(kw,dataset=dataset))
         if the_trait.dataset.type != "Temp":
             the_trait = retrieve_trait_info(
@@ -641,4 +635,4 @@ def fetch_symbols(trait_db_list):
                                           'db_name': trait_db.split(":")[1]})
             symbol_list.append(cursor.fetchone()[0])
 
-    return "+".join(symbol_list)
\ No newline at end of file
+    return "+".join(symbol_list)
diff --git a/gn2/debug.py b/gn2/debug.py
new file mode 100644
index 00000000..6b7173b4
--- /dev/null
+++ b/gn2/debug.py
@@ -0,0 +1,22 @@
+"""Debug utilities"""
+import logging
+from flask import current_app
+
+__this_module_name__ = __name__
+
+
+# pylint: disable=invalid-name
+def getLogger(name: str):
+    """Return a logger"""
+    return (
+        logging.getLogger(name)
+        if not bool(current_app)
+        else current_app.logger)
+
+def __pk__(*args):
+    """Format log entry"""
+    value = args[-1]
+    title_vals = " => ".join(args[0:-1])
+    logger = getLogger(__this_module_name__)
+    logger.debug("%s: %s", title_vals, value)
+    return value
diff --git a/gn2/tests/unit/wqflask/marker_regression/test_run_mapping.py b/gn2/tests/unit/wqflask/marker_regression/test_run_mapping.py
index 817bf2b9..569756c3 100644
--- a/gn2/tests/unit/wqflask/marker_regression/test_run_mapping.py
+++ b/gn2/tests/unit/wqflask/marker_regression/test_run_mapping.py
@@ -2,6 +2,7 @@ import unittest
 import datetime
 from unittest import mock
 
+import gn2.wqflask.marker_regression.run_mapping as run_mapping
 from gn2.wqflask.marker_regression.run_mapping import get_genofile_samplelist
 from gn2.wqflask.marker_regression.run_mapping import geno_db_exists
 from gn2.wqflask.marker_regression.run_mapping import write_input_for_browser
@@ -65,8 +66,9 @@ class TestRunMapping(unittest.TestCase):
     def test_if_geno_db_exists(self, mock_data_set):
         mock_data_set.create_dataset.side_effect = [
             AttributeSetter({}), Exception()]
-        results_no_error = geno_db_exists(self.dataset)
-        results_with_error = geno_db_exists(self.dataset)
+        run_mapping.create_trait = mock.Mock()
+        results_no_error = geno_db_exists(self.dataset, "dataset_1")
+        results_with_error = geno_db_exists(self.dataset, "dataset_1")
 
         self.assertEqual(mock_data_set.create_dataset.call_count, 2)
         self.assertEqual(results_with_error, "False")
diff --git a/gn2/wqflask/api/markdown.py b/gn2/wqflask/api/markdown.py
index 2fb849ea..3b5ab875 100644
--- a/gn2/wqflask/api/markdown.py
+++ b/gn2/wqflask/api/markdown.py
@@ -224,6 +224,7 @@ def policies():
     )
 
 
+@facilities_blueprint.route("/")
 @gn_docs_blueprint.route("/facilities")
 def facilities():
     file_data = fetch_raw_markdown(file_path="general/help/facilities.md")
diff --git a/gn2/wqflask/do_search.py b/gn2/wqflask/do_search.py
index b64c6fce..d50ef39d 100644
--- a/gn2/wqflask/do_search.py
+++ b/gn2/wqflask/do_search.py
@@ -359,6 +359,7 @@ class GenotypeSearch(DoSearch):
 
         if "'" not in self.search_term[0]:
             self.search_term = "%" + self.search_term[0] + "%"
+        self.search_term = self.search_term.replace("*", "%")
 
         for field in self.search_fields:
             where_clause.append('''%s LIKE "%s"''' % ("%s.%s" % self.mescape(self.dataset.type,
diff --git a/gn2/wqflask/marker_regression/run_mapping.py b/gn2/wqflask/marker_regression/run_mapping.py
index 7d2d40f7..92bbe321 100644
--- a/gn2/wqflask/marker_regression/run_mapping.py
+++ b/gn2/wqflask/marker_regression/run_mapping.py
@@ -25,7 +25,7 @@ Redis = Redis()
 
 from flask import Flask, g
 
-from gn2.base.trait import GeneralTrait
+from gn2.base.trait import GeneralTrait, create_trait
 from gn2.base import data_set
 from gn2.base import species
 from gn2.base import webqtlConfig
@@ -49,7 +49,7 @@ class RunMapping:
         # needed to pass temp_uuid to gn1 mapping code (marker_regression_gn1.py)
         self.temp_uuid = temp_uuid
 
-        # ZS: Needed to zoom in or remap temp traits like PCA traits
+        # Needed to zoom in or remap temp traits like PCA traits
         if "temp_trait" in start_vars and start_vars['temp_trait'] != "False":
             self.temp_trait = "True"
             self.group = self.dataset.group.name
@@ -60,7 +60,7 @@ class RunMapping:
         self.json_data = {}
         self.json_data['lodnames'] = ['lod.hk']
 
-        # ZS: Sometimes a group may have a genofile that only includes a subset of samples
+        # Sometimes a group may have a genofile that only includes a subset of samples
         genofile_samplelist = []
         if 'genofile' in start_vars:
             if start_vars['genofile'] != "":
@@ -95,10 +95,6 @@ class RunMapping:
         else:
             self.n_samples = len([val for val in self.vals if val != "x"])
 
-        # ZS: Check if genotypes exist in the DB in order to create links for markers
-
-        self.geno_db_exists = geno_db_exists(self.dataset)
-
         self.mapping_method = start_vars['method']
         if "results_path" in start_vars:
             self.mapping_results_path = start_vars['results_path']
@@ -138,6 +134,7 @@ class RunMapping:
         self.bootstrap_results = []
         self.covariates = start_vars['covariates'] if "covariates" in start_vars else ""
         self.categorical_vars = []
+        self.geno_db_exists = False
 
         # ZS: This is passed to GN1 code for single chr mapping
         self.selected_chr = -1
@@ -310,6 +307,9 @@ class RunMapping:
         if len(results) == 0:
             self.no_results = True
         else:
+            # Check if genotypes exist in the DB in order to create links for markers
+            self.geno_db_exists = geno_db_exists(self.dataset, results[0]['name'])
+
             if self.pair_scan == True:
                 self.figure_data = results[0]
                 self.table_data = results[1]
@@ -656,11 +656,21 @@ def write_input_for_browser(this_dataset, gwas_results, annotations):
     return [gwas_filename, annot_filename]
 
 
-def geno_db_exists(this_dataset):
+def geno_db_exists(this_dataset, first_marker):
+    """
+    Check if genotypes are databased
+
+    This checks two things:
+    - A genotypes dataset exists for this group
+    - The first marker in the genotype file is in the genotypes dataset, 
+    since there might be a mismatch between the file and databased markers
+    """
     geno_db_name = this_dataset.group.name + "Geno"
     try:
         geno_db = data_set.create_dataset(
             dataset_name=geno_db_name, get_samplelist=False)
+        geno_trait = create_trait(name=first_marker, dataset_name=geno_db_name)
+        
         return "True"
     except:
         return "False"
diff --git a/gn2/wqflask/oauth2/client.py b/gn2/wqflask/oauth2/client.py
index a7d20f6b..a7b0099c 100644
--- a/gn2/wqflask/oauth2/client.py
+++ b/gn2/wqflask/oauth2/client.py
@@ -17,8 +17,7 @@ from authlib.integrations.requests_client import OAuth2Session
 from gn2.wqflask.oauth2 import session
 from gn2.wqflask.external_errors import ExternalRequestError
 
-SCOPE = ("profile group role resource register-client user masquerade "
-         "introspect migrate-data")
+SCOPE = ("profile group role resource user masquerade introspect")
 
 def authserver_uri():
     """Return URI to authorisation server."""
@@ -152,7 +151,7 @@ def oauth2_client():
         client = OAuth2Session(
             oauth2_clientid(),
             oauth2_clientsecret(),
-            scope=SCOPE,
+            scope=token["scope"],
             token_endpoint=urljoin(authserver_uri(), "auth/token"),
             token_endpoint_auth_method="client_secret_post",
             token=token,
diff --git a/gn2/wqflask/oauth2/jwks.py b/gn2/wqflask/oauth2/jwks.py
index efd04997..08dfd8c4 100644
--- a/gn2/wqflask/oauth2/jwks.py
+++ b/gn2/wqflask/oauth2/jwks.py
@@ -8,6 +8,8 @@ from flask import Flask
 from authlib.jose import JsonWebKey
 from pymonad.either import Left, Right, Either
 
+from gn2.debug import __pk__
+
 def jwks_directory(app: Flask, configname: str) -> Path:
     """Compute the directory where the JWKs are stored."""
     appsecretsdir = Path(app.config[configname]).parent
@@ -44,10 +46,11 @@ def pem_to_jwk(filepath: Path) -> JsonWebKey:
 
 def __sorted_jwks_paths__(storagedir: Path) -> tuple[tuple[float, Path], ...]:
     """A sorted list of the JWK file paths with their creation timestamps."""
-    return tuple(sorted(((os.stat(keypath).st_ctime, keypath)
-                         for keypath in (Path(storagedir, keyfile)
-                                         for keyfile in os.listdir(storagedir)
-                                         if keyfile.endswith(".pem"))),
+    all_files = tuple(__pk__("STORAGE DIRECTORY ===========>", storagedir).iterdir())
+    return tuple(sorted(((os.stat(keypath).st_ctime, __pk__("FOUND KEY ==========>", keypath))
+                         for keypath in (keyfile
+                                         for keyfile in __pk__("DIRECTORY CONTENT", all_files)
+                                         if __pk__("KEYFILE SUFFIX ========>", keyfile.suffix) == ".pem")),
                         key=lambda tpl: tpl[0]))
 
 
diff --git a/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js b/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js
index 2875eabd..1a738e2d 100644
--- a/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js
+++ b/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js
@@ -14,9 +14,14 @@ range = function(size, startAt=0) {
 indicate_error = function (jqXHR, textStatus, errorThrown) {
   errorElement = document.createElement("span");
   errorElement.setAttribute("class", "alert-danger");
+  fallbackLink = document.createElement('a');
+  fallbackLink.href = "https://fallback.genenetwork.org";
+  fallbackLink.title = "GN2 Fallback";
+  fallbackLink.appendChild(document.createTextNode("GN2 Fallback Server."));
   errorText = document.createTextNode(
-	  "There was an error retrieving and setting the menu. Try again later.");
+	  "There was an error retrieving and setting the menu. Try visiting the ");
   errorElement.appendChild(errorText);
+  errorElement.appendChild(fallbackLink);
   if (document.getElementById("search")){
     form = document.getElementById("search").getElementsByTagName("form")[0];
     form.prepend(errorElement);
@@ -41,7 +46,6 @@ if (typeof gn_server_url === 'undefined'){
 $.ajax(gn_server_url +'/menu/generate/json', {
   dataType: 'json',
   success: process_json,
-  error: indicate_error,
   statusCode: {
 	  ...defaultStatusCodeFunctions,
   }
diff --git a/gn2/wqflask/templates/admin/change_resource_owner.html b/gn2/wqflask/templates/admin/change_resource_owner.html
index 7fd84387..fae7ca8d 100644
--- a/gn2/wqflask/templates/admin/change_resource_owner.html
+++ b/gn2/wqflask/templates/admin/change_resource_owner.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Resource Manager{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/admin/create_group.html b/gn2/wqflask/templates/admin/create_group.html
index b1d214ea..c8ee925e 100644
--- a/gn2/wqflask/templates/admin/create_group.html
+++ b/gn2/wqflask/templates/admin/create_group.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Group Manager{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/admin/group_manager.html b/gn2/wqflask/templates/admin/group_manager.html
index eedfe138..120bbb7b 100644
--- a/gn2/wqflask/templates/admin/group_manager.html
+++ b/gn2/wqflask/templates/admin/group_manager.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Group Manager{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/admin/ind_user_manager.html b/gn2/wqflask/templates/admin/ind_user_manager.html
index b821e5d5..32dc341e 100644
--- a/gn2/wqflask/templates/admin/ind_user_manager.html
+++ b/gn2/wqflask/templates/admin/ind_user_manager.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}User Manager{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/admin/manage_resource.html b/gn2/wqflask/templates/admin/manage_resource.html
index 63ec17c0..719e9203 100644
--- a/gn2/wqflask/templates/admin/manage_resource.html
+++ b/gn2/wqflask/templates/admin/manage_resource.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Resource Manager{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/admin/manage_user.html b/gn2/wqflask/templates/admin/manage_user.html
index 3ef90b90..c660759d 100644
--- a/gn2/wqflask/templates/admin/manage_user.html
+++ b/gn2/wqflask/templates/admin/manage_user.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}

+{% extends "index_page.html" %}

 {% block title %}View and Edit Group{% endblock %}

 {% block css %}

     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />

diff --git a/gn2/wqflask/templates/admin/search_for_groups.html b/gn2/wqflask/templates/admin/search_for_groups.html
index 0e1ec720..abfb2e26 100644
--- a/gn2/wqflask/templates/admin/search_for_groups.html
+++ b/gn2/wqflask/templates/admin/search_for_groups.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Resource Manager{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/admin/set_group_privileges.html b/gn2/wqflask/templates/admin/set_group_privileges.html
index 04842453..83d1cdc3 100644
--- a/gn2/wqflask/templates/admin/set_group_privileges.html
+++ b/gn2/wqflask/templates/admin/set_group_privileges.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Set Group Privileges{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/admin/user_manager.html b/gn2/wqflask/templates/admin/user_manager.html
index 2b6c1b2b..ea0b7fe8 100644
--- a/gn2/wqflask/templates/admin/user_manager.html
+++ b/gn2/wqflask/templates/admin/user_manager.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}User Manager{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/admin/view_group.html b/gn2/wqflask/templates/admin/view_group.html
index c88ce0e7..33d72542 100644
--- a/gn2/wqflask/templates/admin/view_group.html
+++ b/gn2/wqflask/templates/admin/view_group.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}View and Edit Group{% endblock %}
 {% block css %}
 <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/authorisation_error.html b/gn2/wqflask/templates/authorisation_error.html
index 3dce8b52..36646fba 100644
--- a/gn2/wqflask/templates/authorisation_error.html
+++ b/gn2/wqflask/templates/authorisation_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}{{error_type}}: ...{%endblock%}
 {%block content%}
 <div class="container">
diff --git a/gn2/wqflask/templates/base.html b/gn2/wqflask/templates/base.html
index 7db9aed6..cd70668c 100644
--- a/gn2/wqflask/templates/base.html
+++ b/gn2/wqflask/templates/base.html
@@ -3,26 +3,45 @@
 <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <meta charset="utf-8">
-        <title>{% block title %}{% endblock %} GeneNetwork 2</title>
+        <title>
+            {% block title %}{% endblock %}
+        GeneNetwork 2</title>
         <meta name="description" content="">
         <meta name="author" content="">
-        <script type="text/javascript">
-         var pageLoadStart = Date.now();
-        </script>
-        <link rel="icon" type="image/png" sizes="64x64" href="/static/new/images/CITGLogo.png">
-        <link rel="apple-touch-icon" type="image/png" sizes="64x64" href="/static/new/images/CITGLogo.png">
-        <link REL="stylesheet" TYPE="text/css" href="{{ url_for('css', filename='bootstrap/css/bootstrap.css') }}" />
-        <link REL="stylesheet" TYPE="text/css" href="/static/new/css/bootstrap-custom.css" />
-        <link REL="stylesheet" TYPE="text/css" href="/static/new/css/non-responsive.css" />
-        <link REL="stylesheet" TYPE="text/css" href="/static/new/css/docs.css" />
-        <link rel="stylesheet" type="text/css" href="/static/new/css/colorbox.css" />
-        <link rel="stylesheet" type="text/css" href="/static/new/css/parsley.css" />
-        <link rel="stylesheet" type="text/css" href="/static/new/css/broken_links.css" />
-        <link rel="stylesheet" href="/static/new/css/autocomplete.css" />
-        <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='fontawesome/css/font-awesome.min.css') }}" />
-
-        {% block css %}
-        {% endblock %}
+        <script type="text/javascript">var pageLoadStart = Date.now();</script>
+        <link rel="icon"
+              type="image/png"
+              sizes="64x64"
+              href="/static/new/images/CITGLogo.png">
+        <link rel="apple-touch-icon"
+              type="image/png"
+              sizes="64x64"
+              href="/static/new/images/CITGLogo.png">
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('css', filename='bootstrap/css/bootstrap.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/bootstrap-custom.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/non-responsive.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/docs.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/colorbox.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/parsley.css') }}" />
+        <link REL="stylesheet"
+              TYPE="text/css"
+              href="{{ url_for('static', filename='/new/css/broken_links.css') }}" />
+        <link rel="stylesheet"
+              type="text/css"
+              href="{{ url_for('css', filename='fontawesome/css/font-awesome.min.css') }}" />
+        {% block css %}{% endblock %}
         <style>
          .form-rounded {
              border-radius: 1rem;
@@ -33,262 +52,327 @@
          table.dataTable thead .sorting_desc {
              background-image: url({{ url_for("js", filename="DataTables/images/sort_desc_disabled.png") }});
          }
-         .global_search_input{
-             padding:9px 8px;
-             text-decoration: none;
-             border: none;
-
-             border-radius: 5px;
-         }
-         .global_search_input:focus{
-             outline: none;
-         }
-         .btn-stc {
-             padding:9px 8px;
-	     border-left:none;
-	     border-radius:0 40px 40px 0;
-	     cursor: pointer;
-	     height: 40px;
-             width: 64px;
-             margin:0;
-             border:1px solid #d3d3d3;
-             background-color: white;
-             position: absolute;
-             top:0;
-             left: 100%;
-             right: 0;
-             border-left: none;
-         }
-	</style>
+	
+        </style>
     </head>
     <body style="width: 100%">
         <!-- Navbar ================================================== -->
-        <div class="navbar navbar-inverse navbar-static-top pull-left" role="navigation" style="width: 100%; min-width: 850px; white-space: nowrap;">
+        <div class="navbar navbar-inverse navbar-static-top pull-left"
+             role="navigation"
+             style="width: 100%;
+                    min-width: 850px;
+                    white-space: nowrap">
             <div class="container-fluid" style="width: 100%;">
                 <!-- Collect the nav links, forms, and other content for toggling -->
                 <div>
                     <ul class="nav navbar-nav">
-                        <li class="" style="margin-right: 20px;">
+                        <li style="margin-right: 20px;">
                             <a href="/" style="font-weight: bold;">GeneNetwork</a>
                         </li>
-                        <li class="">
-                            <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Intro <span class="caret"></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="/intro">Intro</a></li>
-                                    <li><a href="/submit_trait">Submit Trait</a></li>
-                                    <li><a href="http://genenetwork.org/webqtl/main.py?FormID=batSubmit">Batch Submission</a></li>
-                                </ul>
+                        <li>
+                            <a href="/help"
+                               class="dropdow-toggle"
+                               data-toggle="dropdown"
+                               aria-haspopup="true"
+                               aria-expanded="false">Intro <span class="caret"></span></a>
+                            <ul class="dropdown-menu">
+                                <li>
+                                    <a href="/intro">Intro</a>
+                                </li>
+                                <li>
+                                    <a href="/submit_trait">Submit Trait</a>
+                                </li>
+                                <li>
+                                    <a href="http://genenetwork.org/webqtl/main.py?FormID=batSubmit">Batch Submission</a>
+                                </li>
+                            </ul>
                         </li>
-                        <li class="">
-                            <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Help <span class="caret"></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="{{ url_for('gn_docs_blueprint.references') }}">References</a></li>
-                                    <li><a href="/tutorials">Webinars, Tutorials/Primers</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.blogs_list') }}">Blogs</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.glossary') }}">Glossary of Term</a></li>
-                                    <li><a href="http://gn1.genenetwork.org/faq.html">FAQ</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.policies') }}">Policies</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.links') }}">Links</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.facilities') }}">Facilities</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.environments') }}">Environments</a></li>
-                                    <li><a href="{{ url_for('gn_docs_blueprint.news') }}">GN1 News</a></li>
-                                </ul>
+                        <li>
+                            <a href="/help"
+                               class="dropdown-toggle"
+                               data-toggle="dropdown"
+                               aria-haspopup="true"
+                               aria-expanded="false">Help <span class="caret"></span></a>
+                            <ul class="dropdown-menu">
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.references") }}">References</a>
+                                </li>
+                                <li>
+                                    <a href="/tutorials">Webinars, Tutorials/Primers</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.blogs_list") }}">Blogs</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.glossary") }}">Glossary of Term</a>
+                                </li>
+                                <li>
+                                    <a href="http://gn1.genenetwork.org/faq.html">FAQ</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.policies") }}">Policies</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.links") }}">Links</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.facilities") }}">Facilities</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.environments") }}">Environments</a>
+                                </li>
+                                <li>
+                                    <a href="{{ url_for("gn_docs_blueprint.news") }}">GN1 News</a>
+                                </li>
+                            </ul>
                         </li>
-                        <li class="">
-                            <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Tools <span class="caret"></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="/snp_browser">Variant Browser</a></li>
-                                    <li><a href="http://bnw.genenetwork.org/sourcecodes/home.php">Bayesian Network Webserver</a></li>
-                                    <li><a href="https://systems-genetics.org/">Systems Genetics PheWAS</a></li>
-                                    <li><a href="http://ucscbrowser.genenetwork.org/">Genome Browser</a></li>
-                                    <li><a href="http://power.genenetwork.org">BXD Power Calculator</a></li>
-                                    <li><a href="{{url_for('jupyter_notebooks.launcher')}}">Jupyter Notebooks</a></li>
-                                    <li><a href="https://files.genenetwork.org/current/">Public Datasets</a></li>
-                                </ul>
+                        <li>
+                            <a href="/help"
+                               class="dropdown-toggle"
+                               data-toggle="dropdown"
+                               aria-haspopup="true"
+                               aria-expanded="false">Tools <span class="caret"></span> </a>
+                            <ul class="dropdown-menu">
+                                <li>
+                                    <a href="/snp_browser">Variant Browser</a>
+                                </li>
+                                <li>
+                                    <a href="http://bnw.genenetwork.org/sourcecodes/home.php">Bayesian Network Webserver</a>
+                                </li>
+                                <li>
+                                    <a href="https://systems-genetics.org/">Systems Genetics PheWAS</a>
+                                </li>
+                                <li>
+                                    <a href="http://ucscbrowser.genenetwork.org/">Genome Browser</a>
+                                </li>
+                                <li>
+                                    <a href="http://power.genenetwork.org">BXD Power Calculator</a>
+                                </li>
+                                <li>
+                                    <a href="https://files.genenetwork.org/current/">Public Datasets</a>
+                                </li>
+                                <li>
+                                    <a href="https://r-forge.r-project.org/R/?group_id=52">R/qtlDesign</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/BigRiverQTLPlots.jl">BigRiverQTLPlots.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/BulkLMM.jl">BulkLMM.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/MetabolomicsWorkbenchAPI.jl">MetabolomicsWorkbenchAPI.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/GeneNetworkAPI.jl">GeneNetworkAPI.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/MatrixLMnet.jl">MatrixLMnet.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/MatrixLM.jl">MatrixLM.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/Helium.jl">Helium.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/GeneticScreens.jl">GeneticScreens.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/FlxQTL.jl">FlxQTL.jl</a>
+                                </li>
+                                <li>
+                                    <a href="https://github.com/senresearch/LiteQTL.jl">LiteQTL.jl</a>
+                                </li>
+                            </ul>
                         </li>
                         {% if g.user_session %}
-                        <li class="">
-                            <a href="/collections/list">Collections
-                                <span class="badge badge-info">{{num_collections()}}</span>
-                            </a>
-                        </li>
-                        <li class="">
-                            <a href="/repositories" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Source Code <span class="caret"></a>
-                                <ul class="dropdown-menu">
-                                    <li><a href="https://github.com/genenetwork/genenetwork2">GN2 Source Code</a></li>
-                                    <li><a href="https://github.com/genenetwork/genenetwork">GN1 Source Code</a></li>
-                                    <li><a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a></li>
-                                    <li><a href="https://github.com/genenetwork/genenetwork2/blob/testing/doc/API_readme.md">REST API Documentation</a></li>
-                                </ul>
-                        </li>
-                        {% if g.user_session.logged_in %}
-                        <li class="">
-                            <a href="/edit_account_settings" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{% if g.user_session.user_email %}{{ g.user_session.user_email }}{% else %}User Account Settings{% endif %}<span class="caret"></a>
-                                <ul class="dropdown-menu">
-                                    <li><a id="manage_user" title="User Options" href="/user/manage">User Options</a></li>
-                                    <li><a id="manage_groups" title="Manage Groups" href="/group-management/groups">Manage Groups</a></li>
-                                </ul>
-                        </li>
-                        {% endif %}
-                        <li class="">
-                            {%if logged_in()%}
-                            {%if user_details is mapping%}
-                            {%set user_dets = user_details%}
-                            {%else%}
-                            {%set user_dets = user_details()%}
-                            {%endif%}
-                            <a id="login_out"
-                               title="Signed in as {{user_dets.name}}({{user_dets.email}})"
-                               href="{{url_for('oauth2.user.logout')}}">Sign out</a>
-                            {%else%}
-                            <a id="login_in" href="{{authserver_authorise_uri()}}">Sign in</a>
-                            {%endif%}
-                        </li>
-                        {% endif %}
-
-                        {%if not logged_in()%}
-                        <li class="">
-                            <a id="user:register" title="Register a new user account."
-                               href="{{url_for('oauth2.user.register_user')}}">
-                                Register
-                            </a>
-                        </li>
-                        {%endif%}
-
-                        {%if logged_in()%}
-                        <li class="">
-                            <a id="user:profile" title="User's profile page."
-                               href="{{url_for('oauth2.user.user_profile')}}">
-                                Profile
-                            </a>
-                        </li>
-                        {% endif %}
-                    </ul>
-                </div>
-            </div>
-        </div>
-	{% block search %}
-        <div class="container-fluid" style="width: 100%; min-width: 650px; position: relative;background-color: #d5d5d5; height: 100px;">
-            <form method="get" action="/gsearch" id="globalsearchform">
-		<div class="form-group">
-                    <div class="controls">
-			<select name="type">
-                            <option value="gene">Genes / Molecules</option>
-                            <option value="phenotype" {% if type=="phenotype" %}selected{% endif %}>Phenotypes</option>
-			</select>
-			<div class="col-8  autocomplete" style="margin-left: 30px;margin-right: 10px;">
-                            <input autocomplete="off" class="global_search_input" id="term" style="width:45vw" type="text" required placeholder="Enter you search term here (ex: cytochrome AND P450)" name="terms">
-
-			    <button   type="submit" class="btn-stc" style="position: absolute;  background-color: #336699"><i class="fa fa-search" title="Search " style="color:white;"></i></button>
-			</div>
-			<!-- todo fix text overlap for this;;responsiveness-->
-
-			<span style="padding: 5px;margin-left: 65px;" id="gnqna_home">
-                            <a href="/gnqna">GNQA Search</a>
-			</span>
-
-			<span  style="padding: 5px;margin-left: 65px;" >
-                            <a style="text-decoration: none" target="_blank" href="/search-syntax">
-                                <i  style="text-align: center;color:#336699;;" class="fa fa-question-circle fa-2x" title="see more search hints" aria-hidden="true"></i>
-                            </a>
-			</span>
-		    </div>
-		</div>
-		    </form>
-	</div>
-	{% endblock %}
-        {% block content %}
-            {% endblock %}
-
-            <footer class="footer">
-                <div class="row" style="margin: 10px; width: 100%; min-width: 1200px;">
-                    <div class="col-xs-6">
-                        <p>Web services initiated January, 1994 as
-                            <a href="http://www.ncbi.nlm.nih.gov/pubmed?term=8043953">
-                                The Portable Dictionary of the Mouse Genome
-                            </a>; June 15, 2001 as <a href="https://www.ncbi.nlm.nih.gov/pubmed/15043217">WebQTL</a>; and Jan 5, 2005 as GeneNetwork.
-                        </p>
-                        <p>
-                            This site is currently operated by
-                            <a href="mailto:rwilliams@uthsc.edu">Rob Williams</a>,
-                            <a href="https://thebird.nl/">Pjotr Prins</a>,
-                            <a href="http://www.senresearch.org">Saunak Sen</a>,
-                            <a href="mailto:zachary.a.sloan@gmail.com">Zachary Sloan</a>,
-                            <a href="mailto:acenteno@uthsc.edu">Arthur Centeno</a>,
-                            and <a href="mailto:bonfacemunyoki@gmail.com">Bonface Munyoki</a>.
-                        </p>
-                        <p>Design and code by Pjotr Prins, Shelby Solomon, Zach Sloan, Arthur Centeno, Christan Fischer, Bonface Munyoki, Danny Arends, Arun Isaac, Alex Mwangi, Fred Muriithi, Sam Ockman, Lei Yan, Xiaodong Zhou, Christian Fernandez,
-                            Ning Liu, Rudi Alberts, Elissa Chesler, Sujoy Roy, Evan G. Williams, Alexander G. Williams, Kenneth Manly, Jintao Wang, Robert W. Williams, and
-                            <a href="/credits">colleagues</a>.</p>
-                        <br />
-                        <p>GeneNetwork support from:</p>
-                        <ul>
                             <li>
-                                <a href="http://citg.uthsc.edu">
-                                    The UT Center for Integrative and Translational Genomics
+                                <a href="/collections/list">Collections
+                                    <span class="badge badge-info">{{ num_collections() }}</span>
                                 </a>
                             </li>
                             <li>
-                                <a href="https://www.nigms.nih.gov/">NIGMS</a>
-                                Systems Genetics and Precision Medicine Project (R01 GM123489, 2017-2026)
-                            </li>
-                            <li>
-                                <a href="https://www.nsf.gov/awardsearch/showAward?AWD_ID=2118709">NSF</a>
-                                Panorama: Integrated Rack-Scale Acceleration for Computational Pangenomics
-                                (PPoSS 2118709, 2021-2016)
-                            </li>
-                            <li>
-                                <a href="https://www.drugabuse.gov/">NIDA</a>
-                                NIDA Core Center of Excellence in Transcriptomics, Systems Genetics, and the Addictome (P30 DA044223, 2017-2022)
-                            </li>
-                            <li>
-                                <a href="http://www.nia.nih.gov/">NIA</a>
-                                Translational Systems Genetics of Mitochondria, Metabolism, and Aging (R01AG043930, 2013-2018)
+                                <a href="/repositories"
+                                   class="dropdown-toggle"
+                                   data-toggle="dropdown"
+                                   aria-haspopup="true"
+                                   aria-expanded="false">Source Code <span class="caret"></span></a>
+                                <ul class="dropdown-menu">
+                                    <li>
+                                        <a href="https://github.com/genenetwork/genenetwork2">GN2 Source Code</a>
+                                    </li>
+                                    <li>
+                                        <a href="https://github.com/genenetwork/genenetwork">GN1 Source Code</a>
+                                    </li>
+                                    <li>
+                                        <a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a>
+                                    </li>
+                                    <li>
+                                        <a href="https://github.com/genenetwork/genenetwork2/blob/testing/doc/API_readme.md">REST API Documentation</a>
+                                    </li>
+                                </ul>
                             </li>
+                            {% if logged_in() %}
+                                <li>
+                                    <a href="/edit_account_settings"
+                                       class="dropdown-toggle"
+                                       data-toggle="dropdown"
+                                       aria-haspopup="true"
+                                       aria-expanded="false">
+                                        {% if g.user_session.user_email %}
+                                            {{ g.user_session.user_email }}
+                                        {% else %}
+                                            User Account Settings
+                                        {% endif %}
+                                        <span class="caret"></span></a>
+                                    <ul class="dropdown-menu">
+                                        <li>
+                                            <a id="manage_user" title="User Options" href="/user/manage">User Options</a>
+                                        </li>
+                                        <li>
+                                            <a id="manage_groups"
+                                               title="Manage Groups"
+                                               href="/group-management/groups">Manage Groups</a>
+                                        </li>
+                                    </ul>
+                                </li>
+                            {% endif %}
                             <li>
-                                <a href="https://www.ohsu.edu/iniastress-consortium">NIAAA</a>
-                                Integrative Neuroscience Initiative on Alcoholism (U01 AA016662, U01 AA013499, U24 AA013513, U01 AA014425, 2006-2017)
+                                {% if logged_in() %}
+                                    {% if user_details is mapping %}
+                                        {% set user_dets = user_details %}
+                                    {% else %}
+                                        {% set user_dets = user_details() %}
+                                    {% endif %}
+                                    <a id="login_out"
+                                       title="Signed in as {{ user_dets.name }}({{ user_dets.email }})"
+                                       href="{{ url_for("oauth2.user.logout") }}">Sign out</a>
+                                {% else %}
+                                    <a id="login_in" href="{{ authserver_authorise_uri() }}">Sign in</a>
+                                {% endif %}
                             </li>
+                        {% endif %}
+                        {% if not logged_in() %}
                             <li>
-                                <a href="http://www.drugabuse.gov/">NIDA</a>, <a href="http://www.nimh.nih.gov/">NIMH</a>, and <a href="http://www.niaaa.nih.gov/">NIAAA</a>
-                                (P20-DA 21131, 2001-2012)
+                                <a id="user:register"
+                                   title="Register a new user account."
+                                   href="{{ url_for("oauth2.user.register_user") }}">Register</a>
                             </li>
+                        {% endif %}
+                        {% if logged_in() %}
                             <li>
-                                NCI <a href="http://emice.nci.nih.gov/">MMHCC</a> (U01CA105417), NCRR, <span class="broken_link test" href="http://www.birncommunity.org/">BIRN</span>, (U24 RR021760)
+                                <a id="user:profile"
+                                   title="User's profile page."
+                                   href="{{ url_for("oauth2.user.user_profile") }}">Profile</a>
                             </li>
-                        </UL>
-                        <p>Published in
-                          <a href="http://joss.theoj.org/papers/10.21105/joss.00025">Journal of Open Source Software (JOSS)</a>
-                          <!-- JOSS logo is defunct -->
-                        </p>
+                        {% endif %}
+                    </ul>
+                </div>
+            </div>
+        </div>
+        {% block search %}{% endblock %}
+        {% block content %}{% endblock %}
+        <footer class="footer">
+            <div class="row" style="margin: 10px; width: 100%; min-width: 1200px;">
+                <div class="col-xs-6">
+                    <p>
+                        Web services initiated January, 1994 as
+                        <a href="http://www.ncbi.nlm.nih.gov/pubmed?term=8043953">The Portable Dictionary of the Mouse Genome</a>; June 15, 2001 as <a href="https://www.ncbi.nlm.nih.gov/pubmed/15043217">WebQTL</a>; and Jan 5, 2005 as GeneNetwork.
+                    </p>
+                    <p>
+                        This site is currently operated by
+                        <a href="mailto:rwilliams@uthsc.edu">Rob Williams</a>,
+                        <a href="https://thebird.nl/">Pjotr Prins</a>,
+                        <a href="http://www.senresearch.org">Saunak Sen</a>,
+                        <a href="mailto:zachary.a.sloan@gmail.com">Zachary Sloan</a>,
+                        <a href="mailto:acenteno@uthsc.edu">Arthur Centeno</a>,
+                        and <a href="mailto:bonfacemunyoki@gmail.com">Bonface Munyoki</a>.
+                    </p>
+                    <p>
+                        Design and code by Pjotr Prins, Shelby Solomon, Zach Sloan, Arthur Centeno, Christan Fischer, Bonface Munyoki, Danny Arends, Arun Isaac, Alex Mwangi, Fred Muriithi, Sam Ockman, Lei Yan, Xiaodong Zhou, Christian Fernandez,
+                        Ning Liu, Rudi Alberts, Elissa Chesler, Sujoy Roy, Evan G. Williams, Alexander G. Williams, Kenneth Manly, Jintao Wang, Robert W. Williams, and
+                        <a href="/credits">colleagues</a>.
+                    </p>
+                    <br />
+                    <p>GeneNetwork support from:</p>
+                    <ul>
+                        <li>
+                            <a href="http://citg.uthsc.edu">The UT Center for Integrative and Translational Genomics</a>
+                        </li>
+                        <li>
+                            <a href="https://www.nigms.nih.gov/">NIGMS</a>
+                            Systems Genetics and Precision Medicine Project (R01 GM123489, 2017-2026)
+                        </li>
+                        <li>
+                            <a href="https://www.nsf.gov/awardsearch/showAward?AWD_ID=2118709">NSF</a>
+                            Panorama: Integrated Rack-Scale Acceleration for Computational Pangenomics
+                            (PPoSS 2118709, 2021-2016)
+                        </li>
+                        <li>
+                            <a href="https://www.drugabuse.gov/">NIDA</a>
+                            NIDA Core Center of Excellence in Transcriptomics, Systems Genetics, and the Addictome (P30 DA044223, 2017-2022)
+                        </li>
+                        <li>
+                            <a href="http://www.nia.nih.gov/">NIA</a>
+                            Translational Systems Genetics of Mitochondria, Metabolism, and Aging (R01AG043930, 2013-2018)
+                        </li>
+                        <li>
+                            <a href="https://www.ohsu.edu/iniastress-consortium">NIAAA</a>
+                            Integrative Neuroscience Initiative on Alcoholism (U01 AA016662, U01 AA013499, U24 AA013513, U01 AA014425, 2006-2017)
+                        </li>
+                        <li>
+                            <a href="http://www.drugabuse.gov/">NIDA</a>, <a href="http://www.nimh.nih.gov/">NIMH</a>, and <a href="http://www.niaaa.nih.gov/">NIAAA</a>
+                            (P20-DA 21131, 2001-2012)
+                        </li>
+                        <li>
+                            NCI <a href="http://emice.nci.nih.gov/">MMHCC</a> (U01CA105417), NCRR, <span class="broken_link test" href="http://www.birncommunity.org/">BIRN</span>, (U24 RR021760)
+                        </li>
+                    </ul>
+                    <p>
+                        Published in
+                        <a href="http://joss.theoj.org/papers/10.21105/joss.00025">Journal of Open Source Software (JOSS)</a>
+                        <!-- JOSS logo is defunct -->
+                    </p>
+                    <p>
+                        Development and source code on <a href="https://github.com/genenetwork/">github</a> with <a href="https://issues.genenetwork.org/">issue tracker</a> and <a href="https://github.com/genenetwork/genenetwork2/blob/master/README.md">documentation</a>.
+                    </p>
+                    {% if version: %}
                         <p>
-                            Development and source code on <a href="https://github.com/genenetwork/">github</a> with <a href="https://issues.genenetwork.org/">issue tracker</a> and <a href="https://github.com/genenetwork/genenetwork2/blob/master/README.md">documentation</a>.
-                            {% if version: %}
-                            <p><small>GeneNetwork {{ version }}</small></p>
-                            {% endif %}
-                            <p> It took the server {{ g.request_time() }} seconds to process this page.</p>
-                    </div>
-                    <div class="col-xs-2">
-                        <a href="http://www.python.org/" target="_blank">
-                            <img src="/static/new/images/PythonLogo.png" alt="Python Powered" border="0">
-                        </a>
-                        <a href="http://www.neuinfo.org" target="_blank">
-                            <img src="/static/new/images/Nif.png" alt="Registered with Nif" border="0">
-                        </a>
-                    </div>
+                            <small>GeneNetwork {{ version }}</small>
+                        </p>
+                    {% endif %}
+                    <p>It took the server {{ g.request_time() }} seconds to process this page.</p>
                 </div>
-	    </footer>
-                <!--http://stackoverflow.com/questions/14045515/how-can-i-reuse-one-bootstrap-modal-div-->
-                <!-- Modal -->
-                <div id="utility" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
-                <div class="modal-body">
-                    <p>.</p>
+                <div class="col-xs-2">
+                    <a href="http://www.python.org/" target="_blank">
+                        <img src="/static/new/images/PythonLogo.png"
+                             alt="Python Powered"
+                             border="0">
+                    </a>
+                    <a href="http://www.neuinfo.org" target="_blank">
+                        <img src="/static/new/images/Nif.png" alt="Registered with Nif" border="0">
+                    </a>
                 </div>
-		</div>
-                <script src="{{ url_for('js', filename='jquery/jquery.min.js') }}" type="text/javascript"></script>
-                <script src="{{ url_for('js', filename='bootstrap/js/bootstrap.min.js') }}" type="text/javascript"></script>
-                <script src="/static/new/javascript/search_autocomplete.js"></script>
-                <script>
+            </div>
+        </footer>
+        <!--http://stackoverflow.com/questions/14045515/how-can-i-reuse-one-bootstrap-modal-div-->
+        <!-- Modal -->
+        <div id="utility"
+             class="modal hide fade"
+             tabindex="-1"
+             role="dialog"
+             aria-labelledby="myModalLabel"
+             aria-hidden="true">
+            <div class="modal-body">
+                <p>.</p>
+            </div>
+        </div>
+        <script src="{{ url_for('js', filename='jquery/jquery.min.js') }}"
+                type="text/javascript"></script>
+        <script src="{{ url_for('js', filename='bootstrap/js/bootstrap.min.js') }}"
+                type="text/javascript"></script>
+        <script>
                  //http://stackoverflow.com/questions/11521763/bootstrap-scrollspy-not-working
                  var $window = $(window)
                  $('.bs-docs-sidenav').affix({
@@ -297,58 +381,23 @@
                          bottom: 270
                      }
                  })
-                </script>
-                <script type="text/javascript">
-                 $(document).ready(function() {
-
-                     const urlParams = new  URLSearchParams(window.location.search)
-                     let term = urlParams.get("terms")
-
-                     //should web scrap
-                     var global_search_hint = [
-                         "cytochrome",
-                         "cytochrome AND P450",
-                         "cytochrome NEAR P450",
-                         "cytochrome -P450",
-                         "cytochrome NOT P450",
-                         "species:human",
-                         "group:BXD",
-                         "Hs:chr4:9930021 species:mouse",
-                         "Hs:chr4:9130000..9980000 species:mouse",
-                         "mean:5..7",
-                         "mean:7..",
-                         "Hs:chr4:9930021",
-                         "Hs:chr4:9930021 species:mouse",
-                         "Hs:chr4:9130000..9980000 species:mouse",
-                         "bx*",
-                         "*",
-                     ]
-                     autocomplete(document.getElementById("term"), global_search_hint);
-                     $("#term").keyup(function(event) {
-                         if (event.keyCode === 13) {
-                             event.preventDefault();
-                             $('#globalsearchform').attr('action', "/gsearch").submit();
-                             if ($("#term").val().trim() != "") {
-                                 saveBeforeSubmit($("#term").val().trim())
-                                 $("#globalsearchform")[0].submit();
-                             }
-
-                         }
-                     })
-
-                 });
-                </script>
-                <script src="{{ url_for('js', filename='jquery-cookie/jquery.cookie.js') }}" type="text/javascript"></script>
-                <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jquery-ui/jquery-ui.min.js') }}"></script>    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='colorbox/jquery.colorbox-min.js') }}"></script>
-                <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/parsley.min.js') }}"></script>
-                {% block js %}
-                {% endblock %}
-                <script type="text/javascript">
+        </script>
+        <script src="{{ url_for('js', filename='jquery-cookie/jquery.cookie.js') }}"
+                type="text/javascript"></script>
+        <script language="javascript"
+                type="text/javascript"
+                src="{{ url_for('js', filename='jquery-ui/jquery-ui.min.js') }}"></script>    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='colorbox/jquery.colorbox-min.js') }}"></script>
+        <script language="javascript"
+                type="text/javascript"
+                src="{{ url_for('js', filename='js_alt/parsley.min.js') }}"></script>
+        {% block js %}
+        {% endblock %}
+        <script type="text/javascript">
                  document.addEventListener('DOMContentLoaded', function() {
                      let timeToLoad = document.createElement("p");
                      timeToLoad.innerHTML = "It took your browser " + ((Date.now() - pageLoadStart) / 1000) + " second(s) to render this page";
                      document.querySelector("footer .row .col-xs-6").appendChild(timeToLoad);
 		 });
-                </script>
+        </script>
     </body>
 </html>
diff --git a/gn2/wqflask/templates/base_macro.html b/gn2/wqflask/templates/base_macro.html
index 7fcb6fe7..4cb8e1b7 100644
--- a/gn2/wqflask/templates/base_macro.html
+++ b/gn2/wqflask/templates/base_macro.html
@@ -1,11 +1,9 @@
 {% macro flash_me() -%}
     {% with messages = get_flashed_messages(with_categories=true) %}
         {% if messages %}
-        <div class="container">
-            {% for category, message in messages %}
-                <div class="alert {{ category }}" role="alert">{{ message }}</div>
-            {% endfor %}
-        </div>
+        {% for category, message in messages %}
+            <div class="alert {{ category }}" role="alert">{{ message }}</div>
+        {% endfor %}
         {% endif %}
     {% endwith %}
 {% endmacro %}
diff --git a/gn2/wqflask/templates/blogs.html b/gn2/wqflask/templates/blogs.html
index 314eb733..dfe53d55 100644
--- a/gn2/wqflask/templates/blogs.html
+++ b/gn2/wqflask/templates/blogs.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Blogs {% endblock %}
 {% block css %}
 <link rel="stylesheet" type="text/css" href="/static/new/css/markdown.css" />
@@ -9,4 +9,4 @@
 <div id="markdown" class="container">
     {{ rendered_markdown|safe }}
 </div>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/blogs_list.html b/gn2/wqflask/templates/blogs_list.html
index a74d24a2..a80fa885 100644
--- a/gn2/wqflask/templates/blogs_list.html
+++ b/gn2/wqflask/templates/blogs_list.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Blogs {% endblock %}
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/case_attributes.html b/gn2/wqflask/templates/case_attributes.html
index d1669761..17b70313 100644
--- a/gn2/wqflask/templates/case_attributes.html
+++ b/gn2/wqflask/templates/case_attributes.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 
 {% block css %}
diff --git a/gn2/wqflask/templates/collections/list.html b/gn2/wqflask/templates/collections/list.html
index dc725fb6..a0953298 100644
--- a/gn2/wqflask/templates/collections/list.html
+++ b/gn2/wqflask/templates/collections/list.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {%from "oauth2/display_error.html" import display_error%}
 {% block title %}Your Collections{% endblock %}
 {% block css %}
diff --git a/gn2/wqflask/templates/collections/not_logged_in.html b/gn2/wqflask/templates/collections/not_logged_in.html
index 49b0e07d..8d0707ff 100644
--- a/gn2/wqflask/templates/collections/not_logged_in.html
+++ b/gn2/wqflask/templates/collections/not_logged_in.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Your Collections{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/collections/view.html b/gn2/wqflask/templates/collections/view.html
index 4a672375..a94cb17b 100644
--- a/gn2/wqflask/templates/collections/view.html
+++ b/gn2/wqflask/templates/collections/view.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}View Collection{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/collections/view_anonymous.html b/gn2/wqflask/templates/collections/view_anonymous.html
index 56323e10..16d792e8 100644
--- a/gn2/wqflask/templates/collections/view_anonymous.html
+++ b/gn2/wqflask/templates/collections/view_anonymous.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}View Collection{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/comparison_bar_chart.html b/gn2/wqflask/templates/comparison_bar_chart.html
index d77e0515..7efdf6d7 100644
--- a/gn2/wqflask/templates/comparison_bar_chart.html
+++ b/gn2/wqflask/templates/comparison_bar_chart.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Comparison Bar Chart{% endblock %}
 {% block css %}
      <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='d3-tip/d3-tip.css') }}" />
@@ -35,4 +35,4 @@
     <script type="text/javascript" src="{{ url_for('js', filename='plotly/plotly.min.js') }}"></script>
     <script language="javascript" type="text/javascript" src="/static/new/javascript/comparison_bar_chart.js"></script>
 
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/corr_scatterplot.html b/gn2/wqflask/templates/corr_scatterplot.html
index 9532726c..5a4f4dc1 100644
--- a/gn2/wqflask/templates/corr_scatterplot.html
+++ b/gn2/wqflask/templates/corr_scatterplot.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/correlation_error_page.html b/gn2/wqflask/templates/correlation_error_page.html
index a1b935ac..5bbb3d6d 100644
--- a/gn2/wqflask/templates/correlation_error_page.html
+++ b/gn2/wqflask/templates/correlation_error_page.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Correlation Results{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/correlation_matrix.html b/gn2/wqflask/templates/correlation_matrix.html
index 17fd66fa..08cbb83a 100644
--- a/gn2/wqflask/templates/correlation_matrix.html
+++ b/gn2/wqflask/templates/correlation_matrix.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Correlation Matrix{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/correlation_page.html b/gn2/wqflask/templates/correlation_page.html
index 39d75a0a..2009571c 100644
--- a/gn2/wqflask/templates/correlation_page.html
+++ b/gn2/wqflask/templates/correlation_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Correlation Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
@@ -371,6 +371,7 @@
             {
               'title': "Description",
               'type': "natural",
+              'width': "500px",
               'data': null,
               'render': function(data) {
                 try {
diff --git a/gn2/wqflask/templates/credits.html b/gn2/wqflask/templates/credits.html
index aab1dfb1..fd085f49 100644
--- a/gn2/wqflask/templates/credits.html
+++ b/gn2/wqflask/templates/credits.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Credit{% endblock %}
 {% block content %}
 <Table width= "100%" cellSpacing=0 cellPadding=5 style="margin: 10px;"><TR>
diff --git a/gn2/wqflask/templates/ctl_results.html b/gn2/wqflask/templates/ctl_results.html
index 1c31b499..d8ea220f 100644
--- a/gn2/wqflask/templates/ctl_results.html
+++ b/gn2/wqflask/templates/ctl_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="/static/new/css/network_graph.css" />
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='cytoscape-panzoom/cytoscape.js-panzoom.css') }}">
diff --git a/gn2/wqflask/templates/ctl_setup.html b/gn2/wqflask/templates/ctl_setup.html
index f5b0baf8..bf4e8652 100644
--- a/gn2/wqflask/templates/ctl_setup.html
+++ b/gn2/wqflask/templates/ctl_setup.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}CTL analysis{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/data_sharing.html b/gn2/wqflask/templates/data_sharing.html
index cca498ec..20fefb60 100644
--- a/gn2/wqflask/templates/data_sharing.html
+++ b/gn2/wqflask/templates/data_sharing.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Data Sharing{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/dataset.html b/gn2/wqflask/templates/dataset.html
index 62fac650..99d4cb73 100644
--- a/gn2/wqflask/templates/dataset.html
+++ b/gn2/wqflask/templates/dataset.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/dataset_history.html b/gn2/wqflask/templates/dataset_history.html
index 15105410..e3a3f1d7 100644
--- a/gn2/wqflask/templates/dataset_history.html
+++ b/gn2/wqflask/templates/dataset_history.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block content %}
 <section class="container" id="history">
diff --git a/gn2/wqflask/templates/display_diffs.html b/gn2/wqflask/templates/display_diffs.html
index ce50c1b4..1a160b7f 100644
--- a/gn2/wqflask/templates/display_diffs.html
+++ b/gn2/wqflask/templates/display_diffs.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 
 {% block css %}
diff --git a/gn2/wqflask/templates/display_files.html b/gn2/wqflask/templates/display_files.html
index d0e8cc33..d72ca0ec 100644
--- a/gn2/wqflask/templates/display_files.html
+++ b/gn2/wqflask/templates/display_files.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 
 {% block css %}
diff --git a/gn2/wqflask/templates/docedit.html b/gn2/wqflask/templates/docedit.html
index 50bb96c0..fffeb25b 100644
--- a/gn2/wqflask/templates/docedit.html
+++ b/gn2/wqflask/templates/docedit.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Edit: {{title}}{% endblock %}
 
diff --git a/gn2/wqflask/templates/docs.html b/gn2/wqflask/templates/docs.html
index 1e5a7aef..e11560ee 100644
--- a/gn2/wqflask/templates/docs.html
+++ b/gn2/wqflask/templates/docs.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}{{title}}{% endblock %}
 
diff --git a/gn2/wqflask/templates/edit_case_attributes.html b/gn2/wqflask/templates/edit_case_attributes.html
index f6264818..79aab272 100644
--- a/gn2/wqflask/templates/edit_case_attributes.html
+++ b/gn2/wqflask/templates/edit_case_attributes.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Edit Case Attributes{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/edit_history.html b/gn2/wqflask/templates/edit_history.html
index 876ab085..8ca96f3d 100644
--- a/gn2/wqflask/templates/edit_history.html
+++ b/gn2/wqflask/templates/edit_history.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 
 {% block css %}
diff --git a/gn2/wqflask/templates/edit_phenotype.html b/gn2/wqflask/templates/edit_phenotype.html
index 99efa46c..e6cb3e9e 100644
--- a/gn2/wqflask/templates/edit_phenotype.html
+++ b/gn2/wqflask/templates/edit_phenotype.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/edit_probeset.html b/gn2/wqflask/templates/edit_probeset.html
index 88e97837..322b3006 100644
--- a/gn2/wqflask/templates/edit_probeset.html
+++ b/gn2/wqflask/templates/edit_probeset.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/empty_collection.html b/gn2/wqflask/templates/empty_collection.html
index d1b779ef..0e52cb1f 100644
--- a/gn2/wqflask/templates/empty_collection.html
+++ b/gn2/wqflask/templates/empty_collection.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}{{ tool }}{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/environment.html b/gn2/wqflask/templates/environment.html
index 89e805ce..f5e73039 100644
--- a/gn2/wqflask/templates/environment.html
+++ b/gn2/wqflask/templates/environment.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Glossary{% endblock %}
 
diff --git a/gn2/wqflask/templates/error.html b/gn2/wqflask/templates/error.html
index 2f1e06fa..f38d6dca 100644
--- a/gn2/wqflask/templates/error.html
+++ b/gn2/wqflask/templates/error.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Error: {{message}}{% endblock %}
 {% block content %}
 <!-- Start of body -->
@@ -14,7 +14,7 @@
     <p>
       This error is not what we wanted to see. Unfortunately errors
       are part of all software systems and we need to resolve this
-      together.
+      together. Try using the GN2 <a href="https://fallback.genenetwork.org/">Fallback instance.</a>
     </p>
     <p>
       <b>It is important to report this ERROR so we can fix it for everyone</b>.
diff --git a/gn2/wqflask/templates/facilities.html b/gn2/wqflask/templates/facilities.html
index ee4c84db..a271cc51 100644
--- a/gn2/wqflask/templates/facilities.html
+++ b/gn2/wqflask/templates/facilities.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Facilities{% endblock %}
 
diff --git a/gn2/wqflask/templates/generic_gn_docs.html b/gn2/wqflask/templates/generic_gn_docs.html
index 57723f0b..1e48eec9 100644
--- a/gn2/wqflask/templates/generic_gn_docs.html
+++ b/gn2/wqflask/templates/generic_gn_docs.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}{{ file_title|capitalize }}{% endblock %}
 {% block css %}<link rel="stylesheet" type="text/css" href="/static/new/css/markdown.css" />{% endblock %}
 {% block content %}
diff --git a/gn2/wqflask/templates/geneweaver_page.html b/gn2/wqflask/templates/geneweaver_page.html
index 7687cb6a..1f6630b3 100644
--- a/gn2/wqflask/templates/geneweaver_page.html
+++ b/gn2/wqflask/templates/geneweaver_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}{% if wrong_input == "True" %}WebGestalt Error{% else %}Opening WebGestalt{% endif %}{% endblock %}
 {% block content %}
   {% if wrong_input == "True" %}
@@ -32,4 +32,4 @@
     setTimeout('document.formODE.submit()', 1000);
 </script>
 {% endif %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/genotype.html b/gn2/wqflask/templates/genotype.html
index 7ed1ab70..c17a2518 100644
--- a/gn2/wqflask/templates/genotype.html
+++ b/gn2/wqflask/templates/genotype.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/glossary.html b/gn2/wqflask/templates/glossary.html
index 4922d39e..a720c7dd 100644
--- a/gn2/wqflask/templates/glossary.html
+++ b/gn2/wqflask/templates/glossary.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Glossary{% endblock %}
 
diff --git a/gn2/wqflask/templates/gn3_ctl_results.html b/gn2/wqflask/templates/gn3_ctl_results.html
index 2e96b262..450f9ad9 100644
--- a/gn2/wqflask/templates/gn3_ctl_results.html
+++ b/gn2/wqflask/templates/gn3_ctl_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Ctl results{% endblock %}
 {% block content %}
 <link REL="stylesheet" TYPE="text/css" href="{{ url_for('css', filename='bootstrap/css/bootstrap.css') }}" />
diff --git a/gn2/wqflask/templates/gn3_wgcna_results.html b/gn2/wqflask/templates/gn3_wgcna_results.html
index b60587c3..fe5fd39e 100644
--- a/gn2/wqflask/templates/gn3_wgcna_results.html
+++ b/gn2/wqflask/templates/gn3_wgcna_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}WCGNA results{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/gn_docs_errors.html b/gn2/wqflask/templates/gn_docs_errors.html
index dc381e08..c8170026 100644
--- a/gn2/wqflask/templates/gn_docs_errors.html
+++ b/gn2/wqflask/templates/gn_docs_errors.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Gn docs Error Page{% endblock %}
 {% block css %}<link rel="stylesheet" type="text/css" href="/static/new/css/markdown.css" />{% endblock %}
 {% block content %}
diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html
index 14a41caa..1e59427e 100644
--- a/gn2/wqflask/templates/gn_editor.html
+++ b/gn2/wqflask/templates/gn_editor.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Genenetwork Files Editor{% endblock %}
 {% block css %}
     <style>
diff --git a/gn2/wqflask/templates/gnqa.html b/gn2/wqflask/templates/gnqa.html
index 371ad7b3..7ed54a6b 100644
--- a/gn2/wqflask/templates/gnqa.html
+++ b/gn2/wqflask/templates/gnqa.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}GNQA{% endblock %}
 {% block css %}
     <style>
diff --git a/gn2/wqflask/templates/gnqa_test.html b/gn2/wqflask/templates/gnqa_test.html
index eefa66f7..e648d3c4 100644
--- a/gn2/wqflask/templates/gnqa_test.html
+++ b/gn2/wqflask/templates/gnqa_test.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}GNQA test{% endblock %}
 {% block css %}
 <style>
diff --git a/gn2/wqflask/templates/gsearch.html b/gn2/wqflask/templates/gsearch.html
new file mode 100644
index 00000000..0e7c2d9e
--- /dev/null
+++ b/gn2/wqflask/templates/gsearch.html
@@ -0,0 +1,155 @@
+<link rel="stylesheet" href="/static/new/css/autocomplete.css" />
+<style TYPE="text/css">
+.global_search_input{
+  padding:9px 8px;
+  text-decoration: none;
+  border: none;
+  border-radius: 5px;
+  }
+  .global_search_input:focus{
+  outline: none;
+  }
+  .btn-stc {
+  padding:9px 8px;
+  border-left:none;
+  border-radius:0 40px 40px 0;
+  cursor: pointer;
+  height: 40px;
+  width: 64px;
+  margin:0;
+  border:1px solid #d3d3d3;
+  background-color: white;
+  position: absolute;
+  top:0;
+  left: 100%;
+  right: 0;
+  border-left: none;
+  }
+
+  .clear-input-button:hover{
+  cursor: pointer
+  }
+
+  .clear-input-button {
+  position:absolute;
+  right:10px;
+  top:12px;
+  color:#336699;
+  display:none
+  }
+
+  .clear-input--touched:focus + .clear-input-button, .clear-input--touched:hover + .clear-input-button, .clear-input--touched + .clear-input-button:hover {
+  display: inline-flex;
+  }    
+</style>
+<div class="container-fluid"
+     style="width: 100%;
+     min-width: 650px;
+     position: relative;
+     background-color: #d5d5d5;
+     height: 100px">
+     <form method="get" action="/gsearch" id="globalsearchform">
+       <div class="form-group">
+         <div class="controls">
+           <select name="type">
+             <option value="gene">Genes / Molecules</option>
+             <option value="phenotype" {% if type=="phenotype" %}selected{% endif %}>Phenotypes</option>
+           </select>
+           <div class="col-8  autocomplete"
+                style="margin-left: 30px;
+                margin-right: 10px;
+                position:relative">
+                <input autocomplete="off"
+                       class="global_search_input clear-input"
+                       id="term"
+                       style="width:45vw"
+                       type="text"
+                       required
+                       placeholder="Enter you search term here (ex: cytochrome AND P450)"
+                       style="position:relative"
+                       name="terms">
+                       <span style="" title="Clear" class="glyphicon glyphicon-remove clear-input-button"></span>
+                       <button type="submit"
+                               class="btn-stc "
+                               style="position: absolute;
+                               background-color: #336699">
+                               <font style="color:white;">Search</font>
+                       </button>
+	   </div>
+           <span style="margin-left: 60px;">
+	       <a style=""
+                  target="_blank"
+		  title="See more Search Xapian Hints"
+                  href="https://issues.genenetwork.org/topics/xapian/xapian-search-queries">
+		   <sup>
+		       <i><b >See more Hints </b></i>
+		   </sup>
+	       </a> 
+               </span>
+               <span style="padding: 5px;margin-left: 60px;" id="gnqna_home">
+		   <a href="/gnqna"><b>GNQA Search</b></a>
+               </span>
+
+         </div>
+       </div>
+     </form>
+</div>
+<script src="{{ url_for('js', filename='jquery/jquery.min.js') }}"
+        type="text/javascript"></script>
+	<script src="/static/new/javascript/search_autocomplete.js"></script>
+	<script type="text/javascript">
+	  $(document).ready(function() {
+	  const urlParams = new  URLSearchParams(window.location.search)
+	  let term = urlParams.get("terms")
+	  //should web scrap
+	  var global_search_hint = [
+	  "cytochrome",
+	  "cytochrome AND P450",
+	  "cytochrome NEAR P450",
+	  "cytochrome -P450",
+	  "cytochrome NOT P450",
+	  "species:human",
+	  "group:BXD",
+	  "Hs:chr4:9930021 species:mouse",
+	  "Hs:chr4:9130000..9980000 species:mouse",
+	  "mean:5..7",
+	  "mean:7..",
+	  "Hs:chr4:9930021",
+	  "Hs:chr4:9930021 species:mouse",
+	  "Hs:chr4:9130000..9980000 species:mouse",
+	  "bx*",
+	  "*"
+	  ]
+	  autocomplete(document.getElementById("term"), global_search_hint);
+	  $("#term").keyup(function(event) {
+	  if (event.keyCode === 13) {
+	  event.preventDefault();
+	  $('#globalsearchform').attr('action', "/gsearch").submit();
+	  if ($("#term").val().trim() != "") {
+	  saveBeforeSubmit($("#term").val().trim())
+	  $("#globalsearchform")[0].submit();
+	  }
+
+	  }
+	  })
+
+	  });
+
+	  const input = document.querySelector(".clear-input");
+	  const clearButton = document.querySelector(".clear-input-button");
+	  const handleInputChange = e => {
+	  if (e.target.value && !input.classList.contains("clear-input--touched")) {
+	  input.classList.add("clear-input--touched");
+	  } else if (!e.target.value && input.classList.contains("clear-input--touched")) {
+	  input.classList.remove("clear-input--touched");
+	  }
+	  };
+	  const handleButtonClick = e => {
+	  console.log("clicked this button")
+	  input.value = '';
+	  input.focus();
+	  input.classList.remove("clear-input--touched");
+	  };
+	  clearButton.addEventListener("click", handleButtonClick);
+	  input.addEventListener("input", handleInputChange);	 	  
+	</script>
diff --git a/gn2/wqflask/templates/gsearch_gene.html b/gn2/wqflask/templates/gsearch_gene.html
index e4039f71..35c39a3c 100644
--- a/gn2/wqflask/templates/gsearch_gene.html
+++ b/gn2/wqflask/templates/gsearch_gene.html
@@ -1,34 +1,34 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Search Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='jquery-ui/jquery-ui.theme.css') }}"/>
     <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
 {% endblock %}
+
 {% block content %}
 <!-- Start of body -->
-
     <div class="container">
-
       <div>
         <h3>GN searched for the term(s) <b>"{{ terms }}"</b> in 754 datasets and 39,765,944 traits across 10 species<br/>
             and found <b>{{ trait_count }}</b> results that match your query.<br/>
         </h3>
       </div>
 
-
-      {% if do_ai_search %}
-      <div class="row" id="ai_result_info">
-        <div class="text-center" id="spinner">
-           <i class="fa fa-spinner fa-spin fa-3x"></i>
+      {% if ai_search_enabled %}
+        {% if do_ai_search %}
+        <div class="row" id="ai_result_info">
+          <div class="text-center" id="spinner">
+             <i class="fa fa-spinner fa-spin fa-3x"></i>
+          </div>
         </div>
-      </div>
-      {% else %}
-      <div class="row" id="ai_result_info">
-        <div class="col-sm-6">
-          <div class="alert alert-warning">Please login to view LLM summary context</div>
+        {% else %}
+        <div class="row" id="ai_result_info">
+          <div class="col-sm-6">
+            <div class="alert alert-warning">Please login to view AI generated summary</div>
+          </div>
         </div>
-      </div>
+        {% endif %}
       {% endif %}
 
         <p>To study a record, click on its Record ID below.<br />Check records below and click Add button to add to selection.</p>
@@ -284,7 +284,7 @@
         });
         
     </script>
-    {% if do_ai_search %}
+    {% if ai_search_enabled and do_ai_search %}
     <script type='text/javascript'>
       function ai_content_div(search_term, search_result, search_uri) {
         let header_length = 40;
diff --git a/gn2/wqflask/templates/gsearch_pheno.html b/gn2/wqflask/templates/gsearch_pheno.html
index 95eb5b80..f45b9b21 100644
--- a/gn2/wqflask/templates/gsearch_pheno.html
+++ b/gn2/wqflask/templates/gsearch_pheno.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Search Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/heatmap.html b/gn2/wqflask/templates/heatmap.html
index 92754266..161625dc 100644
--- a/gn2/wqflask/templates/heatmap.html
+++ b/gn2/wqflask/templates/heatmap.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Heatmap{% endblock %}
 {% block css %}
      <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='d3-tip/d3-tip.css') }}" />
@@ -41,4 +41,4 @@
     <script language="javascript" type="text/javascript" src="/static/new/javascript/iplotMScanone_noeff.js"></script>
     <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/underscore.min.js') }}"></script>
 
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/index_page.html b/gn2/wqflask/templates/index_page.html
index 734cd075..3fdfee60 100755
--- a/gn2/wqflask/templates/index_page.html
+++ b/gn2/wqflask/templates/index_page.html
@@ -1,400 +1,526 @@
 {% extends "base.html" %}
-{% block title %}GeneNetwork{% endblock %}
-{% block css %}
-<!-- UIkit CSS -->
-<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='uikit/css/uikit.min.css') }}"/>
-
-<link rel="stylesheet" href="/static/new/css/index_page.css" />
-<link rel="stylesheet" href="/static/new/css/autocomplete.css"/>
+{% block title %} GeneNetwork {% endblock %}
 
-<!-- UIkit JS -->
-<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='uikit/js/uikit.min.js') }}"></script>
+<link rel="stylesheet"
+      type="text/css"
+      href="{{ url_for('css', filename='uikit/css/uikit.min.css') }}" />
+{% block css %}
+<link rel="stylesheet"
+      type="text/css"
+      href="{{ url_for('static', filename='/new/css/index_page.css') }}" />
+<link rel="stylesheet"
+      type="text/css"
+      href="{{ url_for('static', filename='/new/css/toots.css') }}" />
+<style TYPE="text/css">
 
-<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='uikit/js/uikit-icons.min.js') }}"></script>
+ p.interact { display: none; }
 
-<!--locally built emfed package see source file:https://github.com/sampsyo/emfed -->
-<script type="module" src="static/new/javascript/emfed.bundle.js"></script>
-<link rel="stylesheet" type="text/css"
-    href="static/new/css/toots.css">
-<style TYPE="text/css">
-    
-  p.interact { display: none; }
 
+ .media {
+     padding-bottom:10px;
+     border-bottom: 1px solid #c8ccc9;
+ }
 
-  .media {
-    padding-bottom:10px;
-    border-bottom: 1px solid #c8ccc9;
-  }
+ .media img {
 
-  .media img {
+     width: 95%;
+     height: 100%;
+     border-radius: 5px;
+     /*transform: scale(1.1); image small?*/
+     border:1px solid #c8ccc9;
+ }
 
-    width: 95%;
-    height: 100%;
-    border-radius: 5px;
-    /*transform: scale(1.1); image small?*/
-    border:1px solid #c8ccc9;
-  }
+ .toots {
+     margin:0 auto;
+     max-width: 500px;
+     height: 160px;
+     position: relative;
+     border-radius:10px;
+     background-color: #F9F9F9;
 
-  .toots {
-    margin:0 auto;
-    max-width: 500px;
-    height: 160px;
-    position: relative;
-    border-radius:10px;
-    background-color: #F9F9F9;
+ }
 
-  }
+ h2 {
+     margin-bottom: 0px;
+ }
 
-  h2 {
-      margin-bottom: 0px;
-  }
+ ul {
+     margin-top: 0px;
+ }
 
-  ul {
-      margin-top: 0px;
-  }
+ .toot {
+     padding-top:8px;     
+     background:#f9f9f9;
+     color:#000;
+     
+ }
 
-  .toot {
-    padding-top:8px;
-    background:#f9f9f9;
-    color:#000;
- 
-  }
 </style>
 {% endblock %}
+{% block search %}
+{% include "gsearch.html" %}
+{% endblock %}
 {% block content %}
-<!-- Start of body -->
-    <div class="container-fluid" style="min-width: 1210px;">
-
-      {{ flash_me() }}
-
-      {%if anon_collections | length > 0%}
-      <div class="panel panel-warning">
-	<div class="panel-heading">
-	  <h3 class="panel-title">Import Anonymous Collections</h3>
-	</div>
-	<div class="panel-body">
-	  <p>
-	    There {%if anon_collections | length > 1%}are{%else%}is{%endif%}
-	    {{anon_collections | length}} anonymous
-	    collection{%if anon_collections | length > 1%}s{%endif%}
-	    associated with your current session. What do you wish to do?
-	  </p>
-	  <p class="text-danger" style="font-weight: bold;">
-	    <small>
-	      If you choose to ignore this, the anonymous collections will be
-	      eventually deleted and lost.
-	    </small>
-	  </p>
-	  <form action="{{url_for('handle_anonymous_collections')}}"
-		method="POST">
-	    <div class="form-group">
-	      <input type="radio" id="rdo-import" value="import"
-		     name="anon_choice" />
-	      <label for="rdo-import">Import</label>
-	      <input type="radio" id="rdo-delete" value="delete"
-		     name="anon_choice" />
-	      <label for="rdo-delete">Delete</label>
-	    </div>
-
-	    <input type="submit" class="btn btn-warning" value="Submit" />
-	  </form>
-	</div>
-      </div>
-      {%endif%}
-
-        <div class="row" style="width: 100%;">
-
-            <div class="col-xs-4" style="margin-right:50px; min-width: 530px; max-width: 550px;">
-                <section id="search">
-                    <div class="page-header">
-                        <h2>Select and Search</h2>
-                    </div>
-                    <form method="get" action="/search" target="_blank" id="searchform" name="SEARCHFORM",
-			  data-gn_server_url="{{gn_server_url}}">
-                        <fieldset>
-                            <div style="padding-left: 20px; padding-right: 20px;" class="form-horizontal">
-
-                                <div class="form-group">
-                                    <label for="species" class="col-xs-1 control-label" style="width: 65px !important;">Species:</label>
-                                    <div class="col-xs-10 controls input-append" style="display: flex; padding-left: 20px;">
-                                        <div class="col-9">
-                                          <select name="species" id="species" class="form-control" style="width: 340px !important;"><option>Loading...</option></select>
-                                        </div>
+{{ flash_me() }}
+<div class="container-fluid" style="min-width: 1210px;">
+    {% if anon_collections | length > 0 %}
+    <div class="panel panel-warning">
+        <div class="panel-heading">
+            <h3 class="panel-title">Import Anonymous Collections</h3>
+        </div>
+        <div class="panel-body">
+            <p>
+                There
+                {% if anon_collections | length > 1 %}
+                are
+                {% else %}
+                is
+                {% endif %}
+                {{ anon_collections | length }} anonymous
+                collection
+                {% if anon_collections | length > 1 %}s{% endif %}
+                associated with your current session. What do you wish to do?
+            </p>
+            <p class="text-danger" style="font-weight: bold;">
+                <small>
+                    If you choose to ignore this, the anonymous collections will be
+                    eventually deleted and lost.
+                </small>
+            </p>
+            <form action="{{ url_for("handle_anonymous_collections") }}" method="post">
+                <div class="form-group">
+                    <input type="radio" id="rdo-import" value="import" name="anon_choice" />
+                    <label for="rdo-import">Import</label>
+                    <input type="radio" id="rdo-delete" value="delete" name="anon_choice" />
+                    <label for="rdo-delete">Delete</label>
+                </div>
+                <input type="submit" class="btn btn-warning" value="Submit" />
+            </form>
+        </div>
+    </div>
+    {% endif %}
+    <div class="row" style="width: 100%;">
+        <div class="col-xs-4"
+             style="margin-right:50px;
+                    min-width: 530px;
+                    max-width: 550px">
+            <section id="search">
+                <div class="page-header">
+                    <h2>Select and Search</h2>
+                </div>
+                <form method="get"
+                      action="/search"
+                      target="_blank"
+                      id="searchform"
+                      name="SEARCHFORM"
+                      data-gn_server_url="{{ gn_server_url }}">
+                    <fieldset>
+                        <div style="padding-left: 20px;
+                                    padding-right: 20px"
+                             class="form-horizontal">
+                            <div class="form-group">
+                                <label for="species"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important">Species:</label>
+                                <div class="col-xs-10 controls input-append"
+                                     style="display: flex;
+                                            padding-left: 20px">
+                                    <div class="col-9">
+                                        <select name="species"
+                                                id="species"
+                                                class="form-control"
+                                                style="width: 340px !important">
+                                            <option>Loading...</option>
+                                        </select>
                                     </div>
                                 </div>
-
-                                <div class="form-group">
-                                    <label for="group" class="col-xs-1 control-label" style="width: 65px !important;">Group:</label>
-                                    <div class="col-xs-10 controls input-append" style="display: flex; padding-left: 20px;">
-                                        <div class="col-9">
-                                          <select name="group" id="group" class="form-control" style="width: 340px !important;"><option>Loading...</option></select>
-                                          <i class="icon-question-sign"></i>
-                                        </div>
-                                        <div class="col-3" style="margin-left: 10px;">
-                                            <button type="button" id="group_info" class="btn form-control info-button"><span class="glyphicon glyphicon-flag"></span> Info</button>
-                                        </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="group"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important">Group:</label>
+                                <div class="col-xs-10 controls input-append"
+                                     style="display: flex;
+                                            padding-left: 20px">
+                                    <div class="col-9">
+                                        <select name="group"
+                                                id="group"
+                                                class="form-control"
+                                                style="width: 340px !important">
+                                            <option>Loading...</option>
+                                        </select>
+                                        <i class="icon-question-sign"></i>
                                     </div>
-                                </div>
-
-                                <div class="form-group">
-                                    <label for="tissue" class="col-xs-1 control-label" style="width: 65px !important;">Type:</label>
-                                    <div class="col-xs-10 controls input-append" style="display: flex; padding-left: 20px;">
-                                        <div class="col-9">
-                                          <select name="type" id="type" class="form-control" style="width: 340px !important;"><option>Loading...</option></select>
-                                        </div>
-                                        <div class="col-3" style="margin-left: 10px;">
-                                            <button type="button" id="dataset_info" class="btn form-control info-button"><span class="glyphicon glyphicon-flag"></span> Info</button>
-                                        </div>
+                                    <div class="col-3" style="margin-left: 10px;">
+                                        <button type="button" id="group_info" class="btn form-control info-button">
+                                            <span class="glyphicon glyphicon-flag"></span> Info
+                                        </button>
                                     </div>
                                 </div>
-
-                                <div class="form-group">
-                                    <label for="dataset" class="col-xs-1 control-label" style="width: 65px !important;">Dataset:</label>
-                                    <div class="col-xs-10 controls" style="display: flex; padding-left: 20px;">
-                                        <div class="col-9">
-                                          <select name="dataset" id="dataset" class="form-control" style="max-width: 550px; width: 450px !important;"><option>Loading...</option></select>
-                                          <i class="icon-question-sign"></i>
-                                        </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="tissue"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important">Type:</label>
+                                <div class="col-xs-10 controls input-append"
+                                     style="display: flex;
+                                            padding-left: 20px">
+                                    <div class="col-9">
+                                        <select name="type"
+                                                id="type"
+                                                class="form-control"
+                                                style="width: 340px !important">
+                                            <option>Loading...</option>
+                                        </select>
+                                    </div>
+                                    <div class="col-3" style="margin-left: 10px;">
+                                        <button type="button" id="dataset_info" class="btn form-control info-button">
+                                            <span class="glyphicon glyphicon-flag"></span> Info
+                                        </button>
                                     </div>
                                 </div>
-                                <!--  GET ANY  SEARCH -->
-
-                                <div class="form-group">
-                                    <label for="or_search" class="col-xs-1 control-label" style="padding-left: 0px; padding-right: 0px; width: 65px !important;">Get Any:</label>
-                                    <div class="col-xs-10 controls" style="padding-left: 20px;">
-                                        <div class="col-8 autocomplete">
-                                          <textarea id="myInput" onkeyup="pressed(event)" name="search_terms_or" rows="1" class="form-control search-query" style="resize: vertical; max-width: 550px; width: 450px !important;" id="or_search"></textarea>
-                                        </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="dataset"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important">Dataset:</label>
+                                <div class="col-xs-10 controls" style="display: flex; padding-left: 20px;">
+                                    <div class="col-9">
+                                        <select name="dataset"
+                                                id="dataset"
+                                                class="form-control"
+                                                style="max-width: 550px;
+                                                      width: 450px !important">
+                                            <option>Loading...</option>
+                                        </select>
+                                        <i class="icon-question-sign"></i>
                                     </div>
                                 </div>
-
-                                <!--  GET ANY HELP   -->
-                                <div class="form-group">
-                                    <label for="btsearch" class="col-xs-1 control-label" style="width: 65px !important;"></label>
-                                    <div class="col-xs-10 controls" style="padding-left: 20px;">
-                                        <div class="col-12 controls">
-                                            Enter terms, genes, ID numbers in the <b>Search</b> field.<br>
-                                            Use <b>*</b> or <b>?</b> wildcards (Cyp*a?, synap*).<br>
-                                            Use <b>quotes</b> for terms such as <i>"tyrosine kinase"</i>.
-
-
-                                            <div><strong><a style="text-decoration: none;"  href="https://issues.genenetwork.org/topics/xapian/xapian-search-queries" target=”_blank” >see more hints</a></strong></div>
-                                        </div>
+                            </div>
+                            <!--  GET ANY  SEARCH -->
+                            <div class="form-group">
+                                <label for="or_search"
+                                       class="col-xs-1 control-label"
+                                       style="padding-left: 0px;
+                                            padding-right: 0px;
+                                            width: 65px !important">Get Any:</label>
+                                <div class="col-xs-10 controls" style="padding-left: 20px;">
+                                    <div class="col-8 autocomplete">
+                                        <textarea id="myInput"
+                                                  onkeyup="pressed(event)"
+                                                  name="search_terms_or"
+                                                  rows="1"
+                                                  class="form-control search-query"
+                                                  style="resize: vertical;
+                                                      max-width: 550px;
+                                                      width: 450px !important"
+                                                  id="or_search"></textarea>
                                     </div>
                                 </div>
-
-                                <div class="form-group">
-                                    <label for="and_search" class="col-xs-1 control-label" style="padding-left: 0px; padding-right: 0px; width: 65px !important;">Combined:</label>
-                                    <div class="col-xs-10 controls" style="padding-left: 20px;">
-                                        <div class="col-8 autocomplete">
-                                          <textarea id="myInput" onkeyup="pressed(event)" name="search_terms_and" rows="1" class="form-control search-query" style="resize: vertical; max-width: 550px; width: 450px !important;" id="and_search"></textarea>
+                            </div>
+                            <!--  GET ANY HELP   -->
+                            <div class="form-group">
+                                <label for="btsearch"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important"></label>
+                                <div class="col-xs-10 controls" style="padding-left: 20px;">
+                                    <div class="col-12 controls">
+                                        Enter terms, genes, ID numbers in the <b>Search</b> field.
+                                        <br>
+                                        Use <b>*</b> or <b>?</b> wildcards (Cyp*a?, synap*).
+                                        <br>
+                                        Use <b>quotes</b> for terms such as <i>"tyrosine kinase"</i>.
+                                        <div>
+                                            <strong>
+                                                <a style="text-decoration: none"
+                                                   href="https://issues.genenetwork.org/topics/xapian/xapian-search-queries"
+                                                   target="_blank">see more hints</a>
+                                            </strong>
                                         </div>
                                     </div>
                                 </div>
-
-                                <div class="form-group">
-                                    <label for="btsearch" class="col-xs-1 control-label" style="width: 65px !important;"></label>
-                                    <div class="col-xs-10 controls" style="display: flex; padding-left: 20px;">
-                                        <div class="col-2 controls">
-                                            <button id="btsearch" class="btn btn-primary form-control"><span class="glyphicon glyphicon-search"></span> Search</button>
-                                        </div>
-                                        <div class="col-2 align-self-end controls" style="padding-left: 20px;">
-                                            <button type="button" id="make_default" class="btn form-control info-button"><span class="glyphicon glyphicon-pushpin"></span> Lock Menu</button>
-                                        </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="and_search"
+                                       class="col-xs-1 control-label"
+                                       style="padding-left: 0px;
+                                            padding-right: 0px;
+                                            width: 65px !important">Combined:</label>
+                                <div class="col-xs-10 controls" style="padding-left: 20px;">
+                                    <div class="col-8 autocomplete">
+                                        <textarea id="myInput"
+                                                  onkeyup="pressed(event)"
+                                                  name="search_terms_and"
+                                                  rows="1"
+                                                  class="form-control search-query"
+                                                  style="resize: vertical;
+                                                      max-width: 550px;
+                                                      width: 450px !important"
+                                                  id="and_search"></textarea>
                                     </div>
                                 </div>
-
-                                <!--  SEARCH, MAKE DEFAULT -->
-                                <div class="form-group">
+                            </div>
+                            <div class="form-group">
+                                <label for="btsearch"
+                                       class="col-xs-1 control-label"
+                                       style="width: 65px !important"></label>
+                                <div class="col-xs-10 controls" style="display: flex; padding-left: 20px;">
+                                    <div class="col-2 controls">
+                                        <button id="btsearch" class="btn btn-primary form-control">
+                                            <span class="glyphicon glyphicon-search"></span> Search
+                                        </button>
+                                    </div>
+                                    <div class="col-2 align-self-end controls" style="padding-left: 20px;">
+                                        <button type="button" id="make_default" class="btn form-control info-button">
+                                            <span class="glyphicon glyphicon-pushpin"></span> Lock Menu
+                                        </button>
+                                    </div>
                                 </div>
-                                <input type="hidden" name="accession_id" value="None" class="form-control">
-                                <input type="hidden" name="FormID" value="searchResult" class="form-control">
                             </div>
-                        </fieldset>
-                    </form>
-                </section>
-                <section id="advanced">
-                    <div class="page-header">
-                        <h2>Advanced Commands</h2>
-                    </div>
-
-                    <p>You can also use advanced commands. Copy these simple examples into the Get Any field for single term searches and Combined for searches with multiple terms:</p>
-
-                      <ul>
-                        <li><b>POSITION=(chr1 25 30)</b> finds genes, markers, or transcripts on
-                        chromosome 1 between 25 and 30 Mb.</li>
-
-                        <li><b>MEAN=(15 16)</b> in the <b>Combined</b> field finds
-                        highly expressed genes (15 to 16 log2 units)</li>
-
-                        <li><b>RANGE=(1.5 2.5)</b> in the <b>Any</b> field finds traits with values with a specified fold-range (minimum = 1). 
-                        Useful for finding "housekeeping genes" <b>(1.0 1.2)</b> or highly variable molecular assays <b>(10 100)</b>.</li>
-
-                        <li><b>LRS=(15 1000)</b> or <b>LOD=(2 8)</b> finds all traits with peak LRS or LOD scores between lower and upper limits.</li>
-
-                        <li><b>LRS=(9 999 Chr4 122 155)</b> finds all traits on Chr 4 from 122 and 155 Mb with LRS scores between 9 and 999.</li>
-
-                        <li><b>cisLRS=(15 1000 5)</b> or <b>cisLOD=(2 8 5)</b> finds all cis eQTLs with peak LRS or LOD scores between lower and upper limits,
-                            with an <b>inclusion</b> zone of 5 Mb around the parent gene.</li>
-
-                        <li><b>transLRS=(15 1000 5)</b> or <b>transLOD=(2 8 5)</b> finds all trans eQTLs with peak LRS or LOD scores between lower and upper limits,
-                            with an <b>exclusion</b> zone of 5 Mb around the parent gene. You can also add a fourth term specifying which chromosome you want the transLRS to be on
-                            (for example transLRS=(15 1000 5 7) would find all trans eQTLs with peak LRS on chromosome 7 that is also a trans eQTL with exclusionary zone of 5Mb).</li>
-
-                        <li><b>POSITION=(Chr4 122 130) cisLRS=(9 999 10)</b>
-                            finds all traits on Chr 4 from 122 and 155 Mb with cisLRS scores
-                            between 9 and 999 and an inclusion zone of 10 Mb.</li>
-
-                        <li><b>RIF=mitochondrial</b> searches RNA databases for <a href="https://en.wikipedia.org/wiki/GeneRIF">
-                        GeneRIF</a> links.</li>
-
-                        <li><b>WIKI=nicotine</b> searches <a href="http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki">
-                        GeneWiki</a> for genes that you or other users have annotated
-                        with the word <i>nicotine</i>.</li>
-
-                        <li><b>GO:0045202</b> searches for synapse-associated genes listed in the
-                        <a href="http://amigo.geneontology.org/amigo/medial_search?q=GO%3A0045202">
-                            Gene Ontology</a>.</li>
-
-                        <li><b>RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)</b>
-                        finds diabetes-associated transcripts with peak <a href="{{ url_for('gn_docs_blueprint.glossary') }}#E">
-                        trans eQTLs</a> on Chr 2 between 100 and 105 Mb with LRS
-                        scores between 9 and 999.</li>
-                      </ul>
-                </section>
-            </div>
-
-            <div class="col-xs-4" style="width: 600px !important;">
-	            <section id="tutorials">
-                    <div class="page-header">
-                        <h2>Tutorials</h2>
-                    </div>
-                    <div class="uk-grid-match uk-child-width-1-3@m" uk-grid>
-                        <div>
-                            <strong><a class="uk-link-text" href="/tutorials">Webinars & Courses</a></strong><br>
-                            In-person courses, live webinars and webinar recordings<br>
-                            <a href="/tutorials" class="uk-icon-link" uk-icon="laptop" ratio="2"></a>
-                        </div>
-                        <div>
-                            <strong><a class="uk-link-text" href="/tutorials">Tutorials</a></strong><br>
-                            Tutorials: Training materials in HTML, PDF and video formats<br>
-                            <a href="/tutorials" class="uk-icon-link" uk-icon="file-text" ratio="2"></a>
-                        </div>
-                        <div>
-                            <strong><a class="uk-link-text" href="/tutorials">Documentation</a></strong><br>
-                            Online manuals, handbooks, fact sheets and FAQs<br>
-                            <a href="/tutorials" class="uk-icon-link" uk-icon="album" ratio="2"></a>
+                            <!--  SEARCH, MAKE DEFAULT -->
+                            <div class="form-group"></div>
+                            <input type="hidden" name="accession_id" value="None" class="form-control">
+                            <input type="hidden" name="FormID" value="searchResult" class="form-control">
                         </div>
+                    </fieldset>
+                </form>
+            </section>
+            <section id="advanced">
+                <div class="page-header">
+                    <h2>Advanced Commands</h2>
+                </div>
+                <p>
+                    You can also use advanced commands. Copy these simple examples into the Get Any field for single term searches and Combined for searches with multiple terms:
+                </p>
+                <ul>
+                    <li>
+                        <b>POSITION=(chr1 25 30)</b> finds genes, markers, or transcripts on
+                        chromosome 1 between 25 and 30 Mb.
+                    </li>
+                    <li>
+                        <b>MEAN=(15 16)</b> in the <b>Combined</b> field finds
+                        highly expressed genes (15 to 16 log2 units)
+                    </li>
+                    <li>
+                        <b>RANGE=(1.5 2.5)</b> in the <b>Any</b> field finds traits with values with a specified fold-range (minimum = 1).
+                        Useful for finding "housekeeping genes" <b>(1.0 1.2)</b> or highly variable molecular assays <b>(10 100)</b>.
+                    </li>
+                    <li>
+                        <b>LRS=(15 1000)</b> or <b>LOD=(2 8)</b> finds all traits with peak LRS or LOD scores between lower and upper limits.
+                    </li>
+                    <li>
+                        <b>LRS=(9 999 Chr4 122 155)</b> finds all traits on Chr 4 from 122 and 155 Mb with LRS scores between 9 and 999.
+                    </li>
+                    <li>
+                        <b>cisLRS=(15 1000 5)</b> or <b>cisLOD=(2 8 5)</b> finds all cis eQTLs with peak LRS or LOD scores between lower and upper limits,
+                        with an <b>inclusion</b> zone of 5 Mb around the parent gene.
+                    </li>
+                    <li>
+                        <b>transLRS=(15 1000 5)</b> or <b>transLOD=(2 8 5)</b> finds all trans eQTLs with peak LRS or LOD scores between lower and upper limits,
+                        with an <b>exclusion</b> zone of 5 Mb around the parent gene. You can also add a fourth term specifying which chromosome you want the transLRS to be on
+                        (for example transLRS=(15 1000 5 7) would find all trans eQTLs with peak LRS on chromosome 7 that is also a trans eQTL with exclusionary zone of 5Mb).
+                    </li>
+                    <li>
+                        <b>POSITION=(Chr4 122 130) cisLRS=(9 999 10)</b>
+                        finds all traits on Chr 4 from 122 and 155 Mb with cisLRS scores
+                        between 9 and 999 and an inclusion zone of 10 Mb.
+                    </li>
+                    <li>
+                        <b>RIF=mitochondrial</b> searches RNA databases for <a href="https://en.wikipedia.org/wiki/GeneRIF">GeneRIF</a> links.
+                    </li>
+                    <li>
+                        <b>WIKI=nicotine</b> searches <a href="http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki">GeneWiki</a> for genes that you or other users have annotated
+                        with the word <i>nicotine</i>.
+                    </li>
+                    <li>
+                        <b>GO:0045202</b> searches for synapse-associated genes listed in the
+                        <a href="http://amigo.geneontology.org/amigo/medial_search?q=GO%3A0045202">Gene Ontology</a>.
+                    </li>
+                    <li>
+                        <b>RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)</b>
+                        finds diabetes-associated transcripts with peak <a href="{{ url_for("gn_docs_blueprint.glossary") }}#E">trans eQTLs</a> on Chr 2 between 100 and 105 Mb with LRS
+                        scores between 9 and 999.
+                    </li>
+                </ul>
+            </section>
+        </div>
+        <div class="col-xs-4" style="width: 600px !important;">
+            <section id="tutorials">
+                <div class="page-header">
+                    <h2>Tutorials</h2>
+                </div>
+                <div class="uk-grid-match uk-child-width-1-3@m" uk-grid>
+                    <div>
+                        <strong><a class="uk-link-text" href="/tutorials">Webinars & Courses</a></strong>
+                        <br>
+                        In-person courses, live webinars and webinar recordings
+                        <br>
+                        <a href="/tutorials" class="uk-icon-link" uk-icon="laptop" ratio="2"></a>
                     </div>
-                </section>
-                <section id="news-section">
-                    <div class="page-header">
-                        <h2>News</h2>
-                    </div>
-                    <div id="mastadon" style="height: 405px; overflow: scroll; overflow-x: hidden;">
-                    	<a class="mastodon-feed" target="_blank"
-   href="https://genomic.social/@genenetwork"
-   data-toot-limit="5"
-   >Genenetwork mastadon</a>
-                    	
-                    </div>
-                    <div align="right">
-
-                        <a href="https://genomic.social/@genenetwork">more news items...</a>
+                    <div>
+                        <strong><a class="uk-link-text" href="/tutorials">Tutorials</a></strong>
+                        <br>
+                        Tutorials: Training materials in HTML, PDF and video formats
+                        <br>
+                        <a href="/tutorials" class="uk-icon-link" uk-icon="file-text" ratio="2"></a>
                     </div>
-		        </section>
-                <section id="websites">
-                    <div class="page-header">
-                        <h2>Links</h2>
+                    <div>
+                        <strong><a class="uk-link-text" href="/tutorials">Documentation</a></strong>
+                        <br>
+                        Online manuals, handbooks, fact sheets and FAQs
+                        <br>
+                        <a href="/tutorials" class="uk-icon-link" uk-icon="album" ratio="2"></a>
                     </div>
+                </div>
+            </section>
+            <section id="news-section">
+                <div class="page-header">
+                    <h2>News</h2>
+                </div>
+                <div id="mastadon"
+                     style="height: 405px;
+                         overflow: scroll;
+                         overflow-x: hidden">
+                    <a class="mastodon-feed"
+                       target="_blank"
+                       href="https://genomic.social/@genenetwork"
+                       data-toot-limit="5">Genenetwork mastadon</a>
+                </div>
+                <div align="right">
+                    <a href="https://genomic.social/@genenetwork">more news items...</a>
+                </div>
+            </section>
+            <section id="websites">
+                <div class="page-header">
+                    <h2>Links</h2>
+                </div>
+                <ul>
+                    <li>Github</li>
                     <ul>
-                        <li>Github</li>
-                        <ul>
-                            <li><a href="https://github.com/genenetwork/genenetwork2">GN2 Source Code</a></li>
-                            <li><a href="https://github.com/genenetwork/genenetwork3">GN3 Source Code</a></li>
-                            <li><a href="https://github.com/genenetwork/genenetwork">GN1 Source Code</a></li>
-                            <li><a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a></li>
-                        </ul>
+                        <li>
+                            <a href="https://github.com/genenetwork/genenetwork2">GN2 Source Code</a>
+                        </li>
+                        <li>
+                            <a href="https://github.com/genenetwork/genenetwork3">GN3 Source Code</a>
+                        </li>
+                        <li> 
+                            <a href="https://github.com/genenetwork/genenetwork">GN1 Source Code</a>
+                        </li>
+                        <li>
+                            <a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a>
+                        </li>
                     </ul>
+                </ul>
+                <ul>
+                    <li>GeneNetwork 2</li>
                     <ul>
-                        <li>GeneNetwork v2</li>
-                        <ul>
-                            <li><a href="https://genenetwork.org/">Main website</a> at UTHSC</li>
-                        </ul>
+                        <li>
+                            <a href="https://genenetwork.org/">Main website</a> at UTHSC
+                        </li>
+                        <li><a href="https://fallback.genenetwork.org/">Backup</a> instance of GN2</li>
                     </ul>
+
+                </ul>
+                <ul>
+                    <li>GeneNetwork v1</li>
                     <ul>
-                        <li>GeneNetwork v1</li>
-                        <ul>
-                            <li><a href="http://gn1.genenetwork.org/">Main website</a> at UTHSC</li>
-                        </ul>
+                        <li>
+                            <a href="http://gn1.genenetwork.org/">Main website</a> at UTHSC
+                        </li>
                     </ul>
+                </ul>
+                <ul>
+                    <li>Affiliates</li>
                     <ul>
-                        <li>Affiliates</li>
-                        <ul>
-                            <li><b><a href="http://gn1.genenetwork.org">GeneNetwork 1</a> at UTHSC</b></li>
-                            <li><a href="https://systems-genetics.org/">Systems Genetics</a> at EPFL</li>
-                            <li><a href="http://bnw.genenetwork.org/">Bayesian Network Web Server</a> at UTHSC</li>
-                            <li><a href="https://www.geneweaver.org/">GeneWeaver</a></li>
-                            <li><a href="https://phenogen.org/">PhenoGen</a> at University of Colorado</li>
-                            <li><a href="http://www.webgestalt.org/">WebGestalt</a> at Baylor</li>
-                        </ul>
+                        <li>
+                            <b><a href="http://gn1.genenetwork.org">GeneNetwork 1</a> at UTHSC</b>
+                        </li>
+                        <li>
+                            <a href="https://systems-genetics.org/">Systems Genetics</a> at EPFL
+                        </li>
+                        <li>
+                            <a href="http://bnw.genenetwork.org/">Bayesian Network Web Server</a> at UTHSC
+                        </li>
+                        <li>
+                            <a href="https://www.geneweaver.org/">GeneWeaver</a>
+                        </li>
+                        <li>
+                            <a href="https://phenogen.org/">PhenoGen</a> at University of Colorado
+                        </li>
+                        <li>
+                            <a href="http://www.webgestalt.org/">WebGestalt</a> at Baylor
+                        </li>
                     </ul>
+                </ul>
+                <ul>
+                    <li>GeneNetwork hosted portals</li>
                     <ul>
-                        <li>GeneNetwork hosted portals</li>
-                        <ul>
-                            <li><a href="https://www.opar.io/">Omics Portal For Addiction Research</a></li>
-                            <li><a href="https://msk.genenetwork.org/">GN4MSK musculoskeletal</a></li>
-                            <li><a href="https://genecup.org/">GeneCup: Mining PubMed for Gene Relationships using Custom Ontologies</a></li>
-                        </ul>
+                        <li>
+                            <a href="https://www.opar.io/">Omics Portal For Addiction Research</a>
+                        </li>
+                        <li>
+                            <a href="https://msk.genenetwork.org/">GN4MSK musculoskeletal</a>
+                        </li>
+                        <li>
+                            <a href="https://genecup.org/">GeneCup: Mining PubMed for Gene Relationships using Custom Ontologies</a>
+                        </li>
                     </ul>
-                </section>
-            </div>
+                </ul>
+            </section>
         </div>
     </div>
+</div>
 
-{%endblock%}
-
+{% endblock %}
+<script language="javascript"
+        type="text/javascript"
+        src="{{ url_for('js', filename='uikit/js/uikit-icons.min.js') }}"></script>
+<script src="{{ url_for('js', filename='jquery/jquery.min.js') }}"
+        type="text/javascript"></script>
+<script src="{{ url_for('js', filename='bootstrap/js/bootstrap.min.js') }}"
+        type="text/javascript"></script>
 {% block js %}
-
-    <script src="/static/new/javascript/dataset_select_menu_orig.js"></script>
-
-
-    <script type="text/javascript">
-    
-$(document).on('submit', '#searchform', function(event){
-
-    event.preventDefault()
-    let user_searches = [];
-    $(".search-query").each(function() {
-        this_search = $(this).val().trim();
-        if (this_search != ""){
-            user_searches.push(this_search);
-        }
-    });
-
-    for (i=0; i<user_searches.length; ++i){
-        saveBeforeSubmit(user_searches[i])
-    }
-    $( "#searchform" )[0].submit();
-
-});
-    </script>
-
-    <script>
-        function pressed(e) {
-            // Has the enter key been pressed?
-            if ( (window.event ? event.keyCode : e.which) == 13) {
-                e.preventDefault();
-                // If enter key has been pressed and the search fields are non-empty
-                // manually submit the <form>
-
-                if( event.target.value.trim() != "" ) {
-                    saveBeforeSubmit(event.target.value.trim())
-                    $("#searchform").prop("action", "/search")
-                    $("#searchform")[0].submit();
-                }
-                
-            }
-        }
-    </script>
+<!--Note this is locally built emfed package see source file:https://github.com/sampsyo/emfed -->
+
+<script src="{{ url_for('static', filename='/new/javascript/emfed.bundle.js') }}"
+        type="module"></script>
+<script src="{{ url_for('static', filename='/new/javascript/dataset_select_menu_orig.js') }}"
+        type="text/javascript"></script>
+<script>
+
+ $(document).on('submit', '#searchform', function(event){
+
+     event.preventDefault()
+     let user_searches = [];
+     $(".search-query").each(function() {
+         this_search = $(this).val().trim();
+         if (this_search != ""){
+             user_searches.push(this_search);
+         }
+     });
+
+     for (i=0; i<user_searches.length; ++i){
+         saveBeforeSubmit(user_searches[i])
+     }
+     $( "#searchform" )[0].submit();
+
+ });
+ function pressed(e) {
+     // Has the enter key been pressed?
+     if ( (window.event ? event.keyCode : e.which) == 13) {
+         e.preventDefault();
+         // If enter key has been pressed and the search fields are non-empty
+         // manually submit the <form>
+
+         if( event.target.value.trim() != "" ) {
+             saveBeforeSubmit(event.target.value.trim())
+             $("#searchform").prop("action", "/search")
+             $("#searchform")[0].submit();
+         }
+         
+     }
+ }
+ 
+ 
+</script>
 {% endblock %}
diff --git a/gn2/wqflask/templates/info_page.html b/gn2/wqflask/templates/info_page.html
index 91d34573..70132772 100644
--- a/gn2/wqflask/templates/info_page.html
+++ b/gn2/wqflask/templates/info_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}

+{% extends "index_page.html" %}

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

 {% block content %}

 

diff --git a/gn2/wqflask/templates/jobs/debug.html b/gn2/wqflask/templates/jobs/debug.html
index 828ab1cc..a97900d4 100644
--- a/gn2/wqflask/templates/jobs/debug.html
+++ b/gn2/wqflask/templates/jobs/debug.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Debug Job{% endblock%}
 {%block css%}
 {%endblock%}
diff --git a/gn2/wqflask/templates/jobs/no-such-job.html b/gn2/wqflask/templates/jobs/no-such-job.html
index 6fe7d014..e4cbe971 100644
--- a/gn2/wqflask/templates/jobs/no-such-job.html
+++ b/gn2/wqflask/templates/jobs/no-such-job.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}No Such Job{% endblock%}
 {%block css%}
 {%endblock%}
diff --git a/gn2/wqflask/templates/jupyter_notebooks.html b/gn2/wqflask/templates/jupyter_notebooks.html
index afc95a15..6f4af18e 100644
--- a/gn2/wqflask/templates/jupyter_notebooks.html
+++ b/gn2/wqflask/templates/jupyter_notebooks.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 
 {%block title%}
 Jupyter Notebooks
diff --git a/gn2/wqflask/templates/links.html b/gn2/wqflask/templates/links.html
index 4a134c96..0aa2a90e 100644
--- a/gn2/wqflask/templates/links.html
+++ b/gn2/wqflask/templates/links.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Links{% endblock %}
 
diff --git a/gn2/wqflask/templates/list_case_attribute_diffs.html b/gn2/wqflask/templates/list_case_attribute_diffs.html
index bb2658d1..7c5bc1cf 100644
--- a/gn2/wqflask/templates/list_case_attribute_diffs.html
+++ b/gn2/wqflask/templates/list_case_attribute_diffs.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}List Case Attribute Diffs{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/list_case_attribute_diffs_error.html b/gn2/wqflask/templates/list_case_attribute_diffs_error.html
index faeb5d12..4971696c 100644
--- a/gn2/wqflask/templates/list_case_attribute_diffs_error.html
+++ b/gn2/wqflask/templates/list_case_attribute_diffs_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}List Case Attribute Diffs{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/mapping_error.html b/gn2/wqflask/templates/mapping_error.html
index 8364af3c..60aa02ba 100644
--- a/gn2/wqflask/templates/mapping_error.html
+++ b/gn2/wqflask/templates/mapping_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block titl%}Error{%endblock%}
 {%block content%}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/mapping_results.html b/gn2/wqflask/templates/mapping_results.html
index c27de85e..8e9879aa 100644
--- a/gn2/wqflask/templates/mapping_results.html
+++ b/gn2/wqflask/templates/mapping_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Mapping Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
@@ -416,7 +416,7 @@
                 'data': null,
                 'render': function(data, type, row, meta) {
                   {% if geno_db_exists == "True" %}
-                  return '<a target"_blank" href="corr_scatter_plot?method=pearson&dataset_1={{ dataset.group.name }}Geno&dataset_2={{ dataset.name }}&trait_1=' + data.name + '&trait_2={{ this_trait.name }}&cached_trait=trait_2&dataid={{ dataid }}&effect=True">' + String(parseFloat(data.additive).toFixed(3)) + '</a>'
+                  return '<a target"_blank" href="/corr_scatter_plot?method=pearson&dataset_1={{ dataset.group.name }}Geno&dataset_2={{ dataset.name }}&trait_1=' + data.name + '&trait_2={{ this_trait.name }}&cached_trait=trait_2&dataid={{ dataid }}&effect=True">' + String(parseFloat(data.additive).toFixed(3)) + '</a>'
                   {% else %}
                   return String(parseFloat(data.additive).toFixed(3))
                   {% endif %}
diff --git a/gn2/wqflask/templates/metadata/editor.html b/gn2/wqflask/templates/metadata/editor.html
index b85f427d..8c15c64e 100644
--- a/gn2/wqflask/templates/metadata/editor.html
+++ b/gn2/wqflask/templates/metadata/editor.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style>
diff --git a/gn2/wqflask/templates/network_graph.html b/gn2/wqflask/templates/network_graph.html
index cff69ac8..73bb87d8 100644
--- a/gn2/wqflask/templates/network_graph.html
+++ b/gn2/wqflask/templates/network_graph.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="/static/new/css/network_graph.css" />
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='cytoscape-panzoom/cytoscape.js-panzoom.css') }}">
diff --git a/gn2/wqflask/templates/new_security/forgot_password.html b/gn2/wqflask/templates/new_security/forgot_password.html
index 60a221da..80febda8 100644
--- a/gn2/wqflask/templates/new_security/forgot_password.html
+++ b/gn2/wqflask/templates/new_security/forgot_password.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Forgot Password{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/new_security/forgot_password_step2.html b/gn2/wqflask/templates/new_security/forgot_password_step2.html
index 1835fd4c..f9063b4b 100644
--- a/gn2/wqflask/templates/new_security/forgot_password_step2.html
+++ b/gn2/wqflask/templates/new_security/forgot_password_step2.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/new_security/login_user.html b/gn2/wqflask/templates/new_security/login_user.html
index b8cdf6ef..dd14cf49 100644
--- a/gn2/wqflask/templates/new_security/login_user.html
+++ b/gn2/wqflask/templates/new_security/login_user.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/new_security/not_authenticated.html b/gn2/wqflask/templates/new_security/not_authenticated.html
index ea688346..0dcad7ee 100644
--- a/gn2/wqflask/templates/new_security/not_authenticated.html
+++ b/gn2/wqflask/templates/new_security/not_authenticated.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Authentication Needed{% endblock %}
 {% block content %}
     <div class="container">
@@ -8,4 +8,4 @@
         <p>Please contact the data's owner or GN administrators if you believe you should have access to these data.</p>
     </div>
 
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/new_security/password_reset.html b/gn2/wqflask/templates/new_security/password_reset.html
index e21f075c..6de77f89 100644
--- a/gn2/wqflask/templates/new_security/password_reset.html
+++ b/gn2/wqflask/templates/new_security/password_reset.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/new_security/register_user.html b/gn2/wqflask/templates/new_security/register_user.html
index c2895517..6e9115ae 100644
--- a/gn2/wqflask/templates/new_security/register_user.html
+++ b/gn2/wqflask/templates/new_security/register_user.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/new_security/registered.html b/gn2/wqflask/templates/new_security/registered.html
index 29889a97..651b5cf0 100644
--- a/gn2/wqflask/templates/new_security/registered.html
+++ b/gn2/wqflask/templates/new_security/registered.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
      {{ header("Almost Done", "Thanks for registering") }}
diff --git a/gn2/wqflask/templates/new_security/thank_you.html b/gn2/wqflask/templates/new_security/thank_you.html
index d4f5e574..ce15dab1 100644
--- a/gn2/wqflask/templates/new_security/thank_you.html
+++ b/gn2/wqflask/templates/new_security/thank_you.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Register{% endblock %}
 {% block content %}
     {{ header("Thank you", "Thanks for verifying") }}
diff --git a/gn2/wqflask/templates/new_security/verification_still_needed.html b/gn2/wqflask/templates/new_security/verification_still_needed.html
index 1f91fd8d..9cbc7548 100644
--- a/gn2/wqflask/templates/new_security/verification_still_needed.html
+++ b/gn2/wqflask/templates/new_security/verification_still_needed.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Verification{% endblock %}
 {% block content %}
      {{ header("Verification", "You still need to verify") }}
diff --git a/gn2/wqflask/templates/news.html b/gn2/wqflask/templates/news.html
index df8e02ef..c735ad22 100644
--- a/gn2/wqflask/templates/news.html
+++ b/gn2/wqflask/templates/news.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}News{% endblock %}
 
diff --git a/gn2/wqflask/templates/oauth2/confirm-resource-role-unassign-privilege.html b/gn2/wqflask/templates/oauth2/confirm-resource-role-unassign-privilege.html
index 988cf3b4..deb22fe3 100644
--- a/gn2/wqflask/templates/oauth2/confirm-resource-role-unassign-privilege.html
+++ b/gn2/wqflask/templates/oauth2/confirm-resource-role-unassign-privilege.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/create-resource.html b/gn2/wqflask/templates/oauth2/create-resource.html
index 479f4152..28a93ef4 100644
--- a/gn2/wqflask/templates/oauth2/create-resource.html
+++ b/gn2/wqflask/templates/oauth2/create-resource.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 
 {%block title%}Create Resource{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/create-role.html b/gn2/wqflask/templates/oauth2/create-role.html
index 6cf0bb78..3d52d0ae 100644
--- a/gn2/wqflask/templates/oauth2/create-role.html
+++ b/gn2/wqflask/templates/oauth2/create-role.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/data-list-genotype.html b/gn2/wqflask/templates/oauth2/data-list-genotype.html
index 78939a72..f50e014c 100644
--- a/gn2/wqflask/templates/oauth2/data-list-genotype.html
+++ b/gn2/wqflask/templates/oauth2/data-list-genotype.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 
diff --git a/gn2/wqflask/templates/oauth2/data-list-mrna.html b/gn2/wqflask/templates/oauth2/data-list-mrna.html
index c5c1c27e..501ff704 100644
--- a/gn2/wqflask/templates/oauth2/data-list-mrna.html
+++ b/gn2/wqflask/templates/oauth2/data-list-mrna.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 
diff --git a/gn2/wqflask/templates/oauth2/data-list-phenotype.html b/gn2/wqflask/templates/oauth2/data-list-phenotype.html
index d355f3f9..810c59c7 100644
--- a/gn2/wqflask/templates/oauth2/data-list-phenotype.html
+++ b/gn2/wqflask/templates/oauth2/data-list-phenotype.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 
diff --git a/gn2/wqflask/templates/oauth2/data-list.html b/gn2/wqflask/templates/oauth2/data-list.html
index 8a8f6694..787f892f 100644
--- a/gn2/wqflask/templates/oauth2/data-list.html
+++ b/gn2/wqflask/templates/oauth2/data-list.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}Link Data{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/group.html b/gn2/wqflask/templates/oauth2/group.html
index f4c29d18..0da8d754 100644
--- a/gn2/wqflask/templates/oauth2/group.html
+++ b/gn2/wqflask/templates/oauth2/group.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/group_join_or_create.html b/gn2/wqflask/templates/oauth2/group_join_or_create.html
index 8255d2f8..80791a99 100644
--- a/gn2/wqflask/templates/oauth2/group_join_or_create.html
+++ b/gn2/wqflask/templates/oauth2/group_join_or_create.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%block title%}Join or Create Group{%endblock%}
 
diff --git a/gn2/wqflask/templates/oauth2/join-requests.html b/gn2/wqflask/templates/oauth2/join-requests.html
index 833b4e93..11f9f055 100644
--- a/gn2/wqflask/templates/oauth2/join-requests.html
+++ b/gn2/wqflask/templates/oauth2/join-requests.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/list_roles.html b/gn2/wqflask/templates/oauth2/list_roles.html
index a4061fca..bd2a9c75 100644
--- a/gn2/wqflask/templates/oauth2/list_roles.html
+++ b/gn2/wqflask/templates/oauth2/list_roles.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/login.html b/gn2/wqflask/templates/oauth2/login.html
index eaa1a192..8203f088 100644
--- a/gn2/wqflask/templates/oauth2/login.html
+++ b/gn2/wqflask/templates/oauth2/login.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Login{%endblock%}
 {%block content%}
 <div class="container" style="min-width: 1250px;">
diff --git a/gn2/wqflask/templates/oauth2/masquerade.html b/gn2/wqflask/templates/oauth2/masquerade.html
index 48ec6cee..fdf3ebbc 100644
--- a/gn2/wqflask/templates/oauth2/masquerade.html
+++ b/gn2/wqflask/templates/oauth2/masquerade.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}Masquerade As{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/register_user.html b/gn2/wqflask/templates/oauth2/register_user.html
index 27ccbd30..34848f07 100644
--- a/gn2/wqflask/templates/oauth2/register_user.html
+++ b/gn2/wqflask/templates/oauth2/register_user.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Register New User{%endblock%}
 {%block content%}
 <div class="container" style="min-width: 1250px;">
diff --git a/gn2/wqflask/templates/oauth2/request_error.html b/gn2/wqflask/templates/oauth2/request_error.html
index e6ed5fff..d311c401 100644
--- a/gn2/wqflask/templates/oauth2/request_error.html
+++ b/gn2/wqflask/templates/oauth2/request_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%block title%}View User{%endblock%}
 {%block content%}
diff --git a/gn2/wqflask/templates/oauth2/resources.html b/gn2/wqflask/templates/oauth2/resources.html
index c52043db..c7055211 100644
--- a/gn2/wqflask/templates/oauth2/resources.html
+++ b/gn2/wqflask/templates/oauth2/resources.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%block title%}View User{%endblock%}
 {%block content%}
diff --git a/gn2/wqflask/templates/oauth2/role.html b/gn2/wqflask/templates/oauth2/role.html
index c33c93ee..4303c8c8 100644
--- a/gn2/wqflask/templates/oauth2/role.html
+++ b/gn2/wqflask/templates/oauth2/role.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%block title%}View User{%endblock%}
 {%block content%}
diff --git a/gn2/wqflask/templates/oauth2/view-resource-role.html b/gn2/wqflask/templates/oauth2/view-resource-role.html
index 4bd0ab45..54de94f5 100644
--- a/gn2/wqflask/templates/oauth2/view-resource-role.html
+++ b/gn2/wqflask/templates/oauth2/view-resource-role.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/view-resource.html b/gn2/wqflask/templates/oauth2/view-resource.html
index 0788e30c..06b629eb 100644
--- a/gn2/wqflask/templates/oauth2/view-resource.html
+++ b/gn2/wqflask/templates/oauth2/view-resource.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%from "oauth2/display_error.html" import display_error%}
 {%block title%}View User{%endblock%}
diff --git a/gn2/wqflask/templates/oauth2/view-user.html b/gn2/wqflask/templates/oauth2/view-user.html
index 34526b14..e1d06a20 100644
--- a/gn2/wqflask/templates/oauth2/view-user.html
+++ b/gn2/wqflask/templates/oauth2/view-user.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%from "oauth2/profile_nav.html" import profile_nav%}
 {%block title%}View User{%endblock%}
 {%block content%}
diff --git a/gn2/wqflask/templates/pair_scan_results.html b/gn2/wqflask/templates/pair_scan_results.html
index 57e9c38f..8b84588c 100644
--- a/gn2/wqflask/templates/pair_scan_results.html
+++ b/gn2/wqflask/templates/pair_scan_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Pair Scan{% endblock %}
 {% block css %}
 <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_error.html b/gn2/wqflask/templates/partial_correlations/pcorrs_error.html
index 8d6c4bbe..68a00edb 100644
--- a/gn2/wqflask/templates/partial_correlations/pcorrs_error.html
+++ b/gn2/wqflask/templates/partial_correlations/pcorrs_error.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Error: {{message}}{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html b/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html
index 38577c32..22d16823 100644
--- a/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html
+++ b/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 
 {%block title%}Partial Correlations:{%endblock%}
 
diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html b/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html
index dac02397..a4a767f3 100644
--- a/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html
+++ b/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 
 {%block title%}Partial Correlations:{%endblock%}
 
diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html b/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html
index c1ef6001..ebb48c6f 100644
--- a/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html
+++ b/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 
 {%block title%}Partial Correlations:{%endblock%}
 
diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html b/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html
index fe7f8cd4..66285f28 100644
--- a/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html
+++ b/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 
 {%block title%}Partial Correlations:{%endblock%}
 
diff --git a/gn2/wqflask/templates/phenotype.html b/gn2/wqflask/templates/phenotype.html
index 4f4fba6e..d7275611 100644
--- a/gn2/wqflask/templates/phenotype.html
+++ b/gn2/wqflask/templates/phenotype.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/policies.html b/gn2/wqflask/templates/policies.html
index d7b0e3f9..946305ee 100644
--- a/gn2/wqflask/templates/policies.html
+++ b/gn2/wqflask/templates/policies.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Links{% endblock %}
 
diff --git a/gn2/wqflask/templates/probeset.html b/gn2/wqflask/templates/probeset.html
index f3724ce8..544bf33d 100644
--- a/gn2/wqflask/templates/probeset.html
+++ b/gn2/wqflask/templates/probeset.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/publication.html b/gn2/wqflask/templates/publication.html
index 556d184f..c860f3bd 100644
--- a/gn2/wqflask/templates/publication.html
+++ b/gn2/wqflask/templates/publication.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style type="text/css">
diff --git a/gn2/wqflask/templates/references.html b/gn2/wqflask/templates/references.html
index d858e10f..2e69908d 100644
--- a/gn2/wqflask/templates/references.html
+++ b/gn2/wqflask/templates/references.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Reference{% endblock %}
 {% block css %}
 <link rel="stylesheet" type="text/css" href="/static/new/css/markdown.css" />
diff --git a/gn2/wqflask/templates/search-syntax.html b/gn2/wqflask/templates/search-syntax.html
index e4ab7907..481e7f89 100644
--- a/gn2/wqflask/templates/search-syntax.html
+++ b/gn2/wqflask/templates/search-syntax.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block title %}Global Search Syntax{% endblock %}
 
diff --git a/gn2/wqflask/templates/search_error.html b/gn2/wqflask/templates/search_error.html
index df8d9dff..c1746ad4 100644
--- a/gn2/wqflask/templates/search_error.html
+++ b/gn2/wqflask/templates/search_error.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Search Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
diff --git a/gn2/wqflask/templates/search_result_page.html b/gn2/wqflask/templates/search_result_page.html
index 19dcbc9a..6e5e0146 100644
--- a/gn2/wqflask/templates/search_result_page.html
+++ b/gn2/wqflask/templates/search_result_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Search Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
@@ -185,7 +185,7 @@
             {% if results|count > 0  and not too_many_results %}
             var tableId = "trait_table";
 
-            var widthChange = 0; //ZS: For storing the change in width so overall table width can be adjusted by that amount
+            var widthChange = 0; // For storing the change in width so overall table width can be adjusted by that amount
 
             columnDefs = [
             {
@@ -232,6 +232,9 @@
               'targets': 4,
               'render': function(data) {
                 description = data.description
+                {% if 'BinID' in trait_list[0].description %}
+                description = data.description.split(";")[0]
+                {% endif %}
                 if (data.description.length > 200) {
                   description = data.description.slice(0, 200) + '...'
                 }
@@ -242,6 +245,22 @@
                 }
               }
             },
+            {% if 'BinID' in trait_list[0].description %}
+            {
+              'title': "<div style='text-align: right;'>Bin</div>",
+              'type': "natural-minus-na",
+              'data': null,
+              'width': "130px",
+              'targets': 5,
+              'defaultContent': "N/A",
+              'render': function(data) {
+                bin_string = data.description.split(";")[1].split(":")[1];
+                chr_string = "C" + bin_string.split("_")[0].substring(1,4)
+                pos_string = (parseFloat(bin_string.split("_")[1])/1000000).toString()
+                return [chr_string, pos_string].join(": ")
+              }
+            },
+            {% endif %}
             {
               'title': "<div style='text-align: right;'>Location</div>",
               'type': "natural-minus-na",
@@ -407,12 +426,15 @@
                   $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 500));
                   $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
                 }
-                $('td', row).slice(5,10).attr("align", "right");
+                $('td', row).slice(5,11).attr("align", "right");
                 $('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
                 $('td', row).eq(6).attr('data-export', $('td', row).eq(6).text());
                 $('td', row).eq(7).attr('data-export', $('td', row).eq(7).text());
                 $('td', row).eq(8).attr('data-export', $('td', row).eq(8).text());
                 $('td', row).eq(9).attr('data-export', $('td', row).eq(9).text());
+                {% if 'BinID' in trait_list[0].description %}
+                $('td', row).eq(10).attr('data-export', $('td', row).eq(10).text());
+                {% endif %}
                 {% elif dataset.type == 'Publish' %}
                 $('td', row).eq(3).attr('title', $('td', row).eq(3).text());
                 $('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
@@ -428,7 +450,7 @@
                 $('td', row).eq(6).attr('data-export', $('td', row).eq(6).text());
                 $('td', row).eq(7).attr('data-export', $('td', row).eq(7).text());
                 $('td', row).eq(8).attr('data-export', $('td', row).eq(8).text());
-                $('td', row).eq(9).attr('data-export', $('td', row).eq(8).text());
+                $('td', row).eq(9).attr('data-export', $('td', row).eq(9).text());
                 {% elif dataset.type == 'Geno' %}
                 $('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
                 {% endif %}
diff --git a/gn2/wqflask/templates/set_group_privileges.html b/gn2/wqflask/templates/set_group_privileges.html
index a0a53292..027a1e07 100644
--- a/gn2/wqflask/templates/set_group_privileges.html
+++ b/gn2/wqflask/templates/set_group_privileges.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}

+{% extends "index_page.html" %}

 {% block title %}Set Group Privileges{% endblock %}

 {% block css %}

     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />

diff --git a/gn2/wqflask/templates/show_trait.html b/gn2/wqflask/templates/show_trait.html
index 899ee3d8..0433a932 100644
--- a/gn2/wqflask/templates/show_trait.html
+++ b/gn2/wqflask/templates/show_trait.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {%from "oauth2/display_error.html" import display_error%}
 
 {% block title %}Trait Data and Analysis{% endblock %}
diff --git a/gn2/wqflask/templates/show_trait_details.html b/gn2/wqflask/templates/show_trait_details.html
index dc5a49ce..bfd42de3 100644
--- a/gn2/wqflask/templates/show_trait_details.html
+++ b/gn2/wqflask/templates/show_trait_details.html
@@ -222,6 +222,7 @@
         <button type="button" class="btn btn-default" title="Check probe locations at UCSC" onclick="window.open('{{ UCSC_BLAT_URL }}', '_blank')">Verify</button>
         {% endif %}
         {% if this_trait.symbol != None %}
+        <button type="button" class="btn btn-default" title="Write or review comments about this gene" onclick="window.open('{{ url_for('display_genewiki_page', symbol=this_trait.symbol) }}', '_blank')">(GN2) GeneWiki</button>
 	<button type="button" class="btn btn-default" title="Write or review comments about this gene" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}', '_blank')">(GN1) GeneWiki</button>
         {% if dataset.group.species == "mouse" or dataset.group.species == "rat" %}
         <button type="button" class="btn btn-default" title="View SNPs and Indels" onclick="window.open('/snp_browser?first_run=true&species={{ dataset.group.species }}&gene_name={{ this_trait.symbol }}&limit_strains=on', '_blank')">SNPs</button>
diff --git a/gn2/wqflask/templates/show_trait_error.html b/gn2/wqflask/templates/show_trait_error.html
index 550d3f46..ca354f12 100644
--- a/gn2/wqflask/templates/show_trait_error.html
+++ b/gn2/wqflask/templates/show_trait_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Trait Data and Analysis{%endblock%}
 {%block css%}
 <link rel="stylesheet" type="text/css" href="/static/new/css/bar_chart.css" />
diff --git a/gn2/wqflask/templates/snp_browser.html b/gn2/wqflask/templates/snp_browser.html
index b9aea570..8a696b20 100644
--- a/gn2/wqflask/templates/snp_browser.html
+++ b/gn2/wqflask/templates/snp_browser.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
     <link rel="stylesheet" type="text/css" href="{{ url_for('js', filename='DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css') }}" />
diff --git a/gn2/wqflask/templates/startup_errors.html b/gn2/wqflask/templates/startup_errors.html
index 82d85572..91c1807c 100644
--- a/gn2/wqflask/templates/startup_errors.html
+++ b/gn2/wqflask/templates/startup_errors.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}Startup Error{%endblock%}
 {%block content %}
 {%if error_type == "MissingConfigurationError"%}
diff --git a/gn2/wqflask/templates/submit_trait.html b/gn2/wqflask/templates/submit_trait.html
index 10ddf69f..cb09a614 100644
--- a/gn2/wqflask/templates/submit_trait.html
+++ b/gn2/wqflask/templates/submit_trait.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Trait Submission{% endblock %}
 {% block content %}
 <!-- Start of body -->
diff --git a/gn2/wqflask/templates/test_correlation_page.html b/gn2/wqflask/templates/test_correlation_page.html
index 9b0b2828..40bf99c3 100644
--- a/gn2/wqflask/templates/test_correlation_page.html
+++ b/gn2/wqflask/templates/test_correlation_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Correlation Results{% endblock %}
 {% block css %}
     <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
@@ -156,4 +156,4 @@ console.log(correlationResults)
 } );
 </script>
 
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/tool_buttons.html b/gn2/wqflask/templates/tool_buttons.html
index 3e716d70..5ba60acf 100644
--- a/gn2/wqflask/templates/tool_buttons.html
+++ b/gn2/wqflask/templates/tool_buttons.html
@@ -10,10 +10,6 @@
   WebGestalt
 </button>
 
-<button id="send_to_geneweaver" class="btn btn-primary submit_special" data-url="/geneweaver_page" title="GeneWeaver" >
-  GeneWeaver
-</button>
-
 <button id="send_to_bnw" class="btn btn-primary submit_special" data-url="/bnw_page" title="Bayesian network software for causal modeling and reasoning, with an intuitive interface to incorporate biological knowledge and a complete pipeline from data to model to prediction" >
   BNW
 </button>
diff --git a/gn2/wqflask/templates/tutorials.html b/gn2/wqflask/templates/tutorials.html
index 6281291f..d584dd1f 100644
--- a/gn2/wqflask/templates/tutorials.html
+++ b/gn2/wqflask/templates/tutorials.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}Tutorials/Primers{% endblock %}
 {% block content %}
 
diff --git a/gn2/wqflask/templates/view_case_attribute_diff.html b/gn2/wqflask/templates/view_case_attribute_diff.html
index 3ba9b314..cf6ab613 100644
--- a/gn2/wqflask/templates/view_case_attribute_diff.html
+++ b/gn2/wqflask/templates/view_case_attribute_diff.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}View Case Attribute Diff{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/view_case_attribute_diff_error.html b/gn2/wqflask/templates/view_case_attribute_diff_error.html
index 5edbe070..d0fe641b 100644
--- a/gn2/wqflask/templates/view_case_attribute_diff_error.html
+++ b/gn2/wqflask/templates/view_case_attribute_diff_error.html
@@ -1,4 +1,4 @@
-{%extends "base.html"%}
+{% extends "index_page.html" %}
 {%block title%}View Case Attribute Diff{%endblock%}
 
 {%block css%}
diff --git a/gn2/wqflask/templates/webgestalt_page.html b/gn2/wqflask/templates/webgestalt_page.html
index 759e0251..aea31fd8 100644
--- a/gn2/wqflask/templates/webgestalt_page.html
+++ b/gn2/wqflask/templates/webgestalt_page.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}{% if wrong_input == "True" %}WebGestalt Error{% else %}Opening WebGestalt{% endif %}{% endblock %}
 {% block content %}
   {% if wrong_input == "True" %}
diff --git a/gn2/wqflask/templates/wgcna_results.html b/gn2/wqflask/templates/wgcna_results.html
index 0dc030b1..3ce7f035 100644
--- a/gn2/wqflask/templates/wgcna_results.html
+++ b/gn2/wqflask/templates/wgcna_results.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}WCGNA results{% endblock %}
 
 {% block content %} <!-- Start of body -->
diff --git a/gn2/wqflask/templates/wgcna_setup.html b/gn2/wqflask/templates/wgcna_setup.html
index 20316ab2..33f8947d 100644
--- a/gn2/wqflask/templates/wgcna_setup.html
+++ b/gn2/wqflask/templates/wgcna_setup.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}WCGNA analysis{% endblock %}
 {% block content %}
 <!-- Start of body -->
@@ -138,4 +138,4 @@ $(document).on('submit', '#wgcna_form', function(e) {
 })
 
 </script>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/gn2/wqflask/templates/wiki/edit_wiki.html b/gn2/wqflask/templates/wiki/edit_wiki.html
index 23412a31..66371cf3 100644
--- a/gn2/wqflask/templates/wiki/edit_wiki.html
+++ b/gn2/wqflask/templates/wiki/edit_wiki.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 
 {% block css %}
 <style>
diff --git a/gn2/wqflask/templates/wiki/genewiki.html b/gn2/wqflask/templates/wiki/genewiki.html
index b07e86e0..1677c466 100644
--- a/gn2/wqflask/templates/wiki/genewiki.html
+++ b/gn2/wqflask/templates/wiki/genewiki.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block title %}GeneWiki Entry for {{ symbol }}{% endblock %}
 {% block content %}
     {{ flash_me() }}
@@ -11,27 +11,34 @@
         <h5>
             <strong>GeneNetwork:</strong>
         </h5>
-
         {% if wiki %}
-
             <ol class="list-group">
                 {% for entry in wiki %}
                     <li class="list-group-item">
                         <div class="row">
-                            <div class="col-sm-1">{{ loop.index }}.</div>
                             <div class="col-sm-6">
-                                {{ entry.get("comment") }}
+                                {{ loop.index }}. {{ entry.get("comment") }}
                                 {% if entry.get("web_url") %}
                                     <sup> <small> <a href = "{{ entry.web_url }}" target = "_blank"> <span class = "glyphicon glyphicon-globe" aria-hidden = "true"></span>web</a></small></sup>
                                 {% endif %}
                             </div>
-
                             <div class="col-sm-2">
                                 {% if is_logged_in %}
                                 <a href="{{ url_for('edit_wiki', comment_id=entry['id']) }}">
                                     <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
                                 </a>
+                                {% else %}
+                                <a data-toggle="collapse" data-target="#collapseLogin{{ loop.index }}" aria-expanded="false" aria-controls="collapseLogin{{ loop.index }}">
+                                    <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
+                                </a>
+
+                                <div class="collapse" id="collapseLogin{{ loop.index }}">
+                                  <div class="well">
+                                      Please login to be able to edit this
+                                  </div>
+                                </div>
                                 {% endif %}
+
                                 <sup><small>[<a href="/genewiki/{{ entry.id }}/history" target="_blank">history</a>]</small></sup>
                             </div>
                         </div>
@@ -43,5 +50,29 @@
                 <u> There are no GeneNetwork entries for <b> {{ symbol }}.</b></u>
             </p>
         {% endif %}
+        <h5>
+            <strong>GeneRIF from NCBI:</strong>
+        </h5>
+        {% if rif %}
+            <ol class="list-group">
+                {% for entry in rif %}
+                    <li class="list-group-item">
+                        <div class="row">
+                            <div class="col-sm-12">
+                                {{ loop.index }}. {{ entry.get("comment") }}
+                                (<a href="http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids={{ entry.gene_id }}"
+   target="_blank">{{ entry.species }}</a>)
+                                (<a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids={{ entry.pubmed_id }}&dopt=Abstract"
+   target="_blank">PubMed</a>)
+                            </div>
+                        </div>
+                    </li>
+                {% endfor %}
+            </ol>
+        {% else %}
+            <p class = "well">
+                <u> There are no NCBI RIF entries for this for<b> {{ symbol }}.</b></u>
+            </p>
+        {% endif %}
     </div>
 {% endblock %}
diff --git a/gn2/wqflask/templates/wiki/history.html b/gn2/wqflask/templates/wiki/history.html
index bda802d3..4d48b7e8 100644
--- a/gn2/wqflask/templates/wiki/history.html
+++ b/gn2/wqflask/templates/wiki/history.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block content %}
     {{ flash_me() }}
     <div class = "container container-fluid">
diff --git a/gn2/wqflask/templates/wiki/search.html b/gn2/wqflask/templates/wiki/search.html
index 863d3daa..e2899976 100644
--- a/gn2/wqflask/templates/wiki/search.html
+++ b/gn2/wqflask/templates/wiki/search.html
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "index_page.html" %}
 {% block content %}
     <div class="container">
         <div class="row">
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 6bd66940..473b86e9 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -4,22 +4,18 @@ import array
 import base64
 import csv
 import datetime
-import flask
 import hashlib
 import io  # Todo: Use cStringIO?
 
 import json
-import numpy as np
 import os
 import pickle as pickle
 import random
-import requests
 import sys
 import traceback
 import math
 import uuid
 import urllib.parse
-import xlsxwriter
 
 from functools import reduce
 
@@ -30,8 +26,10 @@ from uuid import UUID
 
 from urllib.parse import urljoin
 
-from gn2.wqflask import app
-
+import xlsxwriter
+import requests
+import numpy as np
+import flask
 from gn3.computations.gemma import generate_hash_of_string
 from flask import current_app
 from flask import jsonify
@@ -46,6 +44,7 @@ from flask import send_file
 from flask import url_for
 from flask import flash
 
+from gn2.wqflask import app
 from gn2.wqflask import search_results
 from gn2.wqflask import server_side
 
@@ -248,9 +247,13 @@ def gsearchact():
     search_type = request.args["type"]
     is_user_logged_in = session_info().get("user", {}).get("logged_in", False)
 
-    do_ai_search = current_app.config.get("AI_SEARCH_ENABLED") and is_user_logged_in
+    ai_search_enabled = current_app.config.get("AI_SEARCH_ENABLED")
+    do_ai_search = ai_search_enabled and is_user_logged_in
     if search_type == "gene":
-        return render_template("gsearch_gene.html", **result, do_ai_search=do_ai_search, result=result)
+        return render_template("gsearch_gene.html", **result,
+                               ai_search_enabled=ai_search_enabled,
+                               do_ai_search=do_ai_search,
+                               result=result)
     elif search_type == "phenotype":
         return render_template("gsearch_pheno.html", **result)
 
@@ -310,7 +313,8 @@ def gnqna():
         else:
             return render_template("gnqa.html")
     if request.method == "POST":
-        safe_query = urllib.parse.urlencode({"query": request.form.get("querygnqa")})
+        safe_query = urllib.parse.urlencode(
+            {"query": request.form.get("querygnqa")})
         return monad_requests.get(
             urljoin(GN3_LOCAL_URL, f"/api/llm/search?{safe_query}"),
             headers={"Authorization": f"Bearer {token}"},
@@ -320,7 +324,8 @@ def gnqna():
 @app.route("/editor/edit", methods=["GET"])
 @require_oauth2
 def edit_gn_doc_file():
-    file_path = urllib.parse.urlencode({"file_path": request.args.get("file-path", "")})
+    file_path = urllib.parse.urlencode(
+        {"file_path": request.args.get("file-path", "")})
     response = requests.get(f"http://localhost:8091/edit?{file_path}")
     response.raise_for_status()
     return render_template("gn_editor.html", **response.json())
@@ -339,12 +344,12 @@ def commit_gn_doc():
     if request.method == "GET":
         return render_template("gn_editor_commit.html")
     results = requests.post("http://localhost:8091/commit", json={
-                          "content":  request.form.get("content"),
-                          "filename": request.form.get("file_path"),
-                          "username": session_info()["user"]["name"],
-                          "email": session_info()["user"]["email"],
-                          "commit_message": request.form.get("msg"),
-                          "prev_commit": request.form.get("hash")})
+        "content":  request.form.get("content"),
+        "filename": request.form.get("file_path"),
+        "username": session_info()["user"]["name"],
+        "email": session_info()["user"]["email"],
+        "commit_message": request.form.get("msg"),
+        "prev_commit": request.form.get("hash")})
     data = results.json()
     data["filename"] = request.form.get("file_path")
     return render_template("gn_editor_results_page.html", **data)
@@ -371,7 +376,8 @@ def get_gnqa_records():
         prev_n_queries = get_chunk(response, page, pagination_size)
         return render_template("gnqa_search_history.html",
                                prev_queries=prev_n_queries,
-                               num_pages=math.ceil(len(response)/pagination_size),
+                               num_pages=math.ceil(
+                                   len(response)/pagination_size),
                                current=page)
     token = session_info()["user"]["token"].either(
         lambda err: err, lambda tok: tok["access_token"])
@@ -379,9 +385,9 @@ def get_gnqa_records():
     return (monad_requests.get(urljoin(GN3_LOCAL_URL, response_url),
                                headers={
             "Authorization": f"Bearer {token}"
-        }
-        ).then(lambda resp: resp).either(
-            _error_, _success_))
+            }
+    ).then(lambda resp: resp).either(
+        _error_, _success_))
 
 
 @app.route("/gnqna/record", methods=["GET"])
@@ -402,7 +408,7 @@ def get_gnqa_record_by_task_id():
     return (monad_requests.get(urljoin(GN3_LOCAL_URL, response_url),
                                headers={
             "Authorization": f"Bearer {token}"
-        }).then(lambda resp: resp).either(
+            }).then(lambda resp: resp).either(
             _error_, _success_))
 
 
@@ -472,12 +478,13 @@ def gsearch_updating():
 @app.route("/docedit")
 def docedit():
     try:
-        if g.user_session.record['user_email_address'] == "zachary.a.sloan@gmail.com" or g.user_session.record['user_email_address'] == "labwilliams@gmail.com":
+        if (g.user_session.record['user_email_address'] == "zachary.a.sloan@gmail.com"
+                or g.user_session.record['user_email_address'] == "labwilliams@gmail.com"):
             doc = Docs(request.args['entry'], request.args)
             return render_template("docedit.html", **doc.__dict__)
         else:
             return "You shouldn't be here!"
-    except:
+    except Exception:
         return "You shouldn't be here!"
 
 
@@ -1296,18 +1303,22 @@ def display_diffs_users():
 
 @app.route("/genewiki/<string:symbol>")
 def display_genewiki_page(symbol: str):
-    """Fetch GeneRIF metadata from GN3 and display it"""
-    wiki = {}
+    """Display RIF metadata from NCBI"""
+    wiki, rif = [], []
     try:
-        wiki = requests.get(urljoin(GN3_LOCAL_URL, f"/api/metadata/wiki/{symbol}"))
+        wiki = requests.get(
+            urljoin(GN3_LOCAL_URL, f"/api/metadata/wiki/{symbol}"))
+        rif = requests.get(
+            urljoin(GN3_LOCAL_URL, f"/api/metadata/rif/{symbol}"))
         wiki.raise_for_status()
-        wiki = wiki.json()
+        rif.raise_for_status()
+        wiki, rif = wiki.json(), rif.json()
     except requests.RequestException as excp:
         flash(excp, "alert-warning")
     sess_info = session_info()
     is_logged_in = sess_info.get("user", {}).get("logged_in", False)
-
-    return render_template("wiki/genewiki.html", symbol=symbol, wiki=wiki, is_logged_in=is_logged_in)
+    return render_template("wiki/genewiki.html",
+                           symbol=symbol, wiki=wiki, rif=rif, is_logged_in=is_logged_in)
 
 
 @app.route("/genewiki/<int:comment_id>/history")
@@ -1327,9 +1338,6 @@ def display_wiki_history(comment_id: str):
 @app.route("/datasets/<name>", methods=('GET',))
 def get_dataset(name):
     from gn2.wqflask.oauth2.client import oauth2_get
-    from gn2.wqflask.oauth2.client import user_logged_in
-    from gn2.wqflask.oauth2.request_utils import user_details
-    from gn2.wqflask.oauth2.request_utils import process_error
 
     # We need to use the "id" as the identifier
     metadata = requests.get(
@@ -1605,7 +1613,7 @@ def edit_wiki(comment_id: int):
         categories_resp.raise_for_status()
         categories = list(categories_resp.json().keys())
         grouped_categories = [
-            categories[i : i + 3] for i in range(0, len(categories), 3)
+            categories[i: i + 3] for i in range(0, len(categories), 3)
         ]
 
         session_email = session_info()["user"]["email"]
@@ -1619,7 +1627,7 @@ def edit_wiki(comment_id: int):
     if request.method == "POST":
         post_data = request.form
         web_url = post_data["web_url"]
-        if web_url == "http://": # default prefilled value in form
+        if web_url == "http://":  # default prefilled value in form
             web_url = ""
         payload = {
             "symbol": post_data["symbol"],
@@ -1627,11 +1635,12 @@ def edit_wiki(comment_id: int):
             "species": post_data["species"],
             "comment": post_data["comment"],
             "email": post_data["email"],
-            "web_url": post_data["web_url"],
+            "web_url": web_url,
             "initial": post_data["initial"],
             "categories": post_data.getlist("genecategory"),
             "reason": post_data["reason"],
         }
+
         def _invalid_token(err):
             raise ValueError(f"Error finding user token, got: {err}")
 
@@ -1648,7 +1657,7 @@ def edit_wiki(comment_id: int):
         post_res = post_response.json()
 
         flash(f"Success: {post_res}", "alert-success")
-        return redirect(url_for("edit_wiki", comment_id=comment_id))
+        return redirect(url_for("display_genewiki_page", symbol=post_data["symbol"]))
 
 
 @app.route("/genewiki", methods=["POST", "GET"])
diff --git a/scripts/maintenance/QTL_Reaper_v6.py b/scripts/maintenance/QTL_Reaper_v6.py
index 20fd8e3b..477af973 100755
--- a/scripts/maintenance/QTL_Reaper_v6.py
+++ b/scripts/maintenance/QTL_Reaper_v6.py
@@ -1,111 +1,148 @@
 ####### To run this program do: python QTL_Reaper_v2.py 235
 #Where 163 is the ProbeSetFreeze Id of the database that we want to calculate #the LRS
 #!/usr/bin/python
-import sys
-import os
 import reaper
 import MySQLdb
-import time
-
-con = MySQLdb.Connect(db='db_webqtl', user='username', passwd='', host="localhost")
-cursor = con.cursor()
-
-genotypeDir = '/gnshare/gn/web/genotypes/'
-genotype_1 = reaper.Dataset()
-
-#####get all of the genotypes
-cursor.execute('select Id, Name from InbredSet')
-results = cursor.fetchall()
-InbredSets = {}
-for item in results:
-	InbredSets[item[0]] = genotypeDir+str(item[1])+'.geno'
-
-ProbeSetFreezeIds=sys.argv[1:]
-if ProbeSetFreezeIds:
-	#####convert the Ids to integer
-	ProbeSetFreezeIds=list(map(int, ProbeSetFreezeIds))
-
-else:
-	#####get all of the dataset that need be updated
-	cursor.execute('select distinct(ProbeSetFreezeId) from ProbeSetXRef where pValue is NULL order by ProbeSetFreezeId desc')
-	results = cursor.fetchall()
-	ProbeSetFreezeIds = []
-	for item in results:
-		ProbeSetFreezeIds.append(item[0])
-
-####human dataset can NOT use this program calculate the LRS, ignore it
-if ProbeSetFreezeIds.__contains__(215):
-	ProbeSetFreezeIds.remove(215)
-
-#output_file = open ('/home/xzhou/work/DatabaseTools/cal_LRS_Additive_result.txt', 'w')
-
-#####update 
-for ProbeSetFreezeId in ProbeSetFreezeIds:
-	cursor.execute("""
-		select InbredSetId 
-		from ProbeFreeze, ProbeSetFreeze 
-		where ProbeFreeze.Id=ProbeSetFreeze.ProbeFreezeId and ProbeSetFreeze.Id=%d
-	"""%ProbeSetFreezeId);
-
-	InbredSetId = cursor.fetchone()[0]
-	if InbredSetId==3:
-		InbredSetId=1
-	#if InbredSetId==12:
-	#	InbredSetId=2
-
-	print((ProbeSetFreezeId, InbredSets[InbredSetId]))
-
-	genotype_1.read(InbredSets[InbredSetId])
-	locuses = []
-	for geno in genotype_1:
-		for locus in geno:
-			locuses.append(locus.name)
-
-	cursor.execute('select ProbeSetId, Locus, DataId from ProbeSetXRef where ProbeSetFreezeId=%s'%ProbeSetFreezeId)
-	ProbeSetXRefInfos = cursor.fetchall()
-
-	kj=0
-	for aProbeSetXRef in ProbeSetXRefInfos:
-		ProbeSetId, Locus, DataId = aProbeSetXRef
-		prgy = genotype_1.prgy
-
-		cursor.execute("select Strain.Name, ProbeSetData.value from Strain, ProbeSetData where Strain.Id = ProbeSetData.StrainId and ProbeSetData.Id = %d" % DataId)
-		results = cursor.fetchall()
-		if not results:
-			continue
-		_strains = []
-		_values = []
-		for item2 in results:
-			strain, value = item2
-			if strain in prgy:
-				_strains.append(strain)
-				_values.append(value)
-		if not _strains or not _values:
-			continue
-		
-		if len(_strains) < 8:
-			continue
-		qtlresults = genotype_1.regression(strains = _strains, trait = _values)
-		_max = max(qtlresults)
-		_locus = _max.locus.name
-		_additive = _max.additive
-		_max = _max.lrs
-
-		#output_file.write('%s\t%s\t%s\t%s\t%s\n' % (ProbeSetFreezeId, ProbeSetId, _locus, _max, _additive))
-		
-		# _max(LRS) maybe is infinite sometimes, so define it as a very big number
-		if _max == float('inf'):
-			_max = 10000
-
-		cursor.execute('update ProbeSetXRef set Locus=%s, LRS=%s, additive=%s where ProbeSetId=%s and ProbeSetFreezeId=%s', \
-				(_locus, _max, _additive, ProbeSetId, ProbeSetFreezeId))
-
-		kj += 1
-		if kj%1000==0:
-			print((ProbeSetFreezeId, InbredSets[InbredSetId], kj))
-
-
-	print(ProbeSetFreezeIds)
-
-cursor.close()
-con.close()
+import contextlib
+from argparse import ArgumentParser
+
+
+def run_qtl_reaper(cursor, genotypeDir, ProbeSetFreezeIds):
+    genotype_1 = reaper.Dataset()
+    #####get all of the genotypes
+    cursor.execute('select Id, Name from InbredSet')
+    results = cursor.fetchall()
+    InbredSets = {}
+    for item in results:
+            InbredSets[item[0]] = genotypeDir+str(item[1])+'.geno'
+
+    if ProbeSetFreezeIds:
+        #####convert the Ids to integer
+        ProbeSetFreezeIds=list(map(int, ProbeSetFreezeIds))
+    else:
+        #####get all of the dataset that need be updated
+        cursor.execute('select distinct(ProbeSetFreezeId) from ProbeSetXRef where pValue is NULL order by ProbeSetFreezeId desc')
+        results = cursor.fetchall()
+        ProbeSetFreezeIds = []
+        for item in results:
+            ProbeSetFreezeIds.append(item[0])
+
+    ####human dataset can NOT use this program calculate the LRS, ignore it
+    if ProbeSetFreezeIds.__contains__(215):
+        ProbeSetFreezeIds.remove(215)
+
+    #output_file = open ('/home/xzhou/work/DatabaseTools/cal_LRS_Additive_result.txt', 'w')
+
+    #####update
+    for ProbeSetFreezeId in ProbeSetFreezeIds:
+        cursor.execute("""
+            select InbredSetId
+            from ProbeFreeze, ProbeSetFreeze
+            where ProbeFreeze.Id=ProbeSetFreeze.ProbeFreezeId and ProbeSetFreeze.Id=%d
+        """%ProbeSetFreezeId);
+
+        InbredSetId = cursor.fetchone()[0]
+        if InbredSetId==3:
+            InbredSetId=1
+        #if InbredSetId==12:
+        #	InbredSetId=2
+
+        print((ProbeSetFreezeId, InbredSets[InbredSetId]))
+
+        genotype_1.read(InbredSets[InbredSetId])
+        locuses = []
+        for geno in genotype_1:
+            for locus in geno:
+                locuses.append(locus.name)
+
+        cursor.execute('select ProbeSetId, Locus, DataId from ProbeSetXRef where ProbeSetFreezeId=%s'%ProbeSetFreezeId)
+        ProbeSetXRefInfos = cursor.fetchall()
+
+        kj=0
+        for aProbeSetXRef in ProbeSetXRefInfos:
+            ProbeSetId, Locus, DataId = aProbeSetXRef
+            prgy = genotype_1.prgy
+
+            cursor.execute("select Strain.Name, ProbeSetData.value from Strain, ProbeSetData where Strain.Id = ProbeSetData.StrainId and ProbeSetData.Id = %d" % DataId)
+            results = cursor.fetchall()
+            if not results:
+                continue
+            _strains = []
+            _values = []
+            for item2 in results:
+                strain, value = item2
+                if strain in prgy:
+                    _strains.append(strain)
+                    _values.append(value)
+            if not _strains or not _values:
+                continue
+
+            if len(_strains) < 8:
+                continue
+            qtlresults = genotype_1.regression(strains = _strains, trait = _values)
+            _max = max(qtlresults)
+            _locus = _max.locus.name
+            _additive = _max.additive
+            _max = _max.lrs
+
+            #output_file.write('%s\t%s\t%s\t%s\t%s\n' % (ProbeSetFreezeId, ProbeSetId, _locus, _max, _additive))
+
+            # _max(LRS) maybe is infinite sometimes, so define it as a very big number
+            if _max == float('inf'):
+                _max = 10000
+
+            cursor.execute('update ProbeSetXRef set Locus=%s, LRS=%s, additive=%s where ProbeSetId=%s and ProbeSetFreezeId=%s',
+                           (_locus, _max, _additive, ProbeSetId, ProbeSetFreezeId))
+
+            kj += 1
+            if kj%1000==0:
+                print((ProbeSetFreezeId, InbredSets[InbredSetId], kj))
+
+
+        print(ProbeSetFreezeIds)
+
+
+@contextlib.contextmanager
+def dbconnection(db, user, passwd, host, port):
+    """Connect to the database in a contextmanager."""
+    conn = MySQLdb.Connect(db=db, user=user, passwd=passwd, host=host, port=port)
+    try:
+        yield conn
+    except MySQLdb.Error as _err:
+        conn.rollback()
+    finally:
+        conn.commit()
+        conn.close()
+
+
+def read_db_config(path):
+    with open(path, "r") as infile:
+        lines = tuple(line.strip() for line in infile.readlines())
+        return {
+            "user": lines[0],
+            "passwd": lines[1],
+            "host": lines[2],
+            "port": int(lines[3] or "3306"),
+            "db": lines[4]
+        }
+
+
+def main():
+    parser = ArgumentParser(prog="QTLReaper", description="Python-2 QTLReaper.")
+    parser.add_argument("db_config_file",
+                        type=str,
+                        default="dbconfig",
+                        help="File with database connection configuration")
+    parser.add_argument("genotype_dir",
+                        type=str,
+                        default="/gnshare/gn/web/genotypes/",
+                        help="Directory with the genotype CSV files.")
+    parser.add_argument("ProbeSetFreezeIds",
+                        nargs="*",
+                        help="The ProbeSetFreezeIds to act on.")
+    args = parser.parse_args()
+    with dbconnection(**read_db_config(args.db_config_file)) as conn:
+        run_qtl_reaper(conn.cursor(), args.genotype_dir, args.ProbeSetFreezeIds)
+
+if __name__ == "__main__":
+    main()