aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Yan2017-03-16 17:22:06 +0000
committerLei Yan2017-03-16 17:22:06 +0000
commit5855229d3f5d3be33aef758a4c13620baf5faa9c (patch)
tree34f416fa2806e0b629174c83fd30b489aa454df2
parent6224a885f99ed4e26164e49260c222183bf4982a (diff)
parent2b14b0d04387a262f9895ddd87ce465c6835fa8c (diff)
downloadgenenetwork2-5855229d3f5d3be33aef758a4c13620baf5faa9c.tar.gz
Merge /home/zas1024/gene
-rw-r--r--wqflask/base/data_set.py151
-rw-r--r--wqflask/maintenance/get_group_samplelists.py2
-rw-r--r--wqflask/utility/helper_functions.py20
-rw-r--r--wqflask/utility/tools.py1
-rw-r--r--wqflask/wqflask/do_search.py7
-rw-r--r--wqflask/wqflask/marker_regression/gemma_mapping.py2
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py27
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py601
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json135
-rw-r--r--wqflask/wqflask/static/new/javascript/draw_probability_plot.js12
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js21
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js10
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css2
-rw-r--r--wqflask/wqflask/submit_trait.py24
-rw-r--r--wqflask/wqflask/templates/base.html4
-rw-r--r--wqflask/wqflask/templates/data_sharing.html2
-rw-r--r--wqflask/wqflask/templates/gsearch_gene.html10
-rw-r--r--wqflask/wqflask/templates/links.html2
-rw-r--r--wqflask/wqflask/templates/loading.html32
-rw-r--r--wqflask/wqflask/templates/marker_regression_gn1.html117
-rw-r--r--wqflask/wqflask/templates/policies.html2
-rw-r--r--wqflask/wqflask/templates/reference.html2
-rw-r--r--wqflask/wqflask/templates/search_result_page.html26
-rw-r--r--wqflask/wqflask/templates/show_trait.html8
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html44
-rw-r--r--wqflask/wqflask/templates/show_trait_edit_data.html6
-rw-r--r--wqflask/wqflask/templates/show_trait_mapping_tools.html16
-rw-r--r--wqflask/wqflask/templates/show_trait_statistics.html4
-rw-r--r--wqflask/wqflask/templates/submit_trait.html44
-rw-r--r--wqflask/wqflask/views.py24
30 files changed, 449 insertions, 909 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 41c5d8ba..54dd3c4b 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -264,7 +264,7 @@ class DatasetGroup(object):
def __init__(self, dataset):
"""This sets self.group and self.group_id"""
#logger.debug("DATASET NAME2:", dataset.name)
- self.name, self.id = fetchone(dataset.query_for_group)
+ self.name, self.id, self.genetic_type = fetchone(dataset.query_for_group)
if self.name == 'BXD300':
self.name = "BXD"
@@ -273,6 +273,7 @@ class DatasetGroup(object):
self.get_f1_parent_strains()
self.accession_id = self.get_accession_id()
+ self.mapping_id, self.mapping_names = self.get_mapping_methods()
self.species = webqtlDatabaseFunction.retrieve_species(self.name)
@@ -295,6 +296,20 @@ class DatasetGroup(object):
else:
return "None"
+ def get_mapping_methods(self):
+
+ mapping_id = g.db.execute("select MappingMethodId from InbredSet where Name= '%s'" % self.name).fetchone()[0]
+ if mapping_id == "1":
+ mapping_names = ["QTLReaper", "PYLMM", "R/qtl"]
+ elif mapping_id == "2":
+ mapping_names = ["GEMMA"]
+ elif mapping_id == "4":
+ mapping_names = ["PLINK"]
+ else:
+ mapping_names = []
+
+ return mapping_id, mapping_names
+
def get_specified_markers(self, markers = []):
self.markers = HumanMarkers(self.name, markers)
@@ -317,69 +332,6 @@ class DatasetGroup(object):
self.markers = marker_class(self.name)
- def datasets(self):
- key = "group_dataset_menu:v2:" + self.name
- logger.debug("key is2:", key)
- dataset_menu = []
- logger.debug("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH)
- logger.debug("[tape4] type webqtlConfig.PUBLICTHRESH:", type(webqtlConfig.PUBLICTHRESH))
- the_results = fetchall('''
- (SELECT '#PublishFreeze',PublishFreeze.FullName,PublishFreeze.Name
- FROM PublishFreeze,InbredSet
- WHERE PublishFreeze.InbredSetId = InbredSet.Id
- and InbredSet.Name = '%s'
- and PublishFreeze.public > %s)
- UNION
- (SELECT '#GenoFreeze',GenoFreeze.FullName,GenoFreeze.Name
- FROM GenoFreeze, InbredSet
- WHERE GenoFreeze.InbredSetId = InbredSet.Id
- and InbredSet.Name = '%s'
- and GenoFreeze.public > %s)
- UNION
- (SELECT Tissue.Name, ProbeSetFreeze.FullName,ProbeSetFreeze.Name
- FROM ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue
- WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id
- and ProbeFreeze.TissueId = Tissue.Id
- and ProbeFreeze.InbredSetId = InbredSet.Id
- and InbredSet.Name like %s
- and ProbeSetFreeze.public > %s
- ORDER BY Tissue.Name, ProbeSetFreeze.CreateTime desc, ProbeSetFreeze.AvgId)
- ''' % (self.name, webqtlConfig.PUBLICTHRESH,
- self.name, webqtlConfig.PUBLICTHRESH,
- "'" + self.name + "'", webqtlConfig.PUBLICTHRESH))
-
- #for tissue_name, dataset in itertools.groupby(the_results, itemgetter(0)):
- for dataset_item in the_results:
- tissue_name = dataset_item[0]
- dataset = dataset_item[1]
- dataset_short = dataset_item[2]
- if tissue_name in ['#PublishFreeze', '#GenoFreeze']:
- dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)]))
- else:
- dataset_sub_menu = [item[1:] for item in dataset]
-
- tissue_already_exists = False
- tissue_position = None
- for i, tissue_dict in enumerate(dataset_menu):
- if tissue_dict['tissue'] == tissue_name:
- tissue_already_exists = True
- tissue_position = i
- break
-
- if tissue_already_exists:
- #logger.debug("dataset_menu:", dataset_menu[i]['datasets'])
- dataset_menu[i]['datasets'].append((dataset, dataset_short))
- else:
- dataset_menu.append(dict(tissue=tissue_name,
- datasets=[(dataset, dataset_short)]))
-
- if USE_REDIS:
- Redis.set(key, pickle.dumps(dataset_menu, pickle.HIGHEST_PROTOCOL))
- Redis.expire(key, 60*5)
- self._datasets = dataset_menu
-
- return self._datasets
-
def get_f1_parent_strains(self):
try:
# NL, 07/27/2010. ParInfo has been moved from webqtlForm.py to webqtlUtil.py;
@@ -456,6 +408,71 @@ class DatasetGroup(object):
return genotype
+def datasets(group_name, this_group = None):
+ key = "group_dataset_menu:v2:" + group_name
+ logger.debug("key is2:", key)
+ dataset_menu = []
+ logger.debug("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH)
+ logger.debug("[tape4] type webqtlConfig.PUBLICTHRESH:", type(webqtlConfig.PUBLICTHRESH))
+ the_results = fetchall('''
+ (SELECT '#PublishFreeze',PublishFreeze.FullName,PublishFreeze.Name
+ FROM PublishFreeze,InbredSet
+ WHERE PublishFreeze.InbredSetId = InbredSet.Id
+ and InbredSet.Name = '%s'
+ and PublishFreeze.public > %s)
+ UNION
+ (SELECT '#GenoFreeze',GenoFreeze.FullName,GenoFreeze.Name
+ FROM GenoFreeze, InbredSet
+ WHERE GenoFreeze.InbredSetId = InbredSet.Id
+ and InbredSet.Name = '%s'
+ and GenoFreeze.public > %s)
+ UNION
+ (SELECT Tissue.Name, ProbeSetFreeze.FullName,ProbeSetFreeze.Name
+ FROM ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue
+ WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id
+ and ProbeFreeze.TissueId = Tissue.Id
+ and ProbeFreeze.InbredSetId = InbredSet.Id
+ and InbredSet.Name like %s
+ and ProbeSetFreeze.public > %s
+ ORDER BY Tissue.Name, ProbeSetFreeze.CreateTime desc, ProbeSetFreeze.AvgId)
+ ''' % (group_name, webqtlConfig.PUBLICTHRESH,
+ group_name, webqtlConfig.PUBLICTHRESH,
+ "'" + group_name + "'", webqtlConfig.PUBLICTHRESH))
+
+ #for tissue_name, dataset in itertools.groupby(the_results, itemgetter(0)):
+ for dataset_item in the_results:
+ tissue_name = dataset_item[0]
+ dataset = dataset_item[1]
+ dataset_short = dataset_item[2]
+ if tissue_name in ['#PublishFreeze', '#GenoFreeze']:
+ dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)]))
+ else:
+ dataset_sub_menu = [item[1:] for item in dataset]
+
+ tissue_already_exists = False
+ tissue_position = None
+ for i, tissue_dict in enumerate(dataset_menu):
+ if tissue_dict['tissue'] == tissue_name:
+ tissue_already_exists = True
+ tissue_position = i
+ break
+
+ if tissue_already_exists:
+ #logger.debug("dataset_menu:", dataset_menu[i]['datasets'])
+ dataset_menu[i]['datasets'].append((dataset, dataset_short))
+ else:
+ dataset_menu.append(dict(tissue=tissue_name,
+ datasets=[(dataset, dataset_short)]))
+
+ if USE_REDIS:
+ Redis.set(key, pickle.dumps(dataset_menu, pickle.HIGHEST_PROTOCOL))
+ Redis.expire(key, 60*5)
+
+ if this_group != None:
+ this_group._datasets = dataset_menu
+ return this_group._datasets
+ else:
+ return dataset_menu
class DataSet(object):
"""
@@ -679,7 +696,7 @@ class PhenotypeDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
FROM
InbredSet, PublishFreeze
WHERE
@@ -822,7 +839,7 @@ class GenotypeDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
FROM
InbredSet, GenoFreeze
WHERE
@@ -948,7 +965,7 @@ class MrnaAssayDataSet(DataSet):
self.query_for_group = '''
SELECT
- InbredSet.Name, InbredSet.Id
+ InbredSet.Name, InbredSet.Id, InbredSet.GeneticType
FROM
InbredSet, ProbeSetFreeze, ProbeFreeze
WHERE
diff --git a/wqflask/maintenance/get_group_samplelists.py b/wqflask/maintenance/get_group_samplelists.py
index 2d48ce78..04e94886 100644
--- a/wqflask/maintenance/get_group_samplelists.py
+++ b/wqflask/maintenance/get_group_samplelists.py
@@ -51,6 +51,6 @@ def get_samplelist_from_plink(genofilename):
samplelist = []
for line in genofile:
line = line.split(" ")
- samplelist.append(line[0])
+ samplelist.append(line[1])
return samplelist
diff --git a/wqflask/utility/helper_functions.py b/wqflask/utility/helper_functions.py
index 377f6b26..cf16879f 100644
--- a/wqflask/utility/helper_functions.py
+++ b/wqflask/utility/helper_functions.py
@@ -5,6 +5,9 @@ from base import data_set
from base.species import TheSpecies
from wqflask import user_manager
+
+from flask import Flask, g
+
import logging
logger = logging.getLogger(__name__ )
@@ -41,3 +44,20 @@ def get_trait_db_obs(self, trait_db_list):
name=trait_name,
cellid=None)
self.trait_list.append((trait_ob, dataset_ob))
+
+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
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 8db9ac6e..c28c617a 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -212,6 +212,7 @@ USE_REDIS = get_setting_bool('USE_REDIS')
USE_GN_SERVER = get_setting_bool('USE_GN_SERVER')
GENENETWORK_FILES = get_setting('GENENETWORK_FILES')
+TEMP_TRAITS = get_setting('TEMP_TRAITS')
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = gemma_command()
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index ad3eab79..e1df1e63 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -826,7 +826,8 @@ class PositionSearch(DoSearch):
def get_where_clause(self):
self.search_term = [float(value) if is_number(value) else value for value in self.search_term]
- self.chr, self.mb_min, self.mb_max = self.search_term[:3]
+ chr, self.mb_min, self.mb_max = self.search_term[:3]
+ self.chr = str(chr).lower()
self.get_chr()
where_clause = """ %s.Chr = %s and
@@ -846,9 +847,9 @@ class PositionSearch(DoSearch):
self.chr = int(self.chr)
except:
if 'chr' in self.chr:
- self.chr = int(self.chr.replace('chr', ''))
+ self.chr = self.chr.replace('chr', '')
else:
- self.chr = int(self.chr.replace('CHR', ''))
+ self.chr = self.chr.replace('CHR', '')
def run(self):
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index 66bed5a2..3bde61cd 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -41,7 +41,7 @@ def gen_pheno_txt_file(this_dataset, samples, vals):
this_val = -9
else:
this_val = vals[i]
- outfile.write(line[0] + " " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n")
+ outfile.write("0" + " " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n")
def parse_gemma_output(this_dataset):
included_markers = []
diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
index 9ff431a2..392ad745 100644
--- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py
+++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
@@ -986,9 +986,25 @@ class MarkerRegression(object):
except:
return
+ previous_chr = 1
+ previous_chr_as_int = 0
+ if self.plotScale == "physic":
+ this_chr = str(self.ChrList[self.selectedChr][0])
+ else:
+ this_chr = str(self.ChrList[self.selectedChr][1]+1)
+ # for i, qtlresult in enumerate(self.qtlresults):
+ # if Chr == this_chr:
+ # if Mb < self.startMb or Mb > self.endMb:
+ # return
+ # else:
+ # locPixel = xLeftOffset + (Mb-self.startMb)*plotXScale
+ # break
+ # elif self.selectedChr == -1:
+ # if str(qtlresult['chr']) != Chr:
+
if self.plotScale == 'physic':
if self.selectedChr > -1:
- if self.genotype[0].name != Chr or Mb < self.startMb or Mb > self.endMb:
+ if this_chr != Chr or Mb < self.startMb or Mb > self.endMb:
return
else:
locPixel = xLeftOffset + (Mb-self.startMb)*plotXScale
@@ -1172,7 +1188,10 @@ class MarkerRegression(object):
if self.controlLocus and self.doControl != "false":
string2 = 'Using %s as control' % self.controlLocus
else:
- string2 = 'Using Haldane mapping function with no control for other QTLs'
+ if self.mapping_method == "gemma":
+ string2 = 'Using GEMMA mapping method with no control for other QTLs.'
+ else:
+ string2 = 'Using Haldane mapping function with no control for other QTLs'
d = 4+ max(canvas.stringWidth(string1,font=labelFont),canvas.stringWidth(string2,font=labelFont))
if self.this_trait.name:
identification = "Trait ID: %s : %s" % (self.dataset.fullname, self.this_trait.name)
@@ -2019,6 +2038,8 @@ class MarkerRegression(object):
AdditiveCoordXY = []
DominanceCoordXY = []
+ symbolFont = pid.Font(ttf="fnt_bs", size=5,bold=0) #ZS: For Manhattan Plot
+
previous_chr = 1
previous_chr_as_int = 0
lineWidth = 1
@@ -2122,7 +2143,7 @@ class MarkerRegression(object):
# Yc = yZero - qtlresult['lrs_value']*LRSHeightThresh/LRS_LOD_Max
if self.manhattan_plot == True:
- canvas.drawEllipse(Xc-1, Yc-1, Xc+1, Yc+1, fillColor=pid.black)
+ canvas.drawString("5", Xc-canvas.stringWidth("5",font=symbolFont)/2+1,Yc+2,color=pid.black, font=symbolFont)
else:
LRSCoordXY.append((Xc, Yc))
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 13ae933f..5d55ebe1 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -48,60 +48,23 @@ class ShowTrait(object):
helper_functions.get_species_dataset_trait(self, kw)
else:
self.temp_trait = True
- self.create_temp_trait()
+ self.trait_vals = kw['trait_paste'].split()
+ self.temp_group = kw['group']
+ self.temp_species = kw['species']
+ #self.create_temp_trait()
#self.dataset.group.read_genotype_file()
- # Todo: Add back in the ones we actually need from below, as we discover we need them
- hddn = OrderedDict()
-
- ## Some fields, like method, are defaulted to None; otherwise in IE the field can't be changed using jquery
- #hddn = OrderedDict(
- # FormID = fmID,
- # group = fd.group,
- # submitID = '',
- # scale = 'physic',
- # additiveCheck = 'ON',
- # showSNP = 'ON',
- # showGenes = 'ON',
- # method = None,
- # parentsf14regression = 'OFF',
- # stats_method = '1',
- # chromosomes = '-1',
- # topten = '',
- # viewLegend = 'ON',
- # intervalAnalystCheck = 'ON',
- # valsHidden = 'OFF',
- # database = '',
- # criteria = None,
- # MDPChoice = None,
- # bootCheck = None,
- # permCheck = None,
- # applyVarianceSE = None,
- # sampleNames = '_',
- # sampleVals = '_',
- # sampleVars = '_',
- # otherStrainNames = '_',
- # otherStrainVals = '_',
- # otherStrainVars = '_',
- # extra_attributes = '_',
- # other_extra_attributes = '_',
- # export_data = None
- # )
-
#if this_trait:
# if this_trait.dataset and this_trait.dataset.type and this_trait.dataset.type == 'ProbeSet':
# self.cursor.execute("SELECT h2 from ProbeSetXRef WHERE DataId = %d" %
# this_trait.mysqlid)
# heritability = self.cursor.fetchone()
- #self.dispTraitInformation(kw, "", hddn, self.this_trait) #Display trait information + function buttons
-
- self.build_correlation_tools(self.this_trait)
+ self.build_correlation_tools()
#Get nearest marker for composite mapping
- logger.debug("self.dataset.type:", self.dataset.type)
if hasattr(self.this_trait, 'locus_chr') and self.this_trait.locus_chr != "" and self.dataset.type != "Geno" and self.dataset.type != "Publish":
self.nearest_marker = get_nearest_marker(self.this_trait, self.dataset)
#self.nearest_marker1 = get_nearest_marker(self.this_trait, self.dataset)[0]
@@ -113,6 +76,9 @@ class ShowTrait(object):
self.make_sample_lists(self.this_trait)
+ # Todo: Add back in the ones we actually need from below, as we discover we need them
+ hddn = OrderedDict()
+
if self.dataset.group.allsamples:
hddn['allsamples'] = string.join(self.dataset.group.allsamples, ' ')
@@ -147,13 +113,18 @@ class ShowTrait(object):
else:
self.sample_group_types['samples_primary'] = self.dataset.group.name
sample_lists = [group.sample_list for group in self.sample_groups]
- # logger.debug("sample_lists is:", pf(sample_lists))
self.get_mapping_methods()
self.trait_table_width = get_trait_table_width(self.sample_groups)
- js_data = dict(dataset_type = self.dataset.type,
+ if self.this_trait.symbol:
+ trait_symbol = self.this_trait.symbol
+ else:
+ trait_symbol = None
+ js_data = dict(trait_id = self.this_trait.name,
+ trait_symbol = trait_symbol,
+ dataset_type = self.dataset.type,
data_scale = self.dataset.data_scale,
sample_group_types = self.sample_group_types,
sample_lists = sample_lists,
@@ -183,275 +154,11 @@ class ShowTrait(object):
self.use_pylmm_rqtl = check_pylmm_rqtl()
- def read_data(self, include_f1=False):
- '''read user input data or from trait data and analysis form'''
-
- #if incf1 == None:
- # incf1 = []
-
- #if not self.genotype:
- # self.dataset.read_genotype_file()
- if not samplelist:
- if include_f1:
- samplelist = self.f1list + self.samplelist
- else:
- samplelist = self.samplelist
-
- traitfiledata = getattr(self, "traitfile", None)
- traitpastedata = getattr(self, "traitpaste", None)
- variancefiledata = getattr(self, "variancefile", None)
- variancepastedata = getattr(self, "variancepaste", None)
- Nfiledata = getattr(self, "Nfile", None)
-
- #### Todo: Rewrite below when we get to someone submitting their own trait #####
-
- def to_float(item):
- try:
- return float(item)
- except ValueError:
- return None
-
- logger.debug("bottle samplelist is:", samplelist)
- if traitfiledata:
- tt = traitfiledata.split()
- values = map(webqtlUtil.StringAsFloat, tt)
- elif traitpastedata:
- tt = traitpastedata.split()
- values = map(webqtlUtil.StringAsFloat, tt)
+ def build_correlation_tools(self):
+ if self.temp_trait == True:
+ this_group = self.temp_group
else:
- logger.debug("mapping formdataasfloat")
- #values = map(self.FormDataAsFloat, samplelist)
- values = [to_float(getattr(self, key)) for key in samplelist]
- logger.debug("rocket values is:", values)
-
-
- if len(values) < len(samplelist):
- values += [None] * (len(samplelist) - len(values))
- elif len(values) > len(samplelist):
- values = values[:len(samplelist)]
- logger.debug("now values is:", values)
-
-
- if variancefiledata:
- tt = variancefiledata.split()
- variances = map(webqtlUtil.StringAsFloat, tt)
- elif variancepastedata:
- tt = variancepastedata.split()
- variances = map(webqtlUtil.StringAsFloat, tt)
- else:
- variances = map(self.FormVarianceAsFloat, samplelist)
-
- if len(variances) < len(samplelist):
- variances += [None]*(len(samplelist) - len(variances))
- elif len(variances) > len(samplelist):
- variances = variances[:len(samplelist)]
-
- if Nfiledata:
- tt = string.split(Nfiledata)
- nsamples = map(webqtlUtil.IntAsFloat, tt)
- if len(nsamples) < len(samplelist):
- nsamples += [None]*(len(samplelist) - len(nsamples))
- else:
- nsamples = map(self.FormNAsFloat, samplelist)
-
- ##values, variances, nsamples is obsolete
- self.allTraitData = {}
- for i, _sample in enumerate(samplelist):
- if values[i] != None:
- self.allTraitData[_sample] = webqtlCaseData(
- _sample, values[i], variances[i], nsamples[i])
- logger.debug("allTraitData is:", pf(self.allTraitData))
-
-
- def dispBasicStatistics(self, fd, this_trait):
-
- #XZ, June 22, 2011: The definition and usage of primary_samples, other_samples, specialStrains, all_samples are not clear and hard to understand. But since they are only used in this function for draw graph purpose, they will not hurt the business logic outside. As of June 21, 2011, this function seems work fine, so no hurry to clean up. These parameters and code in this function should be cleaned along with fd.f1list, fd.parlist, fd.samplelist later.
-
- # This should still be riset here - Sam - Nov. 2012
- if fd.genotype.type == "riset":
- samplelist = fd.f1list + fd.samplelist
- else:
- samplelist = fd.f1list + fd.parlist + fd.samplelist
-
- other_samples = [] #XZ: sample that is not of primary group
- specialStrains = [] #XZ: This might be replaced by other_samples / ZS: It is just other samples without parent/f1 samples.
- all_samples = []
- primary_samples = [] #XZ: sample of primary group, e.g., BXD, LXS
-
- #self.MDP_menu = HT.Select(name='stats_mdp', Class='stats_mdp')
- self.MDP_menu = [] # We're going to use the same named data structure as in the old version
- # but repurpose it for Jinja2 as an array
-
- for sample in this_trait.data.keys():
- sampleName = sample.replace("_2nd_", "")
- if sample not in samplelist:
- if this_trait.data[sampleName].value != None:
- if sample.find('F1') < 0:
- specialStrains.append(sample)
- if (this_trait.data[sampleName].value != None) and (sample not in (fd.f1list + fd.parlist)):
- other_samples.append(sample) #XZ: at current stage, other_samples doesn't include parent samples and F1 samples of primary group
- else:
- if (this_trait.data[sampleName].value != None) and (sample not in (fd.f1list + fd.parlist)):
- primary_samples.append(sample) #XZ: at current stage, the primary_samples is the same as fd.samplelist / ZS: I tried defining primary_samples as fd.samplelist instead, but in some cases it ended up including the parent samples (1436869_at BXD)
-
- if len(other_samples) > 3:
- other_samples.sort(key=webqtlUtil.natsort_key)
- primary_samples.sort(key=webqtlUtil.natsort_key)
- primary_samples = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + primary_samples #XZ: note that fd.f1list and fd.parlist are added.
- all_samples = primary_samples + other_samples
- other_samples = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + other_samples #XZ: note that fd.f1list and fd.parlist are added.
- logger.debug("ac1") # This is the one used for first sall3
- self.MDP_menu.append(('All Cases','0'))
- self.MDP_menu.append(('%s Only' % fd.group, '1'))
- self.MDP_menu.append(('Non-%s Only' % fd.group, '2'))
-
- else:
- if (len(other_samples) > 0) and (len(primary_samples) + len(other_samples) > 3):
- logger.debug("ac2")
- self.MDP_menu.append(('All Cases','0'))
- self.MDP_menu.append(('%s Only' % fd.group,'1'))
- self.MDP_menu.append(('Non-%s Only' % fd.group,'2'))
- all_samples = primary_samples
- all_samples.sort(key=webqtlUtil.natsort_key)
- all_samples = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + all_samples
- primary_samples = map(lambda X:"_2nd_"+X, fd.f1list + fd.parlist) + primary_samples
- else:
- logger.debug("ac3")
- all_samples = samplelist
-
- other_samples.sort(key=webqtlUtil.natsort_key)
- all_samples = all_samples + other_samples
-
- if (len(other_samples)) > 0 and (len(primary_samples) + len(other_samples) > 4):
- #One set of vals for all, selected sample only, and non-selected only
- vals1 = []
- vals2 = []
- vals3 = []
-
- #Using all samples/cases for values
- #for sample_type in (all_samples, primary_samples, other_samples):
- for sampleNameOrig in all_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- logger.debug("* type of this_trait:", type(this_trait))
- logger.debug(" name:", this_trait.__class__.__name__)
- logger.debug(" this_trait:", this_trait)
- logger.debug(" type of this_trait.data[sampleName]:", type(this_trait.data[sampleName]))
- logger.debug(" name:", this_trait.data[sampleName].__class__.__name__)
- logger.debug(" this_trait.data[sampleName]:", this_trait.data[sampleName])
- thisval = this_trait.data[sampleName].value
- logger.debug(" thisval:", thisval)
- thisvar = this_trait.data[sampleName].variance
- logger.debug(" thisvar:", thisvar)
- thisValFull = [sampleName, thisval, thisvar]
- logger.debug(" thisValFull:", thisValFull)
-
- vals1.append(thisValFull)
-
- #Using just the group sample
- for sampleNameOrig in primary_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
-
- vals2.append(thisValFull)
-
- #Using all non-group samples only
- for sampleNameOrig in other_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
-
- vals3.append(thisValFull)
-
- vals_set = [vals1,vals2,vals3]
-
- else:
- vals = []
-
- #Using all samples/cases for values
- for sampleNameOrig in all_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
-
- vals.append(thisValFull)
-
- vals_set = [vals]
-
- self.stats_data = []
- for i, vals in enumerate(vals_set):
- if i == 0 and len(vals) < 4:
- stats_container = HT.Div(id="stats_tabs", style="padding:10px;", Class="ui-tabs") #Needed for tabs; notice the "stats_script_text" below referring to this element
- stats_container.append(HT.Div(HT.Italic("Fewer than 4 case data were entered. No statistical analysis has been attempted.")))
- break
- elif (i == 1 and len(primary_samples) < 4):
- stats_container = HT.Div(id="stats_tabs%s" % i, Class="ui-tabs")
- #stats_container.append(HT.Div(HT.Italic("Fewer than 4 " + fd.group + " case data were entered. No statistical analysis has been attempted.")))
- elif (i == 2 and len(other_samples) < 4):
- stats_container = HT.Div(id="stats_tabs%s" % i, Class="ui-tabs")
- stats_container.append(HT.Div(HT.Italic("Fewer than 4 non-" + fd.group + " case data were entered. No statistical analysis has been attempted.")))
- else:
- continue
- if len(vals) > 4:
- stats_tab_list = [HT.Href(text="Basic Table", url="#statstabs-1", Class="stats_tab"),HT.Href(text="Probability Plot", url="#statstabs-5", Class="stats_tab"),
- HT.Href(text="Bar Graph (by name)", url="#statstabs-3", Class="stats_tab"), HT.Href(text="Bar Graph (by rank)", url="#statstabs-4", Class="stats_tab"),
- HT.Href(text="Box Plot", url="#statstabs-2", Class="stats_tab")]
-
- if this_trait.dataset:
- if this_trait.cellid:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.dataset.type, cellid=this_trait.cellid))
- else:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.dataset.type))
- else:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals))
-
- #normalplot_div = HT.Div(id="statstabs-5")
- #normalplot_container = HT.Paragraph()
- #normalplot = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
-
- try:
- plotTitle = this_trait.symbol
- plotTitle += ": "
- plotTitle += this_trait.name
- except:
- plotTitle = str(this_trait.name)
-
- #normalplot_img = BasicStatisticsFunctions.plotNormalProbability(vals=vals, group=fd.group, title=plotTitle, specialStrains=specialStrains)
- #normalplot.append(HT.TR(HT.TD(normalplot_img)))
- #normalplot.append(HT.TR(HT.TD(HT.BR(),HT.BR(),"This plot evaluates whether data are \
- #normally distributed. Different symbols represent different groups.",HT.BR(),HT.BR(),
- #"More about ", HT.Href(url="http://en.wikipedia.org/wiki/Normal_probability_plot",
- # target="_blank", text="Normal Probability Plots"), " and more about interpreting these plots from the ", HT.Href(url="/glossary.html#normal_probability", target="_blank", text="glossary"))))
-
- #boxplot_div = HT.Div(id="statstabs-2")
- #boxplot_container = HT.Paragraph()
- #boxplot = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #boxplot_img, boxplot_link = BasicStatisticsFunctions.plotBoxPlot(vals)
- #boxplot.append(HT.TR(HT.TD(boxplot_img, HT.P(), boxplot_link, align="left")))
-
- #barName_div = HT.Div(id="statstabs-3")
- #barName_container = HT.Paragraph()
- #barName = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #barName_img = BasicStatisticsFunctions.plotBarGraph(identification=fd.identification, group=fd.group, vals=vals, type="name")
-
- #barRank_div = HT.Div(id="statstabs-4")
- #barRank_container = HT.Paragraph()
- #barRank = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #barRank_img = BasicStatisticsFunctions.plotBarGraph(identification=fd.identification, group=fd.group, vals=vals, type="rank")
-
-
- def build_correlation_tools(self, this_trait):
-
- #species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, group=fd.group)
-
- this_group = self.dataset.group.name
+ this_group = self.dataset.group.name
# We're checking a string here!
assert isinstance(this_group, basestring), "We need a string type thing here"
@@ -459,11 +166,15 @@ class ShowTrait(object):
this_group = 'BXD'
if this_group:
- dataset_menu = self.dataset.group.datasets()
+ #dataset_menu = self.dataset.group.datasets()
+ if self.temp_trait == True:
+ dataset_menu = data_set.datasets(this_group)
+ else:
+ dataset_menu = data_set.datasets(this_group, self.dataset.group)
dataset_menu_selected = None
if len(dataset_menu):
- if this_trait and this_trait.dataset:
- dataset_menu_selected = this_trait.dataset.name
+ if self.this_trait and self.this_trait.dataset:
+ dataset_menu_selected = self.this_trait.dataset.name
return_results_menu = (100, 200, 500, 1000, 2000, 5000, 10000, 15000, 20000)
return_results_menu_selected = 500
@@ -474,260 +185,6 @@ class ShowTrait(object):
return_results_menu_selected = return_results_menu_selected,)
- def build_mapping_tools(self, this_trait):
-
-
- #_Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, group=fd.group)
-
- this_group = fd.group
- if this_group[:3] == 'BXD':
- this_group = 'BXD'
-
- #check boxes - one for regular interval mapping, the other for composite
- permCheck1= HT.Input(type='checkbox', Class='checkbox', name='permCheck1',checked="on")
- bootCheck1= HT.Input(type='checkbox', Class='checkbox', name='bootCheck1',checked=0)
- permCheck2= HT.Input(type='checkbox', Class='checkbox', name='permCheck2',checked="on")
- bootCheck2= HT.Input(type='checkbox', Class='checkbox', name='bootCheck2',checked=0)
- optionbox1 = HT.Input(type='checkbox', Class='checkbox', name='parentsf14regression1',checked=0)
- optionbox2 = HT.Input(type='checkbox', Class='checkbox', name='parentsf14regression2',checked=0)
- optionbox3 = HT.Input(type='checkbox', Class='checkbox', name='parentsf14regression3',checked=0)
- applyVariance1 = HT.Input(name='applyVarianceSE1',type='checkbox', Class='checkbox')
- applyVariance2 = HT.Input(name='applyVarianceSE2',type='checkbox', Class='checkbox')
-
- IntervalMappingButton=HT.Input(type='button' ,name='interval',value=' Compute ', Class="button")
- CompositeMappingButton=HT.Input(type='button' ,name='composite',value=' Compute ', Class="button")
- MarkerRegressionButton=HT.Input(type='button',name='marker', value=' Compute ', Class="button")
-
- chrText = HT.Span("Chromosome:", Class="ffl fwb fs12")
-
- # updated by NL 5-28-2010
- # Interval Mapping
- chrMenu = HT.Select(name='chromosomes1')
- chrMenu.append(("All",-1))
- for i in range(len(fd.genotype)):
- if len(fd.genotype[i]) > 1:
- chrMenu.append((fd.genotype[i].name, i))
-
- #Menu for Composite Interval Mapping
- chrMenu2 = HT.Select(name='chromosomes2')
- chrMenu2.append(("All",-1))
- for i in range(len(fd.genotype)):
- if len(fd.genotype[i]) > 1:
- chrMenu2.append((fd.genotype[i].name, i))
-
- if fd.genotype.Mbmap:
- scaleText = HT.Span("Mapping Scale:", Class="ffl fwb fs12")
- scaleMenu1 = HT.Select(name='scale1',
- onChange="checkUncheck(window.document.dataInput.scale1.value, window.document.dataInput.permCheck1, window.document.dataInput.bootCheck1)")
- scaleMenu1.append(("Megabase",'physic'))
- scaleMenu1.append(("Centimorgan",'morgan'))
- scaleMenu2 = HT.Select(name='scale2',
- onChange="checkUncheck(window.document.dataInput.scale2.value, window.document.dataInput.permCheck2, window.document.dataInput.bootCheck2)")
- scaleMenu2.append(("Megabase",'physic'))
- scaleMenu2.append(("Centimorgan",'morgan'))
-
- controlText = HT.Span("Control Locus:", Class="ffl fwb fs12")
- controlMenu = HT.Input(type="text", name="controlLocus", Class="controlLocus")
-
- if fd.genotype.Mbmap:
- intMappingMenu = HT.TableLite(
- HT.TR(HT.TD(chrText), HT.TD(chrMenu, colspan="3")),
- HT.TR(HT.TD(scaleText), HT.TD(scaleMenu1)),
- cellspacing=0, width="263px", cellpadding=2)
- compMappingMenu = HT.TableLite(
- HT.TR(HT.TD(chrText), HT.TD(chrMenu2, colspan="3")),
- HT.TR(HT.TD(scaleText), HT.TD(scaleMenu2)),
- HT.TR(HT.TD(controlText), HT.TD(controlMenu)),
- cellspacing=0, width="325px", cellpadding=2)
- else:
- intMappingMenu = HT.TableLite(
- HT.TR(HT.TD(chrText), HT.TD(chrMenu, colspan="3")),
- cellspacing=0, width="263px", cellpadding=2)
- compMappingMenu = HT.TableLite(
- HT.TR(HT.TD(chrText), HT.TD(chrMenu2, colspan="3")),
- HT.TR(HT.TD(controlText), HT.TD(controlMenu)),
- cellspacing=0, width="325px", cellpadding=2)
-
- directPlotButton = ""
- directPlotButton = HT.Input(type='button',name='', value=' Compute ',\
- onClick="dataEditingFunc(this.form,'directPlot');",Class="button")
- directPlotSortText = HT.Span(HT.Bold("Sort by: "), Class="ffl fwb fs12")
- directPlotSortMenu = HT.Select(name='graphSort')
- directPlotSortMenu.append(('LRS Full',0))
- directPlotSortMenu.append(('LRS Interact',1))
- directPlotPermuText = HT.Span("Permutation Test (n=500)", Class="ffl fs12")
- directPlotPermu = HT.Input(type='checkbox', Class='checkbox',name='directPermuCheckbox', checked="on")
- pairScanReturnText = HT.Span(HT.Bold("Return: "), Class="ffl fwb fs12")
- pairScanReturnMenu = HT.Select(name='pairScanReturn')
- pairScanReturnMenu.append(('top 50','50'))
- pairScanReturnMenu.append(('top 100','100'))
- pairScanReturnMenu.append(('top 200','200'))
- pairScanReturnMenu.append(('top 500','500'))
-
- pairScanMenus = HT.TableLite(
- HT.TR(HT.TD(directPlotSortText), HT.TD(directPlotSortMenu)),
- HT.TR(HT.TD(pairScanReturnText), HT.TD(pairScanReturnMenu)),
- cellspacing=0, width="232px", cellpadding=2)
-
- markerSuggestiveText = HT.Span(HT.Bold("Display LRS greater than:"), Class="ffl fwb fs12")
- markerSuggestive = HT.Input(name='suggestive', size=5, maxlength=8)
- displayAllText = HT.Span(" Display all LRS ", Class="ffl fs12")
- displayAll = HT.Input(name='displayAllLRS', type="checkbox", Class='checkbox')
- useParentsText = HT.Span(" Use Parents ", Class="ffl fs12")
- useParents = optionbox2
- applyVarianceText = HT.Span(" Use Weighted ", Class="ffl fs12")
-
- markerMenu = HT.TableLite(
- HT.TR(HT.TD(markerSuggestiveText), HT.TD(markerSuggestive)),
- HT.TR(HT.TD(displayAll,displayAllText)),
- HT.TR(HT.TD(useParents,useParentsText)),
- HT.TR(HT.TD(applyVariance2,applyVarianceText)),
- cellspacing=0, width="263px", cellpadding=2)
-
-
- mapping_row = HT.TR()
- mapping_container = HT.Div(id="mapping_tabs", Class="ui-tabs")
-
- mapping_tab_list = [HT.Href(text="Interval", url="#mappingtabs-1"), HT.Href(text="Marker Regression", url="#mappingtabs-2"), HT.Href(text="Composite", url="#mappingtabs-3"), HT.Href(text="Pair-Scan", url="#mappingtabs-4")]
- mapping_tabs = HT.List(mapping_tab_list)
- mapping_container.append(mapping_tabs)
-
- interval_div = HT.Div(id="mappingtabs-1")
- interval_container = HT.Span()
-
- intervalTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- intTD = HT.TD(valign="top",NOWRAP='ON', Class="fs12 fwn")
- intTD.append(intMappingMenu,HT.BR())
-
- intTD.append(permCheck1,'Permutation Test (n=2000)',HT.BR(),
- bootCheck1,'Bootstrap Test (n=2000)', HT.BR(), optionbox1, 'Use Parents', HT.BR(),
- applyVariance1,'Use Weighted', HT.BR(), HT.BR(),IntervalMappingButton, HT.BR(), HT.BR())
- intervalTable.append(HT.TR(intTD), HT.TR(HT.TD(HT.Span(HT.Href(url='/glossary.html#intmap', target='_blank', text='Interval Mapping'),
- ' computes linkage maps for the entire genome or single',HT.BR(),' chromosomes.',
- ' The ',HT.Href(url='/glossary.html#permutation', target='_blank', text='Permutation Test'),' estimates suggestive and significant ',HT.BR(),' linkage scores. \
- The ',HT.Href(url='/glossary.html#bootstrap', target='_blank', text='Bootstrap Test'), ' estimates the precision of the QTL location.'
- ,Class="fs12"), HT.BR(), valign="top")))
-
- interval_container.append(intervalTable)
- interval_div.append(interval_container)
- mapping_container.append(interval_div)
-
- # Marker Regression
-
- marker_div = HT.Div(id="mappingtabs-2")
- marker_container = HT.Span()
-
- markerTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- markerTD = HT.TD(valign="top",NOWRAP='ON', Class="fs12 fwn")
- markerTD.append(markerMenu,HT.BR())
-
- markerTD.append(MarkerRegressionButton,HT.BR(),HT.BR())
-
- markerTable.append(HT.TR(markerTD),HT.TR(HT.TD(HT.Span(HT.Href(url='/glossary.html#',target='_blank',text='Marker regression'),
- ' computes and displays LRS values for individual markers.',HT.BR(),
- 'This function also lists additive effects (phenotype units per allele) and', HT.BR(),
- 'dominance deviations for some datasets.', HT.BR(),Class="fs12"), HT.BR(), valign="top")))
-
- marker_container.append(markerTable)
- marker_div.append(marker_container)
- mapping_container.append(marker_div)
-
- # Composite interval mapping
- composite_div = HT.Div(id="mappingtabs-3")
- composite_container = HT.Span()
-
- compositeTable = HT.TableLite(cellspacing=0, cellpadding=3, width="100%")
- compTD = HT.TD(valign="top",NOWRAP='ON', Class="fs12 fwn")
- compTD.append(compMappingMenu,HT.BR())
-
- compTD.append(permCheck2, 'Permutation Test (n=2000)',HT.BR(),
- bootCheck2,'Bootstrap Test (n=2000)', HT.BR(),
- optionbox3, 'Use Parents', HT.BR(), HT.BR(), CompositeMappingButton, HT.BR(), HT.BR())
- compositeTable.append(HT.TR(compTD), HT.TR(HT.TD(HT.Span(HT.Href(url='/glossary.html#Composite',target='_blank',text='Composite Interval Mapping'),
- " allows you to control for a single marker as",HT.BR()," a cofactor. ",
- "To find a control marker, run the ",HT.Bold("Marker Regression")," function."),
- HT.BR(), valign="top")))
-
- composite_container.append(compositeTable)
- composite_div.append(composite_container)
- mapping_container.append(composite_div)
-
- # Pair Scan
-
- pairscan_div = HT.Div(id="mappingtabs-4")
- pairscan_container = HT.Span()
-
- pairScanTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- pairScanTD = HT.TD(NOWRAP='ON', Class="fs12 fwn")
- pairScanTD.append(pairScanMenus,HT.BR())
- pairScanTD.append(directPlotPermu, directPlotPermuText, HT.BR(), HT.BR(),
- directPlotButton,HT.BR(),HT.BR())
- pairScanTable.append(HT.TR(pairScanTD), HT.TR(HT.TD(HT.Span(HT.Href(url='/glossary.html#Pair_Scan', target="_blank", text='Pair-Scan'),
- ' searches for pairs of chromosomal regions that are',HT.BR(),
- 'involved in two-locus epistatic interactions.'), HT.BR(), valign="top")))
-
- pairscan_container.append(pairScanTable)
- pairscan_div.append(pairscan_container)
- mapping_container.append(pairscan_div)
-
- mapping_row.append(HT.TD(mapping_container))
-
- # Treat Interval Mapping and Marker Regression and Pair Scan as a group for displaying
- #disable Interval Mapping and Marker Regression and Pair Scan for human and the dataset doesn't have genotype file
- mappingMethodId = webqtlDatabaseFunction.getMappingMethod(cursor=self.cursor, groupName=this_group)
-
- mapping_script = HT.Script(language="Javascript")
- mapping_script_text = """$(function() { $("#mapping_tabs").tabs(); });"""
- mapping_script.append(mapping_script_text)
-
- submitTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%", Class="target2")
-
- if not mappingMethodId:
- if int(mappingMethodId) == 1:
- submitTable.append(mapping_row)
- submitTable.append(mapping_script)
- elif int(mappingMethodId) == 4:
- # NL; 09-26-2011 testing for Human Genome Association function
- mapping_row=HT.TR()
- mapping_container = HT.Div(id="mapping_tabs", Class="ui-tabs")
-
- mapping_tab_list = [HT.Href(text="Genome Association", url="#mappingtabs-1")]
- mapping_tabs = HT.List(mapping_tab_list)
- mapping_container.append(mapping_tabs)
-
- # Genome Association
- markerSuggestiveText = HT.Span(HT.Bold("P Value:"), Class="ffl fwb fs12")
-
- markerSuggestive = HT.Input(name='pValue', value='0.001', size=10, maxlength=20,onClick="this.value='';",onBlur="if(this.value==''){this.value='0.001'};")
- markerMenu = HT.TableLite(HT.TR(HT.TD(markerSuggestiveText), HT.TD(markerSuggestive),HT.TD(HT.Italic('&nbsp;&nbsp;&nbsp;(e.g. 0.001 or 1e-3 or 1E-3 or 3)'))),cellspacing=0, width="400px", cellpadding=2)
- MarkerRegressionButton=HT.Input(type='button',name='computePlink', value='&nbsp;&nbsp;Compute Using PLINK&nbsp;&nbsp;', onClick= "validatePvalue(this.form);", Class="button")
-
- marker_div = HT.Div(id="mappingtabs-1")
- marker_container = HT.Span()
- markerTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- markerTD = HT.TD(valign="top",NOWRAP='ON', Class="fs12 fwn")
- markerTD.append(markerMenu,HT.BR())
- markerTD.append(MarkerRegressionButton,HT.BR(),HT.BR())
- markerTable.append(HT.TR(markerTD))
-
- marker_container.append(markerTable)
- marker_div.append(marker_container)
-
- mapping_container.append(marker_div)
- mapping_row.append(HT.TD(mapping_container))
- submitTable.append(mapping_row)
- submitTable.append(mapping_script)
- else:
- submitTable.append(HT.TR(HT.TD(HT.Div(HT.Italic("mappingMethodId %s has not been implemented for this dataset yet." % mappingMethodId), id="mapping_tabs", Class="ui-tabs"))))
- submitTable.append(mapping_script)
-
- else:
- submitTable.append(HT.TR(HT.TD(HT.Div(HT.Italic("Mapping options are disabled for data not matched with genotypes."), id="mapping_tabs", Class="ui-tabs"))))
- submitTable.append(mapping_script)
-
- title4Body.append(submitTable)
-
-
def make_sample_lists(self, this_trait):
all_samples_ordered = self.dataset.group.all_samples_ordered()
@@ -753,7 +210,7 @@ class ShowTrait(object):
logger.debug("primary_samples is: ", pf(primary_samples))
logger.debug("other_sample_names2:", other_sample_names)
- if other_sample_names and self.dataset.group.species != "human":
+ if other_sample_names and self.dataset.group.species != "human" and self.dataset.group.name != "CFW":
parent_f1_samples = None
if self.dataset.group.parlist and self.dataset.group.f1list:
parent_f1_samples = self.dataset.group.parlist + self.dataset.group.f1list
@@ -814,9 +271,9 @@ def get_genofiles(this_trait):
return jsondata['genofile']
def get_trait_table_width(sample_groups):
- table_width = 30
+ table_width = 20
if sample_groups[0].se_exists():
- table_width += 10
+ table_width += 15
if (table_width + len(sample_groups[0].attributes)*10) > 100:
table_width = 100
else:
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index 06586372..861af3d6 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"
],
[
- "383",
- "HLCM_0311",
- "GSE9588 Human Liver Normal (Mar11) Males"
- ],
- [
"384",
"HLCF_0311",
"GSE9588 Human Liver Normal (Mar11) Females"
+ ],
+ [
+ "383",
+ "HLCM_0311",
+ "GSE9588 Human Liver Normal (Mar11) Males"
]
],
"Phenotypes": [
@@ -1621,6 +1621,11 @@
"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"
@@ -1631,11 +1636,6 @@
"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,6 +1727,11 @@
],
"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"
@@ -1735,27 +1740,22 @@
"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": [
[
- "196",
- "UCLA_BHF2_ADIPOSE_MALE",
- "UCLA BHF2 Adipose Male mlratio"
- ],
- [
"197",
"UCLA_BHF2_ADIPOSE_FEMALE",
"UCLA BHF2 Adipose Female mlratio"
],
[
+ "196",
+ "UCLA_BHF2_ADIPOSE_MALE",
+ "UCLA BHF2 Adipose Male mlratio"
+ ],
+ [
"165",
"UCLA_BHF2_ADIPOSE_0605",
"UCLA BHF2 Adipose (June05) mlratio"
@@ -1763,16 +1763,16 @@
],
"Brain mRNA": [
[
- "198",
- "UCLA_BHF2_BRAIN_MALE",
- "UCLA BHF2 Brain Male mlratio"
- ],
- [
"199",
"UCLA_BHF2_BRAIN_FEMALE",
"UCLA BHF2 Brain Female mlratio"
],
[
+ "198",
+ "UCLA_BHF2_BRAIN_MALE",
+ "UCLA BHF2 Brain Male mlratio"
+ ],
+ [
"166",
"UCLA_BHF2_BRAIN_0605",
"UCLA BHF2 Brain (June05) mlratio"
@@ -1787,16 +1787,16 @@
],
"Liver mRNA": [
[
- "200",
- "UCLA_BHF2_LIVER_MALE",
- "UCLA BHF2 Liver Male mlratio"
- ],
- [
"201",
"UCLA_BHF2_LIVER_FEMALE",
"UCLA BHF2 Liver Female mlratio"
],
[
+ "200",
+ "UCLA_BHF2_LIVER_MALE",
+ "UCLA BHF2 Liver Male mlratio"
+ ],
+ [
"167",
"UCLA_BHF2_LIVER_0605",
"UCLA BHF2 Liver (June05) mlratio"
@@ -2000,6 +2000,11 @@
"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"
@@ -2010,11 +2015,6 @@
"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,6 +2081,11 @@
"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"
@@ -2091,11 +2096,6 @@
"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": [
[
- "240",
- "MA_M2M_0706_R",
- "Mouse kidney M430v2 Male (Aug06) RMA"
- ],
- [
"239",
"MA_M2F_0706_R",
"Mouse kidney M430v2 Female (Aug06) RMA"
],
[
+ "240",
+ "MA_M2M_0706_R",
+ "Mouse kidney M430v2 Male (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"
],
[
- "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"
+ ],
+ [
+ "274",
+ "DevNeocortex_ILM6.2P3RInv_1110",
+ "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv"
]
],
"Nucleus Accumbens mRNA": [
@@ -2761,6 +2761,11 @@
],
"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"
@@ -2769,11 +2774,6 @@
"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"
]
]
},
@@ -2852,6 +2852,11 @@
"CFW": {
"Hippocampus mRNA": [
[
+ "811",
+ "UCSD_CFW_HIP_RNA-Seq_log2_0117",
+ "UCSD CFW Hippocampus (Jan17) RNA-Seq Log2 Z-score"
+ ],
+ [
"808",
"UCSD_CFW_HIP_RNA-Seq_0117",
"UCSD CFW Hippocampus (Jan17) RNA-Seq"
@@ -2866,6 +2871,11 @@
],
"Prefrontal Cortex mRNA": [
[
+ "813",
+ "UCSD_CFW_PFC_RNA-Seq_log2_0117",
+ "UCSD CFW Prefrontal Cortex (Jan17) RNA-Seq Log2 Z-score"
+ ],
+ [
"810",
"UCSD_CFW_PFC_RNA-Seq_0117",
"UCSD CFW Prefrontal Cortex (Jan17) RNA-Seq"
@@ -2873,6 +2883,11 @@
],
"Striatum mRNA": [
[
+ "812",
+ "UCSD_CFW_STR_RNA-Seq_log2_0117",
+ "UCSD CFW Striatum (Jan17) RNA-Seq Log2 Z-score"
+ ],
+ [
"809",
"UCSD_CFW_SPL_RNA-Seq_0117",
"UCSD CFW Striatum (Jan17) RNA-Seq"
@@ -3082,6 +3097,11 @@
],
"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"
@@ -3102,11 +3122,6 @@
"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"
diff --git a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
index 1eeb6e73..e5787564 100644
--- a/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
+++ b/wqflask/wqflask/static/new/javascript/draw_probability_plot.js
@@ -45,8 +45,7 @@
chart = nv.models.scatterChart().width(w).height(h).showLegend(true).color(d3.scale.category10().range());
chart.pointRange([50, 50]);
chart.legend.updateState(false);
- chart.xAxis.axisLabel("Theoretical quantiles").tickFormat(d3.format('.02f'));
- //chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.02f'));
+ chart.xAxis.axisLabel("Expected Z score").tickFormat(d3.format('.02f'));
chart.tooltipContent(function(obj) {
return '<b style="font-size: 20px">' + obj.point.name + '</b>';
});
@@ -79,7 +78,7 @@
}
return results;
})();
- chart.yAxis.axisLabel("Sample quantiles").tickFormat(d3.format('.0'+max_decimals.toString()+'f'));
+ chart.yAxis.axisLabel("Trait value").tickFormat(d3.format('.0'+max_decimals.toString()+'f'));
sw_result = ShapiroWilkW(sorted_values);
W = sw_result.w.toFixed(3);
pvalue = sw_result.p.toFixed(3);
@@ -115,7 +114,12 @@
data = [make_data('samples_primary'), make_data('samples_other')];
console.log("THE DATA IS:", data);
d3.select("#prob_plot_container svg").datum(data).call(chart);
- $("#prob_plot_title").html("<h3>Normal probability plot</h3>" + test_str);
+ if (js_data.trait_symbol != null) {
+ $("#prob_plot_title").html("<h3>" + js_data.trait_symbol + ": " + js_data.trait_id + "</h3>");
+ } else {
+ $("#prob_plot_title").html("<h3>" + js_data.trait_id + "</h3>");
+ }
+ $("#shapiro_wilk_text").html(test_str)
$("#prob_plot_container .nv-legendWrap").toggle(sample_group === "samples_all");
return chart;
};
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 19955b07..8223a38c 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -18,19 +18,19 @@
}, {
vn: "mean",
pretty: "Mean",
- digits: 2
+ digits: 3
}, {
vn: "median",
pretty: "Median",
- digits: 2
+ digits: 3
}, {
vn: "std_error",
pretty: "Standard Error (SE)",
- digits: 2
+ digits: 3
}, {
vn: "std_dev",
pretty: "Standard Deviation (SD)",
- digits: 2
+ digits: 3
}, {
vn: "min",
pretty: "Minimum",
@@ -42,16 +42,16 @@
}, {
vn: "range",
pretty: "Range (log2)",
- digits: 2
+ digits: 3
}, {
vn: "range_fold",
pretty: "Range (fold)",
- digits: 2
+ digits: 3
}, {
vn: "interquartile",
pretty: "Interquartile Range",
url: "http://www.genenetwork.org/glossary.html#Interquartile",
- digits: 2
+ digits: 3
}
];
@@ -179,8 +179,13 @@
if (!__hasProp.call(_ref, key)) continue;
value = _ref[key];
the_id = process_id("column", key);
- header += "<th id=\"" + the_id + "\" style=\"padding-left: 5px;\">" + value + "</th>";
+ if (Object.keys(_ref).length > 1) {
+ header += "<th id=\"" + the_id + "\" style=\"padding-left: 5px;\">" + value + "</th>";
+ } else {
+ header += "<th id=\"" + the_id + "\" style=\"padding-left: 5px;\">Value</th>";
+ }
}
+
header += "</thead>";
the_rows = "<tbody>";
for (_i = 0, _len = Stat_Table_Rows.length; _i < _len; _i++) {
diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
index c1c25a58..d6cd8134 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
@@ -166,7 +166,7 @@
return function() {
var form_data, url;
//$("#progress_bar_container").modal();
- url = "/marker_regression";
+ url = "/loading";
$('input[name=method]').val("pylmm");
$('input[name=genofile]').val($('#genofile_pylmm').val());
$('input[name=num_perm]').val($('input[name=num_perm_pylmm]').val());
@@ -182,7 +182,7 @@
return function() {
var form_data, url;
//$("#progress_bar_container").modal();
- url = "/marker_regression";
+ url = "/loading";
$('input[name=method]').val("rqtl_geno");
$('input[name=genofile]').val($('#genofile_rqtl_geno').val());
$('input[name=num_perm]').val($('input[name=num_perm_rqtl_geno]').val());
@@ -212,7 +212,7 @@
return function() {
var form_data, url;
//$("#static_progress_bar_container").modal();
- url = "/marker_regression";
+ url = "/loading";
$('input[name=method]').val("plink");
$('input[name=maf]').val($('input[name=maf_plink]').val());
form_data = $('#trait_data_form').serialize();
@@ -227,7 +227,7 @@
var form_data, url;
console.log("RUNNING GEMMA");
//$("#static_progress_bar_container").modal();
- url = "/marker_regression";
+ url = "/loading";
$('input[name=method]').val("gemma");
$('input[name=maf]').val($('input[name=maf_gemma]').val());
form_data = $('#trait_data_form').serialize();
@@ -242,7 +242,7 @@
var form_data, url;
console.log("In interval mapping");
//$("#progress_bar_container").modal();
- url = "/marker_regression";
+ url = "/loading";
$('input[name=method]').val("reaper");
$('input[name=genofile]').val($('#genofile_reaper').val());
$('input[name=num_perm]').val($('input[name=num_perm_reaper]').val());
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 87f602dc..40e58ac8 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 4px 0px;
+ padding: 4px 16px 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/submit_trait.py b/wqflask/wqflask/submit_trait.py
deleted file mode 100644
index 4ab9a4be..00000000
--- a/wqflask/wqflask/submit_trait.py
+++ /dev/null
@@ -1,24 +0,0 @@
-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/base.html b/wqflask/wqflask/templates/base.html
index 210c5708..ec55ebeb 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -81,10 +81,10 @@
</div>
</div>
- <div class="container-fluid" style="background-color: #d5d5d5; height: 95px;">
+ <div class="container-fluid" style="position: relative; background-color: #d5d5d5; height: 95px;">
<form method="get" action="/gsearch">
- <div class="row">
+ <div class="row" style="position: absolute; bottom: 0; top: 30px;">
<select class="form-control col-xs-2" style="width: 170px; margin-top: 15px; margin-left: 10px;" name="type">
<option value="gene">Genes / Molecules</option>
<option value="phenotype" {% if type=="phenotype" %}selected{% endif %}>Phenotypes</option>
diff --git a/wqflask/wqflask/templates/data_sharing.html b/wqflask/wqflask/templates/data_sharing.html
index 4e92106a..366e2075 100644
--- a/wqflask/wqflask/templates/data_sharing.html
+++ b/wqflask/wqflask/templates/data_sharing.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block title %}Search Results{% endblock %}
+{% block title %}Data Sharing{% endblock %}
{% block content %}
<!-- Start of body -->
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html
index 205d5801..e8bb6337 100644
--- a/wqflask/wqflask/templates/gsearch_gene.html
+++ b/wqflask/wqflask/templates/gsearch_gene.html
@@ -44,14 +44,14 @@
<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>
+ <th data-export="Additive Effect">Additive <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 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 align="center" style="padding-right: 0px; 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 align="right" 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>
@@ -82,7 +82,7 @@
<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>
+ <th>Additive <a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</tfoot>
</table>
@@ -145,7 +145,7 @@
{ "type": "natural", "width": "4%" },
{ "type": "natural", "width": "5%" },
{ "type": "natural", "width": "7%" },
- { "type": "natural", "width": "7%" }
+ { "type": "natural", "width": "5%" }
],
"columnDefs": [
{
diff --git a/wqflask/wqflask/templates/links.html b/wqflask/wqflask/templates/links.html
index 80d752e6..6ff7fc6c 100644
--- a/wqflask/wqflask/templates/links.html
+++ b/wqflask/wqflask/templates/links.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block title %}Forgot Password{% endblock %}
+{% block title %}Links{% endblock %}
{% block content %}
<Table width= "100%" cellSpacing=0 cellPadding=5><TR>
diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html
index bc2627a0..cede0e86 100644
--- a/wqflask/wqflask/templates/loading.html
+++ b/wqflask/wqflask/templates/loading.html
@@ -1,14 +1,26 @@
-{% 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>
+<title>Loading Mapping Results</title>
+<link REL="stylesheet" TYPE="text/css" href="/static/packages/bootstrap/css/bootstrap.css" />
+<link REL="stylesheet" TYPE="text/css" href="/static/packages/bootstrap/css/non-responsive.css" />
+<link REL="stylesheet" TYPE="text/css" href="/static/packages/bootstrap/css/docs.css" />
+<link rel="stylesheet" type="text/css" href="/static/packages/colorbox/example4/colorbox.css" />
+<link rel="stylesheet" type="text/css" href="/static/new/css/main.css" />
+<form method="post" action="/marker_regression" name="loading_form" id="loading_form" class="form-horizontal">
+ {% for key, value in start_vars.iteritems() %}
+ <input type="hidden" name="{{ key }}" value="{{ value }}">
+ {% endfor %}
+ <div class="container">
+ <div class="row">
+ <div style="margin-left: 46%; margin-right: 50%; min-height: 100vh; display: flex; align-items: center;">
+ <h1>Loading&nbsp;Mapping&nbsp;Results...</h1>
+ </div>
+ <div class="progress center-block" style="margin-left: 25%; margin-right: 25%; position: absolute; height:50px; width:50%; top: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>
+ </div>
</div>
</form>
-{% endblock %}
-{% block js %}
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+<script src="/static/packages/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
$("#loading_form").submit();
-</script>
-{% endblock %} \ No newline at end of file
+</script> \ No newline at end of file
diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html
index c6112edb..6d3f9326 100644
--- a/wqflask/wqflask/templates/marker_regression_gn1.html
+++ b/wqflask/wqflask/templates/marker_regression_gn1.html
@@ -71,7 +71,7 @@
<input type="radio" name="LRSCheck" value="LRS" {% if LRS_LOD == "LRS" %}checked{% endif %}>LRS
</label>
<label class="radio-inline">
- <input type="radio" name="LRSCheck" value="LOD" {% if LRS_LOD == "LOD" %}checked{% endif %}>LOD
+ <input type="radio" name="LRSCheck" value="{% if LRS_LOD == "-log(p)" %}-log(p){% else %}LOD{% endif %}" {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %}checked{% endif %}>{% if LRS_LOD == "-log(p)" %}-log(p){% else %}LOD{% endif %}
</label>
<a href="http://genenetwork.org/glossary.html#LOD" target="_blank">
<sup style="color:#f00"> ?</sup>
@@ -121,7 +121,7 @@
<span style="color:red;">*</span>
<br>
<input type="checkbox" name="showGenes" class="checkbox" style="display: inline; margin-top: 0px;" {% if geneChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Gene Track </span> <span style="color:red;">*</span><br>
- {% if plotScale != "morgan" %}
+ {% if plotScale != "morgan" and mapping_method != "gemma" %}
<input type="checkbox" name="haplotypeAnalystCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if haplotypeAnalystChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Haplotype Analyst </span> <span style="color:red;">*</span><br>
{% endif %}
<input type="checkbox" name="viewLegend" class="checkbox" style="display: inline; margin-top: 0px;" {% if legendChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Legend </span>
@@ -173,10 +173,10 @@
</form>
{% if selectedChr == -1 %}
- <div style="width:{% if 'additive' in trimmed_markers[0] %}50%{% else %}35%{% endif %};">
+ <div style="width:{% if 'additive' in trimmed_markers[0] %}40%{% else %}30%{% endif %};">
<h2>Results</h2>
- <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
- <table id="qtl_results" class="table table-hover table-striped">
+ <div id="table_container">
+ <table id="qtl_results" class="table table-hover table-striped nowrap">
<thead>
<tr>
<th></th>
@@ -192,7 +192,7 @@
{% if 'additive' in trimmed_markers[0] %}
<th>Add Eff</th>
{% endif %}
- {% if 'dominance' in trimmed_markers[0] %}
+ {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
<th>Dom Eff</th>
{% endif %}
</tr>
@@ -200,33 +200,33 @@
<tbody>
{% for marker in trimmed_markers %}
<tr>
- <td>
+ <td align="center" style="padding-right: 0px;">
<input type="checkbox" name="selectCheck"
class="checkbox edit_sample_checkbox"
value="{{ marker.name }}" checked="checked">
</td>
<td align="right">{{ loop.index }}</td>
<td>{{ marker.name }}</td>
- {% if LRS_LOD == "LOD" %}
+ {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %}
{% if 'lod_score' in marker %}
- <td>{{ '%0.2f' | format(marker.lod_score|float) }}</td>
+ <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td>
{% else %}
- <td>{{ '%0.2f' | format(marker.lrs_value|float / 4.16) }}</td>
+ <td align="right">{{ '%0.2f' | format(marker.lrs_value|float / 4.16) }}</td>
{% endif %}
{% else %}
{% if 'lod_score' in marker %}
- <td>{{ '%0.2f' | format(marker.lod_score|float * 4.16) }}</td>
+ <td align="right">{{ '%0.2f' | format(marker.lod_score|float * 4.16) }}</td>
{% else %}
- <td>{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
+ <td align="right">{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
{% endif %}
{% endif %}
- <td>{{marker.chr}}</td>
- <td>{{ '%0.6f' | format(marker.Mb|float) }}</td>
+ <td align="right">{{marker.chr}}</td>
+ <td align="right">{{ '%0.6f' | format(marker.Mb|float) }}</td>
{% if 'additive' in marker %}
- <td>{{ '%0.3f' | format(marker.additive|float) }}</td>
+ <td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
{% endif %}
- {% if 'dominance' in marker %}
- <td>{{ '%0.2f' | format(marker.dominance|float) }}</td>
+ {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
+ <td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
{% endif %}
</tr>
{% endfor %}
@@ -237,8 +237,8 @@
{% else %}
<div>
<h2>Interval Analyst</h2>
- <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
- <table id="interval_analyst" class="table table-hover table-striped">
+ <div id="table_container">
+ <table id="interval_analyst" class="table table-hover table-striped nowrap">
<thead>
<tr>
{% for header in gene_table_header %}
@@ -274,12 +274,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="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script>
- <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script>
- <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.scientific.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>
js_data = {{ js_data | safe }}
@@ -296,34 +292,50 @@
$(document).ready( function () {
console.time("Creating table");
$('#qtl_results').DataTable( {
+ {% if mapping_method != "reaper" %}
"columns": [
- { "type": "natural", "width": "5%", "bSortable": false },
- { "type": "natural", "width": "6%" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural" }
- ],
- "order": [[1, "asc" ]],
- "buttons": [
- {
- extend: 'csvHtml5',
- text: 'Download CSV',
- title: 'search_results',
- fieldBoundary: '"',
- exportOptions: {
- columns: [1, 2, 3, 4, 5, 6, 7, 8]
- }
- }
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "20%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "15%" }
+ ],
+ {% elif dataset.group.genetic_type == "riset" %}
+ "columns": [
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "20%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "8%" }
],
- "sDom": "RZBtir",
+ {% else %}
+ "columns": [
+ { "type": "natural", "width": "5%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "20%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "8%" },
+ { "type": "natural", "width": "8%" }
+ ],
+ {% endif %}
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
+ "order": [[1, "asc" ]],
+ "sDom": "RZtir",
"iDisplayLength": -1,
- "bDeferRender": true,
+ "autoWidth": false,
+ "deferRender": true,
"bSortClasses": false,
- "scrollY": true,
+ "scrollY": "600px",
"scrollCollapse": false,
+ "scroller": true,
"paging": false
} );
@@ -333,18 +345,7 @@
"sortable": false
}],
"order": [[3, "asc" ]],
- "buttons": [
- {
- extend: 'csvHtml5',
- text: 'Download CSV',
- title: 'search_results',
- fieldBoundary: '"',
- exportOptions: {
- columns: [1, 2, 3, 4, 5, 6, 7, 8, 9]
- }
- }
- ],
- "sDom": "RZBtir",
+ "sDom": "RZtir",
"iDisplayLength": -1,
"bDeferRender": true,
"bSortClasses": false,
diff --git a/wqflask/wqflask/templates/policies.html b/wqflask/wqflask/templates/policies.html
index aa5c453d..83b6b3c0 100644
--- a/wqflask/wqflask/templates/policies.html
+++ b/wqflask/wqflask/templates/policies.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block title %}GeneNetwork{% endblock %}
+{% block title %}Policies{% endblock %}
{% block content %}
<Table width= "100%" cellSpacing=0 cellPadding=5><TR>
diff --git a/wqflask/wqflask/templates/reference.html b/wqflask/wqflask/templates/reference.html
index 4ad97522..cc4408e1 100644
--- a/wqflask/wqflask/templates/reference.html
+++ b/wqflask/wqflask/templates/reference.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block title %}GeneNetwork{% endblock %}
+{% block title %}References{% endblock %}
{% block content %}
<TABLE cellSpacing=5 cellPadding=4 width="100%" border=0>
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index cafa8b93..718b31d3 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -10,7 +10,7 @@
{{ header("Search Results",
'GeneNetwork found {}.'.format(numify(results|count, "record", "records"))) }}
- <div>
+ <div style="padding-left: 10px;">
<input type="hidden" name="uc_id" id="uc_id" value="{{ uc_id }}">
<!-- Need to customize text more for other types of searches -->
@@ -86,7 +86,7 @@
{% if header == 'Max LRS' %}
<th data-export="Max LRS">Max LRS</th>
{% elif header == 'Additive Effect' %}
- <th data-export="Additive Effect">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Additive Effect">Additive <a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
{% else %}
<th data-export="{{header}}">{{header}}</th>
{% endif %}
@@ -182,6 +182,8 @@
$('.trait_checkbox:checkbox').on("change", change_buttons);
},
"createdRow": function ( row, data, index ) {
+ $('td', row).eq(0).attr('style', 'padding-right: 0px;');
+ $('td', row).eq(0).attr('align', 'center');
$('td', row).eq(1).attr('align', 'right');
$('td', row).eq(1).attr('data-export', index+1);
$('td', row).eq(2).attr('data-export', $('td', row).eq(2).text());
@@ -189,8 +191,8 @@
$('td', row).eq(3).attr('data-export', $('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));
+ if ($('td', row).eq(4).text().length > 60) {
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 60));
$('td', row).eq(4).text($('td', row).eq(4).text() + '...')
}
$('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
@@ -208,12 +210,12 @@
{ "type": "natural", "width": "4%" },
{ "type": "natural", "width": "12%" },
{ "type": "natural", "width": "12%" },
- { "type": "natural", "width": "30%" },
- { "type": "natural", "width": "10%" },
- { "type": "natural", "width": "6%" },
+ { "type": "natural", "width": "25%" },
+ { "type": "natural", "width": "11%" },
+ { "type": "natural", "width": "5%" },
{ "type": "natural", "width": "6%" },
- { "type": "natural", "width": "12%" },
- { "type": "natural", "width": "10%" }
+ { "type": "natural", "width": "11%" },
+ { "type": "natural", "width": "6%" }
],
"columnDefs": [ {
"targets": 0,
@@ -266,7 +268,7 @@
$('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('align', 'right');
$('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
$('td', row).eq(6).attr('align', 'right');
$('td', row).eq(6).attr('data-export', $('td', row).eq(6).text());
@@ -283,8 +285,8 @@
{ "type": "natural", "width": "25%" },
{ "type": "natural", "width": "5%" },
{ "type": "natural", "width": "6%" },
- { "type": "natural", "width": "9%" },
- { "type": "natural", "width": "7%" }
+ { "type": "natural", "width": "10%" },
+ { "type": "natural", "width": "9%" }
],
"columnDefs": [ {
"targets": 0,
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index d7e60b61..772c4314 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -237,10 +237,10 @@
$('#samples_primary, #samples_other').DataTable( {
"columns": [
- { "bSortable": false },
- { "type": "natural" },
- null,
- { "type": "cust-txt" }{% if sample_groups[0].attributes|length > 0 %},{% endif %}
+ { "bSortable": false, "width": "8%" },
+ { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "25%" },
+ { "type": "cust-txt", "width": "25%" }{% if sample_groups[0].attributes|length > 0 %},{% endif %}
{% for attribute in sample_groups[0].attributes %}
{ "type": "natural" }{% if loop.index < sample_groups[0].attributes|length %},{% endif %}
{% endfor %}
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index 017a88ae..547c3c27 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -1,17 +1,19 @@
<table class="table">
<tr>
- <td>Species</td>
- <td>{{ this_trait.dataset.group.species }}</td>
- </tr>
- <tr>
- <td>Group</td>
- <td>{{ this_trait.dataset.group.name }}</td>
+ <td>Species and Group</td>
+ <td>{{ this_trait.dataset.group.species }}, {{ this_trait.dataset.group.name }}</td>
</tr>
<tr>
<td>Tissue</td>
<td>{{ this_trait.dataset.tissue }}</td>
</tr>
{% if this_trait.dataset.type == 'ProbeSet' %}
+ {% if this_trait.symbol != None %}
+ <tr>
+ <td>Gene Symbol</td>
+ <td>{{ this_trait.symbol }}</td>
+ </tr>
+ {% endif %}
<tr>
<td>Aliases</td>
<td>{{ this_trait.alias_fmt|replace(",",";") }}</td>
@@ -74,49 +76,35 @@
<div style="margin-bottom:15px;" class="btn-toolbar">
<div class="btn-group">
<a href="#redirect">
- <button type="button" id="add_to_collection" class="btn btn-primary" title="Add to collection">
- <i class="icon-plus-sign icon-white"></i> Add
- </button>
+ <button type="button" id="add_to_collection" class="btn btn-primary" title="Add to collection">Add</button>
</a>
{% if this_trait.dataset.type == 'ProbeSet' %}
{% if this_trait.symbol != None %}
- <a href="http://www.genenetwork.org/webqtl/main.py?cmd=sch&amp;gene={{ this_trait.symbol }}&amp;alias=1&amp;species={{ species_name }}">
- <button type="button" class="btn btn-default" title="Find similar expression data">
- <i class="icon-search"></i> Find
- </button>
+ <a href="http://www.genenetwork.org/webqtl/main.py?cmd=sch&amp;gene={{ this_trait.symbol }}&amp;alias=1&amp;species={{ dataset.group.species }}">
+ <button type="button" class="btn btn-default" title="Find similar expression data">Find</button>
</a>
{% endif %}
{% if UCSC_BLAT_URL != "" %}
<a href="{{ UCSC_BLAT_URL }}">
- <button type="button" class="btn btn-default" title="Check probe locations at UCSC">
- <i class="icon-ok"></i> Verify
- </button>
+ <button type="button" class="btn btn-default" title="Check probe locations at UCSC">Verify</button>
</a>
{% endif %}
{% if this_trait.symbol != None %}
<a href="http://genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}">
- <button type="button" class="btn btn-default" title="Write or review comments about this gene">
- <i class="icon-edit"></i> GeneWiki
- </button>
+ <button type="button" class="btn btn-default" title="Write or review comments about this gene">GeneWiki</button>
</a>
<a href="http://genenetwork.org/webqtl/main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True&geneName={{ this_trait.symbol }}">
- <button type="button" class="btn btn-default" title="View SNPs and Indels">
- <i class="icon-road"></i> SNPs
- </button>
+ <button type="button" class="btn btn-default" title="View SNPs and Indels">SNPs</button>
</a>
{% endif %}
{% if UTHSC_BLAT_URL != "" %}
<a href="{{ UTHSC_BLAT_URL }}">
- <button type="button" class="btn btn-default" title="View probes, SNPs, and RNA-seq at UTHSC">
- <i class="icon-eye-close"></i> RNA-seq
- </button>
+ <button type="button" class="btn btn-default" title="View probes, SNPs, and RNA-seq at UTHSC">RNA-seq</button>
</a>
{% endif %}
{% if show_probes == "True" %}
<a href="http://genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON">
- <button type="button" class="btn btn-default" title="Check sequence of probes">
- <i class="icon-list"></i> Probes
- </button>
+ <button type="button" class="btn btn-default" title="Check sequence of probes">Probes</button>
</a>
{% endif %}
{% endif %}
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
index 8821167b..a431821e 100644
--- a/wqflask/wqflask/templates/show_trait_edit_data.html
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -100,7 +100,7 @@
<tbody>
{% for sample in sample_type.sample_list %}
<tr class="{{ sample.class_outlier }} value_se" id="{{ sample.this_id }}">
- <td class="column_name-"><input type="checkbox" name="selectCheck" class="checkbox edit_sample_checkbox" style="transform: scale(1.5);" value="{{ sample.name }}" checked="checked">
+ <td align="center" style="padding-right: 0px;" class="column_name-"><input type="checkbox" name="selectCheck" class="checkbox edit_sample_checkbox" value="{{ sample.name }}" checked="checked">
</td>
<td class="column_name-Index" align="right">{{ loop.index }}</td>
<td class="column_name-Sample">
@@ -110,12 +110,12 @@
</td>
{# Todo: Add IDs #}
- <td class="column_name-Value">
+ <td class="column_name-Value" align="right">
<input type="text" data-value="{{ sample.display_value }}" name="{{ 'value:' + sample.name }}"
style="text-align:right;"
class="trait_value_input edit_sample_value"
value="{{ sample.display_value }}"
- size=8 maxlength=8
+ size=6 maxlength=6
>
</td>
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 283ee7e5..12ba80b9 100644
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -4,7 +4,8 @@
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-pills">
- {% if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" %}
+ {# if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" #}
+ {% if dataset.group.mapping_id == "1" %}
<li class="active">
<a href="#interval_mapping" data-toggle="tab">Interval Mapping</a>
</li>
@@ -15,21 +16,25 @@
<a href="#rqtl_geno" data-toggle="tab">R/qtl</a>
</li>
{% endif %}
- {% if use_plink_gemma %}
+ {# if use_plink_gemma #}
+ {% if dataset.group.mapping_id == "2" or dataset.group.mapping_id == "4" %}
<li class="active">
<a href="#gemma" data-toggle="tab">GEMMA</a>
</li>
+ {% if dataset.group.mapping_id == "4" %}
<li>
<a href="#plink" data-toggle="tab">PLINK</a>
</li>
{% endif %}
+ {% endif %}
<!--<li>
<a href="#pair_scan" data-toggle="tab">Pair Scan</a>
</li>-->
</ul>
<div class="tab-content">
- {% if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" %}
+ {# if use_pylmm_rqtl and not use_plink_gemma and dataset.group.species != "human" #}
+ {% if dataset.group.mapping_id == "1" %}
<div class="tab-pane active" id="interval_mapping">
<div style="margin-top: 20px" class="form-horizontal">
{% if genofiles and genofiles|length>0 %}
@@ -298,7 +303,8 @@
</div>
</div>
{% endif %}
- {% if use_plink_gemma %}
+ {# if use_plink_gemma #}
+ {% if dataset.group.mapping_id == "2" or dataset.group.mapping_id == "4" %}
<div class="tab-pane active" id="gemma">
<div style="padding: 20px" class="form-horizontal">
<div class="mapping_method_fields form-group">
@@ -318,6 +324,7 @@
</div>
</div>
</div>
+ {% if dataset.group.mapping_id == "4" %}
<div class="tab-pane" id="plink">
<div style="padding: 20px" class="form-horizontal">
<div class="mapping_method_fields form-group">
@@ -338,6 +345,7 @@
</div>
</div>
{% endif %}
+ {% endif %}
</div>
</div>
</div>
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
index 8e237868..0a0e9990 100644
--- a/wqflask/wqflask/templates/show_trait_statistics.html
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -106,11 +106,11 @@
<div id="prob_plot_title"></div>
<svg></svg>
</div>
-
+ <div id="shapiro_wilk_text"></div>
<div>
More about <a href="http://en.wikipedia.org/wiki/Normal_probability_plot">Normal Probability Plots</a> and more
about interpreting these plots from the <a href="http://genenetwork.org/glossary.html#normal_probability">glossary</a>
- </div>
+ </div>
</div>
diff --git a/wqflask/wqflask/templates/submit_trait.html b/wqflask/wqflask/templates/submit_trait.html
index df6b0bb7..2529a4f4 100644
--- a/wqflask/wqflask/templates/submit_trait.html
+++ b/wqflask/wqflask/templates/submit_trait.html
@@ -2,13 +2,12 @@
{% block title %}Trait Submission{% endblock %}
{% block content %}
<!-- Start of body -->
-
+ <form method="post" action="/show_trait">
<div class="container-fluid">
{{ flash_me() }}
<div class="row" style="width: 1400px !important;">
-
<div class="col-xs-5">
<section id="description">
<div>
@@ -36,7 +35,7 @@
<div style="padding-bottom: 50px;" class="form-horizontal">
<h3>1. Choose cross or RI set:</h3>
<br>
- <div class="col-xs-2">
+ <div class="col-xs-2" style="min-height: 15vh; display: flex; align-items: center;">
<img src="/static/new/images/step1.gif">
</div>
<div class="col-xs-10">
@@ -52,44 +51,47 @@
<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 class="form-horizontal"><img src="/static/new/images/arrowdown.gif" style="display:block; margin-left: 50%; margin-right: 50%;"></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;">
+ <div class="col-xs-2" style="min-height: 100vh; display: flex; align-items: center;">
<img src="/static/new/images/step2.gif">
</div>
<div class="col-xs-10">
- <div class="form-group">
+ <div class="form-group" style="padding-left: 15px;">
<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.
+ 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 class="form-group" style="padding-left: 15px;">
+ <p>
+ <b>By Pasting or Typing Multiple Values:</b> You can enter data by pasting a series of numbers representing trait values into this area.
+ 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 inbredline. 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 in the previous section,
+ any data that you paste here will be ignored. Check sample data for the correct format.
+ </p>
+ <textarea name="trait_paste" rows="6" cols="70"></textarea>
+ </div>
+ </div>
+ <div class="controls" style="display:block; margin-left: 40%; margin-right: 20%;">
+ <input type="submit" style="width: 110px; margin-right: 25px;" class="btn btn-primary form-control col-xs-2" value="Submit Trait">
+ <input type="reset" style="width: 110px;" class="btn btn-primary form-control col-xs-2" value="Reset">
</div>
</div>
</section>
</div>
</div>
</div>
+ </form>
{%endblock%}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 4f46a904..ab6c433d 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -50,10 +50,11 @@ 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 wqflask.trait_submission import submit_trait
from utility import temp_data
from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION
+from utility.helper_functions import get_species_groups
from base import webqtlFormData
from base.webqtlConfig import GENERATED_IMAGE_DIR
@@ -296,10 +297,19 @@ def environments():
return render_template("docs.html", **doc.__dict__)
@app.route("/submit_trait")
-def submit_trait():
+def submit_trait_form():
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("/create_temp_trait", methods=('POST',))
+def create_temp_trait():
+ print("REQUEST.FORM:", request.form)
+ #template_vars = submit_trait.SubmitTrait(request.form)
+
+ doc = docs.Docs("links")
+ return render_template("links.html", **doc.__dict__)
+ #return render_template("show_trait.html", **template_vars.__dict__)
+
@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"""
@@ -381,9 +391,6 @@ def export_perm_data():
@app.route("/show_trait")
def show_trait_page():
- # Here it's currently too complicated not to use an fd that is a webqtlFormData
- #fd = webqtlFormData.webqtlFormData(request.args)
- #logger.info("stp y1:", pf(vars(fd)))
template_vars = show_trait.ShowTrait(request.args)
#logger.info("js_data before dump:", template_vars.js_data)
template_vars.js_data = json.dumps(template_vars.js_data,
@@ -450,8 +457,9 @@ def mapping_results_container_page():
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']
+ #temp_uuid = initial_start_vars['temp_uuid']
wanted = (
+ 'temp_uuid',
'trait_id',
'dataset',
'method',
@@ -488,12 +496,14 @@ def loading_page():
'mapmethod_rqtl_geno',
'mapmodel_rqtl_geno'
)
+ start_vars_container = {}
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)
+ start_vars_container['start_vars'] = start_vars
+ rendered_template = render_template("loading.html", **start_vars_container)
return rendered_template