aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2017-01-26 16:26:16 +0000
committerzsloan2017-01-26 16:26:16 +0000
commite63c4014e7bc34b440707be19af3779b72102fdb (patch)
tree6692f7145db3b620a4e316f4d5289c6809ec9250
parent2fe052c10bc1e6468da277a6afbb51468e447c47 (diff)
downloadgenenetwork2-e63c4014e7bc34b440707be19af3779b72102fdb.tar.gz
GEMMA now works with CFW data (had to update where it looks for the input files and how it writes the phenotype file)
Y-axis for GEMMA now says -log(p) Updated the style of the trait sample data table in the trait page Updated dataset_select_menu_orig.js to also build just the Species and Group drop-downs for the trait input page (as opposed to all 4 drop-downs) Updated dataset menu json file Added option to show and hide columns to regular search page using colVis Changed regular and global search result table styles/column widths Began work on user trait submission code (not working yet though) Began work on static loading page for mapping results
-rw-r--r--wqflask/base/data_set.py22
-rw-r--r--wqflask/base/trait.py12
-rw-r--r--wqflask/utility/tools.py1
-rw-r--r--wqflask/wqflask/marker_regression/gemma_mapping.py51
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py37
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py5
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py7
-rw-r--r--wqflask/wqflask/static/new/css/main.css7
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json207
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_select_menu.js12
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js15
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css2
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js5
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js35
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css1
-rw-r--r--wqflask/wqflask/submit_trait.py24
-rw-r--r--wqflask/wqflask/templates/gsearch_gene.html90
-rw-r--r--wqflask/wqflask/templates/loading.html14
-rw-r--r--wqflask/wqflask/templates/search_result_page.html75
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html2
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html27
-rw-r--r--wqflask/wqflask/templates/submit_trait.html101
-rw-r--r--wqflask/wqflask/views.py57
23 files changed, 594 insertions, 215 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 06e02b02..94b38e13 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -44,7 +44,7 @@ from db import webqtlDatabaseFunction
from utility import webqtlUtil
from utility.benchmark import Bench
from utility import chunks
-from utility.tools import locate, locate_ignore_error
+from utility.tools import locate, locate_ignore_error, flat_files
from maintenance import get_group_samplelists
@@ -53,7 +53,7 @@ from pprint import pformat as pf
from db.gn_server import menu_main
from db.call import fetchall,fetchone,fetch1
-from utility.tools import USE_GN_SERVER, USE_REDIS
+from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists
from utility.logger import getLogger
logger = getLogger(__name__ )
@@ -226,7 +226,7 @@ class Markers(object):
class HumanMarkers(Markers):
def __init__(self, name, specified_markers = []):
- marker_data_fh = open(locate('genotype') + '/' + name + '.bim')
+ marker_data_fh = open(flat_files('mapping') + '/' + name + '.bim')
self.markers = []
for line in marker_data_fh:
splat = line.strip().split()
@@ -299,11 +299,21 @@ class DatasetGroup(object):
self.markers = HumanMarkers(self.name, markers)
def get_markers(self):
- #logger.debug("self.species is:", self.species)
- if self.species == "human":
+ logger.debug("self.species is:", self.species)
+
+ def check_plink_gemma():
+ if flat_file_exists("mapping"):
+ MAPPING_PATH = flat_files("mapping")+"/"
+ if (os.path.isfile(MAPPING_PATH+self.name+".bed") and
+ (os.path.isfile(MAPPING_PATH+self.name+".map") or
+ os.path.isfile(MAPPING_PATH+self.name+".bim"))):
+ return True
+ return False
+
+ if check_plink_gemma():
marker_class = HumanMarkers
else:
- marker_class = Markers
+ marker_class = Markers
self.markers = marker_class(self.name)
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index eb5b91c3..bf87e879 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -207,7 +207,7 @@ class GeneralTrait(object):
formatted = self.post_publication_description
else:
formatted = "Not available"
- return formatted.capitalize()
+ return formatted
@property
def alias_fmt(self):
@@ -379,7 +379,7 @@ def jsonable_table_row(trait, dataset_name, index):
additive = "N/A"
else:
additive = "%.3f" % round(float(trait.additive), 2)
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.symbol,
@@ -395,7 +395,7 @@ def jsonable_table_row(trait, dataset_name, index):
else:
additive = "%.2f" % round(float(trait.additive), 2)
if trait.pubmed_id:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -405,7 +405,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
else:
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.description_display,
@@ -415,7 +415,7 @@ def jsonable_table_row(trait, dataset_name, index):
trait.LRS_location_repr,
additive]
elif dataset.type == "Geno":
- return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
+ return ['<input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="' + user_manager.data_hmac('{}:{}'.format(str(trait.name), dataset.name)) + '">',
index,
'<a href="/show_trait?trait_id='+str(trait.name)+'&dataset='+dataset.name+'">'+str(trait.name)+'</a>',
trait.location_repr]
@@ -499,7 +499,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
for i, field in enumerate(dataset.display_fields):
holder = trait_info[i]
if isinstance(trait_info[i], basestring):
- holder = unicode(trait_info[i], "utf8", "ignore")
+ holder = unicode(trait_info[i], "utf-8", "ignore")
setattr(trait, field, holder)
if dataset.type == 'Publish':
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index df032e48..8db9ac6e 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -215,6 +215,7 @@ GENENETWORK_FILES = get_setting('GENENETWORK_FILES')
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = gemma_command()
+GEMMA_RESULTS_PATH = get_setting('GEMMA_RESULTS_PATH')
PLINK_COMMAND = plink_command()
TEMPDIR = tempdir() # defaults to UNIX TMPDIR
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index a56362ec..66bed5a2 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -1,7 +1,7 @@
-import os
+import os, math
from base import webqtlConfig
-from utility.tools import GEMMA_COMMAND
+from utility.tools import flat_files, GEMMA_COMMAND, GEMMA_RESULTS_PATH
def run_gemma(this_dataset, samples, vals):
"""Generates p-values for each marker using GEMMA"""
@@ -10,41 +10,62 @@ def run_gemma(this_dataset, samples, vals):
gen_pheno_txt_file(this_dataset, samples, vals)
- # Don't do this!
- # os.chdir("{}gemma".format(webqtlConfig.GENODIR))
-
# use GEMMA_RUN in the next one, create a unique temp file
- gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/output/%s.cXX.txt -lmm 1 -o %s_output' % (GEMMA_PATH,
+ gemma_command = GEMMA_COMMAND + ' -bfile %s/%s -k %s/%s.sXX.txt -lmm 1 -outdir %s/output -o %s_output' % (flat_files('mapping'),
this_dataset.group.name,
- GEMMA_PATH,
+ flat_files('mapping'),
this_dataset.group.name,
+ GEMMA_RESULTS_PATH,
this_dataset.group.name)
print("gemma_command:" + gemma_command)
os.system(gemma_command)
- included_markers, p_values = parse_gemma_output(this_dataset)
+ marker_obs = parse_gemma_output(this_dataset)
- return included_markers, p_values
+ return marker_obs
def gen_pheno_txt_file(this_dataset, samples, vals):
"""Generates phenotype file for GEMMA"""
- with open("{}/{}.fam".format(GEMMA_PATH, this_dataset.group.name), "w") as outfile:
- for i, sample in enumerate(samples):
- outfile.write(str(sample) + " " + str(sample) + " 0 0 0 " + str(vals[i]) + "\n")
+ current_file_data = []
+ with open("{}/{}.fam".format(flat_files('mapping'), this_dataset.group.name), "r") as outfile:
+ for i, line in enumerate(outfile):
+ split_line = line.split()
+ current_file_data.append(split_line)
+
+ with open("{}/{}.fam".format(flat_files('mapping'), this_dataset.group.name), "w") as outfile:
+ for i, line in enumerate(current_file_data):
+ if vals[i] == "x":
+ this_val = -9
+ else:
+ this_val = vals[i]
+ outfile.write(line[0] + " " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n")
def parse_gemma_output(this_dataset):
included_markers = []
p_values = []
- with open("{}/output/{}_output.assoc.txt".format(GEMMA_PATH, this_dataset.group.name)) as output_file:
+ marker_obs = []
+ with open("{}/output/{}_output.assoc.txt".format(GEMMA_RESULTS_PATH, this_dataset.group.name)) as output_file:
for line in output_file:
if line.startswith("chr"):
continue
else:
+ marker = {}
+ marker['name'] = line.split("\t")[1]
+ marker['chr'] = int(line.split("\t")[0])
+ marker['Mb'] = float(line.split("\t")[2]) / 1000000
+ marker['p_value'] = float(line.split("\t")[10])
+ if math.isnan(marker['p_value']) or (marker['p_value'] <= 0):
+ marker['lod_score'] = 0
+ #marker['lrs_value'] = 0
+ else:
+ marker['lod_score'] = -math.log10(marker['p_value'])
+ #marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61
+ marker_obs.append(marker)
+
included_markers.append(line.split("\t")[1])
p_values.append(float(line.split("\t")[10]))
- #print("p_values: ", p_values)
- return included_markers, p_values
+ return marker_obs
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index d9dbd0da..b1d2f811 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -37,7 +37,7 @@ from utility import temp_data
from utility.benchmark import Bench
from wqflask.marker_regression import gemma_mapping, rqtl_mapping, qtlreaper_mapping, plink_mapping
-from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND, TEMPDIR
+from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, GEMMA_RESULTS_PATH, PLINK_COMMAND, TEMPDIR
from utility.external import shell
from base.webqtlConfig import TMPDIR, GENERATED_TEXT_DIR
@@ -140,7 +140,6 @@ class MarkerRegression(object):
except:
self.num_perm = 0
- self.LRSCheck = self.score_type
if self.num_perm > 0:
self.permCheck = "ON"
else:
@@ -151,12 +150,10 @@ class MarkerRegression(object):
self.dataset.group.get_markers()
if self.mapping_method == "gemma":
- self.score_type = "LOD"
+ self.score_type = "-log(p)"
self.manhattan_plot = True
with Bench("Running GEMMA"):
- included_markers, p_values = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals)
- with Bench("Getting markers from csv"):
- marker_obs = get_markers_from_csv(included_markers, p_values, self.dataset.group.name)
+ marker_obs = gemma_mapping.run_gemma(self.dataset, self.samples, self.vals)
results = marker_obs
elif self.mapping_method == "rqtl_plink":
results = self.run_rqtl_plink()
@@ -511,8 +508,7 @@ class MarkerRegression(object):
logger.debug("Before creating the command")
- command = PYLMM_COMMAND+' --key {} --species {}'.format(key,
- "human")
+ command = PYLMM_COMMAND+' --key {} --species {}'.format(key, "human")
logger.debug("command is:", command)
@@ -610,30 +606,5 @@ def trim_markers_for_table(markers):
return sorted_markers
-def get_markers_from_csv(included_markers, p_values, group_name):
- marker_data_fh = open(os.path.join(webqtlConfig.PYLMM_PATH + group_name + '_markers.csv'))
- markers = []
- for marker_name, p_value in itertools.izip(included_markers, p_values):
- if not p_value or len(included_markers) < 1:
- continue
- for line in marker_data_fh:
- splat = line.strip().split()
- if splat[0] == marker_name:
- marker = {}
- marker['name'] = splat[0]
- marker['chr'] = int(splat[1])
- marker['Mb'] = float(splat[2])
- marker['p_value'] = p_value
- if math.isnan(marker['p_value']) or (marker['p_value'] <= 0):
- marker['lod_score'] = 0
- marker['lrs_value'] = 0
- else:
- marker['lod_score'] = -math.log10(marker['p_value'])
- marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61
- markers.append(marker)
- break
-
- return markers
-
if __name__ == '__main__':
import cPickle as pickle
diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
index bc147f75..9ff431a2 100644
--- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py
+++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
@@ -292,7 +292,10 @@ class MarkerRegression(object):
self.graphHeight = self.GRAPH_DEFAULT_HEIGHT
self.dominanceChecked = False
- self.LRS_LOD = start_vars['LRSCheck']
+ if 'LRSCheck' in start_vars.keys():
+ self.LRS_LOD = start_vars['LRSCheck']
+ else:
+ self.LRS_LOD = start_vars['score_type']
self.cutoff = start_vars['cutoff']
self.intervalAnalystChecked = True
self.draw2X = False
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 091db50f..13ae933f 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -167,7 +167,8 @@ class ShowTrait(object):
if flat_file_exists("mapping"):
MAPPING_PATH = flat_files("mapping")+"/"
if (os.path.isfile(MAPPING_PATH+self.dataset.group.name+".bed") and
- os.path.isfile(MAPPING_PATH+self.dataset.group.name+".map")):
+ (os.path.isfile(MAPPING_PATH+self.dataset.group.name+".map") or
+ os.path.isfile(MAPPING_PATH+self.dataset.group.name+".bim"))):
return True
return False
@@ -729,7 +730,7 @@ class ShowTrait(object):
def make_sample_lists(self, this_trait):
all_samples_ordered = self.dataset.group.all_samples_ordered()
-
+
primary_sample_names = list(all_samples_ordered)
other_sample_names = []
@@ -813,7 +814,7 @@ def get_genofiles(this_trait):
return jsondata['genofile']
def get_trait_table_width(sample_groups):
- table_width = 35
+ table_width = 30
if sample_groups[0].se_exists():
table_width += 10
if (table_width + len(sample_groups[0].attributes)*10) > 100:
diff --git a/wqflask/wqflask/static/new/css/main.css b/wqflask/wqflask/static/new/css/main.css
index 017bbdb8..880395a7 100644
--- a/wqflask/wqflask/static/new/css/main.css
+++ b/wqflask/wqflask/static/new/css/main.css
@@ -2,3 +2,10 @@
padding-left: 30px;
padding-right: 30px;
}
+
+ol {
+ font-family: Arial;
+ font-weight: bold;
+ font-size: 16px;
+ color: #000082
+} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index 2f332a4a..06586372 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -1340,14 +1340,14 @@
"GSE9588 Human Liver Normal (Mar11) Both Sexes"
],
[
- "384",
- "HLCF_0311",
- "GSE9588 Human Liver Normal (Mar11) Females"
- ],
- [
"383",
"HLCM_0311",
"GSE9588 Human Liver Normal (Mar11) Males"
+ ],
+ [
+ "384",
+ "HLCF_0311",
+ "GSE9588 Human Liver Normal (Mar11) Females"
]
],
"Phenotypes": [
@@ -1621,11 +1621,6 @@
"B6D2F2": {
"Brain mRNA": [
[
- "77",
- "BRF2_M_0805_R",
- "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
- ],
- [
"76",
"BRF2_M_0805_M",
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5"
@@ -1636,6 +1631,11 @@
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
],
[
+ "77",
+ "BRF2_M_0805_R",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
+ ],
+ [
"33",
"BRF2_M_0304_P",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN"
@@ -1727,11 +1727,6 @@
],
"Striatum mRNA": [
[
- "85",
- "SA_M2_0905_P",
- "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN"
- ],
- [
"84",
"SA_M2_0905_R",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA"
@@ -1740,22 +1735,27 @@
"83",
"SA_M2_0905_M",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
+ ],
+ [
+ "85",
+ "SA_M2_0905_P",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN"
]
]
},
"BHF2": {
"Adipose mRNA": [
[
- "197",
- "UCLA_BHF2_ADIPOSE_FEMALE",
- "UCLA BHF2 Adipose Female mlratio"
- ],
- [
"196",
"UCLA_BHF2_ADIPOSE_MALE",
"UCLA BHF2 Adipose Male mlratio"
],
[
+ "197",
+ "UCLA_BHF2_ADIPOSE_FEMALE",
+ "UCLA BHF2 Adipose Female mlratio"
+ ],
+ [
"165",
"UCLA_BHF2_ADIPOSE_0605",
"UCLA BHF2 Adipose (June05) mlratio"
@@ -1763,16 +1763,16 @@
],
"Brain mRNA": [
[
- "199",
- "UCLA_BHF2_BRAIN_FEMALE",
- "UCLA BHF2 Brain Female mlratio"
- ],
- [
"198",
"UCLA_BHF2_BRAIN_MALE",
"UCLA BHF2 Brain Male mlratio"
],
[
+ "199",
+ "UCLA_BHF2_BRAIN_FEMALE",
+ "UCLA BHF2 Brain Female mlratio"
+ ],
+ [
"166",
"UCLA_BHF2_BRAIN_0605",
"UCLA BHF2 Brain (June05) mlratio"
@@ -1787,16 +1787,16 @@
],
"Liver mRNA": [
[
- "201",
- "UCLA_BHF2_LIVER_FEMALE",
- "UCLA BHF2 Liver Female mlratio"
- ],
- [
"200",
"UCLA_BHF2_LIVER_MALE",
"UCLA BHF2 Liver Male mlratio"
],
[
+ "201",
+ "UCLA_BHF2_LIVER_FEMALE",
+ "UCLA BHF2 Liver Female mlratio"
+ ],
+ [
"167",
"UCLA_BHF2_LIVER_0605",
"UCLA BHF2 Liver (June05) mlratio"
@@ -2000,11 +2000,6 @@
"UTHSC Brain mRNA U74Av2 (Nov05) PDNN"
],
[
- "81",
- "BR_U_0805_P",
- "UTHSC Brain mRNA U74Av2 (Aug05) PDNN"
- ],
- [
"80",
"BR_U_0805_M",
"UTHSC Brain mRNA U74Av2 (Aug05) MAS5"
@@ -2015,6 +2010,11 @@
"UTHSC Brain mRNA U74Av2 (Aug05) RMA"
],
[
+ "81",
+ "BR_U_0805_P",
+ "UTHSC Brain mRNA U74Av2 (Aug05) PDNN"
+ ],
+ [
"42",
"CB_M_0204_P",
"INIA Brain mRNA M430 (Feb04) PDNN"
@@ -2081,11 +2081,6 @@
"Eye M430v2 WT Gpnmb (Sep08) RMA"
],
[
- "279",
- "Eye_M2_0908_R_WT",
- "Eye M430v2 WT Tyrp1 (Sep08) RMA"
- ],
- [
"278",
"Eye_M2_0908_R_MT",
"Eye M430v2 Mutant Tyrp1 (Sep08) RMA"
@@ -2096,6 +2091,11 @@
"Eye M430v2 WT WT (Sep08) RMA"
],
[
+ "279",
+ "Eye_M2_0908_R_WT",
+ "Eye M430v2 WT Tyrp1 (Sep08) RMA"
+ ],
+ [
"400",
"DBA2J-ONH-1212",
"Howell et al. 2011, DBA/2J Glaucoma Optic Nerve Head M430 2.0 (Dec12) RMA"
@@ -2332,16 +2332,16 @@
],
"Kidney mRNA": [
[
- "239",
- "MA_M2F_0706_R",
- "Mouse kidney M430v2 Female (Aug06) RMA"
- ],
- [
"240",
"MA_M2M_0706_R",
"Mouse kidney M430v2 Male (Aug06) RMA"
],
[
+ "239",
+ "MA_M2F_0706_R",
+ "Mouse kidney M430v2 Female (Aug06) RMA"
+ ],
+ [
"118",
"MA_M2_0806_R",
"Mouse kidney M430v2 Sex Balanced (Aug06) RMA"
@@ -2546,14 +2546,14 @@
"HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv"
],
[
- "275",
- "DevNeocortex_ILM6.2P14RInv_1110",
- "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv"
- ],
- [
"274",
"DevNeocortex_ILM6.2P3RInv_1110",
"BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv"
+ ],
+ [
+ "275",
+ "DevNeocortex_ILM6.2P14RInv_1110",
+ "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv"
]
],
"Nucleus Accumbens mRNA": [
@@ -2761,11 +2761,6 @@
],
"Ventral Tegmental Area mRNA": [
[
- "230",
- "VCUEtvsSal_0609_R",
- "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA"
- ],
- [
"229",
"VCUEtOH_0609_R",
"VCU BXD VTA EtOH M430 2.0 (Jun09) RMA"
@@ -2774,6 +2769,11 @@
"228",
"VCUSal_0609_R",
"VCU BXD VTA Sal M430 2.0 (Jun09) RMA"
+ ],
+ [
+ "230",
+ "VCUEtvsSal_0609_R",
+ "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA"
]
]
},
@@ -2849,6 +2849,36 @@
]
]
},
+ "CFW": {
+ "Hippocampus mRNA": [
+ [
+ "808",
+ "UCSD_CFW_HIP_RNA-Seq_0117",
+ "UCSD CFW Hippocampus (Jan17) RNA-Seq"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "None",
+ "CFWPublish",
+ "CFW Published Phenotypes"
+ ]
+ ],
+ "Prefrontal Cortex mRNA": [
+ [
+ "810",
+ "UCSD_CFW_PFC_RNA-Seq_0117",
+ "UCSD CFW Prefrontal Cortex (Jan17) RNA-Seq"
+ ]
+ ],
+ "Striatum mRNA": [
+ [
+ "809",
+ "UCSD_CFW_SPL_RNA-Seq_0117",
+ "UCSD CFW Striatum (Jan17) RNA-Seq"
+ ]
+ ]
+ },
"CIE-INIA": {
"LCM Brain Regions mRNA": [
[
@@ -3052,11 +3082,6 @@
],
"Hippocampus mRNA": [
[
- "213",
- "Illum_LXS_Hipp_NOS_1008",
- "Hippocampus Illumina NOS (Oct08) RankInv beta"
- ],
- [
"219",
"Illum_LXS_Hipp_NON_1008",
"Hippocampus Illumina NON (Oct08) RankInv beta"
@@ -3077,6 +3102,11 @@
"Hippocampus Illumina RSS (Oct08) RankInv beta"
],
[
+ "213",
+ "Illum_LXS_Hipp_NOS_1008",
+ "Hippocampus Illumina NOS (Oct08) RankInv beta"
+ ],
+ [
"143",
"Illum_LXS_Hipp_loess0807",
"Hippocampus Illumina (Aug07) LOESS"
@@ -3246,6 +3276,17 @@
},
"Scripps-2013": {}
},
+ "poplar": {
+ "Poplar": {
+ "Phenotypes": [
+ [
+ "649",
+ "PoplarPublish",
+ "Poplar Published Phenotypes"
+ ]
+ ]
+ }
+ },
"rat": {
"HSNIH-Palmer": {
"Phenotypes": [
@@ -3555,6 +3596,10 @@
"Reduced Complexity Cross (B6JxB6N F2)"
],
[
+ "CFW",
+ "CFW Outbred GWAS"
+ ],
+ [
"CIE-INIA",
"Chronic Intermittent Ethanol"
],
@@ -3603,6 +3648,12 @@
"SOTNOT-OHSU"
]
],
+ "poplar": [
+ [
+ "Poplar",
+ "Poplar"
+ ]
+ ],
"rat": [
[
"HSNIH-Palmer",
@@ -3641,15 +3692,15 @@
"species": [
[
"human",
- "Human"
+ "Human (hg19)"
],
[
"mouse",
- "Mouse"
+ "Mouse (mm10)"
],
[
"rat",
- "Rat"
+ "Rat (rn3)"
],
[
"drosophila",
@@ -3664,6 +3715,10 @@
"Barley"
],
[
+ "poplar",
+ "Poplar"
+ ],
+ [
"soybean",
"Soybean"
],
@@ -4682,6 +4737,24 @@
"Genotypes"
]
],
+ "CFW": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Hippocampus mRNA",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Prefrontal Cortex mRNA",
+ "Prefrontal Cortex mRNA"
+ ],
+ [
+ "Striatum mRNA",
+ "Striatum mRNA"
+ ]
+ ],
"CIE-INIA": [
[
"Phenotypes",
@@ -4842,6 +4915,14 @@
],
"Scripps-2013": []
},
+ "poplar": {
+ "Poplar": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ]
+ ]
+ },
"rat": {
"HSNIH-Palmer": [
[
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
index 43b0960c..9ad38102 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js
@@ -1,10 +1,10 @@
$(function() {
- var gndata; // loaded once for all to use
- process_json = function(data) {
- populate_species();
- return apply_default();
- };
- $.getJSON(gn_server_url+"/int/menu/main.json",
+ var gndata; // loaded once for all to use
+ process_json = function(data) {
+ populate_species();
+ return apply_default();
+ };
+ $.getJSON(gn_server_url+"int/menu/main.json",
function(data) {
gndata = data;
console.log("***** GOT DATA from GN_SERVER ****");
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
index 1fe4cf75..fd96eb78 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
@@ -4,7 +4,9 @@ $(function() {
process_json = function(data) {
window.jdata = data;
populate_species();
- return apply_default();
+ if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option)
+ return apply_default();
+ }
};
$.ajax('/static/new/javascript/dataset_menu_structure.json', {
dataType: 'json',
@@ -23,7 +25,9 @@ $(function() {
species = $('#species').val();
group_list = this.jdata.groups[species];
redo_dropdown($('#group'), group_list);
- return populate_type();
+ if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option)
+ return populate_type();
+ }
};
window.populate_group = populate_group;
populate_type = function() {
@@ -70,7 +74,12 @@ $(function() {
})(this));
$('#group').change((function(_this) {
return function() {
- return populate_type();
+ if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option)
+ return populate_type();
+ }
+ else {
+ return false
+ }
};
})(this));
$('#type').change((function(_this) {
diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
index 6e0e7348..87f602dc 100644
--- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
+++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
@@ -81,7 +81,7 @@ table.dataTable tbody tr.selected {
table.dataTable tbody th,
table.dataTable tbody td {
font: 12px Arial, Sans-serif;
- padding: 4px 5px;
+ padding: 4px 5px 4px 0px;
}
table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
border-top: 1px solid #ddd;
diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js b/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js
new file mode 100644
index 00000000..072d6c9a
--- /dev/null
+++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/buttons.colVis.min.js
@@ -0,0 +1,5 @@
+(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(d){return g(d,window,document)}):"object"===typeof exports?module.exports=function(d,e){d||(d=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(d,e).$;e.fn.dataTable.Buttons||require("datatables.net-buttons")(d,e);return g(e,d,d.document)}:g(jQuery,window,document)})(function(g,d,e,h){d=g.fn.dataTable;g.extend(d.ext.buttons,{colvis:function(a,b){return{extend:"collection",
+text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:b.columns}]}},columnsToggle:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnToggle",columns:a}}).toArray()},columnToggle:function(a,b){return{extend:"columnVisibility",columns:b.columns}},columnsVisibility:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnVisibility",columns:a,visibility:b.visibility}}).toArray()},
+columnVisibility:{columns:h,text:function(a,b,c){return c._columnText(a,c.columns)},className:"buttons-columnVisibility",action:function(a,b,c,f){a=b.columns(f.columns);b=a.visible();a.visible(f.visibility!==h?f.visibility:!(b.length&&b[0]))},init:function(a,b,c){var f=this;a.on("column-visibility.dt"+c.namespace,function(b,d){d.bDestroying||f.active(a.column(c.columns).visible())}).on("column-reorder.dt"+c.namespace,function(b,d,e){1===a.columns(c.columns).count()&&("number"===typeof c.columns&&
+(c.columns=e.mapping[c.columns]),b=a.column(c.columns),f.text(c._columnText(a,c.columns)),f.active(b.visible()))});this.active(a.column(c.columns).visible())},destroy:function(a,b,c){a.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(a,b){var c=a.column(b).index();return a.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"")}},colvisRestore:{className:"buttons-colvisRestore",text:function(a){return a.i18n("buttons.colvisRestore",
+"Restore visibility")},init:function(a,b,c){c._visOriginal=a.columns().indexes().map(function(b){return a.column(b).visible()}).toArray()},action:function(a,b,c,d){b.columns().every(function(a){a=b.colReorder&&b.colReorder.transpose?b.colReorder.transpose(a,"toOriginal"):a;this.visible(d._visOriginal[a])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(a,b,c,d){b.columns(d.show).visible(!0,!1);b.columns(d.hide).visible(!1,!1);b.columns.adjust()},show:[],hide:[]}});return d.Buttons}); \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js
new file mode 100644
index 00000000..ae3fb9c8
--- /dev/null
+++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.buttons.min.js
@@ -0,0 +1,35 @@
+/*!
+ Buttons for DataTables 1.2.4
+ Š2016 SpryMedia Ltd - datatables.net/license
+*/
+(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return d(n,window,document)}):"object"===typeof exports?module.exports=function(n,o){n||(n=window);if(!o||!o.fn.dataTable)o=require("datatables.net")(n,o).$;return d(o,n,n.document)}:d(jQuery,window,document)})(function(d,n,o,m){var i=d.fn.dataTable,u=0,v=0,j=i.ext.buttons,l=function(a,b){!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},l.defaults,b);b.buttons&&(this.c.buttons=b.buttons);
+this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+u++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(l.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===m)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.button.active,c=d(c.node);if(b===m)return c.hasClass(e);c.toggleClass(e,b===m?!0:b);return this},add:function(a,b){var c=
+this.s.buttons;if("string"===typeof b){for(var e=b.split("-"),c=this.s,d=0,h=e.length-1;d<h;d++)c=c.buttons[1*e[d]];c=c.buttons;b=1*e[e.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b,c;b=0;for(c=a.length;b<c;b++)this.remove(a[b].node);this.dom.container.remove();
+a=this.s.dt.settings()[0];b=0;for(c=a.length;b<c;b++)if(a.inst===this){a.splice(b,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);var c=this._nodeToButton(a);d(c.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){a=this._nodeToButton(a);return d(a.node)},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var g=b.buttons.length-1;0<=g;g--)this.remove(b.buttons[g].node);
+b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.collection.buttonLiner,e=c.inCollection&&e&&e.tag?e.tag:this.c.dom.buttonLiner.tag,g=this.s.dt,h=d(c.node),f=function(a){return"function"===typeof a?a(g,h,c.conf):a};if(b===m)return f(c.conf.text);c.conf.text=b;e?h.children(e).html(f(b)):h.html(f(b));return this},_constructor:function(){var a=
+this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var c=0,g=e.length;c<g;c++)this.add(e[c]);b.on("destroy",function(){a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!o.activeElement||o.activeElement===o.body){var c=String.fromCharCode(b.keyCode).toLowerCase();a.s.listenKeys.toLowerCase().indexOf(c)!==-1&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:
+a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,e=b.length;c<e;c++)a.append(b[c].inserter),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){for(var g=this.s.dt,h=0,b=!d.isArray(b)?[b]:b,f=0,r=b.length;f<r;f++){var k=this._resolveExtends(b[f]);if(k)if(d.isArray(k))this._expandButton(a,k,c,e);else{var p=this._buildButton(k,c);if(p){e!==m?(a.splice(e,0,p),e++):a.push(p);if(p.conf.buttons){var s=
+this.c.dom.collection;p.collection=d("<"+s.tag+"/>").addClass(s.className);p.conf._collection=p.collection;this._expandButton(p.buttons,p.conf.buttons,!0,e)}k.init&&k.init.call(g.button(p.node),g,d(p.node),k);h++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,g=this.c.dom.collection,h=this.s.dt,f=function(b){return"function"===typeof b?b(h,k,a):b};b&&g.button&&(c=g.button);b&&g.buttonLiner&&(e=g.buttonLiner);if(a.available&&!a.available(h,a))return!1;var r=function(a,
+b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,e])},k=d("<"+c.tag+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a);k.blur()}).on("keyup.dtb",function(b){b.keyCode===13&&!k.hasClass(c.disabled)&&a.action&&r(b,h,k,a)});"a"===c.tag.toLowerCase()&&k.attr("href","#");
+e.tag?(g=d("<"+e.tag+"/>").html(f(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&g.attr("href","#"),k.append(g)):k.html(f(a.text));!1===a.enabled&&k.addClass(c.disabled);a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",a.titleAttr);a.namespace||(a.namespace=".dt-button-"+v++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(k):k;this._addKey(a);return{conf:a,node:k.get(0),inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,
+b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<e;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var d=this._nodeToButton(a,b[c].buttons);if(d)return d}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<e;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var d=this._nodeToHost(a,b[c].buttons);if(d)return d}}},_keypress:function(a,b){var c=function(e){for(var g=0,h=e.length;g<h;g++){var f=e[g].conf,r=e[g].node;if(f.key)if(f.key===a)d(r).click();else if(d.isPlainObject(f.key)&&
+f.key.key===a&&(!f.key.shiftKey||b.shiftKey))if(!f.key.altKey||b.altKey)if(!f.key.ctrlKey||b.ctrlKey)(!f.key.metaKey||b.metaKey)&&d(r).click();e[g].buttons.length&&c(e[g].buttons)}};c(this.s.buttons)},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key,a=this.s.listenKeys.split(""),b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){for(var b=this.s.dt,c,e,g=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===m)return;
+if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!j[c])throw"Unknown button type: "+c;c=j[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)},a=g(a);a&&a.extend;){if(!j[a.extend])throw"Cannot extend unknown button type: "+a.extend;var h=g(j[a.extend]);if(d.isArray(h))return h;if(!h)return!1;c=h.className;a=d.extend({},h,a);c&&a.className!==c&&(a.className=c+" "+a.className);var f=a.postfixButtons;if(f){a.buttons||(a.buttons=[]);
+c=0;for(e=f.length;c<e;c++)a.buttons.push(f[c]);a.postfixButtons=null}if(f=a.prefixButtons){a.buttons||(a.buttons=[]);c=0;for(e=f.length;c<e;c++)a.buttons.splice(c,0,f[c]);a.prefixButtons=null}a.extend=h.extend}return a}});l.background=function(a,b,c){c===m&&(c=400);a?d("<div/>").addClass(b).css("display","none").appendTo("body").fadeIn(c):d("body > div."+b).fadeOut(c,function(){d(this).removeClass(b).remove()})};l.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=
+[],e=d.map(b,function(a){return a.name}),g=function(a){if(d.isArray(a))for(var f=0,r=a.length;f<r;f++)g(a[f]);else"string"===typeof a?-1!==a.indexOf(",")?g(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};g(a);return c};l.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,g,f=0,h=b.length;f<h;f++)if(d=b[f])g=c!==m?c+f:f+"",a.push({node:d.node,name:d.conf.name,idx:g}),d.buttons&&e(a,d.buttons,g+"-")},g=function(a,b){var f,
+h,i=[];e(i,b.s.buttons);f=d.map(i,function(a){return a.node});if(d.isArray(a)||a instanceof d){f=0;for(h=a.length;f<h;f++)g(a[f],b)}else if(null===a||a===m||"*"===a){f=0;for(h=i.length;f<h;f++)c.push({inst:b,node:i[f].node})}else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(",")){i=a.split(",");f=0;for(h=i.length;f<h;f++)g(d.trim(i[f]),b)}else if(a.match(/^\d+(\-\d+)*$/))f=d.map(i,function(a){return a.idx}),c.push({inst:b,node:i[d.inArray(a,
+f)].node});else if(-1!==a.indexOf(":name")){var j=a.replace(":name","");f=0;for(h=i.length;f<h;f++)i[f].name===j&&c.push({inst:b,node:i[f].node})}else d(f).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(i=d.inArray(a,f),-1!==i&&c.push({inst:b,node:f[i]}))},h=0,f=a.length;h<f;h++)g(b,a[h]);return c};l.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},
+button:{tag:"a",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};l.version="1.2.4";d.extend(j,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",action:function(a,b,c,e){var a=c.offset(),g=d(b.table().container()),h=!1;d("div.dt-button-background").length&&(h=d(".dt-button-collection").offset(),d("body").trigger("click.dtb-collection"));e._collection.addClass(e.collectionLayout).css("display",
+"none").appendTo("body").fadeIn(e.fade);var f=e._collection.css("position");h&&"absolute"===f?e._collection.css({top:h.top,left:h.left}):"absolute"===f?(e._collection.css({top:a.top+c.outerHeight(),left:a.left}),c=a.left+e._collection.outerWidth(),g=g.offset().left+g.width(),c>g&&e._collection.css("left",a.left-(c-g))):(a=e._collection.height()/2,a>d(n).height()/2&&(a=d(n).height()/2),e._collection.css("marginTop",-1*a));e.background&&l.background(!0,e.backgroundClassName,e.fade);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",
+function(){});d("body").on("click.dtb-collection",function(a){var c=d.fn.addBack?"addBack":"andSelf";if(!d(a.target).parents()[c]().filter(e._collection).length){e._collection.fadeOut(e.fade,function(){e._collection.detach()});d("div.dt-button-background").off("click.dtb-collection");l.background(false,e.backgroundClassName,e.fade);d("body").off("click.dtb-collection");b.off("buttons-action.b-internal")}})},10);if(e.autoClose)b.on("buttons-action.b-internal",function(){d("div.dt-button-background").click()})},
+background:!0,collectionLayout:"",backgroundClassName:"dt-button-background",autoClose:!1,fade:400},copy:function(a,b){if(j.copyHtml5)return"copyHtml5";if(j.copyFlash&&j.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(j.csvHtml5&&j.csvHtml5.available(a,b))return"csvHtml5";if(j.csvFlash&&j.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(j.excelHtml5&&j.excelHtml5.available(a,b))return"excelHtml5";if(j.excelFlash&&j.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,
+b){if(j.pdfHtml5&&j.pdfHtml5.available(a,b))return"pdfHtml5";if(j.pdfFlash&&j.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=d.isArray(a[0])?a[0]:a,c=d.isArray(a[0])?a[1]:a,e=function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())};return{extend:"collection",text:e,className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,
+c){c.page.len(a).draw()},init:function(b,c,e){var d=this,c=function(){d.active(b.page.len()===a)};b.on("length.dt"+e.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(e(a))})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",function(a,b){b===m&&(b=a,a=m);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return l.buttonSelector(l.instanceSelector(a,
+c._buttons),b)},!0);c._groupSelector=a;return c});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1<c.length&&c.splice(1,c.length);return c});i.Api.registerPlural("buttons().active()","button().active()",function(a){return a===m?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});i.Api.registerPlural("buttons().action()","button().action()",function(a){return a===m?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,
+a)})});i.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});i.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});i.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});i.Api.registerPlural("buttons().text()","button().text()",function(a){return a===m?this.map(function(a){return a.inst.text(a.node)}):
+this.each(function(b){b.inst.text(b.node,a)})});i.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});i.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons)for(var c=l.instanceSelector(b,c._buttons),d=0,g=c.length;d<g;d++)a=a.add(c[d].container())});return a});i.Api.register("button().add()",function(a,
+b){var c=this.context;c.length&&(c=l.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});i.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});i.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var q;i.Api.register("buttons.info()",function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),
+clearTimeout(q),q=null,this;q&&clearTimeout(q);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a?"<h2>"+a+"</h2>":"").append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==m&&0!==c&&(q=setTimeout(function(){e.buttons.info(!1)},c));return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){for(var b=new i.Api(this.context[0]),
+c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}}},a),e=function(a){if("string"!==typeof a)return a;c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(t.innerHTML=a,a=t.value);return a},a=b.columns(c.columns).indexes().map(function(a){var d=
+b.column(a).header();return c.format.header(d.innerHTML,a,d)}).toArray(),g=b.table().footer()?b.columns(c.columns).indexes().map(function(a){var d=b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a,d)}).toArray():null,h=b.rows(c.rows,c.modifier).indexes().toArray(),f=b.cells(h,c.columns),h=f.render(c.orthogonal).toArray(),f=f.nodes().toArray(),j=a.length,k=0<j?h.length/j:0,l=Array(k),m=0,n=0;n<k;n++){for(var o=Array(j),q=0;q<j;q++)o[q]=c.format.body(h[m],n,q,f[m]),m++;l[n]=o}return{header:a,
+footer:g,body:l}}});var t=d("<textarea/>")[0];d.fn.dataTable.Buttons=l;d.fn.DataTable.Buttons=l;d(o).on("init.dt plugin-init.dt",function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new l(b,c)).container()}});i.ext.feature.push({fnInit:function(a){var a=new i.Api(a),b=a.init().buttons||i.defaults.buttons;return(new l(a,b)).container()},cFeature:"B"});return l}); \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css b/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css
new file mode 100644
index 00000000..284cb376
--- /dev/null
+++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/scroller.dataTables.min.css
@@ -0,0 +1 @@
+div.DTS{display:block !important}div.DTS tbody th,div.DTS tbody td{white-space:nowrap}div.DTS div.DTS_Loading{z-index:1}div.DTS div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px)}div.DTS div.dataTables_scrollBody table{z-index:2}div.DTS div.dataTables_paginate,div.DTS div.dataTables_length{display:none} \ No newline at end of file
diff --git a/wqflask/wqflask/submit_trait.py b/wqflask/wqflask/submit_trait.py
new file mode 100644
index 00000000..4ab9a4be
--- /dev/null
+++ b/wqflask/wqflask/submit_trait.py
@@ -0,0 +1,24 @@
+from __future__ import print_function, division
+
+from flask import Flask, g
+
+from pprint import pformat as pf
+
+def get_species_groups():
+
+ species_query = "SELECT SpeciesId, MenuName FROM Species"
+
+ species_ids_and_names = g.db.execute(species_query).fetchall()
+
+
+ species_and_groups = []
+ for species_id, species_name in species_ids_and_names:
+ this_species_groups = {}
+ this_species_groups['species'] = species_name
+ groups_query = "SELECT InbredSetName FROM InbredSet WHERE SpeciesId = %s" % (species_id)
+ groups = [group[0] for group in g.db.execute(groups_query).fetchall()]
+
+ this_species_groups['groups'] = groups
+ species_and_groups.append(this_species_groups)
+
+ return species_and_groups \ No newline at end of file
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html
index 097d0d2c..205d5801 100644
--- a/wqflask/wqflask/templates/gsearch_gene.html
+++ b/wqflask/wqflask/templates/gsearch_gene.html
@@ -9,7 +9,7 @@
<div class="container">
<p>You searched for {{ terms }}.</p>
- <p>To study a record, click on its ID below.<br />Check records below and click Add button to add to selection.</p>
+ <p>To study a record, click on its Record ID below.<br />Check records below and click Add button to add to selection.</p>
<div>
<br />
@@ -27,36 +27,36 @@
<button class="btn btn-default" id="export_traits">Download CSV</button>
</form>
<br />
- <div style="width: 2000px; background-color: #eeeeee; border: 1px solid black;">
- <table width="2000px" id="trait_table" class="table table-hover table-striped" >
+ <div style="width: 2000px;">
+ <table width="2000px" id="trait_table" class="table table-hover table-striped nowrap" style="float: left;">
<thead>
<tr>
- <th style="background-color: #eeeeee;"></th>
- <th data-export="Index" style="background-color: #eeeeee;">Index</th>
- <th data-export="Species" style="background-color: #eeeeee;">Species</th>
- <th data-export="Group" style="background-color: #eeeeee;">Group</th>
- <th data-export="Tissue" style="background-color: #eeeeee;">Tissue</th>
- <th data-export="Dataset" style="background-color: #eeeeee;">Dataset</th>
- <th data-export="Record" style="background-color: #eeeeee;">Record</th>
- <th data-export="Symbol" style="background-color: #eeeeee;">Symbol</th>
- <th data-export="Description" style="background-color: #eeeeee;">Description</th>
- <th data-export="Location" style="background-color: #eeeeee;">Location</th>
- <th data-export="Mean" style="background-color: #eeeeee;">Mean</th>
- <th data-export="Max LRS" style="background-color: #eeeeee;">Max LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th data-export="Max LRS Location" style="background-color: #eeeeee;">Max LRS Location</th>
- <th data-export="Additive Effect" style="background-color: #eeeeee;">Additive Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th></th>
+ <th data-export="Index">Index</th>
+ <th data-export="Record">Record ID</th>
+ <th data-export="Species">Species</th>
+ <th data-export="Group">Group</th>
+ <th data-export="Tissue">Tissue</th>
+ <th data-export="Dataset">Dataset</th>
+ <th data-export="Symbol">Symbol</th>
+ <th data-export="Description">Description</th>
+ <th data-export="Location">Location</th>
+ <th data-export="Mean">Mean</th>
+ <th data-export="Max LRS">Max LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Max LRS Location">Max LRS Location</th>
+ <th data-export="Additive Effect">Additive Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
<tbody>
{% for this_trait in trait_list %}
<tr id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}">
- <td><input type="checkbox" name="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" value="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></td>
+ <td style="padding-left: 5px;"><input type="checkbox" name="searchResult" class="checkbox trait_checkbox" value="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></td>
<td data-export="{{ loop.index }}">{{ loop.index }}</td>
+ <td data-export="{{ this_trait.name }}"><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></td>
<td data-export="{{ this_trait.dataset.group.species }}">{{ this_trait.dataset.group.species }}</td>
<td data-export="{{ this_trait.dataset.group.name }}">{{ this_trait.dataset.group.name }}</td>
<td data-export="{{ this_trait.dataset.tissue }}">{{ this_trait.dataset.tissue }}</td>
<td data-export="{{ this_trait.dataset.name }}">{{ this_trait.dataset.name }}</td>
- <td data-export="{{ this_trait.name }}"><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></td>
<td data-export="{{ this_trait.symbol }}">{{ this_trait.symbol }}</td>
<td data-export="{{ this_trait.description_display }}">{{ this_trait.description_display }}</td>
<td data-export="{{ this_trait.location_repr }}" align="right">{{ this_trait.location_repr }}</td>
@@ -69,20 +69,20 @@
</tbody>
<tfoot>
<tr>
- <th style="background-color: #eeeeee;"></th>
- <th style="background-color: #eeeeee;">Index</th>
- <th style="background-color: #eeeeee;">Species</th>
- <th style="background-color: #eeeeee;">Group</th>
- <th style="background-color: #eeeeee;">Tissue</th>
- <th style="background-color: #eeeeee;">Dataset</th>
- <th style="background-color: #eeeeee;">Record</th>
- <th style="background-color: #eeeeee;">Symbol</th>
- <th style="background-color: #eeeeee;">Description</th>
- <th style="background-color: #eeeeee;">Location</th>
- <th style="background-color: #eeeeee;">Mean</th>
- <th style="background-color: #eeeeee;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th style="background-color: #eeeeee;">Max LRS Location</th>
- <th style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th></th>
+ <th>Index</th>
+ <th>Record ID</th>
+ <th>Species</th>
+ <th>Group</th>
+ <th>Tissue</th>
+ <th>Dataset</th>
+ <th>Symbol</th>
+ <th>Description</th>
+ <th>Location</th>
+ <th>Mean</th>
+ <th>Max LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th>Max LRS Location</th>
+ <th>Additive Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</tfoot>
</table>
@@ -123,26 +123,34 @@
console.time("Creating table");
$('#trait_table').DataTable( {
+ "createdRow": function ( row, data, index ) {
+ $('td', row).eq(8).attr('title', $('td', row).eq(8).text());
+ if ($('td', row).eq(8).text().length > 50) {
+ $('td', row).eq(8).text($('td', row).eq(8).text().substring(0, 50));
+ $('td', row).eq(8).text($('td', row).eq(8).text() + '...')
+ }
+ },
"paging": false,
"columns": [
{ "orderDataType": "dom-checkbox" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural", "width": "8%" },
- { "type": "natural" },
+ { "type": "natural", "width": "3%" },
+ { "type": "natural", "width": "6%" },
+ { "type": "natural", "width": "8%" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
- { "type": "natural", "width": "8%" },
{ "type": "natural" },
- { "type": "natural" },
- { "type": "natural", "width": "8%" },
- { "type": "natural" }
+ { "type": "natural", "width": "7%" },
+ { "type": "natural", "width": "4%" },
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "7%" },
+ { "type": "natural", "width": "7%" }
],
"columnDefs": [
{
"targets": 0,
+ "orderable": false,
"orderDataType": "dom-checkbox"
}
],
diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html
new file mode 100644
index 00000000..bc2627a0
--- /dev/null
+++ b/wqflask/wqflask/templates/loading.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% block title %}Loading Mapping Results{% endblock %}
+{% block content %}
+<form method="post" action="/marker_regression" name="loading_form" id="loading_form">
+ <div class="progress" style="position: fixed; top: 50%; left: 50%;">
+ <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%"></div>
+ </div>
+</form>
+{% endblock %}
+{% block js %}
+<script type="text/javascript">
+$("#loading_form").submit();
+</script>
+{% endblock %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index f7b450c1..cafa8b93 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -3,6 +3,7 @@
{% block css %}
<link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" />
<link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/scroller.dataTables.min.css">
+ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.dataTables.css">
{% endblock %}
{% block content %}
<!-- Start of body -->
@@ -125,9 +126,8 @@
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.buttons.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/buttons.colVis.min.js"></script>
<script type='text/javascript'>
var json_trait_list = {{ json_trait_list|safe }};
@@ -204,24 +204,33 @@
},
"data": json_trait_list,
"columns": [
- { "type": "natural" },
+ { "type": "natural", "width": "2%" },
{ "type": "natural", "width": "4%" },
- { "type": "natural" },
- { "type": "natural" },
+ { "type": "natural", "width": "12%" },
+ { "type": "natural", "width": "12%" },
{ "type": "natural", "width": "30%" },
{ "type": "natural", "width": "10%" },
- { "type": "natural" },
+ { "type": "natural", "width": "6%" },
{ "type": "natural", "width": "6%" },
{ "type": "natural", "width": "12%" },
- { "type": "natural" }
+ { "type": "natural", "width": "10%" }
],
"columnDefs": [ {
"targets": 0,
"orderable": false
} ],
"order": [[1, "asc" ]],
- "sDom": "RZtir",
+ buttons: [
+ {
+ extend: 'colvis',
+ text: 'Show or Hide Columns',
+ columns: ':not(:first-child)',
+ postfixButtons: [ 'colvisRestore' ]
+ }
+ ],
+ "sDom": "BRZtir",
"iDisplayLength": -1,
+ "autoWidth": false,
"deferRender": true,
"bSortClasses": false,
"scrollY": "600px",
@@ -246,12 +255,16 @@
$('td', row).eq(2).attr('data-export', $('td', row).eq(2).text());
$('td', row).eq(3).attr('title', $('td', row).eq(3).text());
$('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
- if ($('td', row).eq(3).text().length > 40) {
- $('td', row).eq(3).text($('td', row).eq(3).text().substring(0, 40));
+ if ($('td', row).eq(3).text().length > 50) {
+ $('td', row).eq(3).text($('td', row).eq(3).text().substring(0, 50));
$('td', row).eq(3).text($('td', row).eq(3).text() + '...')
}
$('td', row).eq(4).attr('title', $('td', row).eq(4).text());
$('td', row).eq(4).attr('data-export', $('td', row).eq(4).text());
+ if ($('td', row).eq(4).text().length > 50) {
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50));
+ $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
+ }
$('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 30));
$('td', row).eq(5).attr('align', 'right');
$('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
@@ -263,22 +276,30 @@
},
"data": json_trait_list,
"columns": [
- { "type": "natural" },
+ { "type": "natural", "width": "2%" },
{ "type": "natural", "width": "5%" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
{ "type": "natural", "width": "6%" },
- { "type": "natural" },
- { "type": "natural", "width": "9%" }
+ { "type": "natural", "width": "30%" },
+ { "type": "natural", "width": "25%" },
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "6%" },
+ { "type": "natural", "width": "9%" },
+ { "type": "natural", "width": "7%" }
],
"columnDefs": [ {
"targets": 0,
"orderable": false
} ],
"order": [[1, "asc" ]],
- "sDom": "RZtr",
+ buttons: [
+ {
+ extend: 'colvis',
+ text: 'Show or Hide Columns',
+ columns: ':not(:first-child)',
+ postfixButtons: [ 'colvisRestore' ]
+ }
+ ],
+ "sDom": "BRZtir",
"iDisplayLength": -1,
"autoWidth": false,
"deferRender": true,
@@ -306,9 +327,9 @@
},
"data": json_trait_list,
"columns": [
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "12%" },
+ { "type": "natural", "width": "40%" },
{ "type": "natural", "width": "40%"}
],
"columnDefs": [ {
@@ -316,7 +337,15 @@
"orderable": false
} ],
"order": [[1, "asc" ]],
- "sDom": "RZtir",
+ buttons: [
+ {
+ extend: 'colvis',
+ text: 'Show or Hide Columns',
+ columns: ':not(:first-child)',
+ postfixButtons: [ 'colvisRestore' ]
+ }
+ ],
+ "sDom": "BRZtir",
"iDisplayLength": -1,
"autoWidth": false,
"deferRender": true,
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index a254d956..8821167b 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -77,6 +77,7 @@
{% for sample_type in sample_groups %}
<div class="sample_group" style="width:{{ trait_table_width }}%;">
<h3>{{ sample_type.header }}</h3>
+ <hr>
<div id="table_container">
<table class="table-hover table-striped" id="samples_{{ sample_type.sample_group_type }}" style="float: left;">
<thead>
@@ -146,6 +147,7 @@
</table>
</div>
</div>
+ <br>
{% endfor %}
<!--</div>-->
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 149ad864..283ee7e5 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -16,11 +16,11 @@
</li>
{% endif %}
{% if use_plink_gemma %}
- <li>
- <a href="#plink" data-toggle="tab">PLINK</a>
+ <li class="active">
+ <a href="#gemma" data-toggle="tab">GEMMA</a>
</li>
<li>
- <a href="#gemma" data-toggle="tab">GEMMA</a>
+ <a href="#plink" data-toggle="tab">PLINK</a>
</li>
{% endif %}
<!--<li>
@@ -299,40 +299,39 @@
</div>
{% endif %}
{% if use_plink_gemma %}
- <div class="tab-pane" id="plink">
+ <div class="tab-pane active" id="gemma">
<div style="padding: 20px" class="form-horizontal">
<div class="mapping_method_fields form-group">
- <label for="maf_plink" class="col-xs-3 control-label">Minor allele threshold</label>
+ <label for="maf_gemma" class="col-xs-3 control-label">Minor allele threshold</label>
<div style="margin-left: 20px;" class="col-xs-3 controls">
- <input name="maf_plink" value="0.01" type="text" class="form-control">
+ <input name="maf_gemma" value="0.01" type="text" class="form-control">
</div>
</div>
</div>
<div class="form-group">
- <label for="plink_compute" class="col-xs-1 control-label"></label>
+ <label for="gemma_compute" class="col-xs-1 control-label"></label>
<div style="margin-left:20px;" class="col-xs-4 controls">
- <button id="plink_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Marker Regression">
+ <button id="gemma_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Marker Regression">
Compute
</button>
</div>
</div>
</div>
-
- <div class="tab-pane" id="gemma">
+ <div class="tab-pane" id="plink">
<div style="padding: 20px" class="form-horizontal">
<div class="mapping_method_fields form-group">
- <label for="maf_gemma" class="col-xs-3 control-label">Minor allele threshold</label>
+ <label for="maf_plink" class="col-xs-3 control-label">Minor allele threshold</label>
<div style="margin-left: 20px;" class="col-xs-3 controls">
- <input name="maf_gemma" value="0.01" type="text" class="form-control">
+ <input name="maf_plink" value="0.01" type="text" class="form-control">
</div>
</div>
</div>
<div class="form-group">
- <label for="gemma_compute" class="col-xs-1 control-label"></label>
+ <label for="plink_compute" class="col-xs-1 control-label"></label>
<div style="margin-left:20px;" class="col-xs-4 controls">
- <button id="gemma_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Marker Regression">
+ <button id="plink_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Marker Regression">
Compute
</button>
</div>
diff --git a/wqflask/wqflask/templates/submit_trait.html b/wqflask/wqflask/templates/submit_trait.html
new file mode 100644
index 00000000..df6b0bb7
--- /dev/null
+++ b/wqflask/wqflask/templates/submit_trait.html
@@ -0,0 +1,101 @@
+{% extends "base.html" %}
+{% block title %}Trait Submission{% endblock %}
+{% block content %}
+<!-- Start of body -->
+
+ <div class="container-fluid">
+
+ {{ flash_me() }}
+
+ <div class="row" style="width: 1400px !important;">
+
+ <div class="col-xs-5">
+ <section id="description">
+ <div>
+ <h2 style="color: #5a5a5a;">Introduction</h2>
+ <hr>
+ <p>The trait values that you enter are statistically compared with verified genotypes collected at a set of microsatellite markers in each RI set. The markers are drawn from a set of over 750, but for each set redundant markers have been removed, preferentially retaining those that are most informative.</p>
+ <p>These error-checked RI mapping data match theoretical expectations for RI strain sets. The cumulative adjusted length of the RI maps are approximately 1400 cM, a value that matches those of both MIT maps and Chromosome Committee Report maps. See our full description of the genetic data collected as part of the WebQTL project.</p>
+ </div>
+ </section>
+ <br>
+ <section id="description">
+ <div>
+ <h2 style="color: #5a5a5a;">About Your Data</h2>
+ <hr>
+ <p>You can open a separate window giving the number of strains for each data set and sample data.</p>
+ <p>None of your submitted data is copied or stored by this system except during the actual processing of your submission. By the time the reply page displays in your browser, your submission has been cleared from this system.</p>
+ </div>
+ </section>
+ </div>
+ <div style="padding-left:20px" class="col-xs-6" style="width: 600px !important;">
+ <section id="submission_form">
+ <div class="form-group">
+ <h2 style="color: #5a5a5a;">Trait Submission Form</h2>
+ <hr>
+ <div style="padding-bottom: 50px;" class="form-horizontal">
+ <h3>1. Choose cross or RI set:</h3>
+ <br>
+ <div class="col-xs-2">
+ <img src="/static/new/images/step1.gif">
+ </div>
+ <div class="col-xs-10">
+ <div class="form-group">
+ <label for="species" class="col-xs-2 control-label">Species: </label>
+ <div class="col-xs-4 controls">
+ <select name="species" id="species" class="form-control span3" style="width: 280px !important;"></select>
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="group" class="col-xs-2 control-label">Group: </label>
+ <div class="col-xs-4 controls">
+ <select name="group" id="group" class="form-control span3" style="width: 280px !important;"></select>
+ </div>
+ </div>
+ <!--
+ <select name="corr_dataset">
+ {% for species in species_and_groups %}
+ <optgroup label="{{ species.species }} ------">
+ {% for group in species.groups %}
+ <option value="{{ group }}">
+ {{ group }}
+ </option>
+ {% endfor %}
+ </optgroup>
+ {% endfor %}
+ </select>
+ -->
+ </div>
+ </div>
+ <div style="padding-bottom: 50px;" class="form-horizontal">
+ <h3>2. Enter Trait Data:</h3>
+ <br>
+ <div class="col-xs-2" style="vertical-align:middle;">
+ <img src="/static/new/images/step2.gif">
+ </div>
+ <div class="col-xs-10">
+ <div class="form-group">
+ <p>
+ <b>From a File:</b> You can enter data by entering a file name here. The file should contain a series of numbers representing trait values.
+ The values can be on one line separated by spaces or tabs, or they can be on separate lines. Include one value for each progeny individual
+ or recombinant inbred line. Represent missing values with a non-numeric character such as "x". If you have chosen a recombinant inbred set,
+ when you submit your data will be displayed in a form where you can confirm and/or edit them. If you enter a file name here, any data that
+ you paste into the next section will be ignored.
+ </p>
+ <input type="file" name="trait_file" style="border-width: 1px; border-style: solid; border-color: #999999;">
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ </div>
+ </div>
+
+{%endblock%}
+
+{% block js %}
+ <script src="/static/new/javascript/dataset_select_menu_orig.js"></script>
+ <script>
+ gn_server_url = "{{ gn_server_url }}";
+ </script>
+{% endblock %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 4f6725b3..4f46a904 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -50,6 +50,7 @@ from wqflask.correlation_matrix import show_corr_matrix
from wqflask.correlation import corr_scatter_plot
from wqflask.wgcna import wgcna_analysis
from wqflask.ctl import ctl_analysis
+from wqflask.submit_trait import get_species_groups
from utility import temp_data
from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION
@@ -294,6 +295,11 @@ def environments():
doc = docs.Docs("environments")
return render_template("docs.html", **doc.__dict__)
+@app.route("/submit_trait")
+def submit_trait():
+ species_and_groups = get_species_groups()
+ return render_template("submit_trait.html", **{'species_and_groups' : species_and_groups, 'gn_server_url' : GN_SERVER_URL, 'version' : GN_VERSION})
+
@app.route('/export_trait_excel', methods=('POST',))
def export_trait_excel():
"""Excel file consisting of the sample data from the trait data and analysis page"""
@@ -440,6 +446,57 @@ def heatmap_page():
def mapping_results_container_page():
return render_template("mapping_results_container.html")
+@app.route("/loading", methods=('POST',))
+def loading_page():
+ initial_start_vars = request.form
+ logger.debug("Marker regression called with initial_start_vars:", initial_start_vars.items())
+ temp_uuid = initial_start_vars['temp_uuid']
+ wanted = (
+ 'trait_id',
+ 'dataset',
+ 'method',
+ 'trimmed_markers',
+ 'selected_chr',
+ 'chromosomes',
+ 'mapping_scale',
+ 'score_type',
+ 'suggestive',
+ 'significant',
+ 'num_perm',
+ 'permCheck',
+ 'perm_output',
+ 'num_bootstrap',
+ 'bootCheck',
+ 'bootstrap_results',
+ 'LRSCheck',
+ 'maf',
+ 'manhattan_plot',
+ 'control_marker',
+ 'control_marker_db',
+ 'do_control',
+ 'genofile',
+ 'pair_scan',
+ 'startMb',
+ 'endMb',
+ 'graphWidth',
+ 'lrsMax',
+ 'additiveCheck',
+ 'showSNP',
+ 'showGenes',
+ 'viewLegend',
+ 'haplotypeAnalystCheck',
+ 'mapmethod_rqtl_geno',
+ 'mapmodel_rqtl_geno'
+ )
+ start_vars = {}
+ for key, value in initial_start_vars.iteritems():
+ if key in wanted or key.startswith(('value:')):
+ start_vars[key] = value
+
+ rendered_template = render_template("loading.html", **start_vars)
+
+ return rendered_template
+
@app.route("/marker_regression", methods=('POST',))
def marker_regression_page():
initial_start_vars = request.form