From 88022d6c26b320cb614454b706fad26fcd34033e Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 31 May 2012 17:10:28 -0500
Subject: On branch develop Changes to be committed: modified:
web/javascript/jqueryFunction.js modified:
web/webqtl/correlation/CorrelationPage.py modified:
web/webqtl/showTrait/DataEditingPage.py
---
web/webqtl/correlation/CorrelationPage.py | 1118 ++++++++++++++++-------------
web/webqtl/showTrait/DataEditingPage.py | 35 +-
2 files changed, 639 insertions(+), 514 deletions(-)
mode change 100644 => 100755 web/webqtl/showTrait/DataEditingPage.py
(limited to 'web/webqtl')
diff --git a/web/webqtl/correlation/CorrelationPage.py b/web/webqtl/correlation/CorrelationPage.py
index 8ce669cb..1fd16021 100755
--- a/web/webqtl/correlation/CorrelationPage.py
+++ b/web/webqtl/correlation/CorrelationPage.py
@@ -23,6 +23,9 @@
# Created by GeneNetwork Core Team 2010/08/10
#
# Last updated by NL 2011/02/11
+# Last updated by Christian Fernandez 2012/04/07
+# Refactored correlation calculation into smaller functions in preparation of
+# separating html from existing code
import string
from math import *
@@ -47,447 +50,324 @@ from dbFunction import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from correlation import correlationFunction
+import logging
+logging.basicConfig(filename="/tmp/gn_log", level=logging.INFO)
+_log = logging.getLogger("correlation")
-class CorrelationPage(templatePage):
+METHOD_SAMPLE_PEARSON = "1"
+METHOD_SAMPLE_RANK = "2"
+METHOD_LIT = "3"
+METHOD_TISSUE_PEARSON = "4"
+METHOD_TISSUE_RANK = "5"
- corrMinInformative = 4
+TISSUE_METHODS = [METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK]
- def __init__(self, fd):
+TISSUE_MOUSE_DB = 1
- #XZ, 01/14/2009: This method is for parallel computing only.
- #XZ: It is supposed to be called when "Genetic Correlation, Pearson's r" (method 1)
- #XZ: or "Genetic Correlation, Spearman's rho" (method 2) is selected
- def compute_corr( input_nnCorr, input_trait, input_list, computing_method):
+class AuthException(Exception): pass
- allcorrelations = []
- for line in input_list:
- tokens = line.split('","')
- tokens[-1] = tokens[-1][:-2] #remove the last "
- tokens[0] = tokens[0][1:] #remove the first "
+class Trait(object):
+ def __init__(self, name, raw_values = None, lit_corr = None, tissue_corr = None, p_tissue = None):
+ self.name = name
+ self.raw_values = raw_values
+ self.lit_corr = lit_corr
+ self.tissue_corr = tissue_corr
+ self.p_tissue = p_tissue
+ self.correlation = 0
+ self.p_value = 0
- traitdataName = tokens[0]
- database_trait = tokens[1:]
+ @staticmethod
+ def from_csv(line, data_start = 1):
+ name = line[0]
+ numbers = line[data_start:]
+ # _log.info(numbers)
+ numbers = [ float(number) for number in numbers ]
- if computing_method == "1": #XZ: Pearson's r
- corr,nOverlap = utility.webqtlUtil.calCorrelationText(input_trait, database_trait, input_nnCorr)
- else: #XZ: Spearman's rho
- corr,nOverlap = utility.webqtlUtil.calCorrelationRankText(input_trait, database_trait, input_nnCorr)
- traitinfo = [traitdataName,corr,nOverlap]
- allcorrelations.append(traitinfo)
+ return Trait(name, raw_values = numbers)
- return allcorrelations
+ def calculate_correlation(self, values, method):
+ """Calculate the correlation value and p value according to the method specified"""
+ #ZS: This takes the list of values of the trait our selected trait is being correlated against and removes the values of the samples our trait has no value for
+ #There's probably a better way of dealing with this, but I'll have to ask Christian
+ updated_raw_values = []
+ updated_values = []
+ for i in range(len(values)):
+ if values[i] != "None":
+ updated_raw_values.append(self.raw_values[i])
+ updated_values.append(values[i])
- templatePage.__init__(self, fd)
+ self.raw_values = updated_raw_values
+ values = updated_values
- if not self.openMysql():
- return
-
- if not fd.genotype:
- fd.readGenotype()
+ if method == METHOD_SAMPLE_PEARSON or method == METHOD_LIT or method == METHOD_TISSUE_PEARSON:
+ corr,nOverlap = webqtlUtil.calCorrelation(self.raw_values, values, len(values))
+ else:
+ corr,nOverlap = webqtlUtil.calCorrelationRank(self.raw_values, values, len(values))
- #XZ, 09/18/2008: get the information such as value, variance of the input strain names from the form.
- if fd.allstrainlist:
- mdpchoice = fd.formdata.getvalue('MDPChoice')
- #XZ, in HTML source code, it is "BXD Only" or "BXH only", and so on
- if mdpchoice == "1":
- strainlist = fd.f1list + fd.strainlist
- #XZ, in HTML source code, it is "MDP Only"
- elif mdpchoice == "2":
- strainlist = []
- strainlist2 = fd.f1list + fd.strainlist
- for strain in fd.allstrainlist:
- if strain not in strainlist2:
- strainlist.append(strain)
- #So called MDP Panel
- if strainlist:
- strainlist = fd.f1list+fd.parlist+strainlist
- #XZ, in HTML source code, it is "All Cases"
+ self.correlation = corr
+ self.overlap = nOverlap
+
+ if self.overlap < 3:
+ self.p_value = 1.0
+ else:
+ #ZS - This is probably the wrong way to deal with this. Correlation values of 1.0 definitely exist (the trait correlated against itself), so zero division needs to br prevented.
+ if abs(self.correlation) >= 1.0:
+ self.p_value = 0.0
else:
- strainlist = fd.allstrainlist
- #XZ, 09/18/2008: put the trait data into dictionary fd.allTraitData
- fd.readData(fd.allstrainlist)
- else:
- mdpchoice = None
- strainlist = fd.strainlist
- #XZ, 09/18/2008: put the trait data into dictionary fd.allTraitData
- fd.readData()
+ ZValue = 0.5*log((1.0+self.correlation)/(1.0-self.correlation))
+ ZValue = ZValue*sqrt(self.overlap-3)
+ self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue)))
- #XZ, 3/16/2010: variable RISet must be pass by the form
- RISet = fd.RISet
- #XZ, 12/12/2008: get species infomation
- species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=RISet)
+
- #XZ, 09/18/2008: get all information about the user selected database.
- self.target_db_name = fd.formdata.getvalue('database')
+#XZ, 01/14/2009: This method is for parallel computing only.
+#XZ: It is supposed to be called when "Genetic Correlation, Pearson's r" (method 1)
+#XZ: or "Genetic Correlation, Spearman's rho" (method 2) is selected
+def compute_corr( input_nnCorr, input_trait, input_list, computing_method):
+
+ allcorrelations = []
+
+ for line in input_list:
+ tokens = line.split('","')
+ tokens[-1] = tokens[-1][:-2] #remove the last "
+ tokens[0] = tokens[0][1:] #remove the first "
+
+ traitdataName = tokens[0]
+ database_trait = tokens[1:]
+
+ if computing_method == "1": #XZ: Pearson's r
+ corr,nOverlap = utility.webqtlUtil.calCorrelationText(input_trait, database_trait, input_nnCorr)
+ else: #XZ: Spearman's rho
+ corr,nOverlap = utility.webqtlUtil.calCorrelationRankText(input_trait, database_trait, input_nnCorr)
+ traitinfo = [traitdataName,corr,nOverlap]
+ allcorrelations.append(traitinfo)
+
+ return allcorrelations
+
+def get_correlation_method_key(form_data):
+ #XZ, 09/28/2008: if user select "1", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "2", then display 2, 3 and 5.
+ #XZ, 09/28/2008: if user select "3", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "4", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "5", then display 2, 3 and 5.
+
+ method = form_data.formdata.getvalue("method")
+ if method not in ["1", "2", "3" ,"4", "5"]:
+ return "1"
+
+ return method
+
+
+def get_custom_trait(form_data, cursor):
+ """Pulls the custom trait, if it exists, out of the form data"""
+ trait_name = form_data.formdata.getvalue('fullname')
+
+ if trait_name:
+ trait = webqtlTrait(fullname=trait_name, cursor=cursor)
+ trait.retrieveInfo()
+ return trait
+ else:
+ return None
+
+
+#XZ, 09/18/2008: get the information such as value, variance of the input strain names from the form.
+def get_sample_data(form_data):
+ if form_data.allstrainlist:
+ mdpchoice = form_data.formdata.getvalue('MDPChoice')
+ #XZ, in HTML source code, it is "BXD Only" or "BXH only", and so on
+ if mdpchoice == "1":
+ strainlist = form_data.f1list + form_data.strainlist
+ #XZ, in HTML source code, it is "MDP Only"
+ elif mdpchoice == "2":
+ strainlist = []
+ strainlist2 = form_data.f1list + form_data.strainlist
+ for strain in form_data.allstrainlist:
+ if strain not in strainlist2:
+ strainlist.append(strain)
+ #So called MDP Panel
+ if strainlist:
+ strainlist = form_data.f1list+form_data.parlist+strainlist
+ #XZ, in HTML source code, it is "All Cases"
+ else:
+ strainlist = form_data.allstrainlist
+ #XZ, 09/18/2008: put the trait data into dictionary form_data.allTraitData
+ form_data.readData(form_data.allstrainlist)
+ else:
+ mdpchoice = None
+ strainlist = form_data.strainlist
+ #XZ, 09/18/2008: put the trait data into dictionary form_data.allTraitData
+ form_data.readData()
+
+ return strainlist
+
+
+def get_mdp_choice(form_data):
+ if form_data.allstrainlist:
+ return form_data.formdata.getvalue("MDPChoice")
+ else:
+ return None
+
+
+def get_species(fd, cursor):
+ #XZ, 3/16/2010: variable RISet must be pass by the form
+ RISet = fd.RISet
+ #XZ, 12/12/2008: get species infomation
+ species = webqtlDatabaseFunction.retrieveSpecies(cursor=cursor, RISet=RISet)
+ return species
+
+
+def sortTraitCorrelations(traits, method="1"):
+ if method in TISSUE_METHODS:
+ traits.sort(key=lambda trait: trait.tissue_corr != None and abs(trait.tissue_corr), reverse=True)
+ elif method == METHOD_LIT:
+ traits.sort(key=lambda trait: trait.lit_corr != None and abs(trait.lit_corr), reverse=True)
+ else:
+ traits.sort(key=lambda trait: trait.correlation != None and abs(trait.correlation), reverse=True)
+
+ return traits
+
+
+def auth_user_for_db(db, cursor, target_db_name, privilege, username):
+ """Authorize a user for access to a database if that database is
+ confidential. A db (identified by a record in ProbeSetFreeze) contains a
+ list of authorized users who may access it, as well as its confidentiality
+ level.
+
+ If the current user's privilege level is greater than 'user', ie: root or
+ admin, then they are automatically authed, otherwise, check the
+ AuthorizedUsers field for the presence of their name."""
+
+ if db.type == 'ProbeSet':
+ cursor.execute('SELECT Id, Name, FullName, confidentiality, AuthorisedUsers FROM ProbeSetFreeze WHERE Name = "%s"' % target_db_name)
+ indId, indName, indFullName, confidential, AuthorisedUsers = cursor.fetchall()[0]
+
+ if confidential:
+ authorized = 0
+
+ #for the dataset that confidentiality is 1
+ #1. 'admin' and 'root' can see all of the dataset
+ #2. 'user' can see the dataset that AuthorisedUsers contains his id(stored in the Id field of User table)
+ if webqtlConfig.USERDICT[privilege] > webqtlConfig.USERDICT['user']:
+ authorized = 1
+ else:
+ if username in AuthorisedUsers.split(","):
+ authorized = 1
+
+ if not authorized:
+ raise AuthException("The %s database you selected is not open to the public at this time, please go back and select other database." % indFullName)
- try:
- self.db = webqtlDataset(self.target_db_name, self.cursor)
- except:
- heading = "Correlation Table"
- detail = ["The database you just requested has not been established yet."]
- self.error(heading=heading,detail=detail)
- return
- #XZ, 09/18/2008: check if user has the authority to get access to the database.
- if self.db.type == 'ProbeSet':
- self.cursor.execute('SELECT Id, Name, FullName, confidentiality, AuthorisedUsers FROM ProbeSetFreeze WHERE Name = "%s"' % self.target_db_name)
- indId, indName, indFullName, confidential, AuthorisedUsers = self.cursor.fetchall()[0]
+class CorrelationPage(templatePage):
- if confidential == 1:
- access_to_confidential_dataset = 0
+ corrMinInformative = 4
- #for the dataset that confidentiality is 1
- #1. 'admin' and 'root' can see all of the dataset
- #2. 'user' can see the dataset that AuthorisedUsers contains his id(stored in the Id field of User table)
- if webqtlConfig.USERDICT[self.privilege] > webqtlConfig.USERDICT['user']:
- access_to_confidential_dataset = 1
- else:
- AuthorisedUsersList=AuthorisedUsers.split(',')
- if AuthorisedUsersList.__contains__(self.userName):
- access_to_confidential_dataset = 1
+ PAGE_HEADING = "Correlation Table"
+ CORRELATION_METHODS = {"1" : "Genetic Correlation (Pearson's r)",
+ "2" : "Genetic Correlation (Spearman's rho)",
+ "3" : "SGO Literature Correlation",
+ "4" : "Tissue Correlation (Pearson's r)",
+ "5" : "Tissue Correlation (Spearman's rho)"}
- if not access_to_confidential_dataset:
- #Error, Confidential Database
- heading = "Correlation Table"
- detail = ["The %s database you selected is not open to the public at this time, please go back and select other database." % indFullName]
- self.error(heading=heading,detail=detail,error="Confidential Database")
- return
+ RANK_ORDERS = {"1": 0, "2": 1, "3": 0, "4": 0, "5": 1}
- #XZ, 09/18/2008: filter out the strains that have no value.
- _strains, _vals, _vars, N = fd.informativeStrains(strainlist)
- N = len(_strains)
+ def error(self, message, error="Error", heading = None):
+ heading = heading or self.PAGE_HEADING
+ return templatePage.error(heading = heading, detail = [message], error=error)
- if N < self.corrMinInformative:
- heading = "Correlation Table"
- detail = ['Fewer than %d strain data were entered for %s data set. No calculation of correlation has been attempted.' % (self.corrMinInformative, RISet)]
- self.error(heading=heading,detail=detail)
+ def __init__(self, fd):
+
+ # Call the superclass constructor
+ templatePage.__init__(self, fd)
+
+ # Connect to the database
+ if not self.openMysql():
return
- #XZ, 09/28/2008: if user select "1", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "2", then display 2, 3 and 5.
- #XZ, 09/28/2008: if user select "3", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "4", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "5", then display 2, 3 and 5.
- methodDict = {"1":"Genetic Correlation (Pearson's r)","2":"Genetic Correlation (Spearman's rho)","3":"SGO Literature Correlation","4":"Tissue Correlation (Pearson's r)", "5":"Tissue Correlation (Spearman's rho)"}
- self.method = fd.formdata.getvalue('method')
- if self.method not in ("1","2","3","4","5"):
- self.method = "1"
+ # Read the genotype from a file
+ if not fd.genotype:
+ fd.readGenotype()
- self.returnNumber = int(fd.formdata.getvalue('criteria'))
+ sample_list = get_sample_data(fd)
+ mdp_choice = get_mdp_choice(fd) # No idea what this is yet
+ self.species = get_species(fd, self.cursor)
- myTrait = fd.formdata.getvalue('fullname')
- if myTrait:
- myTrait = webqtlTrait(fullname=myTrait, cursor=self.cursor)
- myTrait.retrieveInfo()
+ #XZ, 09/18/2008: get all information about the user selected database.
+ target_db_name = fd.formdata.getvalue('database')
+ self.target_db_name = target_db_name
- # We will not get Literature Correlations if there is no GeneId because there is nothing to look against
try:
- input_trait_GeneId = int(fd.formdata.getvalue('GeneId'))
+ self.db = webqtlDataset(target_db_name, self.cursor)
except:
- input_trait_GeneId = None
+ detail = ["The database you just requested has not been established yet."]
+ self.error(detail)
+ return
- # We will not get Tissue Correlations if there is no gene symbol because there is nothing to look against
+ # Auth if needed
try:
- input_trait_symbol = myTrait.symbol
- except:
- input_trait_symbol = None
-
-
- #XZ, 12/12/2008: if the species is rat or human, translate the geneid to mouse geneid
- input_trait_mouse_geneid = self.translateToMouseGeneID(species, input_trait_GeneId)
-
-
- #XZ: As of Nov/13/2010, this dataset is 'UTHSC Illumina V6.2 RankInv B6 D2 average CNS GI average (May 08)'
- TissueProbeSetFreezeId = 1
-
- #XZ, 09/22/2008: If we need search by GeneId,
- #XZ, 09/22/2008: we have to check if this GeneId is in the literature or tissue correlation table.
- #XZ, 10/15/2008: We also to check if the selected database is probeset type.
- if self.method == "3" or self.method == "4" or self.method == "5":
- if self.db.type != "ProbeSet":
- self.error(heading="Wrong correlation type",detail="It is not possible to compute the %s between your trait and data in this %s database. Please try again after selecting another type of correlation." % (methodDict[self.method],self.db.name),error="Correlation Type Error")
- return
-
- """
- if not input_trait_GeneId:
- self.error(heading="No Associated GeneId",detail="This trait has no associated GeneId, so we are not able to show any literature or tissue related information.",error="No GeneId Error")
- return
- """
-
- #XZ: We have checked geneid did exist
-
- if self.method == "3":
- if not input_trait_GeneId or not self.checkForLitInfo(input_trait_mouse_geneid):
- self.error(heading="No Literature Info",detail="This gene does not have any associated Literature Information.",error="Literature Correlation Error")
- return
-
- if self.method == "4" or self.method == "5":
- if not input_trait_symbol:
- self.error(heading="No Tissue Correlation Information",detail="This gene does not have any associated Tissue Correlation Information.",error="Tissue Correlation Error")
- return
-
- if not self.checkSymbolForTissueCorr(TissueProbeSetFreezeId, myTrait.symbol):
- self.error(heading="No Tissue Correlation Information",detail="This gene does not have any associated Tissue Correlation Information.",error="Tissue Correlation Error")
- return
-
-############################################################################################################################################
-
- allcorrelations = []
- nnCorr = len(_vals)
-
- #XZ: Use the fast method only for probeset dataset, and this dataset must have been created.
- #XZ: Otherwise, use original method
-
- useFastMethod = False
-
- if self.db.type == "ProbeSet":
-
- DatabaseFileName = self.getFileName( target_db_name=self.target_db_name )
- DirectoryList = os.listdir(webqtlConfig.TEXTDIR) ### List of existing text files. Used to check if a text file already exists
-
- if DatabaseFileName in DirectoryList:
- useFastMethod = True
-
- if useFastMethod:
- if 1:
- #try:
- useLit = False
- if self.method == "3":
- litCorrs = self.fetchLitCorrelations(species=species, GeneId=input_trait_GeneId, db=self.db, returnNumber=self.returnNumber)
- useLit = True
-
- useTissueCorr = False
- if self.method == "4" or self.method == "5":
- tissueCorrs = self.fetchTissueCorrelations(db=self.db, primaryTraitSymbol=input_trait_symbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=self.method, returnNumber = self.returnNumber)
- useTissueCorr = True
-
- datasetFile = open(webqtlConfig.TEXTDIR+DatabaseFileName,'r')
-
- #XZ, 01/08/2009: read the first line
- line = datasetFile.readline()
- dataset_strains = webqtlUtil.readLineCSV(line)[1:]
-
- #XZ, 01/08/2009: This step is critical. It is necessary for this new method.
- #XZ: The original function fetchAllDatabaseData uses all strains stored in variable _strains to
- #XZ: retrieve the values of each strain from database in real time.
- #XZ: The new method uses all strains stored in variable dataset_strains to create a new variable
- #XZ: _newvals. _newvals has the same length as dataset_strains. The items in _newvals is in
- #XZ: the same order of items in dataset_strains. The value of each item in _newvals is either
- #XZ: the value of correspinding strain in _vals or 'None'.
- _newvals = []
- for item in dataset_strains:
- if item in _strains:
- _newvals.append(_vals[_strains.index(item)])
- else:
- _newvals.append('None')
-
- nnCorr = len(_newvals)
-
- #XZ, 01/14/2009: If literature corr or tissue corr is selected,
- #XZ: there is no need to use parallel computing.
- if useLit or useTissueCorr:
- for line in datasetFile:
- traitdata=webqtlUtil.readLineCSV(line)
- traitdataName = traitdata[0]
- traitvals = traitdata[1:]
-
- if useLit:
- if not litCorrs.has_key( traitdataName ):
- continue
-
- if useTissueCorr:
- if not tissueCorrs.has_key( traitdataName ):
- continue
-
- if self.method == "3" or self.method == "4":
- corr,nOverlap = webqtlUtil.calCorrelationText(traitvals,_newvals,nnCorr)
- else:
- corr,nOverlap = webqtlUtil.calCorrelationRankText(traitvals,_newvals,nnCorr)
-
- traitinfo = [traitdataName,corr,nOverlap]
-
- if useLit:
- traitinfo.append(litCorrs[traitdataName])
-
- if useTissueCorr:
- tempCorr, tempPValue = tissueCorrs[traitdataName]
- traitinfo.append(tempCorr)
- traitinfo.append(tempPValue)
-
- allcorrelations.append(traitinfo)
- #XZ, 01/14/2009: If genetic corr is selected, use parallel computing
- else:
- input_line_list = datasetFile.readlines()
- all_line_number = len(input_line_list)
-
- step = 1000
- job_number = math.ceil( float(all_line_number)/step )
-
- job_input_lists = []
-
- for job_index in range( int(job_number) ):
- starti = job_index*step
- endi = min((job_index+1)*step, all_line_number)
-
- one_job_input_list = []
-
- for i in range( starti, endi ):
- one_job_input_list.append( input_line_list[i] )
-
- job_input_lists.append( one_job_input_list )
-
- ppservers = ()
- # Creates jobserver with automatically detected number of workers
- job_server = pp.Server(ppservers=ppservers)
-
- jobs = []
- results = []
-
- for one_job_input_list in job_input_lists: #pay attention to modules from outside
- jobs.append( job_server.submit(func=compute_corr, args=(nnCorr, _newvals, one_job_input_list, self.method), depfuncs=(), modules=("utility.webqtlUtil",)) )
-
- for one_job in jobs:
- one_result = one_job()
- results.append( one_result )
-
- for one_result in results:
- for one_traitinfo in one_result:
- allcorrelations.append( one_traitinfo )
-
- datasetFile.close()
- totalTraits = len(allcorrelations)
- #except:
- # useFastMethod = False
- # self.error(heading="No computation method",detail="Something is wrong within the try except block in CorrelationPage python module.",error="Computation Error")
- # return
-
- #XZ, 01/08/2009: use the original method to retrieve from database and compute.
- if not useFastMethod:
-
- traitdatabase, dataStartPos = self.fetchAllDatabaseData(species=species, GeneId=input_trait_GeneId, GeneSymbol=input_trait_symbol, strains=_strains, db=self.db, method=self.method, returnNumber=self.returnNumber, tissueProbeSetFreezeId=TissueProbeSetFreezeId)
-
- totalTraits = len(traitdatabase) #XZ, 09/18/2008: total trait number
-
- for traitdata in traitdatabase:
- traitdataName = traitdata[0]
- traitvals = traitdata[dataStartPos:]
- if self.method == "1" or self.method == "3" or self.method == "4":
- corr,nOverlap = webqtlUtil.calCorrelation(traitvals,_vals,nnCorr)
- else:
- corr,nOverlap = webqtlUtil.calCorrelationRank(traitvals,_vals,nnCorr)
-
- traitinfo = [traitdataName,corr,nOverlap]
-
- #XZ, 09/28/2008: if user select '3', then fetchAllDatabaseData would give us LitCorr in the [1] position
- #XZ, 09/28/2008: if user select '4' or '5', then fetchAllDatabaseData would give us Tissue Corr in the [1] position
- #XZ, 09/28/2008: and Tissue Corr P Value in the [2] position
- if input_trait_GeneId and self.db.type == "ProbeSet":
- if self.method == "3":
- traitinfo.append( traitdata[1] )
- if self.method == "4" or self.method == "5":
- traitinfo.append( traitdata[1] )
- traitinfo.append( traitdata[2] )
-
- allcorrelations.append(traitinfo)
+ auth_user_for_db(self.db, self.cursor, target_db_name, self.privilege, self.userName)
+ except AuthException, e:
+ detail = [e.message]
+ return self.error(detail)
+ #XZ, 09/18/2008: filter out the strains that have no value.
+ self.sample_names, vals, vars, N = fd.informativeStrains(sample_list)
-#############################################################
+ #CF - If less than a minimum number of strains/cases in common, don't calculate anything
+ if len(self.sample_names) < self.corrMinInformative:
+ detail = ['Fewer than %d strain data were entered for %s data set. No calculation of correlation has been attempted.' % (self.corrMinInformative, fd.RISet)]
+ self.error(heading=PAGE_HEADING,detail=detail)
- if self.method == "3" and input_trait_GeneId:
- allcorrelations.sort(webqtlUtil.cmpLitCorr)
- #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr'
- #to compare each trait by their tissue corr p values.
- #But because the tissue corr p values are generated by permutation test,
- #the top ones always have p value 0. So comparing p values actually does nothing.
- #In addition, for the tissue data in our database, the N is always the same.
- #So it's safe to compare with tissue corr statistic value.
- #That's the same as literature corr.
- elif self.method in ["4","5"] and input_trait_GeneId:
- allcorrelations.sort(webqtlUtil.cmpLitCorr)
- else:
- allcorrelations.sort(webqtlUtil.cmpCorr)
+ self.method = get_correlation_method_key(fd)
+ correlation_method = self.CORRELATION_METHODS[self.method]
+ rankOrder = self.RANK_ORDERS[self.method]
- #XZ, 09/20/2008: we only need the top ones.
- self.returnNumber = min(self.returnNumber,len(allcorrelations))
- allcorrelations = allcorrelations[:self.returnNumber]
+ # CF - Number of results returned
+ self.returnNumber = int(fd.formdata.getvalue('criteria'))
- addLiteratureCorr = False
- addTissueCorr = False
+ self.record_count = 0
- traitList = []
- for item in allcorrelations:
- thisTrait = webqtlTrait(db=self.db, name=item[0], cursor=self.cursor)
- thisTrait.retrieveInfo( QTL='Yes' )
+ myTrait = get_custom_trait(fd, self.cursor)
- nOverlap = item[2]
- corr = item[1]
- #XZ: calculate corrPValue
- if nOverlap < 3:
- corrPValue = 1.0
- else:
- if abs(corr) >= 1.0:
- corrPValue = 0.0
- else:
- ZValue = 0.5*log((1.0+corr)/(1.0-corr))
- ZValue = ZValue*sqrt(nOverlap-3)
- corrPValue = 2.0*(1.0 - reaper.normp(abs(ZValue)))
-
- thisTrait.Name = item[0]
- thisTrait.corr = corr
- thisTrait.nOverlap = nOverlap
- thisTrait.corrPValue = corrPValue
- # NL, 07/19/2010
- # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot'
- rankOrder = 0;
- if self.method in ["2","5"]:
- rankOrder = 1;
- thisTrait.rankOrder =rankOrder
-
- #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet.
- if len(item) == 5:
- thisTrait.tissueCorr = item[3]
- thisTrait.tissuePValue = item[4]
- addLiteratureCorr = True
+ # We will not get Literature Correlations if there is no GeneId because there is nothing to look against
+ self.gene_id = int(fd.formdata.getvalue('GeneId') or 0)
- #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet.
- elif len(item) == 4:
- thisTrait.LCorr = item[3]
- thisTrait.mouse_geneid = self.translateToMouseGeneID(species, thisTrait.geneid)
- addTissueCorr = True
+ # We will not get Tissue Correlations if there is no gene symbol because there is nothing to look against
+ self.trait_symbol = myTrait.symbol
+
- #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet.
- # Phenotype data will not have geneid, and neither will some probes
- # we need to handle this because we will get an attribute error
- else:
- if input_trait_mouse_geneid and self.db.type=="ProbeSet":
- addLiteratureCorr = True
- if input_trait_symbol and self.db.type=="ProbeSet":
- addTissueCorr = True
+ #XZ, 12/12/2008: if the species is rat or human, translate the geneid to mouse geneid
+ self.input_trait_mouse_gene_id = self.translateToMouseGeneID(self.species, self.gene_id)
- traitList.append(thisTrait)
+ #XZ: As of Nov/13/2010, this dataset is 'UTHSC Illumina V6.2 RankInv B6 D2 average CNS GI average (May 08)'
+ self.tissue_probeset_freeze_id = 1
- if addLiteratureCorr:
- traitList = self.getLiteratureCorrelationByList(input_trait_mouse_geneid, species, traitList)
- if addTissueCorr:
- traitList = self.getTissueCorrelationByList( primaryTraitSymbol=input_trait_symbol, traitList=traitList,TissueProbeSetFreezeId =TissueProbeSetFreezeId, method=self.method)
+ traitList = self.correlate(vals)
+
+ _log.info("Done doing correlation calculation")
-########################################################
+############################################################################################################################################
TD_LR = HT.TD(height=200,width="100%",bgColor='#eeeeee')
mainfmName = webqtlUtil.genRandStr("fm_")
form = HT.Form(cgi= os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name= mainfmName, submit=HT.Input(type='hidden'))
- hddn = {'FormID':'showDatabase', 'ProbeSetID':'_','database':self.target_db_name, 'databaseFull':self.db.fullname, 'CellID':'_', 'RISet':RISet, 'identification':fd.identification}
+ hddn = {'FormID': 'showDatabase',
+ 'ProbeSetID': '_',
+ 'database': self.target_db_name,
+ 'databaseFull': self.db.fullname,
+ 'CellID': '_',
+ 'RISet': fd.RISet,
+ 'identification': fd.identification}
if myTrait:
hddn['fullname']=fd.formdata.getvalue('fullname')
- if mdpchoice:
- hddn['MDPChoice']=mdpchoice
+ if mdp_choice:
+ hddn['MDPChoice']=mdp_choice
#XZ, 09/18/2008: pass the trait data to next page by hidden parameters.
@@ -510,13 +390,13 @@ class CorrelationPage(templatePage):
#XZ, 3/11/2010: add one parameter to record if the method is rank order.
form.append(HT.Input(name="rankOrder", value="%s" % rankOrder, type='hidden'))
- form.append(HT.Input(name="TissueProbeSetFreezeId", value="%s" % TissueProbeSetFreezeId, type='hidden'))
+ form.append(HT.Input(name="TissueProbeSetFreezeId", value="%s" % self.tissue_probeset_freeze_id, type='hidden'))
####################################
# generate the info on top of page #
####################################
- info = self.getTopInfo(myTrait=myTrait, method=self.method, db=self.db, target_db_name=self.target_db_name, returnNumber=self.returnNumber, methodDict=methodDict, totalTraits=totalTraits, identification=fd.identification )
+ info = self.getTopInfo(myTrait=myTrait, method=self.method, db=self.db, target_db_name=self.target_db_name, returnNumber=self.returnNumber, methodDict=self.CORRELATION_METHODS, totalTraits=traitList, identification=fd.identification )
##############
# Excel file #
@@ -536,7 +416,7 @@ class CorrelationPage(templatePage):
#####################################################################
-
+ #Select All, Deselect All, Invert Selection, Add to Collection
mintmap = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'showIntMap');" % mainfmName)
mintmap_img = HT.Image("/images/multiple_interval_mapping1_final.jpg", name='mintmap', alt="Multiple Interval Mapping", title="Multiple Interval Mapping", style="border:none;")
mintmap.append(mintmap_img)
@@ -555,10 +435,10 @@ class CorrelationPage(templatePage):
partialCorr = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'partialCorrInput');" % mainfmName)
partialCorr_img = HT.Image("/images/partial_correlation_final.jpg", name='partialCorr', alt="Partial Correlation", title="Partial Correlation", style="border:none;")
partialCorr.append(partialCorr_img)
- addselect = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (RISet, mainfmName))
+ addselect = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (fd.RISet, mainfmName))
addselect_img = HT.Image("/images/add_collection1_final.jpg", name="addselect", alt="Add To Collection", title="Add To Collection", style="border:none;")
addselect.append(addselect_img)
- selectall = HT.Href(url="#redirect", onClick="checkAll(document.getElementsByName('%s')[0]);" % mainfmName)
+ selectall = HT.Href(url="#redirect", onClick="checkAll(document.getElementsByName('%s')[0]);" % mainfmName)
selectall_img = HT.Image("/images/select_all2_final.jpg", name="selectall", alt="Select All", title="Select All", style="border:none;")
selectall.append(selectall_img)
selectinvert = HT.Href(url="#redirect", onClick = "checkInvert(document.getElementsByName('%s')[0]);" % mainfmName)
@@ -575,20 +455,90 @@ class CorrelationPage(templatePage):
selectandor.append(('OR','or'))
selectandor.selected.append('AND')
- pageTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="100%", border=0, align="Left")
- containerTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="90%",border=0, align="Left")
+ #External analysis tools
+ GCATButton = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GCAT');" % mainfmName)
+ GCATButton_img = HT.Image("/images/GCAT_logo_final.jpg", name="GCAT", alt="GCAT", title="GCAT", style="border:none")
+ GCATButton.append(GCATButton_img)
+
+ ODE = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'ODE');" % mainfmName)
+ ODE_img = HT.Image("/images/ODE_logo_final.jpg", name="ode", alt="ODE", title="ODE", style="border:none")
+ ODE.append(ODE_img)
+
+ '''
+ #XZ, 07/07/2010: I comment out this block of code.
+ WebGestaltScript = HT.Script(language="Javascript")
+ WebGestaltScript.append("""
+setTimeout('openWebGestalt()', 2000);
+function openWebGestalt(){
+var thisForm = document['WebGestalt'];
+makeWebGestaltTree(thisForm, '%s', %d, 'edag_only.php');
+}
+ """ % (mainfmName, len(traitList)))
+ '''
+
+ self.cursor.execute('SELECT GeneChip.GO_tree_value FROM GeneChip, ProbeFreeze, ProbeSetFreeze WHERE GeneChip.Id = ProbeFreeze.ChipId and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.Name = "%s"' % self.db.name)
+ result = self.cursor.fetchone()
+
+ if result:
+ GO_tree_value = result[0]
+
+ if GO_tree_value:
+
+ WebGestalt = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GOTree');" % mainfmName)
+ WebGestalt_img = HT.Image("/images/webgestalt_icon_final.jpg", name="webgestalt", alt="Gene Set Analysis Toolkit", title="Gene Set Analysis Toolkit", style="border:none")
+ WebGestalt.append(WebGestalt_img)
+
+ hddnWebGestalt = {
+ 'id_list':'',
+ 'correlation':'',
+ 'id_value':'',
+ 'llid_list':'',
+ 'id_type':GO_tree_value,
+ 'idtype':'',
+ 'species':'',
+ 'list':'',
+ 'client':''}
+
+ hddnWebGestalt['ref_type'] = hddnWebGestalt['id_type']
+ hddnWebGestalt['cat_type'] = 'GO'
+ hddnWebGestalt['significancelevel'] = 'Top10'
+
+ if self.species == 'rat':
+ hddnWebGestalt['org'] = 'Rattus norvegicus'
+ elif self.species == 'human':
+ hddnWebGestalt['org'] = 'Homo sapiens'
+ elif self.species == 'mouse':
+ hddnWebGestalt['org'] = 'Mus musculus'
+ else:
+ hddnWebGestalt['org'] = ''
+
+ for key in hddnWebGestalt.keys():
+ form.append(HT.Input(name=key, value=hddnWebGestalt[key], type='hidden'))
+
- optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="320", height="80", border=0, align="Left")
- optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), align="left"))
- optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add")))
+ #Create tables with options, etc
+
+ pageTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="100%", border=0, align="Left")
+
+ containerTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="90%",border=0, align="Left")
+
+
+ if not GO_tree_value:
+ optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="480", height="80", border=0, align="Left")
+ optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), HT.TD(GCATButton), HT.TD(ODE), align="left"))
+ optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add"), HT.TD("Gene Set"), HT.TD(" "*2,"GCAT")))
+ else:
+ optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="560", height="80", border=0, align="Left")
+ optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), HT.TD(GCATButton), HT.TD(ODE), HT.TD(WebGestalt), align="left"))
+ optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add"), HT.TD("Gene Set"), HT.TD(" "*2,"GCAT"), HT.TD(" "*3, "ODE")))
containerTable.append(HT.TR(HT.TD(optionsTable)))
functionTable = HT.TableLite(cellSpacing=2,cellPadding=0,width="480",height="80", border=0, align="Left")
functionRow = HT.TR(HT.TD(networkGraph, width="16.7%"), HT.TD(cormatrix, width="16.7%"), HT.TD(partialCorr, width="16.7%"), HT.TD(mcorr, width="16.7%"), HT.TD(mintmap, width="16.7%"), HT.TD(heatmap), align="left")
labelRow = HT.TR(HT.TD(" "*1,HT.Text("Graph")), HT.TD(" "*1,HT.Text("Matrix")), HT.TD(" "*1,HT.Text("Partial")), HT.TD(HT.Text("Compare")), HT.TD(HT.Text("QTL Map")), HT.TD(HT.Text(text="Heat Map")))
functionTable.append(functionRow, labelRow)
- containerTable.append(HT.TR(HT.TD(functionTable), HT.BR()))
+ containerTable.append(HT.TR(HT.TD(functionTable), HT.BR()))
#more_options = HT.Image("/images/more_options1_final.jpg", name='more_options', alt="Expand Options", title="Expand Options", style="border:none;", Class="toggleShowHide")
@@ -597,12 +547,14 @@ class CorrelationPage(templatePage):
moreOptions = HT.Input(type='button',name='options',value='More Options', onClick="",Class="toggle")
fewerOptions = HT.Input(type='button',name='options',value='Fewer Options', onClick="",Class="toggle")
+ """
if (fd.formdata.getvalue('showHideOptions') == 'less'):
- containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(fewerOptions, Class="toggleShowHide"))))
- containerTable.append(HT.TR(HT.TD(" ")))
+ containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(fewerOptions, Class="toggleShowHide"))))
+ containerTable.append(HT.TR(HT.TD(" ")))
else:
- containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(moreOptions, Class="toggleShowHide"))))
- containerTable.append(HT.TR(HT.TD(" ")))
+ containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(moreOptions, Class="toggleShowHide"))))
+ containerTable.append(HT.TR(HT.TD(" ")))
+ """
containerTable.append(HT.TR(HT.TD(HT.Span(selecttraits,' with r > ',selectgt, ' ',selectandor, ' r < ',selectlt,Class="bd1 cbddf fs11")), style="display:none;", Class="extra_options"))
@@ -615,9 +567,9 @@ class CorrelationPage(templatePage):
if self.db.type=="Geno":
- containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
+ containerTable.append(HT.TR(HT.TD(xlsUrl, height=60)))
- pageTable.append(HT.TR(HT.TD(containerTable)))
+ pageTable.append(HT.TR(HT.TD(containerTable)))
tblobj['header'], worksheet = self.getTableHeaderForGeno( method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -636,9 +588,9 @@ class CorrelationPage(templatePage):
div = HT.Div(webqtlUtil.genTableObj(tblobj=tblobj, file=filename, sortby=sortby, tableID = "sortable", addIndex = "1"), corrScript, Id="sortable")
- pageTable.append(HT.TR(HT.TD(div)))
+ pageTable.append(HT.TR(HT.TD(div)))
- form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
+ form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
HT.Input(name='ShowLine',type='hidden', value =1),
HT.P(), HT.P(), pageTable)
TD_LR.append(corrHeading, info, form, HT.P())
@@ -649,9 +601,9 @@ class CorrelationPage(templatePage):
elif self.db.type=="Publish":
- containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
+ containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
- pageTable.append(HT.TR(HT.TD(containerTable)))
+ pageTable.append(HT.TR(HT.TD(containerTable)))
tblobj['header'], worksheet = self.getTableHeaderForPublish(method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -661,7 +613,7 @@ class CorrelationPage(templatePage):
corrScript = HT.Script(language="Javascript")
corrScript.append("var corrArray = new Array();")
- tblobj['body'], worksheet, corrScript = self.getTableBodyForPublish(traitList=traitList, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=species)
+ tblobj['body'], worksheet, corrScript = self.getTableBodyForPublish(traitList=traitList, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=self.species)
workbook.close()
@@ -671,7 +623,7 @@ class CorrelationPage(templatePage):
# NL, 07/27/2010. genTableObj function has been moved from templatePage.py to webqtlUtil.py;
div = HT.Div(webqtlUtil.genTableObj(tblobj=tblobj, file=filename, sortby=sortby, tableID = "sortable", addIndex = "1"), corrScript, Id="sortable")
- pageTable.append(HT.TR(HT.TD(div)))
+ pageTable.append(HT.TR(HT.TD(div)))
form.append(
HT.Input(name='ShowStrains',type='hidden', value =1),
@@ -685,7 +637,6 @@ class CorrelationPage(templatePage):
elif self.db.type=="ProbeSet":
-
tblobj['header'], worksheet = self.getTableHeaderForProbeSet(method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -694,7 +645,7 @@ class CorrelationPage(templatePage):
corrScript = HT.Script(language="Javascript")
corrScript.append("var corrArray = new Array();")
- tblobj['body'], worksheet, corrScript = self.getTableBodyForProbeSet(traitList=traitList, primaryTrait=myTrait, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=species)
+ tblobj['body'], worksheet, corrScript = self.getTableBodyForProbeSet(traitList=traitList, primaryTrait=myTrait, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=self.species)
workbook.close()
objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb')
@@ -741,95 +692,21 @@ class CorrelationPage(templatePage):
#updated by NL. Delete function generateJavaScript, move js files to dhtml.js, webqtl.js and jqueryFunction.js
#variables: filename, strainIds and vals are required by getquerystring function
- strainIds=self.getStrainIds(species=species, strains=_strains)
+ strainIds=self.getStrainIds(species=self.species, strains=self.sample_names)
var1 = HT.Input(name="filename", value=filename, type='hidden')
var2 = HT.Input(name="strainIds", value=strainIds, type='hidden')
- var3 = HT.Input(name="vals", value=_vals, type='hidden')
+ var3 = HT.Input(name="vals", value=vals, type='hidden')
customizerButton = HT.Input(type="button", Class="button", value="Add Correlation", onClick = "xmlhttpPost('%smain.py?FormID=AJAX_table', 'sortable', (getquerystring(this.form)))" % webqtlConfig.CGIDIR)
containerTable.append(HT.TR(HT.TD(HT.Span(var1,var2,var3,customizerButton, "with", dbCustomizer, Class="bd1 cbddf fs11"), HT.BR(), HT.BR()), style="display:none;", Class="extra_options"))
- #outside analysis part
- GCATButton = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GCAT');" % mainfmName)
- GCATButton_img = HT.Image("/images/GCAT_logo_final.jpg", name="GCAT", alt="GCAT", title="GCAT", style="border:none")
- GCATButton.append(GCATButton_img)
-
- ODE = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'ODE');" % mainfmName)
- ODE_img = HT.Image("/images/ODE_logo_final.jpg", name="ode", alt="ODE", title="ODE", style="border:none")
- ODE.append(ODE_img)
+ containerTable.append(HT.TR(HT.TD(xlsUrl, HT.BR(), HT.BR())))
- '''
- #XZ, 07/07/2010: I comment out this block of code.
- WebGestaltScript = HT.Script(language="Javascript")
- WebGestaltScript.append("""
-setTimeout('openWebGestalt()', 2000);
-function openWebGestalt(){
- var thisForm = document['WebGestalt'];
- makeWebGestaltTree(thisForm, '%s', %d, 'edag_only.php');
-}
- """ % (mainfmName, len(traitList)))
- '''
-
- self.cursor.execute('SELECT GeneChip.GO_tree_value FROM GeneChip, ProbeFreeze, ProbeSetFreeze WHERE GeneChip.Id = ProbeFreeze.ChipId and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.Name = "%s"' % self.db.name)
- result = self.cursor.fetchone()
+ pageTable.append(HT.TR(HT.TD(containerTable)))
- if result:
- GO_tree_value = result[0]
+ pageTable.append(HT.TR(HT.TD(div)))
- if GO_tree_value:
-
- WebGestalt = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GOTree');" % mainfmName)
- WebGestalt_img = HT.Image("/images/webgestalt_icon_final.jpg", name="webgestalt", alt="Gene Set Analysis Toolkit", title="Gene Set Analysis Toolkit", style="border:none")
- WebGestalt.append(WebGestalt_img)
-
- hddnWebGestalt = {
- 'id_list':'',
- 'correlation':'',
- 'id_value':'',
- 'llid_list':'',
- 'id_type':GO_tree_value,
- 'idtype':'',
- 'species':'',
- 'list':'',
- 'client':''}
-
- hddnWebGestalt['ref_type'] = hddnWebGestalt['id_type']
- hddnWebGestalt['cat_type'] = 'GO'
- hddnWebGestalt['significancelevel'] = 'Top10'
-
- if species == 'rat':
- hddnWebGestalt['org'] = 'Rattus norvegicus'
- elif species == 'human':
- hddnWebGestalt['org'] = 'Homo sapiens'
- elif species == 'mouse':
- hddnWebGestalt['org'] = 'Mus musculus'
- else:
- hddnWebGestalt['org'] = ''
-
- for key in hddnWebGestalt.keys():
- form.append(HT.Input(name=key, value=hddnWebGestalt[key], type='hidden'))
-
-
- LinkOutTable = HT.TableLite(cellSpacing=2,cellPadding=0,width="320",height="80", border=0, align="Left")
-
- if not GO_tree_value:
- LinkOutRow = HT.TR(HT.TD(GCATButton, width="50%"), HT.TD(ODE, width="50%"), align="left")
- LinkOutLabels = HT.TR(HT.TD(" ", HT.Text("GCAT"), width="50%"), HT.TD(" ",HT.Text("ODE"), width="50%"), align="left")
- else:
- LinkOutRow = HT.TR(HT.TD(WebGestalt, width="25%"), HT.TD(GCATButton, width="25%"), HT.TD(ODE, width="25%"), align="left")
- LinkOutLabels = HT.TR(HT.TD(HT.Text("Gene Set")), HT.TD(" "*2, HT.Text("GCAT")), HT.TD(" "*3, HT.Text("ODE")), style="display:none;", Class="extra_options")
-
- LinkOutTable.append(LinkOutRow,LinkOutLabels)
-
- containerTable.append(HT.TR(HT.TD(LinkOutTable), Class="extra_options", style="display:none;"))
-
- containerTable.append(HT.TR(HT.TD(xlsUrl, HT.BR(), HT.BR())))
-
- pageTable.append(HT.TR(HT.TD(containerTable)))
-
- pageTable.append(HT.TR(HT.TD(div)))
-
- if species == 'human':
+ if self.species == 'human':
heatmap = ""
form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
@@ -1009,7 +886,7 @@ Resorting this table
tempTable = self.getTempLiteratureTable(species=species, input_species_geneid=GeneId, returnNumber=returnNumber)
if method == "4" or method == "5":
- tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, TissueProbeSetFreezeId=tissueProbeSetFreezeId, method=method, returnNumber=returnNumber)
+ tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method, returnNumber=returnNumber)
for step in range(nnn):
temp = []
@@ -1068,18 +945,30 @@ Resorting this table
oridata.append(results)
datasize = len(oridata[0])
- traitdatabase = []
- # put all of the seperate data together into a huge list of lists
+ traits = []
+ # put all of the separate data together into a huge list of lists
for j in range(datasize):
traitdata = list(oridata[0][j])
for i in range(1,nnn):
traitdata += list(oridata[i][j][dataStartPos:])
- traitdatabase.append(traitdata)
+
+ trait = Trait(traitdata[0], traitdata[dataStartPos:])
+
+ if method == METHOD_LIT:
+ trait.lit_corr = traitdata[1]
+
+ if method in TISSUE_METHODS:
+ trait.tissue_corr = traitdata[1]
+ trait.p_tissue = traitdata[2]
+
+ traits.append(trait)
if tempTable:
self.cursor.execute( 'DROP TEMPORARY TABLE %s' % tempTable )
- return traitdatabase, dataStartPos
+ return traits
+
+
# XZ, 09/20/2008: This function creates TEMPORARY TABLE tmpTableName_2 and return its name.
@@ -1159,7 +1048,7 @@ Resorting this table
except:
return 0
- symbolCorrDict, symbolPvalueDict = self.calculateCorrOfAllTissueTrait(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=method)
+ symbolCorrDict, symbolPvalueDict = self.calculateCorrOfAllTissueTrait(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method)
symbolCorrList = symbolCorrDict.items()
@@ -1216,7 +1105,7 @@ Resorting this table
Returns a dictionary of 'TraitID':(tissueCorr, tissuePValue) for the requested correlation"""
- tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=method, returnNumber=returnNumber)
+ tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method, returnNumber=returnNumber)
query = "SELECT ProbeSet.Name, %s.Correlation, %s.PValue" % (tempTable, tempTable)
query += ' FROM (ProbeSet, ProbeSetXRef, ProbeSetFreeze)'
@@ -1276,6 +1165,225 @@ Resorting this table
return traitList
+ def get_trait(self, cached, vals):
+
+ if cached:
+ _log.info("Using the fast method because the file exists")
+ lit_corrs = {}
+ tissue_corrs = {}
+ use_lit = False
+ if self.method == METHOD_LIT:
+ lit_corrs = self.fetchLitCorrelations(species=self.species, GeneId=self.gene_id, db=self.db, returnNumber=self.returnNumber)
+ use_lit = True
+
+ use_tissue_corr = False
+ if self.method in TISSUE_METHODS:
+ tissue_corrs = self.fetchTissueCorrelations(db=self.db, primaryTraitSymbol=self.trait_symbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=self.method, returnNumber = self.returnNumber)
+ use_tissue_corr = True
+
+ DatabaseFileName = self.getFileName( target_db_name=self.target_db_name )
+ datasetFile = open(webqtlConfig.TEXTDIR+DatabaseFileName,'r')
+
+ #XZ, 01/08/2009: read the first line
+ line = datasetFile.readline()
+ cached_sample_names = webqtlUtil.readLineCSV(line)[1:]
+
+ #XZ, 01/08/2009: This step is critical. It is necessary for this new method.
+ #XZ: The original function fetchAllDatabaseData uses all strains stored in variable _strains to
+ #XZ: retrieve the values of each strain from database in real time.
+ #XZ: The new method uses all strains stored in variable dataset_strains to create a new variable
+ #XZ: _newvals. _newvals has the same length as dataset_strains. The items in _newvals is in
+ #XZ: the same order of items in dataset_strains. The value of each item in _newvals is either
+ #XZ: the value of correspinding strain in _vals or 'None'.
+ new_vals = []
+ for name in cached_sample_names:
+ if name in self.sample_names:
+ new_vals.append(float(vals[self.sample_names.index(name)]))
+ else:
+ new_vals.append('None')
+
+ nnCorr = len(new_vals)
+
+ #XZ, 01/14/2009: If literature corr or tissue corr is selected,
+ #XZ: there is no need to use parallel computing.
+
+ traits = []
+ data_start = 1
+ for line in datasetFile:
+ raw_trait = webqtlUtil.readLineCSV(line)
+ trait = Trait.from_csv(raw_trait, data_start)
+ trait.lit_corr = lit_corrs.get(trait.name)
+ trait.tissue_corr, trait.p_tissue = tissue_corrs.get(trait.name, (None, None))
+ traits.append(trait)
+
+ return traits, new_vals
+
+ else:
+ _log.info("Using the slow method for correlation")
+
+ _log.info("Fetching from database")
+ traits = self.fetchAllDatabaseData(species=self.species, GeneId=self.gene_id, GeneSymbol=self.trait_symbol, strains=self.sample_names, db=self.db, method=self.method, returnNumber=self.returnNumber, tissueProbeSetFreezeId= self.tissue_probeset_freeze_id)
+ _log.info("Done fetching from database")
+ totalTraits = len(traits) #XZ, 09/18/2008: total trait number
+
+ return traits, vals
+
+
+ def do_parallel_correlation(self):
+ _log.info("Invoking parallel computing")
+ input_line_list = datasetFile.readlines()
+ _log.info("Read lines from the file")
+ all_line_number = len(input_line_list)
+
+ step = 1000
+ job_number = math.ceil( float(all_line_number)/step )
+
+ job_input_lists = []
+
+ _log.info("Configuring jobs")
+
+ for job_index in range( int(job_number) ):
+ starti = job_index*step
+ endi = min((job_index+1)*step, all_line_number)
+
+ one_job_input_list = []
+
+ for i in range( starti, endi ):
+ one_job_input_list.append( input_line_list[i] )
+
+ job_input_lists.append( one_job_input_list )
+
+ _log.info("Creating pp servers")
+
+ ppservers = ()
+ # Creates jobserver with automatically detected number of workers
+ job_server = pp.Server(ppservers=ppservers)
+
+ _log.info("Done creating servers")
+
+ jobs = []
+ results = []
+
+ _log.info("Starting parallel computation, submitting jobs")
+ for one_job_input_list in job_input_lists: #pay attention to modules from outside
+ jobs.append( job_server.submit(func=compute_corr, args=(nnCorr, _newvals, one_job_input_list, self.method), depfuncs=(), modules=("utility.webqtlUtil",)) )
+ _log.info("Done submitting jobs")
+
+ for one_job in jobs:
+ one_result = one_job()
+ results.append( one_result )
+
+ _log.info("Acquiring results")
+
+ for one_result in results:
+ for one_traitinfo in one_result:
+ allcorrelations.append( one_traitinfo )
+
+ _log.info("Appending the results")
+
+ datasetFile.close()
+ totalTraits = len(allcorrelations)
+ _log.info("Done correlating using the fast method")
+
+
+ def correlate(self, vals):
+
+ correlations = []
+
+ #XZ: Use the fast method only for probeset dataset, and this dataset must have been created.
+ #XZ: Otherwise, use original method
+ _log.info("Entering correlation")
+
+ db_filename = self.getFileName( target_db_name=self.target_db_name )
+
+ cache_available = db_filename in os.listdir(webqtlConfig.TEXTDIR)
+
+ # If the cache file exists, do a cached correlation for probeset data
+ if self.db.type == "ProbeSet":
+# if self.method in [METHOD_SAMPLE_PEARSON, METHOD_SAMPLE_RANK] and cache_available:
+# traits = do_parallel_correlation()
+#
+# else:
+
+ (traits, vals) = self.get_trait(cache_available, vals)
+
+ for trait in traits:
+ trait.calculate_correlation(vals, self.method)
+
+ self.record_count = len(traits) #ZS: This isn't a good way to get this value, so I need to change it later
+
+ #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr'
+ #to compare each trait by their tissue corr p values.
+ #But because the tissue corr p values are generated by permutation test,
+ #the top ones always have p value 0. So comparing p values actually does nothing.
+ #In addition, for the tissue data in our database, the N is always the same.
+ #So it's safe to compare with tissue corr statistic value.
+ #That's the same as literature corr.
+ #if self.method in [METHOD_LIT, METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK] and self.gene_id:
+ # traits.sort(webqtlUtil.cmpLitCorr)
+ #else:
+ #if self.method in TISSUE_METHODS:
+ # sort(traits, key=lambda A: math.fabs(A.tissue_corr))
+ #elif self.method == METHOD_LIT:
+ # traits.sort(traits, key=lambda A: math.fabs(A.lit_corr))
+ #else:
+ traits = sortTraitCorrelations(traits, self.method)
+
+ # Strip to the top N correlations
+ traits = traits[:min(self.returnNumber, len(traits))]
+
+ addLiteratureCorr = False
+ addTissueCorr = False
+
+ trait_list = []
+ for trait in traits:
+ db_trait = webqtlTrait(db=self.db, name=trait.name, cursor=self.cursor)
+ db_trait.retrieveInfo( QTL='Yes' )
+
+ db_trait.Name = trait.name
+ db_trait.corr = trait.correlation
+ db_trait.nOverlap = trait.overlap
+ db_trait.corrPValue = trait.p_value
+
+ # NL, 07/19/2010
+ # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot'
+ db_trait.RANK_ORDER = self.RANK_ORDERS[self.method]
+
+ #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet.
+ if self.method in TISSUE_METHODS:
+ db_trait.tissueCorr = trait.tissue_corr
+ db_trait.tissuePValue = trait.p_tissue
+ addTissueCorr = True
+
+
+ #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet.
+ elif self.method == METHOD_LIT:
+ db_trait.LCorr = trait.lit_corr
+ db_trait.mouse_geneid = self.translateToMouseGeneID(self.species, db_trait.geneid)
+ addLiteratureCorr = True
+
+ #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet.
+ # Phenotype data will not have geneid, and neither will some probes
+ # we need to handle this because we will get an attribute error
+ else:
+ if self.input_trait_mouse_gene_id and self.db.type=="ProbeSet":
+ addLiteratureCorr = True
+ if self.trait_symbol and self.db.type=="ProbeSet":
+ addTissueCorr = True
+
+ trait_list.append(db_trait)
+
+ if addLiteratureCorr:
+ trait_list = self.getLiteratureCorrelationByList(self.input_trait_mouse_gene_id,
+ self.species, trait_list)
+ if addTissueCorr:
+ trait_list = self.getTissueCorrelationByList(
+ primaryTraitSymbol = self.trait_symbol,
+ traitList = trait_list,
+ TissueProbeSetFreezeId = TISSUE_MOUSE_DB,
+ method=self.method)
+
+ return trait_list
def calculateCorrOfAllTissueTrait(self, primaryTraitSymbol=None, TissueProbeSetFreezeId=None, method=None):
@@ -1283,10 +1391,10 @@ Resorting this table
symbolCorrDict = {}
symbolPvalueDict = {}
- primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
primaryTraitValue = primaryTraitSymbolValueDict.values()[0]
- SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
if method in ["2","5"]:
symbolCorrDict, symbolPvalueDict = correlationFunction.batchCalTissueCorr(primaryTraitValue,SymbolValueDict,method='spearman')
@@ -1301,7 +1409,7 @@ Resorting this table
#XZ, 10/13/2010
def getTissueCorrelationByList(self, primaryTraitSymbol=None, traitList=None, TissueProbeSetFreezeId=None, method=None):
- primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
if primaryTraitSymbol.lower() in primaryTraitSymbolValueDict:
primaryTraitValue = primaryTraitSymbolValueDict[primaryTraitSymbol.lower()]
@@ -1312,7 +1420,7 @@ Resorting this table
if hasattr(thisTrait, 'symbol'):
geneSymbolList.append(thisTrait.symbol)
- SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=geneSymbolList, TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=geneSymbolList, TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
for thisTrait in traitList:
if hasattr(thisTrait, 'symbol') and thisTrait.symbol and thisTrait.symbol.lower() in SymbolValueDict:
@@ -1339,7 +1447,7 @@ Resorting this table
if myTrait:
if method in ["1","2"]: #genetic correlation
info = HT.Paragraph("Values of Record %s in the " % myTrait.getGivenName(), HT.Href(text=myTrait.db.fullname,url=webqtlConfig.INFOPAGEHREF % myTrait.db.name,target="_blank", Class="fwn"),
- " database were compared to all %d records in the " % totalTraits, HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank", Class="fwn"),
+ " database were compared to all %d records in the " % self.record_count, HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank", Class="fwn"),
' database. The top %d correlations ranked by the %s are displayed.' % (returnNumber,methodDict[method]),
' You can resort this list using the small arrowheads in the top row.')
else:
@@ -1359,7 +1467,7 @@ Resorting this table
' You can resort this list using the small arrowheads in the top row.' )
elif identification:
- info = HT.Paragraph('Values of %s were compared to all %d traits in ' % (identification, totalTraits),
+ info = HT.Paragraph('Values of %s were compared to all %d traits in ' % (identification, self.record_count),
HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank",Class="fwn"),
' database. The TOP %d correlations ranked by the %s are displayed.' % (returnNumber,methodDict[method]),
' You can resort this list using the small arrowheads in the top row.')
@@ -1934,7 +2042,7 @@ Resorting this table
TCorr = thisTrait.tissueCorr
TCorrStr = "%2.3f" % thisTrait.tissueCorr
# NL, 07/19/2010: add a new parameter rankOrder for js function 'showTissueCorrPlot'
- rankOrder = thisTrait.rankOrder
+ rankOrder = self.RANK_ORDERS[self.method]
TCorrPlotURL = "javascript:showTissueCorrPlot('%s','%s','%s',%d)" %(formName, primaryTrait.symbol, thisTrait.symbol,rankOrder)
tr.append(TDCell(HT.TD(HT.Href(text=TCorrStr, url=TCorrPlotURL, Class="fs12 fwn ff1"), Class="fs12 fwn ff1 b1 c222", align='right'), TCorrStr, abs(TCorr)))
else:
diff --git a/web/webqtl/showTrait/DataEditingPage.py b/web/webqtl/showTrait/DataEditingPage.py
old mode 100644
new mode 100755
index f38b9880..974b2ed5
--- a/web/webqtl/showTrait/DataEditingPage.py
+++ b/web/webqtl/showTrait/DataEditingPage.py
@@ -416,13 +416,15 @@ class DataEditingPage(templatePage):
UTHSC_BLAT_URL = ""
if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
- verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="addselect", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
+ verifyButton = HT.Href(url="#")
+ verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
+ title=" Check probe locations at UCSC ", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL, style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = 'Verify'
if UTHSC_BLAT_URL:
- rnaseqButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
- rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="addselect", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
+ rnaseqButton = HT.Href(url="#")
+ rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ",
+ title=" View probes, SNPs, and RNA-seq at UTHSC ", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL, style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = 'RNA-seq'
tSpan.append(HT.BR())
@@ -590,10 +592,24 @@ class DataEditingPage(templatePage):
url="http://string.embl.de/newstring_cgi/show_link_summary.pl?identifier=%s" \
% thisTrait.symbol,Class="fs14 fwn", \
title="Protein interactions: known and inferred"), style=linkStyle), " "*2)
- if thisTrait.geneid:
+ if thisTrait.symbol:
+ #ZS: The "species scientific" converts the plain English species names we're using to their scientific names, which are needed for PANTHER's input
+ #We should probably use the scientific name along with the English name (if not instead of) elsewhere as well, given potential non-English speaking users
+ if _Species == "mouse":
+ species_scientific = "Mus%20musculus"
+ elif _Species == "rat":
+ species_scientific = "Rattus%20norvegicus"
+ elif _Species == "human":
+ species_scientific = "Homo%20sapiens"
+ elif _Species == "drosophila":
+ species_scientific = "Drosophila%20melanogaster"
+ else:
+ species_scientific = "all"
+
+ species_scientific
tSpan.append(HT.Span(HT.Href(text= 'PANTHER',target="mainFrame", \
- url="http://www.pantherdb.org/genes/gene.do?acc=%s" \
- % thisTrait.geneid,Class="fs14 fwn", \
+ url="http://www.pantherdb.org/genes/geneList.do?searchType=basic&fieldName=all&organism=%s&listType=1&fieldValue=%s" \
+ % (species_scientific, thisTrait.symbol),Class="fs14 fwn", \
title="Gene and protein data resources from Celera-ABI"), style=linkStyle), " "*2)
else:
pass
@@ -755,11 +771,12 @@ class DataEditingPage(templatePage):
UCSC_BLAT_URL = ""
UTHSC_BLAT_URL = ""
if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
+ #verifyButton = HT.Href(url="#", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
+ verifyButton = HT.Href(url="#")
verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="addselect", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = "Verify"
- rnaseqButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
+ rnaseqButton = HT.Href(url="#", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="addselect", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = "RNA-seq"
--
cgit v1.2.3
From e03be38427b6fcb64a567e345c96fc2a6ee99d60 Mon Sep 17 00:00:00 2001
From: root
Date: Fri, 1 Jun 2012 15:03:29 -0500
Subject: added scrollable tab areas for the updated basic statistics output
---
.../basicStatistics/updatedBasicStatisticsPage.py | 54 +++++++++++-----------
web/webqtl/showTrait/DataEditingPage.py | 22 ++++-----
2 files changed, 38 insertions(+), 38 deletions(-)
(limited to 'web/webqtl')
diff --git a/web/webqtl/basicStatistics/updatedBasicStatisticsPage.py b/web/webqtl/basicStatistics/updatedBasicStatisticsPage.py
index 156dafe7..ab7ed07d 100755
--- a/web/webqtl/basicStatistics/updatedBasicStatisticsPage.py
+++ b/web/webqtl/basicStatistics/updatedBasicStatisticsPage.py
@@ -63,9 +63,9 @@ class updatedBasicStatisticsPage(templatePage):
thisValFull = [strain_names[i], this_strain_val, this_strain_var]
vals.append(thisValFull)
- 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"),
+ stats_tab_list = [HT.Href(text="Basic Table", url="#statstabs-1", Class="stats_tab"),HT.Href(text="Probability Plot", url="#statstabs-2", 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")]
+ HT.Href(text="Box Plot", url="#statstabs-5", Class="stats_tab")]
stats_tabs = HT.List(stats_tab_list)
stats_container = HT.Div(id="stats_tabs", Class="ui-tabs")
@@ -73,7 +73,7 @@ class updatedBasicStatisticsPage(templatePage):
stats_script_text = """$(function() { $("#stats_tabs").tabs();});""" #Javascript enabling tabs
- table_div = HT.Div(id="statstabs-1")
+ table_div = HT.Div(id="statstabs-1", style="height:320px;width:740px;overflow:scroll;")
table_container = HT.Paragraph()
statsTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
@@ -86,16 +86,21 @@ class updatedBasicStatisticsPage(templatePage):
table_div.append(table_container)
stats_container.append(table_div)
- 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")))
- boxplot_container.append(boxplot)
- boxplot_div.append(boxplot_container)
- stats_container.append(boxplot_div)
+ normalplot_div = HT.Div(id="statstabs-2", style="height:540px;width:740px;overflow:scroll;")
+ normalplot_container = HT.Paragraph()
+ normalplot = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
+ plotTitle = fd.formdata.getvalue("normalPlotTitle","")
+ normalplot_img = BasicStatisticsFunctions.plotNormalProbability(vals=vals, RISet=fd.RISet, 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"))))
+ normalplot_container.append(normalplot)
+ normalplot_div.append(normalplot_container)
+ stats_container.append(normalplot_div)
- barName_div = HT.Div(id="statstabs-3")
+ barName_div = HT.Div(id="statstabs-3", style="height:540px;width:740px;overflow:scroll;")
barName_container = HT.Paragraph()
barName = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
barName_img = BasicStatisticsFunctions.plotBarGraph(identification=fd.identification, RISet=fd.RISet, vals=vals, type="name")
@@ -104,7 +109,7 @@ class updatedBasicStatisticsPage(templatePage):
barName_div.append(barName_container)
stats_container.append(barName_div)
- barRank_div = HT.Div(id="statstabs-4")
+ barRank_div = HT.Div(id="statstabs-4", style="height:540px;width:740px;overflow:scroll;")
barRank_container = HT.Paragraph()
barRank = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
barRank_img = BasicStatisticsFunctions.plotBarGraph(identification=fd.identification, RISet=fd.RISet, vals=vals, type="rank")
@@ -112,20 +117,15 @@ class updatedBasicStatisticsPage(templatePage):
barRank_container.append(barRank)
barRank_div.append(barRank_container)
stats_container.append(barRank_div)
-
- normalplot_div = HT.Div(id="statstabs-5")
- normalplot_container = HT.Paragraph()
- normalplot = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- plotTitle = fd.formdata.getvalue("normalPlotTitle","")
- normalplot_img = BasicStatisticsFunctions.plotNormalProbability(vals=vals, RISet=fd.RISet, 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"))))
- normalplot_container.append(normalplot)
- normalplot_div.append(normalplot_container)
- stats_container.append(normalplot_div)
+
+ boxplot_div = HT.Div(id="statstabs-5", style="height:540px;width:740px;overflow:scroll;")
+ 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")))
+ boxplot_container.append(boxplot)
+ boxplot_div.append(boxplot_container)
+ stats_container.append(boxplot_div)
stats_cell.append(stats_container)
stats_script.append(stats_script_text)
diff --git a/web/webqtl/showTrait/DataEditingPage.py b/web/webqtl/showTrait/DataEditingPage.py
index 974b2ed5..c240d8a0 100755
--- a/web/webqtl/showTrait/DataEditingPage.py
+++ b/web/webqtl/showTrait/DataEditingPage.py
@@ -280,13 +280,13 @@ class DataEditingPage(templatePage):
if snpurl:
snpBrowserButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % snpurl)
- snpBrowserButton_img = HT.Image("/images/snp_icon.jpg", name="addselect", alt=" View SNPs and Indels ", title=" View SNPs and Indels ", style="border:none;")
+ snpBrowserButton_img = HT.Image("/images/snp_icon.jpg", name="snpbrowser", alt=" View SNPs and Indels ", title=" View SNPs and Indels ", style="border:none;")
snpBrowserButton.append(snpBrowserButton_img)
snpBrowserText = "SNPs"
#XZ: Show GeneWiki for all species
geneWikiButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE) + "?FormID=geneWiki&symbol=%s" % thisTrait.symbol))
- geneWikiButton_img = HT.Image("/images/genewiki_icon.jpg", name="addselect", alt=" Write or review comments about this gene ", title=" Write or review comments about this gene ", style="border:none;")
+ geneWikiButton_img = HT.Image("/images/genewiki_icon.jpg", name="genewiki", alt=" Write or review comments about this gene ", title=" Write or review comments about this gene ", style="border:none;")
geneWikiButton.append(geneWikiButton_img)
geneWikiText = 'GeneWiki'
@@ -295,7 +295,7 @@ class DataEditingPage(templatePage):
if _Species in ("mouse", "rat", "human"):
similarUrl = "%s?cmd=sch&gene=%s&alias=1&species=%s" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), thisTrait.symbol, _Species)
similarButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % similarUrl)
- similarButton_img = HT.Image("/images/find_icon.jpg", name="addselect", alt=" Find similar expression data ", title=" Find similar expression data ", style="border:none;")
+ similarButton_img = HT.Image("/images/find_icon.jpg", name="similar", alt=" Find similar expression data ", title=" Find similar expression data ", style="border:none;")
similarButton.append(similarButton_img)
similarText = "Find"
else:
@@ -416,15 +416,15 @@ class DataEditingPage(templatePage):
UTHSC_BLAT_URL = ""
if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#")
+ verifyButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL)
verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
- title=" Check probe locations at UCSC ", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL, style="border:none;")
+ title=" Check probe locations at UCSC ", style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = 'Verify'
if UTHSC_BLAT_URL:
- rnaseqButton = HT.Href(url="#")
+ rnaseqButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL)
rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ",
- title=" View probes, SNPs, and RNA-seq at UTHSC ", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL, style="border:none;")
+ title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = 'RNA-seq'
tSpan.append(HT.BR())
@@ -444,8 +444,8 @@ class DataEditingPage(templatePage):
if probeResult[0] > 0:
probeurl = "%s?FormID=showProbeInfo&database=%s&ProbeSetID=%s&CellID=%s&RISet=%s&incparentsf1=ON" \
% (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), thisTrait.db, thisTrait.name, thisTrait.cellid, fd.RISet)
- probeButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % probeurl)
- probeButton_img = HT.Image("/images/probe_icon.jpg", name="addselect", alt=" Check sequence of probes ", title=" Check sequence of probes ", style="border:none;")
+ probeButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % probeurl)
+ probeButton_img = HT.Image("/images/probe_icon.jpg", name="probe", alt=" Check sequence of probes ", title=" Check sequence of probes ", style="border:none;")
probeButton.append(probeButton_img)
probeText = "Probes"
@@ -773,11 +773,11 @@ class DataEditingPage(templatePage):
if UCSC_BLAT_URL:
#verifyButton = HT.Href(url="#", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
verifyButton = HT.Href(url="#")
- verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="addselect", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
+ verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = "Verify"
rnaseqButton = HT.Href(url="#", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
- rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="addselect", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
+ rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = "RNA-seq"
--
cgit v1.2.3
From ee24468b3ad5575c4f7ba06aa3319bdab3a34c6c Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Thu, 23 Aug 2012 16:01:08 -0500
Subject: Various minor changes
---
web/webqtl/base/webqtlConfigLocal.py | 10 +++++-----
wqflask/base/webqtlConfigLocal.py | 11 ++++++-----
wqflask/wqflask/dataSharing/SharingInfoPage.py | 4 +++-
wqflask/wqflask/views.py | 1 +
4 files changed, 15 insertions(+), 11 deletions(-)
(limited to 'web/webqtl')
diff --git a/web/webqtl/base/webqtlConfigLocal.py b/web/webqtl/base/webqtlConfigLocal.py
index dc86bb10..1f986aa7 100755
--- a/web/webqtl/base/webqtlConfigLocal.py
+++ b/web/webqtl/base/webqtlConfigLocal.py
@@ -3,15 +3,15 @@
#########################################
MYSQL_SERVER = 'localhost'
-DB_NAME = 'db_webqtl'
-DB_USER = 'webqtl'
+DB_NAME = 'db_webqtl_zas1024'
+DB_USER = 'webqtlupd'
DB_PASSWD = 'webqtl'
MYSQL_UPDSERVER = 'localhost'
-DB_UPDNAME = 'db_webqtl'
-DB_UPDUSER = 'webqtl'
+DB_UPDNAME = 'db_webqtl_zas1024'
+DB_UPDUSER = 'webqtlupd'
DB_UPDPASSWD = 'webqtl'
-GNROOT = '/gnshare/gn/'
+GNROOT = '/home/zas1024/gn/'
PythonPath = '/usr/bin/python'
PIDDLE_FONT_PATH = '/usr/lib/python2.4/site-packages/piddle/truetypefonts/'
diff --git a/wqflask/base/webqtlConfigLocal.py b/wqflask/base/webqtlConfigLocal.py
index 35da73c2..5aab48ac 100755
--- a/wqflask/base/webqtlConfigLocal.py
+++ b/wqflask/base/webqtlConfigLocal.py
@@ -3,16 +3,17 @@
#########################################
MYSQL_SERVER = 'localhost'
-DB_NAME = 'db_webqtl'
+DB_NAME = 'db_webqtl_zas1024'
DB_USER = 'webqtlupd'
-DB_PASSWD = 'zhou&yan@ut'
+DB_PASSWD = 'webqtl'
MYSQL_UPDSERVER = 'localhost'
-DB_UPDNAME = 'db_webqtl'
+DB_UPDNAME = 'db_webqtl_zas1024'
DB_UPDUSER = 'webqtlupd'
-DB_UPDPASSWD = 'zhou&yan@ut'
+DB_UPDPASSWD = 'webqtl'
-GNROOT = '/gnshare/gn/'
+GNROOT = '/home/zas1024/gn/'
+ROOT_URL = 'http://alexandria.uthsc.edu:91/'
PythonPath = '/usr/bin/python'
PIDDLE_FONT_PATH = '/usr/lib/python2.4/site-packages/piddle/truetypefonts/'
diff --git a/wqflask/wqflask/dataSharing/SharingInfoPage.py b/wqflask/wqflask/dataSharing/SharingInfoPage.py
index 5503ff74..7ad44440 100755
--- a/wqflask/wqflask/dataSharing/SharingInfoPage.py
+++ b/wqflask/wqflask/dataSharing/SharingInfoPage.py
@@ -28,6 +28,8 @@ from __future__ import print_function, division
from pprint import pformat as pf
+import urlparse
+
import flask
from base.templatePage import templatePage
@@ -54,7 +56,7 @@ class SharingInfoPage(templatePage):
sql = "select GN_AccesionId from InfoFiles where InfoPageName = %s"
cursor.execute(sql, InfoPageName)
GN_AccessionId = cursor.fetchone()
- self.redirect_url = "http://23.21.59.238:5001/data_sharing?GN_AccessionId=%s" % GN_AccessionId
+ self.redirect_url = urlparse.urljoin(webqtlConfig.ROOT_URL, "/data_sharing?GN_AccessionId=%s" % GN_AccessionId)
#self.redirect_url = flask.url_for('data_sharing', GN_AccessionId=GN_AccessionId[0])
print("set self.redirect_url")
#print("before redirect")
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 06d8227c..852e6a16 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -19,6 +19,7 @@ print("latest blue")
@app.route("/")
def index_page():
+ print("Sending index_page")
return render_template("index_page.html")
--
cgit v1.2.3
From e5ba48c06a76ac1d4d4725cf633de1cf3abfde2d Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Tue, 2 Oct 2012 14:52:40 -0500
Subject: Renamed trait_data_and_analysis.html to show_trait.html,
DataEditingPage.py to show_trait.py, and trait_data_and_analysis.coffee to
show_trait.coffee
---
.../collection/ExportSelectionDetailInfoPage.py | 5 +-
wqflask/wqflask/show_trait/DataEditingPage.py | 1557 --------------------
wqflask/wqflask/show_trait/show_trait.py | 1557 ++++++++++++++++++++
.../static/new/javascript/show_trait.coffee | 182 +++
.../new/javascript/trait_data_and_analysis.coffee | 182 ---
.../new/javascript/trait_data_and_analysis.js | 207 ---
wqflask/wqflask/templates/show_trait.html | 1346 +++++++++++++++++
.../wqflask/templates/trait_data_and_analysis.html | 1346 -----------------
wqflask/wqflask/views.py | 2 +-
9 files changed, 3090 insertions(+), 3294 deletions(-)
delete mode 100755 wqflask/wqflask/show_trait/DataEditingPage.py
create mode 100755 wqflask/wqflask/show_trait/show_trait.py
create mode 100644 wqflask/wqflask/static/new/javascript/show_trait.coffee
delete mode 100644 wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
delete mode 100644 wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
create mode 100644 wqflask/wqflask/templates/show_trait.html
delete mode 100644 wqflask/wqflask/templates/trait_data_and_analysis.html
(limited to 'web/webqtl')
diff --git a/web/webqtl/collection/ExportSelectionDetailInfoPage.py b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
index 69f293b2..a61b6f6e 100755
--- a/web/webqtl/collection/ExportSelectionDetailInfoPage.py
+++ b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
@@ -128,7 +128,10 @@ class ExportSelectionDetailInfoPage(templatePage):
count = count + 1
except:
pass
- mean = sum/count
+ if count = 0:
+ mean = 0
+ else:
+ mean = sum/count
text[-1].append(mean)
text[-1] += testval
if len(text[0]) < 255 or len(text) < 255:
diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py
deleted file mode 100755
index 12e816f8..00000000
--- a/wqflask/wqflask/show_trait/DataEditingPage.py
+++ /dev/null
@@ -1,1557 +0,0 @@
-from __future__ import absolute_import, print_function, division
-
-import string
-import os
-import cPickle
-#import pyXLWriter as xl
-
-from collections import OrderedDict
-
-from htmlgen import HTMLgen2 as HT
-
-from base import webqtlConfig
-from base import webqtlCaseData
-from wqflask.show_trait.SampleList import SampleList
-from utility import webqtlUtil, Plot, Bunch
-from base.webqtlTrait import webqtlTrait
-from dbFunction import webqtlDatabaseFunction
-from base.templatePage import templatePage
-from basicStatistics import BasicStatisticsFunctions
-
-from pprint import pformat as pf
-
-###############################################
-#
-# Todo: Put in security to ensure that user has permission to access confidential data sets
-# And add i.p.limiting as necessary
-#
-##############################################
-
-
-
-class DataEditingPage(templatePage):
-
- def __init__(self, fd):
- self.fd = fd
-
- templatePage.__init__(self, fd)
- assert self.openMysql(), "No datbase!"
-
- this_trait = self.get_this_trait()
-
- ##read genotype file
- fd.RISet = this_trait.riset
- fd.readGenotype()
-
- if not fd.genotype:
- fd.readData(incf1=1)
-
- # determine data editing page format
- variance_data_page = 0
- if fd.formID == 'varianceChoice':
- variance_data_page = 1
-
- if variance_data_page:
- fmID='dataEditing'
- else:
- if fd.enablevariance:
- fmID='pre_dataEditing'
- else:
- fmID='dataEditing'
-
- # Some fields, like method, are defaulted to None; otherwise in IE the field can't be changed using jquery
- hddn = OrderedDict(
- FormID = fmID,
- RISet = fd.RISet,
- 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 = '_'
- )
-
- if fd.enablevariance:
- hddn['enablevariance']='ON'
- if fd.incparentsf1:
- hddn['incparentsf1']='ON'
-
- if this_trait:
- hddn['fullname'] = str(this_trait)
- try:
- hddn['normalPlotTitle'] = this_trait.symbol
- hddn['normalPlotTitle'] += ": "
- hddn['normalPlotTitle'] += this_trait.name
- except:
- hddn['normalPlotTitle'] = str(this_trait.name)
- hddn['fromDataEditingPage'] = 1
- if this_trait.db and this_trait.db.type and this_trait.db.type == 'ProbeSet':
- hddn['trait_type'] = this_trait.db.type
- if this_trait.cellid:
- hddn['cellid'] = this_trait.cellid
- else:
- self.cursor.execute("SELECT h2 from ProbeSetXRef WHERE DataId = %d" %
- this_trait.mysqlid)
- heritability = self.cursor.fetchone()
- hddn['heritability'] = heritability
-
- hddn['attribute_names'] = ""
-
- hddn['mappingMethodId'] = webqtlDatabaseFunction.getMappingMethod (cursor=self.cursor,
- groupName=fd.RISet)
-
- if fd.identification:
- hddn['identification'] = fd.identification
- else:
- hddn['identification'] = "Un-named trait" #If no identification, set identification to un-named
-
- self.dispTraitInformation(fd, "", hddn, this_trait) #Display trait information + function buttons
-
- if this_trait == None:
- this_trait = webqtlTrait(data=fd.allTraitData, db=None)
-
- ## Variance submit page only
- #if fd.enablevariance and not variance_data_page:
- # pass
- # #title2Body.append("Click the next button to go to the variance submission form.",
- # # HT.Center(next,reset))
- #else:
- # pass
- # # We'll get this part working later
- # print("Calling dispBasicStatistics")
- # self.dispBasicStatistics(fd, this_trait)
-
- self.build_correlation_tools(fd, this_trait)
-
-
- self.make_sample_lists(fd, variance_data_page, this_trait)
-
- if fd.allsamplelist:
- hddn['allsamplelist'] = string.join(fd.allsamplelist, ' ')
-
- if fd.varianceDispName != 'Variance':
- hddn['isSE'] = "yes"
-
- # We'll need access to this_trait and hddn in the Jinja2 Template, so we put it inside self
- self.this_trait = this_trait
- self.hddn = hddn
-
- self.sample_group_types = OrderedDict()
- self.sample_group_types['primary_only'] = fd.RISet + " Only"
- self.sample_group_types['other_only'] = "Non-" + fd.RISet
- self.sample_group_types['all_cases'] = "All Cases"
- self.js_data = dict(sample_groups = self.sample_group_types)
-
-
- def get_this_trait(self):
- # When is traitInfos used?
- #if traitInfos:
- # database, ProbeSetID, CellID = traitInfos
- #else:
- database = self.fd['database']
- probe_set_id = self.fd['ProbeSetID']
- cell_id = self.fd.get('CellID')
-
- this_trait = webqtlTrait(db=database, name=probe_set_id, cellid=cell_id, cursor=self.cursor)
-
- ##identification, etc.
- self.fd.identification = '%s : %s' % (this_trait.db.shortname, probe_set_id)
- this_trait.returnURL = webqtlConfig.CGIDIR + webqtlConfig.SCRIPTFILE + '?FormID=showDatabase&database=%s\
- &ProbeSetID=%s&RISet=%s&parentsf1=on' %(database, probe_set_id, self.fd['RISet'])
-
- if cell_id:
- self.fd.identification = '%s/%s'%(self.fd.identification, cell_id)
- this_trait.returnURL = '%s&CellID=%s' % (this_trait.returnURL, cell_id)
-
- this_trait.retrieveInfo()
- this_trait.retrieveData()
- return this_trait
-
-
- def dispTraitInformation(self, fd, title1Body, hddn, this_trait):
-
- _Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
-
- #tbl = HT.TableLite(cellpadding=2, Class="collap", style="margin-left:20px;", width="840", valign="top", id="target1")
-
- #reset=HT.Input(type='Reset',name='',value=' Reset ',Class="button")
-
- #XZ, August 02, 2011: The display of icons is decided by the trait type (if trait exists), along with user log-in status. Note that the new submitted trait might not be trait object.
- addSelectionButton = ""
- verifyButton = ""
- rnaseqButton = ""
- geneWikiButton = ""
- probeButton = ""
- similarButton = ""
- snpBrowserButton = ""
- updateButton = ""
-
- addSelectionText = ""
- verifyText = ""
- rnaseqText = ""
- geneWikiText = ""
- probeText = ""
- similarText = ""
- snpBrowserText = ""
- updateText = ""
-
- if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['user']:
-
- if this_trait==None or this_trait.db.type=='Temp':
- updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'addPublish');")
- updateButton_img = HT.Image("/images/edit_icon.jpg", name="addnew", alt="Add To Publish", title="Add To Publish", style="border:none;")
- updateButton.append(updateButton_img)
- updateText = "Edit"
- elif this_trait.db.type != 'Temp':
- if this_trait.db.type == 'Publish' and this_trait.confidential: #XZ: confidential phenotype trait
- if webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
- updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'updateRecord');")
- updateButton_img = HT.Image("/images/edit_icon.jpg", name="update", alt="Edit", title="Edit", style="border:none;")
- updateButton.append(updateButton_img)
- updateText = "Edit"
- else:
- updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'updateRecord');")
- updateButton_img = HT.Image("/images/edit_icon.jpg", name="update", alt="Edit", title="Edit", style="border:none;")
- updateButton.append(updateButton_img)
- updateText = "Edit"
- else:
- pass
-
- self.cursor.execute('SELECT Name FROM InbredSet WHERE Name="%s"' % fd.RISet)
- if this_trait:
- addSelectionButton = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (fd.RISet, 'dataInput'))
- addSelectionButton_img = HT.Image("/images/add_icon.jpg", name="addselect", alt="Add To Collection", title="Add To Collection", style="border:none;")
- #addSelectionButton.append(addSelectionButton_img)
- addSelectionText = "Add"
- elif self.cursor.fetchall():
- addSelectionButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('%s')[0], 'addRecord');" % ('dataInput'))
- addSelectionButton_img = HT.Image("/images/add_icon.jpg", name="", alt="Add To Collection", title="Add To Collection", style="border:none;")
- #addSelectionButton.append(addSelectionButton_img)
- addSelectionText = "Add"
- else:
- pass
-
-
- # Microarray database information to display
- if this_trait and this_trait.db and this_trait.db.type == 'ProbeSet': #before, this line was only reached if this_trait != 0, but now we need to check
- try:
- hddn['GeneId'] = int(string.strip(this_trait.geneid))
- except:
- pass
-
- #Info2Disp = HT.Paragraph()
-
- #XZ: Gene Symbol
- if this_trait.symbol:
- #XZ: Show SNP Browser only for mouse
- if _Species == 'mouse':
- self.cursor.execute("select geneSymbol from GeneList where geneSymbol = %s", this_trait.symbol)
- geneName = self.cursor.fetchone()
- if geneName:
- snpurl = os.path.join(webqtlConfig.CGIDIR, "main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True") + "&geneName=%s" % geneName[0]
- else:
- if this_trait.chr and this_trait.mb:
- snpurl = os.path.join(webqtlConfig.CGIDIR, "main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True") + \
- "&chr=%s&start=%2.6f&end=%2.6f" % (this_trait.chr, this_trait.mb-0.002, this_trait.mb+0.002)
- else:
- snpurl = ""
-
- if snpurl:
- snpBrowserButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % snpurl)
- snpBrowserButton_img = HT.Image("/images/snp_icon.jpg", name="snpbrowser", alt=" View SNPs and Indels ", title=" View SNPs and Indels ", style="border:none;")
- #snpBrowserButton.append(snpBrowserButton_img)
- snpBrowserText = "SNPs"
-
- #XZ: Show GeneWiki for all species
- geneWikiButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE) + "?FormID=geneWiki&symbol=%s" % this_trait.symbol))
- geneWikiButton_img = HT.Image("/images/genewiki_icon.jpg", name="genewiki", alt=" Write or review comments about this gene ", title=" Write or review comments about this gene ", style="border:none;")
- #geneWikiButton.append(geneWikiButton_img)
- geneWikiText = 'GeneWiki'
-
- #XZ: display similar traits in other selected datasets
- if this_trait and this_trait.db and this_trait.db.type=="ProbeSet" and this_trait.symbol:
- if _Species in ("mouse", "rat", "human"):
- similarUrl = "%s?cmd=sch&gene=%s&alias=1&species=%s" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.symbol, _Species)
- similarButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % similarUrl)
- similarButton_img = HT.Image("/images/find_icon.jpg", name="similar", alt=" Find similar expression data ", title=" Find similar expression data ", style="border:none;")
- #similarButton.append(similarButton_img)
- similarText = "Find"
- else:
- pass
- #tbl.append(HT.TR(
- #HT.TD('Gene Symbol: ', Class="fwb fs13", valign="top", nowrap="on", width=90),
- #HT.TD(width=10, valign="top"),
- #HT.TD(HT.Span('%s' % this_trait.symbol, valign="top", Class="fs13 fsI"), valign="top", width=740)
- #))
- else:
- tbl.append(HT.TR(
- HT.TD('Gene Symbol: ', Class="fwb fs13", valign="top", nowrap="on"),
- HT.TD(width=10, valign="top"),
- HT.TD(HT.Span('Not available', Class="fs13 fsI"), valign="top")
- ))
-
-
-
- ##display Verify Location button
- try:
- blatsequence = this_trait.blatseq
- if not blatsequence:
- #XZ, 06/03/2009: ProbeSet name is not unique among platforms. We should use ProbeSet Id instead.
- self.cursor.execute("""SELECT Probe.Sequence, Probe.Name
- FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
- WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
- ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
- ProbeSetFreeze.Name = '%s' AND
- ProbeSet.Name = '%s' AND
- Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""" % (this_trait.db.name, this_trait.name) )
- seqs = self.cursor.fetchall()
- if not seqs:
- raise ValueError
- else:
- blatsequence = ''
- for seqt in seqs:
- if int(seqt[1][-1]) % 2 == 1:
- blatsequence += string.strip(seqt[0])
-
- #--------Hongqiang add this part in order to not only blat ProbeSet, but also blat Probe
- blatsequence = '%3E'+this_trait.name+'%0A'+blatsequence+'%0A'
- #XZ, 06/03/2009: ProbeSet name is not unique among platforms. We should use ProbeSet Id instead.
- self.cursor.execute("""SELECT Probe.Sequence, Probe.Name
- FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
- WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
- ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
- ProbeSetFreeze.Name = '%s' AND
- ProbeSet.Name = '%s' AND
- Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""" % (this_trait.db.name, this_trait.name) )
-
- seqs = self.cursor.fetchall()
- for seqt in seqs:
- if int(seqt[1][-1]) %2 == 1:
- blatsequence += '%3EProbe_'+string.strip(seqt[1])+'%0A'+string.strip(seqt[0])+'%0A'
- #--------
- #XZ, 07/16/2009: targetsequence is not used, so I comment out this block
- #targetsequence = this_trait.targetseq
- #if targetsequence==None:
- # targetsequence = ""
-
- #XZ: Pay attention to the parameter of version (rn, mm, hg). They need to be changed if necessary.
- if _Species == "rat":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', blatsequence)
- UTHSC_BLAT_URL = ""
- elif _Species == "mouse":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', blatsequence)
- UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', blatsequence)
- elif _Species == "human":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
- UTHSC_BLAT_URL = ""
- else:
- UCSC_BLAT_URL = ""
- UTHSC_BLAT_URL = ""
-
- if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL)
- verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
- title=" Check probe locations at UCSC ", style="border:none;")
- verifyButton.append(verifyButtonImg)
- verifyText = 'Verify'
- if UTHSC_BLAT_URL:
- rnaseqButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL)
- rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ",
- title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
- rnaseqButton.append(rnaseqButtonImg)
- rnaseqText = 'RNA-seq'
- tSpan.append(HT.BR())
- except:
- pass
-
- #Display probe information (if any)
- if this_trait.db.name.find('Liver') >= 0 and this_trait.db.name.find('F2') < 0:
- pass
- else:
- #query database for number of probes associated with trait; if count > 0, set probe tool button and text
- self.cursor.execute("""SELECT count(*)
- FROM Probe, ProbeSet
- WHERE ProbeSet.Name = '%s' AND Probe.ProbeSetId = ProbeSet.Id""" % (this_trait.name))
-
- probeResult = self.cursor.fetchone()
- if probeResult[0] > 0:
- probeurl = "%s?FormID=showProbeInfo&database=%s&ProbeSetID=%s&CellID=%s&RISet=%s&incparentsf1=ON" \
- % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.db, this_trait.name, this_trait.cellid, fd.RISet)
- probeButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % probeurl)
- probeButton_img = HT.Image("/images/probe_icon.jpg", name="probe", alt=" Check sequence of probes ", title=" Check sequence of probes ", style="border:none;")
- #probeButton.append(probeButton_img)
- probeText = "Probes"
-
- #tSpan = HT.Span(Class="fs13")
-
- #XZ: deal with blat score and blat specificity.
- #if this_trait.probe_set_specificity or this_trait.probe_set_blat_score:
- # if this_trait.probe_set_specificity:
- # pass
- # #tSpan.append(HT.Href(url="/blatInfo.html", target="_blank", title="Values higher than 2 for the specificity are good", text="BLAT specificity", Class="non_bold"),": %.1f" % float(this_trait.probe_set_specificity), " "*3)
- # if this_trait.probe_set_blat_score:
- # pass
- # #tSpan.append("Score: %s" % int(this_trait.probe_set_blat_score), " "*2)
-
- #onClick="openNewWin('/blatInfo.html')"
-
- #tbl.append(HT.TR(
- # HT.TD('Target Score: ', Class="fwb fs13", valign="top", nowrap="on"),
- # HT.TD(width=10, valign="top"),
- # HT.TD(tSpan, valign="top")
- # ))
-
- #tSpan = HT.Span(Class="fs13")
- #tSpan.append(str(_Species).capitalize(), ", ", fd.RISet)
- #
- #tbl.append(HT.TR(
- # HT.TD('Species and Group: ', Class="fwb fs13", valign="top", nowrap="on"),
- # HT.TD(width=10, valign="top"),
- # HT.TD(tSpan, valign="top")
- # ))
-
- #if this_trait.cellid:
- # self.cursor.execute("""
- # select ProbeFreeze.Name from ProbeFreeze, ProbeSetFreeze
- # where
- # ProbeFreeze.Id = ProbeSetFreeze.ProbeFreezeId AND
- # ProbeSetFreeze.Id = %d""" % this_trait.db.id)
- # probeDBName = self.cursor.fetchone()[0]
- # tbl.append(HT.TR(
- # HT.TD('Database: ', Class="fs13 fwb", valign="top", nowrap="on"),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span('%s' % probeDBName, Class="non_bold"), valign="top")
- # ))
- #else:
- #tbl.append(HT.TR(
- # HT.TD('Database: ', Class="fs13 fwb", valign="top", nowrap="on"),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Href(text=this_trait.db.fullname, url = webqtlConfig.INFOPAGEHREF % this_trait.db.name,
- # target='_blank', Class="fs13 fwn non_bold"), valign="top")
- # ))
- #pass
-
- this_trait.species = _Species # We need this in the template, so we tuck it into this_trait
- this_trait.database = this_trait.get_database()
-
- #XZ: ID links
- if this_trait.genbankid or this_trait.geneid or this_trait.unigeneid or this_trait.omim or this_trait.homologeneid:
- idStyle = "background:#dddddd;padding:2"
- tSpan = HT.Span(Class="fs13")
- if this_trait.geneid:
- gurl = HT.Href(text= 'Gene', target='_blank',\
- url=webqtlConfig.NCBI_LOCUSID % this_trait.geneid, Class="fs14 fwn", title="Info from NCBI Entrez Gene")
- #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
- if this_trait.omim:
- gurl = HT.Href(text= 'OMIM', target='_blank', \
- url= webqtlConfig.OMIM_ID % this_trait.omim,Class="fs14 fwn", title="Summary from On Mendelian Inheritance in Man")
- #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
- if this_trait.unigeneid:
- try:
- gurl = HT.Href(text= 'UniGene',target='_blank',\
- url= webqtlConfig.UNIGEN_ID % tuple(string.split(this_trait.unigeneid,'.')[:2]),Class="fs14 fwn", title="UniGene ID")
- #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
- except:
- pass
- if this_trait.genbankid:
- this_trait.genbankid = '|'.join(this_trait.genbankid.split('|')[0:10])
- if this_trait.genbankid[-1]=='|':
- this_trait.genbankid=this_trait.genbankid[0:-1]
- gurl = HT.Href(text= 'GenBank', target='_blank', \
- url= webqtlConfig.GENBANK_ID % this_trait.genbankid,Class="fs14 fwn", title="Find the original GenBank sequence used to design the probes")
- #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
- if this_trait.homologeneid:
- hurl = HT.Href(text= 'HomoloGene', target='_blank',\
- url=webqtlConfig.HOMOLOGENE_ID % this_trait.homologeneid, Class="fs14 fwn", title="Find similar genes in other species")
- #tSpan.append(HT.Span(hurl, style=idStyle), " "*2)
-
- #tbl.append(
- # HT.TR(HT.TD(colspan=3,height=6)),
- # HT.TR(
- # HT.TD('Resource Links: ', Class="fwb fs13", valign="top", nowrap="on"),
- # HT.TD(width=10, valign="top"),
- # HT.TD(tSpan, valign="top")
- # ))
-
- #XZ: Resource Links:
- if this_trait.symbol:
- linkStyle = "background:#dddddd;padding:2"
- tSpan = HT.Span(style="font-family:verdana,serif;font-size:13px")
-
- #XZ,12/26/2008: Gene symbol may contain single quotation mark.
- #For example, Affymetrix, mouse430v2, 1440338_at, the symbol is 2'-Pde (geneid 211948)
- #I debug this by using double quotation marks.
- if _Species == "rat":
-
- #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
- #symatlas_species = "Rattus norvegicus"
-
- #self.cursor.execute("SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = '%s'" % this_trait.symbol)
- self.cursor.execute('SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = "%s"' % this_trait.symbol)
- try:
- kgId, chr, txst, txen = self.cursor.fetchall()[0]
- if chr and txst and txen and kgId:
- txst = int(txst*1000000)
- txen = int(txen*1000000)
- #tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\
- # title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('rn3',kgId,chr,txst,txen),Class="fs14 fwn"), style=linkStyle)
- # , " "*2)
- except:
- pass
- if _Species == "mouse":
-
- #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
- #symatlas_species = "Mus musculus"
-
- #self.cursor.execute("SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = '%s'" % this_trait.symbol)
- self.cursor.execute('SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = "%s"' % this_trait.symbol)
- try:
- chr, txst, txen = self.cursor.fetchall()[0]
- if chr and txst and txen and this_trait.refseq_transcriptid :
- txst = int(txst*1000000)
- txen = int(txen*1000000)
- tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\
- title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('mm9',this_trait.refseq_transcriptid,chr,txst,txen),
- Class="fs14 fwn"), style=linkStyle)
- , " "*2)
- except:
- pass
-
- #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
- #tSpan.append(HT.Span(HT.Href(text= 'SymAtlas',target="mainFrame",\
- # url="http://symatlas.gnf.org/SymAtlas/bioentry?querytext=%s&query=14&species=%s&type=Expression" \
- # % (this_trait.symbol,symatlas_species),Class="fs14 fwn", \
- # title="Expression across many tissues and cell types"), style=linkStyle), " "*2)
- if this_trait.geneid and (_Species == "mouse" or _Species == "rat" or _Species == "human"):
- #tSpan.append(HT.Span(HT.Href(text= 'BioGPS',target="mainFrame",\
- # url="http://biogps.gnf.org/?org=%s#goto=genereport&id=%s" \
- # % (_Species, this_trait.geneid),Class="fs14 fwn", \
- # title="Expression across many tissues and cell types"), style=linkStyle), " "*2)
- pass
- #tSpan.append(HT.Span(HT.Href(text= 'STRING',target="mainFrame",\
- # url="http://string.embl.de/newstring_cgi/show_link_summary.pl?identifier=%s" \
- # % this_trait.symbol,Class="fs14 fwn", \
- # title="Protein interactions: known and inferred"), style=linkStyle), " "*2)
- if this_trait.symbol:
- #ZS: The "species scientific" converts the plain English species names we're using to their scientific names, which are needed for PANTHER's input
- #We should probably use the scientific name along with the English name (if not instead of) elsewhere as well, given potential non-English speaking users
- if _Species == "mouse":
- species_scientific = "Mus%20musculus"
- elif _Species == "rat":
- species_scientific = "Rattus%20norvegicus"
- elif _Species == "human":
- species_scientific = "Homo%20sapiens"
- elif _Species == "drosophila":
- species_scientific = "Drosophila%20melanogaster"
- else:
- species_scientific = "all"
-
- species_scientific
- #tSpan.append(HT.Span(HT.Href(text= 'PANTHER',target="mainFrame", \
- # url="http://www.pantherdb.org/genes/geneList.do?searchType=basic&fieldName=all&organism=%s&listType=1&fieldValue=%s" \
- # % (species_scientific, this_trait.symbol),Class="fs14 fwn", \
- # title="Gene and protein data resources from Celera-ABI"), style=linkStyle), " "*2)
- else:
- pass
- #tSpan.append(HT.Span(HT.Href(text= 'BIND',target="mainFrame",\
- # url="http://bind.ca/?textquery=%s" \
- # % this_trait.symbol,Class="fs14 fwn", \
- # title="Protein interactions"), style=linkStyle), " "*2)
- #if this_trait.geneid and (_Species == "mouse" or _Species == "rat" or _Species == "human"):
- # tSpan.append(HT.Span(HT.Href(text= 'Gemma',target="mainFrame",\
- # url="http://www.chibi.ubc.ca/Gemma/gene/showGene.html?ncbiid=%s" \
- # % this_trait.geneid, Class="fs14 fwn", \
- # title="Meta-analysis of gene expression data"), style=linkStyle), " "*2)
- #tSpan.append(HT.Span(HT.Href(text= 'SynDB',target="mainFrame",\
- # url="http://lily.uthsc.edu:8080/20091027_GNInterfaces/20091027_redirectSynDB.jsp?query=%s" \
- # % this_trait.symbol, Class="fs14 fwn", \
- # title="Brain synapse database"), style=linkStyle), " "*2)
- #if _Species == "mouse":
- # tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
- # url="http://mouse.brain-map.org/brain/%s.html" \
- # % this_trait.symbol, Class="fs14 fwn", \
- # title="Allen Brain Atlas"), style=linkStyle), " "*2)
-
- if this_trait.geneid:
- #if _Species == "mouse":
- # tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
- # url="http://www.brain-map.org/search.do?queryText=egeneid=%s" \
- # % this_trait.geneid, Class="fs14 fwn", \
- # title="Allen Brain Atlas"), style=linkStyle), " "*2)
- if _Species == "human":
- #tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
- # url="http://humancortex.alleninstitute.org/has/human/imageseries/search/1.html?searchSym=t&searchAlt=t&searchName=t&gene_term=&entrez_term=%s" \
- # % this_trait.geneid, Class="fs14 fwn", \
- # title="Allen Brain Atlas"), style=linkStyle), " "*2)
- pass
-
- #tbl.append(
- # HT.TR(HT.TD(colspan=3,height=6)),
- # HT.TR(
- # HT.TD(' '),
- # HT.TD(width=10, valign="top"),
- # HT.TD(tSpan, valign="top")))
-
- #menuTable = HT.TableLite(cellpadding=2, Class="collap", width="620", id="target1")
- #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(similarButton, align="center"),HT.TD(verifyButton, align="center"),HT.TD(geneWikiButton, align="center"),HT.TD(snpBrowserButton, align="center"),HT.TD(rnaseqButton, align="center"),HT.TD(probeButton, align="center"),HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
- #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(similarText, align="center"),HT.TD(verifyText, align="center"),HT.TD(geneWikiText, align="center"),HT.TD(snpBrowserText, align="center"),HT.TD(rnaseqText, align="center"),HT.TD(probeText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
-
-
- #for zhou mi's cliques, need to be removed
- #if self.database[:6] == 'BXDMic' and self.ProbeSetID in cliqueID:
- # Info2Disp.append(HT.Strong('Clique Search: '),HT.Href(text='Search',\
- # url ="http://compbio1.utmem.edu/clique_go/results.php?pid=%s&pval_1=0&pval_2=0.001" \
- # % self.ProbeSetID,target='_blank',Class="normalsize"),HT.BR())
-
- #linkTable.append(HT.TR(linkTD))
- #Info2Disp.append(linkTable)
- #title1Body.append(tbl, HT.BR(), menuTable)
-
- elif this_trait and this_trait.db and this_trait.db.type =='Publish': #Check if trait is phenotype
-
- if this_trait.confidential:
- pass
- #tbl.append(HT.TR(
- # HT.TD('Pre-publication Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.pre_publication_description, Class="fs13"), valign="top", width=740)
- # ))
- if webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
- #tbl.append(HT.TR(
- # HT.TD('Post-publication Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.post_publication_description, Class="fs13"), valign="top", width=740)
- # ))
- #tbl.append(HT.TR(
- # HT.TD('Pre-publication Abbreviation: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.pre_publication_abbreviation, Class="fs13"), valign="top", width=740)
- # ))
- #tbl.append(HT.TR(
- # HT.TD('Post-publication Abbreviation: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.post_publication_abbreviation, Class="fs13"), valign="top", width=740)
- # ))
- #tbl.append(HT.TR(
- # HT.TD('Lab code: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.lab_code, Class="fs13"), valign="top", width=740)
- # ))
- pass
- #tbl.append(HT.TR(
- # HT.TD('Owner: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.owner, Class="fs13"), valign="top", width=740)
- # ))
- else:
- pass
- #tbl.append(HT.TR(
- # HT.TD('Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.post_publication_description, Class="fs13"), valign="top", width=740)
- # ))
- #tbl.append(HT.TR(
- # HT.TD('Authors: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.authors, Class="fs13"),
- # valign="top", width=740)
- # ))
- #tbl.append(HT.TR(
- # HT.TD('Title: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(this_trait.title, Class="fs13"),
- # valign="top", width=740)
- # ))
- if this_trait.journal:
- journal = this_trait.journal
- if this_trait.year:
- journal = this_trait.journal + " (%s)" % this_trait.year
- #
- #tbl.append(HT.TR(
- # HT.TD('Journal: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(journal, Class="fs13"),
- # valign="top", width=740)
- # ))
- PubMedLink = ""
- if this_trait.pubmed_id:
- PubMedLink = webqtlConfig.PUBMEDLINK_URL % this_trait.pubmed_id
- if PubMedLink:
- #tbl.append(HT.TR(
- # HT.TD('Link: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(HT.Href(url=PubMedLink, text="PubMed",target='_blank',Class="fs14 fwn"),
- # style = "background:#cddcff;padding:2"), valign="top", width=740)
- # ))
- pass
-
- menuTable = HT.TableLite(cellpadding=2, Class="collap", width="150", id="target1")
- #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
- #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
-
- #title1Body.append(tbl, HT.BR(), menuTable)
-
- elif this_trait and this_trait.db and this_trait.db.type == 'Geno': #Check if trait is genotype
-
- GenoInfo = HT.Paragraph()
- if this_trait.chr and this_trait.mb:
- location = ' Chr %s @ %s Mb' % (this_trait.chr,this_trait.mb)
- else:
- location = "not available"
-
- if this_trait.sequence and len(this_trait.sequence) > 100:
- if _Species == "rat":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', this_trait.sequence)
- UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('rat', 'rn3', this_trait.sequence)
- elif _Species == "mouse":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
- UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
- elif _Species == "human":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
- UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('human', 'hg19', this_trait.sequence)
- else:
- UCSC_BLAT_URL = ""
- UTHSC_BLAT_URL = ""
- if UCSC_BLAT_URL:
- #verifyButton = HT.Href(url="#", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
- verifyButton = HT.Href(url="#")
- verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
- verifyButton.append(verifyButtonImg)
- verifyText = "Verify"
- rnaseqButton = HT.Href(url="#", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
- rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
- rnaseqButton.append(rnaseqButtonImg)
- rnaseqText = "RNA-seq"
-
- #tbl.append(HT.TR(
- # HT.TD('Location: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Span(location, Class="fs13"), valign="top", width=740)
- # ),
- # HT.TR(
- # HT.TD('SNP Search: ', Class="fs13 fwb",
- # valign="top", nowrap="on", width=90),
- # HT.TD(width=10, valign="top"),
- # HT.TD(HT.Href("http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=snp&cmd=search&term=%s" % this_trait.name, 'NCBI',Class="fs13"),
- # valign="top", width=740)
- # ))
-
- menuTable = HT.TableLite(cellpadding=2, Class="collap", width="275", id="target1")
- #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(verifyButton, align="center"),HT.TD(rnaseqButton, align="center"), HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
- #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(verifyText, align="center"),HT.TD(rnaseqText, align="center"), HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
-
- #title1Body.append(tbl, HT.BR(), menuTable)
-
- elif (this_trait == None or this_trait.db.type == 'Temp'): #if temporary trait (user-submitted trait or PCA trait)
-
- #TempInfo = HT.Paragraph()
- if this_trait != None:
- if this_trait.description:
- pass
- #tbl.append(HT.TR(HT.TD(HT.Strong('Description: '),' %s ' % this_trait.description,HT.BR()), colspan=3, height=15))
- else:
- tbl.append(HT.TR(HT.TD(HT.Strong('Description: '),'not available',HT.BR(),HT.BR()), colspan=3, height=15))
-
- if (updateText == "Edit"):
- menuTable = HT.TableLite(cellpadding=2, Class="collap", width="150", id="target1")
- else:
- menuTable = HT.TableLite(cellpadding=2, Class="collap", width="80", id="target1")
-
- #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="right"),HT.TD(updateButton, align="right"), colspan=3, height=50, style="vertical-align:bottom;") )
- #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
- #
- #title1Body.append(tbl, HT.BR(), menuTable)
-
- else:
- pass
-
-
- 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.
- #stats_row = HT.TR()
- #stats_cell = HT.TD()
-
- 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.
- print("ac1") # This is the one used for first sall3
- self.MDP_menu.append(('All Cases','0'))
- self.MDP_menu.append(('%s Only' % fd.RISet, '1'))
- self.MDP_menu.append(('Non-%s Only' % fd.RISet, '2'))
-
- else:
- if (len(other_samples) > 0) and (len(primary_samples) + len(other_samples) > 3):
- print("ac2")
- self.MDP_menu.append(('All Cases','0'))
- self.MDP_menu.append(('%s Only' % fd.RISet,'1'))
- self.MDP_menu.append(('Non-%s Only' % fd.RISet,'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:
- print("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_", "")
-
- #try:
- print("* type of this_trait:", type(this_trait))
- print(" name:", this_trait.__class__.__name__)
- print(" this_trait:", this_trait)
- print(" type of this_trait.data[sampleName]:", type(this_trait.data[sampleName]))
- print(" name:", this_trait.data[sampleName].__class__.__name__)
- print(" this_trait.data[sampleName]:", this_trait.data[sampleName])
- thisval = this_trait.data[sampleName].value
- print(" thisval:", thisval)
- thisvar = this_trait.data[sampleName].variance
- print(" thisvar:", thisvar)
- thisValFull = [sampleName, thisval, thisvar]
- print(" thisValFull:", thisValFull)
- #except:
- # continue
-
- vals1.append(thisValFull)
-
-
- #vals1 = [[sampleNameOrig.replace("_2nd_", ""),
- # this_trait.data[sampleName].val,
- # this_trait.data[sampleName].var]
- # for sampleNameOrig in all_samples]]
- #
-
- #Using just the RISet sample
- for sampleNameOrig in primary_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- #try:
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
- #except:
- # continue
-
- vals2.append(thisValFull)
-
- #Using all non-RISet samples only
- for sampleNameOrig in other_samples:
- sampleName = sampleNameOrig.replace("_2nd_", "")
-
- #try:
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
- #except:
- # continue
-
- 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_", "")
-
- #try:
- thisval = this_trait.data[sampleName].value
- thisvar = this_trait.data[sampleName].variance
- thisValFull = [sampleName,thisval,thisvar]
- #except:
- # continue
-
- 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.")))
- stats_script_text = """$(function() { $("#stats_tabs").tabs();});"""
- #stats_cell.append(stats_container)
- 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.RISet + " 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.RISet + " case data were entered. No statistical analysis has been attempted.")))
- stats_script_text = """$(function() { $("#stats_tabs0").tabs(); $("#stats_tabs1").tabs(); $("#stats_tabs2").tabs();});"""
- else:
- #stats_container = HT.Div(id="stats_tabs%s" % i, Class="ui-tabs")
- stats_script_text = """$(function() { $("#stats_tabs0").tabs(); $("#stats_tabs1").tabs(); $("#stats_tabs2").tabs();});"""
- 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")]
- #stats_tabs = HT.List(stats_tab_list)
- #stats_container.append(stats_tabs)
- #
- #table_div = HT.Div(id="statstabs-1")
- #table_container = HT.Paragraph()
- #
- #statsTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
-
- if this_trait.db:
- if this_trait.cellid:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.db.type, cellid=this_trait.cellid))
- else:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.db.type))
- else:
- self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals))
-
- #statsTable.append(HT.TR(HT.TD(statsTableCell)))
-
- #table_container.append(statsTable)
- #table_div.append(table_container)
- #stats_container.append(table_div)
- #
- #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, RISet=fd.RISet, 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"))))
- #normalplot_container.append(normalplot)
- #normalplot_div.append(normalplot_container)
- #stats_container.append(normalplot_div)
-
- #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")))
- #boxplot_container.append(boxplot)
- #boxplot_div.append(boxplot_container)
- #stats_container.append(boxplot_div)
-
-
- #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, RISet=fd.RISet, vals=vals, type="name")
- #barName.append(HT.TR(HT.TD(barName_img)))
- #barName_container.append(barName)
- #barName_div.append(barName_container)
- #stats_container.append(barName_div)
- #
- #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, RISet=fd.RISet, vals=vals, type="rank")
- #barRank.append(HT.TR(HT.TD(barRank_img)))
- #barRank_container.append(barRank)
- #barRank_div.append(barRank_container)
- #stats_container.append(barRank_div)
-
- # stats_cell.append(stats_container)
- #
- #stats_script.append(stats_script_text)
- #
- #submitTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%", Class="target2")
- #stats_row.append(stats_cell)
-
- #submitTable.append(stats_row)
- #submitTable.append(stats_script)
-
- #title2Body.append(submitTable)
-
-
- def build_correlation_tools(self, fd, this_trait):
-
- #species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
-
- RISetgp = fd.RISet
-
- # We're checking a string here!
- assert isinstance(RISetgp, basestring), "We need a string type thing here"
- if RISetgp[:3] == 'BXD':
- RISetgp = 'BXD'
-
- if RISetgp:
- #sample_correlation = HT.Input(type='button',name='sample_corr', value=' Compute ', Class="button sample_corr")
- #lit_correlation = HT.Input(type='button',name='lit_corr', value=' Compute ', Class="button lit_corr")
- #tissue_correlation = HT.Input(type='button',name='tiss_corr', value=' Compute ', Class="button tiss_corr")
- #methodText = HT.Span("Calculate:", Class="ffl fwb fs12")
- #
- #databaseText = HT.Span("Database:", Class="ffl fwb fs12")
- #databaseMenu1 = HT.Select(name='database1')
- #databaseMenu2 = HT.Select(name='database2')
- #databaseMenu3 = HT.Select(name='database3')
-
- dataset_menu = []
- print("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH)
- print("[tape4] type webqtlConfig.PUBLICTHRESH:", type(webqtlConfig.PUBLICTHRESH))
- self.cursor.execute('''SELECT PublishFreeze.FullName,PublishFreeze.Name FROM
- PublishFreeze,InbredSet WHERE PublishFreeze.InbredSetId = InbredSet.Id
- and InbredSet.Name = %s and PublishFreeze.public > %s''',
- (RISetgp, webqtlConfig.PUBLICTHRESH))
- for item in self.cursor.fetchall():
- dataset_menu.append(dict(tissue=None,
- datasets=[item]))
-
- self.cursor.execute('''SELECT GenoFreeze.FullName,GenoFreeze.Name FROM GenoFreeze,
- InbredSet WHERE GenoFreeze.InbredSetId = InbredSet.Id and InbredSet.Name =
- %s and GenoFreeze.public > %s''',
- (RISetgp, webqtlConfig.PUBLICTHRESH))
- for item in self.cursor.fetchall():
- dataset_menu.append(dict(tissue=None,
- datasets=[item]))
-
- #03/09/2009: Xiaodong changed the SQL query to order by Name as requested by Rob.
- self.cursor.execute('SELECT Id, Name FROM Tissue order by Name')
- for item in self.cursor.fetchall():
- tissue_id, tissue_name = item
- #databaseMenuSub = HT.Optgroup(label = '%s ------' % tissue_name)
- #dataset_sub_menu = []
- print("phun9")
- self.cursor.execute('''SELECT ProbeSetFreeze.FullName,ProbeSetFreeze.Name FROM ProbeSetFreeze, ProbeFreeze,
- InbredSet WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = %s and
- ProbeSetFreeze.public > %s and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name like %s
- order by ProbeSetFreeze.CreateTime desc, ProbeSetFreeze.AvgId ''',
- (tissue_id, webqtlConfig.PUBLICTHRESH, "%" + RISetgp + "%"))
- print("phun8")
- dataset_sub_menu = [item for item in self.cursor.fetchall() if item]
- #for item2 in self.cursor.fetchall():
- # dataset_sub_menu.append(item2)
- if dataset_sub_menu:
- dataset_menu.append(dict(tissue=tissue_name,
- datasets=dataset_sub_menu))
- # ("**heading**", tissue_name))
- #dataset_menu.append(dataset_sub_menu)
-
- dataset_menu_selected = None
- if len(dataset_menu):
- if this_trait and this_trait.db:
- dataset_menu_selected = this_trait.db.name
-
- #criteriaText = HT.Span("Return:", Class="ffl fwb fs12")
-
- #criteriaMenu1 = HT.Select(name='criteria1', selected='500', onMouseOver="if (NS4 || IE4) activateEl('criterias', event);")
-
- return_results_menu = (100, 200, 500, 1000, 2000, 5000, 10000, 15000, 20000)
- return_results_menu_selected = 500
-
- #criteriaMenu1.append(('top 100','100'))
- #criteriaMenu1.append(('top 200','200'))
- #criteriaMenu1.append(('top 500','500'))
- #criteriaMenu1.append(('top 1000','1000'))
- #criteriaMenu1.append(('top 2000','2000'))
- #criteriaMenu1.append(('top 5000','5000'))
- #criteriaMenu1.append(('top 10000','10000'))
- #criteriaMenu1.append(('top 15000','15000'))
- #criteriaMenu1.append(('top 20000','20000'))
-
- #self.MDPRow1 = HT.TR(Class='mdp1')
- #self.MDPRow2 = HT.TR(Class='mdp2')
- #self.MDPRow3 = HT.TR(Class='mdp3')
-
- # correlationMenus1 = HT.TableLite(
- # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu1, colspan="3")),
- # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu1)),
- # self.MDPRow1, cellspacing=0, width="619px", cellpadding=2)
- # correlationMenus1.append(HT.Input(name='orderBy', value='2', type='hidden')) # to replace the orderBy menu
- # correlationMenus2 = HT.TableLite(
- # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu2, colspan="3")),
- # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu2)),
- # self.MDPRow2, cellspacing=0, width="619px", cellpadding=2)
- # correlationMenus2.append(HT.Input(name='orderBy', value='2', type='hidden'))
- # correlationMenus3 = HT.TableLite(
- # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu3, colspan="3")),
- # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu3)),
- # self.MDPRow3, cellspacing=0, width="619px", cellpadding=2)
- # correlationMenus3.append(HT.Input(name='orderBy', value='2', type='hidden'))
- #
- #else:
- # correlationMenus = ""
-
-
- #corr_row = HT.TR()
- #corr_container = HT.Div(id="corr_tabs", Class="ui-tabs")
- #
- #if (this_trait.db != None and this_trait.db.type =='ProbeSet'):
- # corr_tab_list = [HT.Href(text='Sample r', url="#corrtabs-1"),
- # HT.Href(text='Literature r', url="#corrtabs-2"),
- # HT.Href(text='Tissue r', url="#corrtabs-3")]
- #else:
- # corr_tab_list = [HT.Href(text='Sample r', url="#corrtabs-1")]
- #
- #corr_tabs = HT.List(corr_tab_list)
- #corr_container.append(corr_tabs)
-
- #if correlationMenus1 or correlationMenus2 or correlationMenus3:
- #sample_div = HT.Div(id="corrtabs-1")
- #sample_container = HT.Span()
- #
- #sample_type = HT.Input(type="radio", name="sample_method", value="1", checked="checked")
- #sample_type2 = HT.Input(type="radio", name="sample_method", value="2")
- #
- #sampleTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #sampleTD = HT.TD(correlationMenus1, HT.BR(),
- # "Pearson", sample_type, " "*3, "Spearman Rank", sample_type2, HT.BR(), HT.BR(),
- # sample_correlation, HT.BR(), HT.BR())
- #
- #sampleTD.append(HT.Span("The ",
- # HT.Href(url="/correlationAnnotation.html#sample_r", target="_blank",
- # text="Sample Correlation")," is computed between trait data and",
- # " any ",HT.BR()," other traits in the sample database selected above. Use ",
- # HT.Href(url="/glossary.html#Correlations", target="_blank", text="Spearman Rank"),
- # HT.BR(),"when the sample size is small (<20) or when there are influential \
- # outliers.", HT.BR(),Class="fs12"))
-
- #sampleTable.append(sampleTD)
-
- #sample_container.append(sampleTable)
- #sample_div.append(sample_container)
- #corr_container.append(sample_div)
- #
- #literature_div = HT.Div(id="corrtabs-2")
- #literature_container = HT.Span()
-
- #literatureTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #literatureTD = HT.TD(correlationMenus2,HT.BR(),lit_correlation, HT.BR(), HT.BR())
- #literatureTD.append(HT.Span("The ", HT.Href(url="/correlationAnnotation.html", target="_blank",text="Literature Correlation"), " (Lit r) between this gene and all other genes is computed",HT.BR(),
- # "using the ", HT.Href(url="https://grits.eecs.utk.edu/sgo/sgo.html", target="_blank", text="Semantic Gene Organizer"),
- # " and human, rat, and mouse data from PubMed. ", HT.BR(),"Values are ranked by Lit r, \
- # but Sample r and Tissue r are also displayed.", HT.BR(), HT.BR(),
- # HT.Href(url="/glossary.html#Literature", target="_blank", text="More on using Lit r"), Class="fs12"))
- #literatureTable.append(literatureTD)
- #
- #literature_container.append(literatureTable)
- #literature_div.append(literature_container)
- #
- #if this_trait.db != None:
- # if (this_trait.db.type =='ProbeSet'):
- # corr_container.append(literature_div)
- #
- #tissue_div = HT.Div(id="corrtabs-3")
- #tissue_container = HT.Span()
- #
- #tissue_type = HT.Input(type="radio", name="tissue_method", value="4", checked="checked")
- #tissue_type2 = HT.Input(type="radio", name="tissue_method", value="5")
- #
- #tissueTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
- #tissueTD = HT.TD(correlationMenus3,HT.BR(),
- # "Pearson", tissue_type, " "*3, "Spearman Rank", tissue_type2, HT.BR(), HT.BR(),
- # tissue_correlation, HT.BR(), HT.BR())
- #tissueTD.append(HT.Span("The ", HT.Href(url="/webqtl/main.py?FormID=tissueCorrelation", target="_blank", text="Tissue Correlation"),
- #" (Tissue r) estimates the similarity of expression of two genes",HT.BR()," or \
- #transcripts across different cells, tissues, or organs (",HT.Href(url="/correlationAnnotation.html#tissue_r", target="_blank", text="glossary"),"). \
- #Tissue correlations",HT.BR()," are generated by analyzing expression in multiple samples usually taken from \
- #single cases.",HT.BR(),HT.Bold("Pearson")," and ",HT.Bold("Spearman Rank")," correlations have been computed for all pairs \
- #of genes",HT.BR()," using data from mouse samples.",
- #HT.BR(), Class="fs12"))
- #tissueTable.append(tissueTD)
- #
- #tissue_container.append(tissueTable)
- #tissue_div.append(tissue_container)
- #if this_trait.db != None:
- # if (this_trait.db.type =='ProbeSet'):
- # corr_container.append(tissue_div)
- #
- #corr_row.append(HT.TD(corr_container))
- #
- #corr_script = HT.Script(language="Javascript")
- #corr_script_text = """$(function() { $("#corr_tabs").tabs(); });"""
- #corr_script.append(corr_script_text)
- #
- #submitTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%", Class="target4")
- #submitTable.append(corr_row)
- #submitTable.append(corr_script)
- #
- #title3Body.append(submitTable)
- self.corr_tools = dict(dataset_menu = dataset_menu,
- dataset_menu_selected = dataset_menu_selected,
- return_results_menu = return_results_menu,
- return_results_menu_selected = return_results_menu_selected,)
-
-
- def dispMappingTools(self, fd, title4Body, this_trait):
-
- _Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
-
- RISetgp = fd.RISet
- if RISetgp[:3] == 'BXD':
- RISetgp = '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=RISetgp)
-
- 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(' (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=' Compute Using PLINK ', 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, fd, variance_data_page, this_trait):
- if fd.genotype.type == "riset":
- all_samples_ordered = fd.f1list + fd.samplelist
- else:
- all_samples_ordered = fd.parlist + fd.f1list + fd.samplelist
-
- this_trait_samples = set(this_trait.data.keys())
-
- primary_sample_names = all_samples_ordered
-
- print("-*- primary_samplelist is:", pf(primary_sample_names))
-
- primary_samples = SampleList(self.cursor,
- fd=fd,
- variance_data_page=variance_data_page,
- sample_names=primary_sample_names,
- this_trait=this_trait,
- sample_group_type='primary',
- header="%s Only" % (fd.RISet))
-
- print("primary_samples.attributes:", pf(primary_samples.attributes))
-
- other_sample_names = []
- for sample in this_trait.data.keys():
- print("hjk - sample is:", sample)
- if sample not in all_samples_ordered:
- all_samples_ordered.append(sample)
- other_sample_names.append(sample)
-
- if other_sample_names:
- unappended_par_f1 = fd.f1list + fd.parlist
- par_f1_samples = ["_2nd_" + sample for sample in unappended_par_f1]
-
- other_sample_names.sort() #Sort other samples
- other_sample_names = par_f1_samples + other_sample_names
-
- other_samples = SampleList(self.cursor,
- fd=fd,
- variance_data_page=variance_data_page,
- sample_names=other_sample_names,
- this_trait=this_trait,
- sample_group_type='other',
- header="Non-%s" % (fd.RISet))
-
- self.sample_groups = (primary_samples, other_samples)
- else:
- self.sample_groups = (primary_samples,)
-
- #TODO: Figure out why this if statement is written this way - Zach
- #if (other_sample_names or (fd.f1list and this_trait.data.has_key(fd.f1list[0]))
- # or (fd.f1list and this_trait.data.has_key(fd.f1list[1]))):
- # print("hjs")
- fd.allsamplelist = all_samples_ordered
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
new file mode 100755
index 00000000..743e4ad6
--- /dev/null
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -0,0 +1,1557 @@
+from __future__ import absolute_import, print_function, division
+
+import string
+import os
+import cPickle
+#import pyXLWriter as xl
+
+from collections import OrderedDict
+
+from htmlgen import HTMLgen2 as HT
+
+from base import webqtlConfig
+from base import webqtlCaseData
+from wqflask.show_trait.SampleList import SampleList
+from utility import webqtlUtil, Plot, Bunch
+from base.webqtlTrait import webqtlTrait
+from dbFunction import webqtlDatabaseFunction
+from base.templatePage import templatePage
+from basicStatistics import BasicStatisticsFunctions
+
+from pprint import pformat as pf
+
+###############################################
+#
+# Todo: Put in security to ensure that user has permission to access confidential data sets
+# And add i.p.limiting as necessary
+#
+##############################################
+
+
+
+class ShowTrait(templatePage):
+
+ def __init__(self, fd):
+ self.fd = fd
+
+ templatePage.__init__(self, fd)
+ assert self.openMysql(), "No datbase!"
+
+ this_trait = self.get_this_trait()
+
+ ##read genotype file
+ fd.RISet = this_trait.riset
+ fd.readGenotype()
+
+ if not fd.genotype:
+ fd.readData(incf1=1)
+
+ # determine data editing page format
+ variance_data_page = 0
+ if fd.formID == 'varianceChoice':
+ variance_data_page = 1
+
+ if variance_data_page:
+ fmID='dataEditing'
+ else:
+ if fd.enablevariance:
+ fmID='pre_dataEditing'
+ else:
+ fmID='dataEditing'
+
+ # Some fields, like method, are defaulted to None; otherwise in IE the field can't be changed using jquery
+ hddn = OrderedDict(
+ FormID = fmID,
+ RISet = fd.RISet,
+ 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 = '_'
+ )
+
+ if fd.enablevariance:
+ hddn['enablevariance']='ON'
+ if fd.incparentsf1:
+ hddn['incparentsf1']='ON'
+
+ if this_trait:
+ hddn['fullname'] = str(this_trait)
+ try:
+ hddn['normalPlotTitle'] = this_trait.symbol
+ hddn['normalPlotTitle'] += ": "
+ hddn['normalPlotTitle'] += this_trait.name
+ except:
+ hddn['normalPlotTitle'] = str(this_trait.name)
+ hddn['fromDataEditingPage'] = 1
+ if this_trait.db and this_trait.db.type and this_trait.db.type == 'ProbeSet':
+ hddn['trait_type'] = this_trait.db.type
+ if this_trait.cellid:
+ hddn['cellid'] = this_trait.cellid
+ else:
+ self.cursor.execute("SELECT h2 from ProbeSetXRef WHERE DataId = %d" %
+ this_trait.mysqlid)
+ heritability = self.cursor.fetchone()
+ hddn['heritability'] = heritability
+
+ hddn['attribute_names'] = ""
+
+ hddn['mappingMethodId'] = webqtlDatabaseFunction.getMappingMethod (cursor=self.cursor,
+ groupName=fd.RISet)
+
+ if fd.identification:
+ hddn['identification'] = fd.identification
+ else:
+ hddn['identification'] = "Un-named trait" #If no identification, set identification to un-named
+
+ self.dispTraitInformation(fd, "", hddn, this_trait) #Display trait information + function buttons
+
+ if this_trait == None:
+ this_trait = webqtlTrait(data=fd.allTraitData, db=None)
+
+ ## Variance submit page only
+ #if fd.enablevariance and not variance_data_page:
+ # pass
+ # #title2Body.append("Click the next button to go to the variance submission form.",
+ # # HT.Center(next,reset))
+ #else:
+ # pass
+ # # We'll get this part working later
+ # print("Calling dispBasicStatistics")
+ # self.dispBasicStatistics(fd, this_trait)
+
+ self.build_correlation_tools(fd, this_trait)
+
+
+ self.make_sample_lists(fd, variance_data_page, this_trait)
+
+ if fd.allsamplelist:
+ hddn['allsamplelist'] = string.join(fd.allsamplelist, ' ')
+
+ if fd.varianceDispName != 'Variance':
+ hddn['isSE'] = "yes"
+
+ # We'll need access to this_trait and hddn in the Jinja2 Template, so we put it inside self
+ self.this_trait = this_trait
+ self.hddn = hddn
+
+ self.sample_group_types = OrderedDict()
+ self.sample_group_types['primary_only'] = fd.RISet + " Only"
+ self.sample_group_types['other_only'] = "Non-" + fd.RISet
+ self.sample_group_types['all_cases'] = "All Cases"
+ self.js_data = dict(sample_groups = self.sample_group_types)
+
+
+ def get_this_trait(self):
+ # When is traitInfos used?
+ #if traitInfos:
+ # database, ProbeSetID, CellID = traitInfos
+ #else:
+ database = self.fd['database']
+ probe_set_id = self.fd['ProbeSetID']
+ cell_id = self.fd.get('CellID')
+
+ this_trait = webqtlTrait(db=database, name=probe_set_id, cellid=cell_id, cursor=self.cursor)
+
+ ##identification, etc.
+ self.fd.identification = '%s : %s' % (this_trait.db.shortname, probe_set_id)
+ this_trait.returnURL = webqtlConfig.CGIDIR + webqtlConfig.SCRIPTFILE + '?FormID=showDatabase&database=%s\
+ &ProbeSetID=%s&RISet=%s&parentsf1=on' %(database, probe_set_id, self.fd['RISet'])
+
+ if cell_id:
+ self.fd.identification = '%s/%s'%(self.fd.identification, cell_id)
+ this_trait.returnURL = '%s&CellID=%s' % (this_trait.returnURL, cell_id)
+
+ this_trait.retrieveInfo()
+ this_trait.retrieveData()
+ return this_trait
+
+
+ def dispTraitInformation(self, fd, title1Body, hddn, this_trait):
+
+ _Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
+
+ #tbl = HT.TableLite(cellpadding=2, Class="collap", style="margin-left:20px;", width="840", valign="top", id="target1")
+
+ #reset=HT.Input(type='Reset',name='',value=' Reset ',Class="button")
+
+ #XZ, August 02, 2011: The display of icons is decided by the trait type (if trait exists), along with user log-in status. Note that the new submitted trait might not be trait object.
+ addSelectionButton = ""
+ verifyButton = ""
+ rnaseqButton = ""
+ geneWikiButton = ""
+ probeButton = ""
+ similarButton = ""
+ snpBrowserButton = ""
+ updateButton = ""
+
+ addSelectionText = ""
+ verifyText = ""
+ rnaseqText = ""
+ geneWikiText = ""
+ probeText = ""
+ similarText = ""
+ snpBrowserText = ""
+ updateText = ""
+
+ if webqtlConfig.USERDICT[self.privilege] >= webqtlConfig.USERDICT['user']:
+
+ if this_trait==None or this_trait.db.type=='Temp':
+ updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'addPublish');")
+ updateButton_img = HT.Image("/images/edit_icon.jpg", name="addnew", alt="Add To Publish", title="Add To Publish", style="border:none;")
+ updateButton.append(updateButton_img)
+ updateText = "Edit"
+ elif this_trait.db.type != 'Temp':
+ if this_trait.db.type == 'Publish' and this_trait.confidential: #XZ: confidential phenotype trait
+ if webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
+ updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'updateRecord');")
+ updateButton_img = HT.Image("/images/edit_icon.jpg", name="update", alt="Edit", title="Edit", style="border:none;")
+ updateButton.append(updateButton_img)
+ updateText = "Edit"
+ else:
+ updateButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('dataInput')[0],'updateRecord');")
+ updateButton_img = HT.Image("/images/edit_icon.jpg", name="update", alt="Edit", title="Edit", style="border:none;")
+ updateButton.append(updateButton_img)
+ updateText = "Edit"
+ else:
+ pass
+
+ self.cursor.execute('SELECT Name FROM InbredSet WHERE Name="%s"' % fd.RISet)
+ if this_trait:
+ addSelectionButton = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (fd.RISet, 'dataInput'))
+ addSelectionButton_img = HT.Image("/images/add_icon.jpg", name="addselect", alt="Add To Collection", title="Add To Collection", style="border:none;")
+ #addSelectionButton.append(addSelectionButton_img)
+ addSelectionText = "Add"
+ elif self.cursor.fetchall():
+ addSelectionButton = HT.Href(url="#redirect", onClick="dataEditingFunc(document.getElementsByName('%s')[0], 'addRecord');" % ('dataInput'))
+ addSelectionButton_img = HT.Image("/images/add_icon.jpg", name="", alt="Add To Collection", title="Add To Collection", style="border:none;")
+ #addSelectionButton.append(addSelectionButton_img)
+ addSelectionText = "Add"
+ else:
+ pass
+
+
+ # Microarray database information to display
+ if this_trait and this_trait.db and this_trait.db.type == 'ProbeSet': #before, this line was only reached if this_trait != 0, but now we need to check
+ try:
+ hddn['GeneId'] = int(string.strip(this_trait.geneid))
+ except:
+ pass
+
+ #Info2Disp = HT.Paragraph()
+
+ #XZ: Gene Symbol
+ if this_trait.symbol:
+ #XZ: Show SNP Browser only for mouse
+ if _Species == 'mouse':
+ self.cursor.execute("select geneSymbol from GeneList where geneSymbol = %s", this_trait.symbol)
+ geneName = self.cursor.fetchone()
+ if geneName:
+ snpurl = os.path.join(webqtlConfig.CGIDIR, "main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True") + "&geneName=%s" % geneName[0]
+ else:
+ if this_trait.chr and this_trait.mb:
+ snpurl = os.path.join(webqtlConfig.CGIDIR, "main.py?FormID=SnpBrowserResultPage&submitStatus=1&diffAlleles=True&customStrain=True") + \
+ "&chr=%s&start=%2.6f&end=%2.6f" % (this_trait.chr, this_trait.mb-0.002, this_trait.mb+0.002)
+ else:
+ snpurl = ""
+
+ if snpurl:
+ snpBrowserButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % snpurl)
+ snpBrowserButton_img = HT.Image("/images/snp_icon.jpg", name="snpbrowser", alt=" View SNPs and Indels ", title=" View SNPs and Indels ", style="border:none;")
+ #snpBrowserButton.append(snpBrowserButton_img)
+ snpBrowserText = "SNPs"
+
+ #XZ: Show GeneWiki for all species
+ geneWikiButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE) + "?FormID=geneWiki&symbol=%s" % this_trait.symbol))
+ geneWikiButton_img = HT.Image("/images/genewiki_icon.jpg", name="genewiki", alt=" Write or review comments about this gene ", title=" Write or review comments about this gene ", style="border:none;")
+ #geneWikiButton.append(geneWikiButton_img)
+ geneWikiText = 'GeneWiki'
+
+ #XZ: display similar traits in other selected datasets
+ if this_trait and this_trait.db and this_trait.db.type=="ProbeSet" and this_trait.symbol:
+ if _Species in ("mouse", "rat", "human"):
+ similarUrl = "%s?cmd=sch&gene=%s&alias=1&species=%s" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.symbol, _Species)
+ similarButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % similarUrl)
+ similarButton_img = HT.Image("/images/find_icon.jpg", name="similar", alt=" Find similar expression data ", title=" Find similar expression data ", style="border:none;")
+ #similarButton.append(similarButton_img)
+ similarText = "Find"
+ else:
+ pass
+ #tbl.append(HT.TR(
+ #HT.TD('Gene Symbol: ', Class="fwb fs13", valign="top", nowrap="on", width=90),
+ #HT.TD(width=10, valign="top"),
+ #HT.TD(HT.Span('%s' % this_trait.symbol, valign="top", Class="fs13 fsI"), valign="top", width=740)
+ #))
+ else:
+ tbl.append(HT.TR(
+ HT.TD('Gene Symbol: ', Class="fwb fs13", valign="top", nowrap="on"),
+ HT.TD(width=10, valign="top"),
+ HT.TD(HT.Span('Not available', Class="fs13 fsI"), valign="top")
+ ))
+
+
+
+ ##display Verify Location button
+ try:
+ blatsequence = this_trait.blatseq
+ if not blatsequence:
+ #XZ, 06/03/2009: ProbeSet name is not unique among platforms. We should use ProbeSet Id instead.
+ self.cursor.execute("""SELECT Probe.Sequence, Probe.Name
+ FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
+ WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
+ ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
+ ProbeSetFreeze.Name = '%s' AND
+ ProbeSet.Name = '%s' AND
+ Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""" % (this_trait.db.name, this_trait.name) )
+ seqs = self.cursor.fetchall()
+ if not seqs:
+ raise ValueError
+ else:
+ blatsequence = ''
+ for seqt in seqs:
+ if int(seqt[1][-1]) % 2 == 1:
+ blatsequence += string.strip(seqt[0])
+
+ #--------Hongqiang add this part in order to not only blat ProbeSet, but also blat Probe
+ blatsequence = '%3E'+this_trait.name+'%0A'+blatsequence+'%0A'
+ #XZ, 06/03/2009: ProbeSet name is not unique among platforms. We should use ProbeSet Id instead.
+ self.cursor.execute("""SELECT Probe.Sequence, Probe.Name
+ FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
+ WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
+ ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
+ ProbeSetFreeze.Name = '%s' AND
+ ProbeSet.Name = '%s' AND
+ Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""" % (this_trait.db.name, this_trait.name) )
+
+ seqs = self.cursor.fetchall()
+ for seqt in seqs:
+ if int(seqt[1][-1]) %2 == 1:
+ blatsequence += '%3EProbe_'+string.strip(seqt[1])+'%0A'+string.strip(seqt[0])+'%0A'
+ #--------
+ #XZ, 07/16/2009: targetsequence is not used, so I comment out this block
+ #targetsequence = this_trait.targetseq
+ #if targetsequence==None:
+ # targetsequence = ""
+
+ #XZ: Pay attention to the parameter of version (rn, mm, hg). They need to be changed if necessary.
+ if _Species == "rat":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', blatsequence)
+ UTHSC_BLAT_URL = ""
+ elif _Species == "mouse":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', blatsequence)
+ UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', blatsequence)
+ elif _Species == "human":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
+ UTHSC_BLAT_URL = ""
+ else:
+ UCSC_BLAT_URL = ""
+ UTHSC_BLAT_URL = ""
+
+ if UCSC_BLAT_URL:
+ verifyButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL)
+ verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
+ title=" Check probe locations at UCSC ", style="border:none;")
+ verifyButton.append(verifyButtonImg)
+ verifyText = 'Verify'
+ if UTHSC_BLAT_URL:
+ rnaseqButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL)
+ rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ",
+ title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
+ rnaseqButton.append(rnaseqButtonImg)
+ rnaseqText = 'RNA-seq'
+ tSpan.append(HT.BR())
+ except:
+ pass
+
+ #Display probe information (if any)
+ if this_trait.db.name.find('Liver') >= 0 and this_trait.db.name.find('F2') < 0:
+ pass
+ else:
+ #query database for number of probes associated with trait; if count > 0, set probe tool button and text
+ self.cursor.execute("""SELECT count(*)
+ FROM Probe, ProbeSet
+ WHERE ProbeSet.Name = '%s' AND Probe.ProbeSetId = ProbeSet.Id""" % (this_trait.name))
+
+ probeResult = self.cursor.fetchone()
+ if probeResult[0] > 0:
+ probeurl = "%s?FormID=showProbeInfo&database=%s&ProbeSetID=%s&CellID=%s&RISet=%s&incparentsf1=ON" \
+ % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.db, this_trait.name, this_trait.cellid, fd.RISet)
+ probeButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % probeurl)
+ probeButton_img = HT.Image("/images/probe_icon.jpg", name="probe", alt=" Check sequence of probes ", title=" Check sequence of probes ", style="border:none;")
+ #probeButton.append(probeButton_img)
+ probeText = "Probes"
+
+ #tSpan = HT.Span(Class="fs13")
+
+ #XZ: deal with blat score and blat specificity.
+ #if this_trait.probe_set_specificity or this_trait.probe_set_blat_score:
+ # if this_trait.probe_set_specificity:
+ # pass
+ # #tSpan.append(HT.Href(url="/blatInfo.html", target="_blank", title="Values higher than 2 for the specificity are good", text="BLAT specificity", Class="non_bold"),": %.1f" % float(this_trait.probe_set_specificity), " "*3)
+ # if this_trait.probe_set_blat_score:
+ # pass
+ # #tSpan.append("Score: %s" % int(this_trait.probe_set_blat_score), " "*2)
+
+ #onClick="openNewWin('/blatInfo.html')"
+
+ #tbl.append(HT.TR(
+ # HT.TD('Target Score: ', Class="fwb fs13", valign="top", nowrap="on"),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(tSpan, valign="top")
+ # ))
+
+ #tSpan = HT.Span(Class="fs13")
+ #tSpan.append(str(_Species).capitalize(), ", ", fd.RISet)
+ #
+ #tbl.append(HT.TR(
+ # HT.TD('Species and Group: ', Class="fwb fs13", valign="top", nowrap="on"),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(tSpan, valign="top")
+ # ))
+
+ #if this_trait.cellid:
+ # self.cursor.execute("""
+ # select ProbeFreeze.Name from ProbeFreeze, ProbeSetFreeze
+ # where
+ # ProbeFreeze.Id = ProbeSetFreeze.ProbeFreezeId AND
+ # ProbeSetFreeze.Id = %d""" % this_trait.db.id)
+ # probeDBName = self.cursor.fetchone()[0]
+ # tbl.append(HT.TR(
+ # HT.TD('Database: ', Class="fs13 fwb", valign="top", nowrap="on"),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span('%s' % probeDBName, Class="non_bold"), valign="top")
+ # ))
+ #else:
+ #tbl.append(HT.TR(
+ # HT.TD('Database: ', Class="fs13 fwb", valign="top", nowrap="on"),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Href(text=this_trait.db.fullname, url = webqtlConfig.INFOPAGEHREF % this_trait.db.name,
+ # target='_blank', Class="fs13 fwn non_bold"), valign="top")
+ # ))
+ #pass
+
+ this_trait.species = _Species # We need this in the template, so we tuck it into this_trait
+ this_trait.database = this_trait.get_database()
+
+ #XZ: ID links
+ if this_trait.genbankid or this_trait.geneid or this_trait.unigeneid or this_trait.omim or this_trait.homologeneid:
+ idStyle = "background:#dddddd;padding:2"
+ tSpan = HT.Span(Class="fs13")
+ if this_trait.geneid:
+ gurl = HT.Href(text= 'Gene', target='_blank',\
+ url=webqtlConfig.NCBI_LOCUSID % this_trait.geneid, Class="fs14 fwn", title="Info from NCBI Entrez Gene")
+ #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
+ if this_trait.omim:
+ gurl = HT.Href(text= 'OMIM', target='_blank', \
+ url= webqtlConfig.OMIM_ID % this_trait.omim,Class="fs14 fwn", title="Summary from On Mendelian Inheritance in Man")
+ #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
+ if this_trait.unigeneid:
+ try:
+ gurl = HT.Href(text= 'UniGene',target='_blank',\
+ url= webqtlConfig.UNIGEN_ID % tuple(string.split(this_trait.unigeneid,'.')[:2]),Class="fs14 fwn", title="UniGene ID")
+ #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
+ except:
+ pass
+ if this_trait.genbankid:
+ this_trait.genbankid = '|'.join(this_trait.genbankid.split('|')[0:10])
+ if this_trait.genbankid[-1]=='|':
+ this_trait.genbankid=this_trait.genbankid[0:-1]
+ gurl = HT.Href(text= 'GenBank', target='_blank', \
+ url= webqtlConfig.GENBANK_ID % this_trait.genbankid,Class="fs14 fwn", title="Find the original GenBank sequence used to design the probes")
+ #tSpan.append(HT.Span(gurl, style=idStyle), " "*2)
+ if this_trait.homologeneid:
+ hurl = HT.Href(text= 'HomoloGene', target='_blank',\
+ url=webqtlConfig.HOMOLOGENE_ID % this_trait.homologeneid, Class="fs14 fwn", title="Find similar genes in other species")
+ #tSpan.append(HT.Span(hurl, style=idStyle), " "*2)
+
+ #tbl.append(
+ # HT.TR(HT.TD(colspan=3,height=6)),
+ # HT.TR(
+ # HT.TD('Resource Links: ', Class="fwb fs13", valign="top", nowrap="on"),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(tSpan, valign="top")
+ # ))
+
+ #XZ: Resource Links:
+ if this_trait.symbol:
+ linkStyle = "background:#dddddd;padding:2"
+ tSpan = HT.Span(style="font-family:verdana,serif;font-size:13px")
+
+ #XZ,12/26/2008: Gene symbol may contain single quotation mark.
+ #For example, Affymetrix, mouse430v2, 1440338_at, the symbol is 2'-Pde (geneid 211948)
+ #I debug this by using double quotation marks.
+ if _Species == "rat":
+
+ #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
+ #symatlas_species = "Rattus norvegicus"
+
+ #self.cursor.execute("SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = '%s'" % this_trait.symbol)
+ self.cursor.execute('SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = "%s"' % this_trait.symbol)
+ try:
+ kgId, chr, txst, txen = self.cursor.fetchall()[0]
+ if chr and txst and txen and kgId:
+ txst = int(txst*1000000)
+ txen = int(txen*1000000)
+ #tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\
+ # title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('rn3',kgId,chr,txst,txen),Class="fs14 fwn"), style=linkStyle)
+ # , " "*2)
+ except:
+ pass
+ if _Species == "mouse":
+
+ #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
+ #symatlas_species = "Mus musculus"
+
+ #self.cursor.execute("SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = '%s'" % this_trait.symbol)
+ self.cursor.execute('SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = "%s"' % this_trait.symbol)
+ try:
+ chr, txst, txen = self.cursor.fetchall()[0]
+ if chr and txst and txen and this_trait.refseq_transcriptid :
+ txst = int(txst*1000000)
+ txen = int(txen*1000000)
+ tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\
+ title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('mm9',this_trait.refseq_transcriptid,chr,txst,txen),
+ Class="fs14 fwn"), style=linkStyle)
+ , " "*2)
+ except:
+ pass
+
+ #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more
+ #tSpan.append(HT.Span(HT.Href(text= 'SymAtlas',target="mainFrame",\
+ # url="http://symatlas.gnf.org/SymAtlas/bioentry?querytext=%s&query=14&species=%s&type=Expression" \
+ # % (this_trait.symbol,symatlas_species),Class="fs14 fwn", \
+ # title="Expression across many tissues and cell types"), style=linkStyle), " "*2)
+ if this_trait.geneid and (_Species == "mouse" or _Species == "rat" or _Species == "human"):
+ #tSpan.append(HT.Span(HT.Href(text= 'BioGPS',target="mainFrame",\
+ # url="http://biogps.gnf.org/?org=%s#goto=genereport&id=%s" \
+ # % (_Species, this_trait.geneid),Class="fs14 fwn", \
+ # title="Expression across many tissues and cell types"), style=linkStyle), " "*2)
+ pass
+ #tSpan.append(HT.Span(HT.Href(text= 'STRING',target="mainFrame",\
+ # url="http://string.embl.de/newstring_cgi/show_link_summary.pl?identifier=%s" \
+ # % this_trait.symbol,Class="fs14 fwn", \
+ # title="Protein interactions: known and inferred"), style=linkStyle), " "*2)
+ if this_trait.symbol:
+ #ZS: The "species scientific" converts the plain English species names we're using to their scientific names, which are needed for PANTHER's input
+ #We should probably use the scientific name along with the English name (if not instead of) elsewhere as well, given potential non-English speaking users
+ if _Species == "mouse":
+ species_scientific = "Mus%20musculus"
+ elif _Species == "rat":
+ species_scientific = "Rattus%20norvegicus"
+ elif _Species == "human":
+ species_scientific = "Homo%20sapiens"
+ elif _Species == "drosophila":
+ species_scientific = "Drosophila%20melanogaster"
+ else:
+ species_scientific = "all"
+
+ species_scientific
+ #tSpan.append(HT.Span(HT.Href(text= 'PANTHER',target="mainFrame", \
+ # url="http://www.pantherdb.org/genes/geneList.do?searchType=basic&fieldName=all&organism=%s&listType=1&fieldValue=%s" \
+ # % (species_scientific, this_trait.symbol),Class="fs14 fwn", \
+ # title="Gene and protein data resources from Celera-ABI"), style=linkStyle), " "*2)
+ else:
+ pass
+ #tSpan.append(HT.Span(HT.Href(text= 'BIND',target="mainFrame",\
+ # url="http://bind.ca/?textquery=%s" \
+ # % this_trait.symbol,Class="fs14 fwn", \
+ # title="Protein interactions"), style=linkStyle), " "*2)
+ #if this_trait.geneid and (_Species == "mouse" or _Species == "rat" or _Species == "human"):
+ # tSpan.append(HT.Span(HT.Href(text= 'Gemma',target="mainFrame",\
+ # url="http://www.chibi.ubc.ca/Gemma/gene/showGene.html?ncbiid=%s" \
+ # % this_trait.geneid, Class="fs14 fwn", \
+ # title="Meta-analysis of gene expression data"), style=linkStyle), " "*2)
+ #tSpan.append(HT.Span(HT.Href(text= 'SynDB',target="mainFrame",\
+ # url="http://lily.uthsc.edu:8080/20091027_GNInterfaces/20091027_redirectSynDB.jsp?query=%s" \
+ # % this_trait.symbol, Class="fs14 fwn", \
+ # title="Brain synapse database"), style=linkStyle), " "*2)
+ #if _Species == "mouse":
+ # tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
+ # url="http://mouse.brain-map.org/brain/%s.html" \
+ # % this_trait.symbol, Class="fs14 fwn", \
+ # title="Allen Brain Atlas"), style=linkStyle), " "*2)
+
+ if this_trait.geneid:
+ #if _Species == "mouse":
+ # tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
+ # url="http://www.brain-map.org/search.do?queryText=egeneid=%s" \
+ # % this_trait.geneid, Class="fs14 fwn", \
+ # title="Allen Brain Atlas"), style=linkStyle), " "*2)
+ if _Species == "human":
+ #tSpan.append(HT.Span(HT.Href(text= 'ABA',target="mainFrame",\
+ # url="http://humancortex.alleninstitute.org/has/human/imageseries/search/1.html?searchSym=t&searchAlt=t&searchName=t&gene_term=&entrez_term=%s" \
+ # % this_trait.geneid, Class="fs14 fwn", \
+ # title="Allen Brain Atlas"), style=linkStyle), " "*2)
+ pass
+
+ #tbl.append(
+ # HT.TR(HT.TD(colspan=3,height=6)),
+ # HT.TR(
+ # HT.TD(' '),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(tSpan, valign="top")))
+
+ #menuTable = HT.TableLite(cellpadding=2, Class="collap", width="620", id="target1")
+ #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(similarButton, align="center"),HT.TD(verifyButton, align="center"),HT.TD(geneWikiButton, align="center"),HT.TD(snpBrowserButton, align="center"),HT.TD(rnaseqButton, align="center"),HT.TD(probeButton, align="center"),HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+ #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(similarText, align="center"),HT.TD(verifyText, align="center"),HT.TD(geneWikiText, align="center"),HT.TD(snpBrowserText, align="center"),HT.TD(rnaseqText, align="center"),HT.TD(probeText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+
+
+ #for zhou mi's cliques, need to be removed
+ #if self.database[:6] == 'BXDMic' and self.ProbeSetID in cliqueID:
+ # Info2Disp.append(HT.Strong('Clique Search: '),HT.Href(text='Search',\
+ # url ="http://compbio1.utmem.edu/clique_go/results.php?pid=%s&pval_1=0&pval_2=0.001" \
+ # % self.ProbeSetID,target='_blank',Class="normalsize"),HT.BR())
+
+ #linkTable.append(HT.TR(linkTD))
+ #Info2Disp.append(linkTable)
+ #title1Body.append(tbl, HT.BR(), menuTable)
+
+ elif this_trait and this_trait.db and this_trait.db.type =='Publish': #Check if trait is phenotype
+
+ if this_trait.confidential:
+ pass
+ #tbl.append(HT.TR(
+ # HT.TD('Pre-publication Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.pre_publication_description, Class="fs13"), valign="top", width=740)
+ # ))
+ if webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
+ #tbl.append(HT.TR(
+ # HT.TD('Post-publication Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.post_publication_description, Class="fs13"), valign="top", width=740)
+ # ))
+ #tbl.append(HT.TR(
+ # HT.TD('Pre-publication Abbreviation: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.pre_publication_abbreviation, Class="fs13"), valign="top", width=740)
+ # ))
+ #tbl.append(HT.TR(
+ # HT.TD('Post-publication Abbreviation: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.post_publication_abbreviation, Class="fs13"), valign="top", width=740)
+ # ))
+ #tbl.append(HT.TR(
+ # HT.TD('Lab code: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.lab_code, Class="fs13"), valign="top", width=740)
+ # ))
+ pass
+ #tbl.append(HT.TR(
+ # HT.TD('Owner: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.owner, Class="fs13"), valign="top", width=740)
+ # ))
+ else:
+ pass
+ #tbl.append(HT.TR(
+ # HT.TD('Phenotype: ', Class="fs13 fwb", valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.post_publication_description, Class="fs13"), valign="top", width=740)
+ # ))
+ #tbl.append(HT.TR(
+ # HT.TD('Authors: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.authors, Class="fs13"),
+ # valign="top", width=740)
+ # ))
+ #tbl.append(HT.TR(
+ # HT.TD('Title: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(this_trait.title, Class="fs13"),
+ # valign="top", width=740)
+ # ))
+ if this_trait.journal:
+ journal = this_trait.journal
+ if this_trait.year:
+ journal = this_trait.journal + " (%s)" % this_trait.year
+ #
+ #tbl.append(HT.TR(
+ # HT.TD('Journal: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(journal, Class="fs13"),
+ # valign="top", width=740)
+ # ))
+ PubMedLink = ""
+ if this_trait.pubmed_id:
+ PubMedLink = webqtlConfig.PUBMEDLINK_URL % this_trait.pubmed_id
+ if PubMedLink:
+ #tbl.append(HT.TR(
+ # HT.TD('Link: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(HT.Href(url=PubMedLink, text="PubMed",target='_blank',Class="fs14 fwn"),
+ # style = "background:#cddcff;padding:2"), valign="top", width=740)
+ # ))
+ pass
+
+ menuTable = HT.TableLite(cellpadding=2, Class="collap", width="150", id="target1")
+ #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+ #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+
+ #title1Body.append(tbl, HT.BR(), menuTable)
+
+ elif this_trait and this_trait.db and this_trait.db.type == 'Geno': #Check if trait is genotype
+
+ GenoInfo = HT.Paragraph()
+ if this_trait.chr and this_trait.mb:
+ location = ' Chr %s @ %s Mb' % (this_trait.chr,this_trait.mb)
+ else:
+ location = "not available"
+
+ if this_trait.sequence and len(this_trait.sequence) > 100:
+ if _Species == "rat":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', this_trait.sequence)
+ UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('rat', 'rn3', this_trait.sequence)
+ elif _Species == "mouse":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
+ UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
+ elif _Species == "human":
+ UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
+ UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('human', 'hg19', this_trait.sequence)
+ else:
+ UCSC_BLAT_URL = ""
+ UTHSC_BLAT_URL = ""
+ if UCSC_BLAT_URL:
+ #verifyButton = HT.Href(url="#", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
+ verifyButton = HT.Href(url="#")
+ verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
+ verifyButton.append(verifyButtonImg)
+ verifyText = "Verify"
+ rnaseqButton = HT.Href(url="#", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
+ rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
+ rnaseqButton.append(rnaseqButtonImg)
+ rnaseqText = "RNA-seq"
+
+ #tbl.append(HT.TR(
+ # HT.TD('Location: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Span(location, Class="fs13"), valign="top", width=740)
+ # ),
+ # HT.TR(
+ # HT.TD('SNP Search: ', Class="fs13 fwb",
+ # valign="top", nowrap="on", width=90),
+ # HT.TD(width=10, valign="top"),
+ # HT.TD(HT.Href("http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=snp&cmd=search&term=%s" % this_trait.name, 'NCBI',Class="fs13"),
+ # valign="top", width=740)
+ # ))
+
+ menuTable = HT.TableLite(cellpadding=2, Class="collap", width="275", id="target1")
+ #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="center"),HT.TD(verifyButton, align="center"),HT.TD(rnaseqButton, align="center"), HT.TD(updateButton, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+ #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(verifyText, align="center"),HT.TD(rnaseqText, align="center"), HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+
+ #title1Body.append(tbl, HT.BR(), menuTable)
+
+ elif (this_trait == None or this_trait.db.type == 'Temp'): #if temporary trait (user-submitted trait or PCA trait)
+
+ #TempInfo = HT.Paragraph()
+ if this_trait != None:
+ if this_trait.description:
+ pass
+ #tbl.append(HT.TR(HT.TD(HT.Strong('Description: '),' %s ' % this_trait.description,HT.BR()), colspan=3, height=15))
+ else:
+ tbl.append(HT.TR(HT.TD(HT.Strong('Description: '),'not available',HT.BR(),HT.BR()), colspan=3, height=15))
+
+ if (updateText == "Edit"):
+ menuTable = HT.TableLite(cellpadding=2, Class="collap", width="150", id="target1")
+ else:
+ menuTable = HT.TableLite(cellpadding=2, Class="collap", width="80", id="target1")
+
+ #menuTable.append(HT.TR(HT.TD(addSelectionButton, align="right"),HT.TD(updateButton, align="right"), colspan=3, height=50, style="vertical-align:bottom;") )
+ #menuTable.append(HT.TR(HT.TD(addSelectionText, align="center"),HT.TD(updateText, align="center"), colspan=3, height=50, style="vertical-align:bottom;"))
+ #
+ #title1Body.append(tbl, HT.BR(), menuTable)
+
+ else:
+ pass
+
+
+ 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.
+ #stats_row = HT.TR()
+ #stats_cell = HT.TD()
+
+ 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.
+ print("ac1") # This is the one used for first sall3
+ self.MDP_menu.append(('All Cases','0'))
+ self.MDP_menu.append(('%s Only' % fd.RISet, '1'))
+ self.MDP_menu.append(('Non-%s Only' % fd.RISet, '2'))
+
+ else:
+ if (len(other_samples) > 0) and (len(primary_samples) + len(other_samples) > 3):
+ print("ac2")
+ self.MDP_menu.append(('All Cases','0'))
+ self.MDP_menu.append(('%s Only' % fd.RISet,'1'))
+ self.MDP_menu.append(('Non-%s Only' % fd.RISet,'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:
+ print("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_", "")
+
+ #try:
+ print("* type of this_trait:", type(this_trait))
+ print(" name:", this_trait.__class__.__name__)
+ print(" this_trait:", this_trait)
+ print(" type of this_trait.data[sampleName]:", type(this_trait.data[sampleName]))
+ print(" name:", this_trait.data[sampleName].__class__.__name__)
+ print(" this_trait.data[sampleName]:", this_trait.data[sampleName])
+ thisval = this_trait.data[sampleName].value
+ print(" thisval:", thisval)
+ thisvar = this_trait.data[sampleName].variance
+ print(" thisvar:", thisvar)
+ thisValFull = [sampleName, thisval, thisvar]
+ print(" thisValFull:", thisValFull)
+ #except:
+ # continue
+
+ vals1.append(thisValFull)
+
+
+ #vals1 = [[sampleNameOrig.replace("_2nd_", ""),
+ # this_trait.data[sampleName].val,
+ # this_trait.data[sampleName].var]
+ # for sampleNameOrig in all_samples]]
+ #
+
+ #Using just the RISet sample
+ for sampleNameOrig in primary_samples:
+ sampleName = sampleNameOrig.replace("_2nd_", "")
+
+ #try:
+ thisval = this_trait.data[sampleName].value
+ thisvar = this_trait.data[sampleName].variance
+ thisValFull = [sampleName,thisval,thisvar]
+ #except:
+ # continue
+
+ vals2.append(thisValFull)
+
+ #Using all non-RISet samples only
+ for sampleNameOrig in other_samples:
+ sampleName = sampleNameOrig.replace("_2nd_", "")
+
+ #try:
+ thisval = this_trait.data[sampleName].value
+ thisvar = this_trait.data[sampleName].variance
+ thisValFull = [sampleName,thisval,thisvar]
+ #except:
+ # continue
+
+ 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_", "")
+
+ #try:
+ thisval = this_trait.data[sampleName].value
+ thisvar = this_trait.data[sampleName].variance
+ thisValFull = [sampleName,thisval,thisvar]
+ #except:
+ # continue
+
+ 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.")))
+ stats_script_text = """$(function() { $("#stats_tabs").tabs();});"""
+ #stats_cell.append(stats_container)
+ 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.RISet + " 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.RISet + " case data were entered. No statistical analysis has been attempted.")))
+ stats_script_text = """$(function() { $("#stats_tabs0").tabs(); $("#stats_tabs1").tabs(); $("#stats_tabs2").tabs();});"""
+ else:
+ #stats_container = HT.Div(id="stats_tabs%s" % i, Class="ui-tabs")
+ stats_script_text = """$(function() { $("#stats_tabs0").tabs(); $("#stats_tabs1").tabs(); $("#stats_tabs2").tabs();});"""
+ 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")]
+ #stats_tabs = HT.List(stats_tab_list)
+ #stats_container.append(stats_tabs)
+ #
+ #table_div = HT.Div(id="statstabs-1")
+ #table_container = HT.Paragraph()
+ #
+ #statsTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
+
+ if this_trait.db:
+ if this_trait.cellid:
+ self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.db.type, cellid=this_trait.cellid))
+ else:
+ self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals, trait_type=this_trait.db.type))
+ else:
+ self.stats_data.append(BasicStatisticsFunctions.basicStatsTable(vals=vals))
+
+ #statsTable.append(HT.TR(HT.TD(statsTableCell)))
+
+ #table_container.append(statsTable)
+ #table_div.append(table_container)
+ #stats_container.append(table_div)
+ #
+ #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, RISet=fd.RISet, 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"))))
+ #normalplot_container.append(normalplot)
+ #normalplot_div.append(normalplot_container)
+ #stats_container.append(normalplot_div)
+
+ #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")))
+ #boxplot_container.append(boxplot)
+ #boxplot_div.append(boxplot_container)
+ #stats_container.append(boxplot_div)
+
+
+ #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, RISet=fd.RISet, vals=vals, type="name")
+ #barName.append(HT.TR(HT.TD(barName_img)))
+ #barName_container.append(barName)
+ #barName_div.append(barName_container)
+ #stats_container.append(barName_div)
+ #
+ #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, RISet=fd.RISet, vals=vals, type="rank")
+ #barRank.append(HT.TR(HT.TD(barRank_img)))
+ #barRank_container.append(barRank)
+ #barRank_div.append(barRank_container)
+ #stats_container.append(barRank_div)
+
+ # stats_cell.append(stats_container)
+ #
+ #stats_script.append(stats_script_text)
+ #
+ #submitTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%", Class="target2")
+ #stats_row.append(stats_cell)
+
+ #submitTable.append(stats_row)
+ #submitTable.append(stats_script)
+
+ #title2Body.append(submitTable)
+
+
+ def build_correlation_tools(self, fd, this_trait):
+
+ #species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
+
+ RISetgp = fd.RISet
+
+ # We're checking a string here!
+ assert isinstance(RISetgp, basestring), "We need a string type thing here"
+ if RISetgp[:3] == 'BXD':
+ RISetgp = 'BXD'
+
+ if RISetgp:
+ #sample_correlation = HT.Input(type='button',name='sample_corr', value=' Compute ', Class="button sample_corr")
+ #lit_correlation = HT.Input(type='button',name='lit_corr', value=' Compute ', Class="button lit_corr")
+ #tissue_correlation = HT.Input(type='button',name='tiss_corr', value=' Compute ', Class="button tiss_corr")
+ #methodText = HT.Span("Calculate:", Class="ffl fwb fs12")
+ #
+ #databaseText = HT.Span("Database:", Class="ffl fwb fs12")
+ #databaseMenu1 = HT.Select(name='database1')
+ #databaseMenu2 = HT.Select(name='database2')
+ #databaseMenu3 = HT.Select(name='database3')
+
+ dataset_menu = []
+ print("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH)
+ print("[tape4] type webqtlConfig.PUBLICTHRESH:", type(webqtlConfig.PUBLICTHRESH))
+ self.cursor.execute('''SELECT PublishFreeze.FullName,PublishFreeze.Name FROM
+ PublishFreeze,InbredSet WHERE PublishFreeze.InbredSetId = InbredSet.Id
+ and InbredSet.Name = %s and PublishFreeze.public > %s''',
+ (RISetgp, webqtlConfig.PUBLICTHRESH))
+ for item in self.cursor.fetchall():
+ dataset_menu.append(dict(tissue=None,
+ datasets=[item]))
+
+ self.cursor.execute('''SELECT GenoFreeze.FullName,GenoFreeze.Name FROM GenoFreeze,
+ InbredSet WHERE GenoFreeze.InbredSetId = InbredSet.Id and InbredSet.Name =
+ %s and GenoFreeze.public > %s''',
+ (RISetgp, webqtlConfig.PUBLICTHRESH))
+ for item in self.cursor.fetchall():
+ dataset_menu.append(dict(tissue=None,
+ datasets=[item]))
+
+ #03/09/2009: Xiaodong changed the SQL query to order by Name as requested by Rob.
+ self.cursor.execute('SELECT Id, Name FROM Tissue order by Name')
+ for item in self.cursor.fetchall():
+ tissue_id, tissue_name = item
+ #databaseMenuSub = HT.Optgroup(label = '%s ------' % tissue_name)
+ #dataset_sub_menu = []
+ print("phun9")
+ self.cursor.execute('''SELECT ProbeSetFreeze.FullName,ProbeSetFreeze.Name FROM ProbeSetFreeze, ProbeFreeze,
+ InbredSet WHERE ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = %s and
+ ProbeSetFreeze.public > %s and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name like %s
+ order by ProbeSetFreeze.CreateTime desc, ProbeSetFreeze.AvgId ''',
+ (tissue_id, webqtlConfig.PUBLICTHRESH, "%" + RISetgp + "%"))
+ print("phun8")
+ dataset_sub_menu = [item for item in self.cursor.fetchall() if item]
+ #for item2 in self.cursor.fetchall():
+ # dataset_sub_menu.append(item2)
+ if dataset_sub_menu:
+ dataset_menu.append(dict(tissue=tissue_name,
+ datasets=dataset_sub_menu))
+ # ("**heading**", tissue_name))
+ #dataset_menu.append(dataset_sub_menu)
+
+ dataset_menu_selected = None
+ if len(dataset_menu):
+ if this_trait and this_trait.db:
+ dataset_menu_selected = this_trait.db.name
+
+ #criteriaText = HT.Span("Return:", Class="ffl fwb fs12")
+
+ #criteriaMenu1 = HT.Select(name='criteria1', selected='500', onMouseOver="if (NS4 || IE4) activateEl('criterias', event);")
+
+ return_results_menu = (100, 200, 500, 1000, 2000, 5000, 10000, 15000, 20000)
+ return_results_menu_selected = 500
+
+ #criteriaMenu1.append(('top 100','100'))
+ #criteriaMenu1.append(('top 200','200'))
+ #criteriaMenu1.append(('top 500','500'))
+ #criteriaMenu1.append(('top 1000','1000'))
+ #criteriaMenu1.append(('top 2000','2000'))
+ #criteriaMenu1.append(('top 5000','5000'))
+ #criteriaMenu1.append(('top 10000','10000'))
+ #criteriaMenu1.append(('top 15000','15000'))
+ #criteriaMenu1.append(('top 20000','20000'))
+
+ #self.MDPRow1 = HT.TR(Class='mdp1')
+ #self.MDPRow2 = HT.TR(Class='mdp2')
+ #self.MDPRow3 = HT.TR(Class='mdp3')
+
+ # correlationMenus1 = HT.TableLite(
+ # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu1, colspan="3")),
+ # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu1)),
+ # self.MDPRow1, cellspacing=0, width="619px", cellpadding=2)
+ # correlationMenus1.append(HT.Input(name='orderBy', value='2', type='hidden')) # to replace the orderBy menu
+ # correlationMenus2 = HT.TableLite(
+ # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu2, colspan="3")),
+ # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu2)),
+ # self.MDPRow2, cellspacing=0, width="619px", cellpadding=2)
+ # correlationMenus2.append(HT.Input(name='orderBy', value='2', type='hidden'))
+ # correlationMenus3 = HT.TableLite(
+ # HT.TR(HT.TD(databaseText), HT.TD(databaseMenu3, colspan="3")),
+ # HT.TR(HT.TD(criteriaText), HT.TD(criteriaMenu3)),
+ # self.MDPRow3, cellspacing=0, width="619px", cellpadding=2)
+ # correlationMenus3.append(HT.Input(name='orderBy', value='2', type='hidden'))
+ #
+ #else:
+ # correlationMenus = ""
+
+
+ #corr_row = HT.TR()
+ #corr_container = HT.Div(id="corr_tabs", Class="ui-tabs")
+ #
+ #if (this_trait.db != None and this_trait.db.type =='ProbeSet'):
+ # corr_tab_list = [HT.Href(text='Sample r', url="#corrtabs-1"),
+ # HT.Href(text='Literature r', url="#corrtabs-2"),
+ # HT.Href(text='Tissue r', url="#corrtabs-3")]
+ #else:
+ # corr_tab_list = [HT.Href(text='Sample r', url="#corrtabs-1")]
+ #
+ #corr_tabs = HT.List(corr_tab_list)
+ #corr_container.append(corr_tabs)
+
+ #if correlationMenus1 or correlationMenus2 or correlationMenus3:
+ #sample_div = HT.Div(id="corrtabs-1")
+ #sample_container = HT.Span()
+ #
+ #sample_type = HT.Input(type="radio", name="sample_method", value="1", checked="checked")
+ #sample_type2 = HT.Input(type="radio", name="sample_method", value="2")
+ #
+ #sampleTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
+ #sampleTD = HT.TD(correlationMenus1, HT.BR(),
+ # "Pearson", sample_type, " "*3, "Spearman Rank", sample_type2, HT.BR(), HT.BR(),
+ # sample_correlation, HT.BR(), HT.BR())
+ #
+ #sampleTD.append(HT.Span("The ",
+ # HT.Href(url="/correlationAnnotation.html#sample_r", target="_blank",
+ # text="Sample Correlation")," is computed between trait data and",
+ # " any ",HT.BR()," other traits in the sample database selected above. Use ",
+ # HT.Href(url="/glossary.html#Correlations", target="_blank", text="Spearman Rank"),
+ # HT.BR(),"when the sample size is small (<20) or when there are influential \
+ # outliers.", HT.BR(),Class="fs12"))
+
+ #sampleTable.append(sampleTD)
+
+ #sample_container.append(sampleTable)
+ #sample_div.append(sample_container)
+ #corr_container.append(sample_div)
+ #
+ #literature_div = HT.Div(id="corrtabs-2")
+ #literature_container = HT.Span()
+
+ #literatureTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
+ #literatureTD = HT.TD(correlationMenus2,HT.BR(),lit_correlation, HT.BR(), HT.BR())
+ #literatureTD.append(HT.Span("The ", HT.Href(url="/correlationAnnotation.html", target="_blank",text="Literature Correlation"), " (Lit r) between this gene and all other genes is computed",HT.BR(),
+ # "using the ", HT.Href(url="https://grits.eecs.utk.edu/sgo/sgo.html", target="_blank", text="Semantic Gene Organizer"),
+ # " and human, rat, and mouse data from PubMed. ", HT.BR(),"Values are ranked by Lit r, \
+ # but Sample r and Tissue r are also displayed.", HT.BR(), HT.BR(),
+ # HT.Href(url="/glossary.html#Literature", target="_blank", text="More on using Lit r"), Class="fs12"))
+ #literatureTable.append(literatureTD)
+ #
+ #literature_container.append(literatureTable)
+ #literature_div.append(literature_container)
+ #
+ #if this_trait.db != None:
+ # if (this_trait.db.type =='ProbeSet'):
+ # corr_container.append(literature_div)
+ #
+ #tissue_div = HT.Div(id="corrtabs-3")
+ #tissue_container = HT.Span()
+ #
+ #tissue_type = HT.Input(type="radio", name="tissue_method", value="4", checked="checked")
+ #tissue_type2 = HT.Input(type="radio", name="tissue_method", value="5")
+ #
+ #tissueTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%")
+ #tissueTD = HT.TD(correlationMenus3,HT.BR(),
+ # "Pearson", tissue_type, " "*3, "Spearman Rank", tissue_type2, HT.BR(), HT.BR(),
+ # tissue_correlation, HT.BR(), HT.BR())
+ #tissueTD.append(HT.Span("The ", HT.Href(url="/webqtl/main.py?FormID=tissueCorrelation", target="_blank", text="Tissue Correlation"),
+ #" (Tissue r) estimates the similarity of expression of two genes",HT.BR()," or \
+ #transcripts across different cells, tissues, or organs (",HT.Href(url="/correlationAnnotation.html#tissue_r", target="_blank", text="glossary"),"). \
+ #Tissue correlations",HT.BR()," are generated by analyzing expression in multiple samples usually taken from \
+ #single cases.",HT.BR(),HT.Bold("Pearson")," and ",HT.Bold("Spearman Rank")," correlations have been computed for all pairs \
+ #of genes",HT.BR()," using data from mouse samples.",
+ #HT.BR(), Class="fs12"))
+ #tissueTable.append(tissueTD)
+ #
+ #tissue_container.append(tissueTable)
+ #tissue_div.append(tissue_container)
+ #if this_trait.db != None:
+ # if (this_trait.db.type =='ProbeSet'):
+ # corr_container.append(tissue_div)
+ #
+ #corr_row.append(HT.TD(corr_container))
+ #
+ #corr_script = HT.Script(language="Javascript")
+ #corr_script_text = """$(function() { $("#corr_tabs").tabs(); });"""
+ #corr_script.append(corr_script_text)
+ #
+ #submitTable = HT.TableLite(cellspacing=0, cellpadding=0, width="100%", Class="target4")
+ #submitTable.append(corr_row)
+ #submitTable.append(corr_script)
+ #
+ #title3Body.append(submitTable)
+ self.corr_tools = dict(dataset_menu = dataset_menu,
+ dataset_menu_selected = dataset_menu_selected,
+ return_results_menu = return_results_menu,
+ return_results_menu_selected = return_results_menu_selected,)
+
+
+ def dispMappingTools(self, fd, title4Body, this_trait):
+
+ _Species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=fd.RISet)
+
+ RISetgp = fd.RISet
+ if RISetgp[:3] == 'BXD':
+ RISetgp = '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=RISetgp)
+
+ 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(' (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=' Compute Using PLINK ', 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, fd, variance_data_page, this_trait):
+ if fd.genotype.type == "riset":
+ all_samples_ordered = fd.f1list + fd.samplelist
+ else:
+ all_samples_ordered = fd.parlist + fd.f1list + fd.samplelist
+
+ this_trait_samples = set(this_trait.data.keys())
+
+ primary_sample_names = all_samples_ordered
+
+ print("-*- primary_samplelist is:", pf(primary_sample_names))
+
+ primary_samples = SampleList(self.cursor,
+ fd=fd,
+ variance_data_page=variance_data_page,
+ sample_names=primary_sample_names,
+ this_trait=this_trait,
+ sample_group_type='primary',
+ header="%s Only" % (fd.RISet))
+
+ print("primary_samples.attributes:", pf(primary_samples.attributes))
+
+ other_sample_names = []
+ for sample in this_trait.data.keys():
+ print("hjk - sample is:", sample)
+ if sample not in all_samples_ordered:
+ all_samples_ordered.append(sample)
+ other_sample_names.append(sample)
+
+ if other_sample_names:
+ unappended_par_f1 = fd.f1list + fd.parlist
+ par_f1_samples = ["_2nd_" + sample for sample in unappended_par_f1]
+
+ other_sample_names.sort() #Sort other samples
+ other_sample_names = par_f1_samples + other_sample_names
+
+ other_samples = SampleList(self.cursor,
+ fd=fd,
+ variance_data_page=variance_data_page,
+ sample_names=other_sample_names,
+ this_trait=this_trait,
+ sample_group_type='other',
+ header="Non-%s" % (fd.RISet))
+
+ self.sample_groups = (primary_samples, other_samples)
+ else:
+ self.sample_groups = (primary_samples,)
+
+ #TODO: Figure out why this if statement is written this way - Zach
+ #if (other_sample_names or (fd.f1list and this_trait.data.has_key(fd.f1list[0]))
+ # or (fd.f1list and this_trait.data.has_key(fd.f1list[1]))):
+ # print("hjs")
+ fd.allsamplelist = all_samples_ordered
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee
new file mode 100644
index 00000000..803045d5
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee
@@ -0,0 +1,182 @@
+console.log("start_b")
+
+# this is our isNumber, do not confuse with the underscore.js one
+is_number = (o) ->
+ return ! isNaN (o-0) && o != null
+
+$ ->
+ hide_tabs = (start) ->
+ for x in [start..10]
+ $("#stats_tabs" + x).hide()
+
+ hide_tabs(1)
+
+ # Changes stats table between all, bxd only and non-bxd, etc.
+ stats_mdp_change = ->
+ selected = $(this).val()
+ hide_tabs(0)
+ $("#stats_tabs" + selected).show()
+
+ $(".stats_mdp").change(stats_mdp_change)
+
+ change_stats_value = (sample_sets, category, value_type, decimal_places)->
+ id = "#" + process_id(category, value_type)
+ console.log("the_id:", id)
+ in_box = $(id).html
+
+ current_value = parseFloat($(in_box)).toFixed(decimal_places)
+
+ the_value = sample_sets[category][value_type]()
+ if decimal_places > 0
+ the_value = the_value.toFixed(decimal_places)
+
+ if the_value != current_value
+ $(id).html(the_value).effect("highlight")
+
+ update_stat_values = (sample_sets)->
+ for category in ['primary_only', 'other_only', 'all_cases']
+ change_stats_value(sample_sets, category, "n_of_samples", 0)
+ for stat in ["mean", "median", "std_dev", "std_error"]
+ change_stats_value(sample_sets, category, stat, 2)
+
+ edit_data_change = ->
+ sample_sets =
+ primary_only: new Stats([])
+ other_only: new Stats([])
+ all_cases: new Stats([])
+
+ console.log("at beginning:", sample_sets)
+ values = $('#value_table').find(".edit_sample_value")
+
+ for value in values
+ real_value = $(value).val()
+ row = $(value).closest("tr")
+ category = row[0].id
+ checkbox = $(row).find(".edit_sample_checkbox")
+ checked = $(checkbox).attr('checked')
+
+ if checked and is_number(real_value) and real_value != ""
+ real_value = parseFloat(real_value)
+ if _(category).startsWith("Primary")
+ sample_sets.primary_only.add_value(real_value)
+ else if _(category).startsWith("Other")
+ sample_sets.other_only.add_value(real_value)
+ sample_sets.all_cases.add_value(real_value)
+ console.log("towards end:", sample_sets)
+ update_stat_values(sample_sets)
+
+
+ make_table = ->
+ header = " "
+ console.log("js_data.sample_groups:", js_data.sample_groups)
+ for key, value of js_data.sample_groups
+ console.log("aa key:", key)
+ console.log("aa value:", value)
+ the_id = process_id("column", key)
+ header += """#{ value } """
+ header += " "
+ console.log("windex header is:", header)
+
+ rows = [
+ {
+ vn: "n_of_samples"
+ pretty: "N of Samples"
+ },
+ {
+ vn: "mean"
+ pretty: "Mean"
+ },
+ {
+ vn: "median"
+ pretty: "Median"
+ },
+ {
+ vn: "std_error"
+ pretty: "Standard Error (SE)"
+ },
+ {
+ vn: "std_dev"
+ pretty: "Standard Deviation (SD)"
+ }
+ ]
+
+ console.log("rows are:", rows)
+ the_rows = "
"
+ console.log("length of rows:", rows.length)
+ for row in rows
+ console.log("rowing")
+ row_line = """"""
+ row_line += """#{ row.pretty } """
+ console.log("box - js_data.sample_groups:", js_data.sample_groups)
+ for key, value of js_data.sample_groups
+ console.log("apple key:", key)
+ the_id = process_id(key, row.vn)
+ console.log("the_id:", the_id)
+ row_line += """foo """
+ row_line += """ """
+ console.log("row line:", row_line)
+ the_rows += row_line
+ the_rows += " "
+ table = header + the_rows
+ console.log("table is:", table)
+ $("#stats_table").append(table)
+
+
+
+ process_id = (values...) ->
+ ### Make an id or a class valid javascript by, for example, eliminating spaces ###
+ processed = ""
+ for value in values
+ console.log("value:", value)
+ value = value.replace(" ", "_")
+ if processed.length
+ processed += "-"
+ processed += value
+ return processed
+
+
+ show_hide_outliers = ->
+ console.log("FOOBAR in beginning of show_hide_outliers")
+ label = $('#show_hide_outliers').val()
+ console.log("lable is:", label)
+ if label == "Hide Outliers"
+ $('#show_hide_outliers').val("Show Outliers")
+ else if label == "Show Outliers"
+ console.log("Found Show Outliers")
+ $('#show_hide_outliers').val("Hide Outliers")
+ console.log("Should be now Hide Outliers")
+
+
+ #Calculate Correlations Code
+
+
+ on_corr_method_change = ->
+ console.log("in beginning of on_corr_method_change")
+ corr_method = $('select[name=corr_method]').val()
+ console.log("corr_method is:", corr_method)
+ $('.correlation_desc').hide()
+ $('#' + corr_method + "_r_desc").show().effect("highlight")
+ if corr_method == "lit"
+ $("#corr_sample_method_options").hide()
+ else
+ $("#corr_sample_method_options").show()
+
+ $('select[name=corr_method]').change(on_corr_method_change)
+
+
+ #End Calculate Correlations Code
+
+
+ console.log("before registering show_hide_outliers")
+ $('#show_hide_outliers').click(show_hide_outliers)
+ console.log("after registering show_hide_outliers")
+
+ _.mixin(_.str.exports()); # Add string fuctions directly to underscore
+ $('#value_table').change(edit_data_change)
+ console.log("loaded")
+ #console.log("basic_table is:", basic_table)
+ # Add back following two lines later
+ make_table()
+ edit_data_change() # Set the values at the beginning
+ #$("#all-mean").html('foobar8')
+ console.log("end")
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
deleted file mode 100644
index 803045d5..00000000
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
+++ /dev/null
@@ -1,182 +0,0 @@
-console.log("start_b")
-
-# this is our isNumber, do not confuse with the underscore.js one
-is_number = (o) ->
- return ! isNaN (o-0) && o != null
-
-$ ->
- hide_tabs = (start) ->
- for x in [start..10]
- $("#stats_tabs" + x).hide()
-
- hide_tabs(1)
-
- # Changes stats table between all, bxd only and non-bxd, etc.
- stats_mdp_change = ->
- selected = $(this).val()
- hide_tabs(0)
- $("#stats_tabs" + selected).show()
-
- $(".stats_mdp").change(stats_mdp_change)
-
- change_stats_value = (sample_sets, category, value_type, decimal_places)->
- id = "#" + process_id(category, value_type)
- console.log("the_id:", id)
- in_box = $(id).html
-
- current_value = parseFloat($(in_box)).toFixed(decimal_places)
-
- the_value = sample_sets[category][value_type]()
- if decimal_places > 0
- the_value = the_value.toFixed(decimal_places)
-
- if the_value != current_value
- $(id).html(the_value).effect("highlight")
-
- update_stat_values = (sample_sets)->
- for category in ['primary_only', 'other_only', 'all_cases']
- change_stats_value(sample_sets, category, "n_of_samples", 0)
- for stat in ["mean", "median", "std_dev", "std_error"]
- change_stats_value(sample_sets, category, stat, 2)
-
- edit_data_change = ->
- sample_sets =
- primary_only: new Stats([])
- other_only: new Stats([])
- all_cases: new Stats([])
-
- console.log("at beginning:", sample_sets)
- values = $('#value_table').find(".edit_sample_value")
-
- for value in values
- real_value = $(value).val()
- row = $(value).closest("tr")
- category = row[0].id
- checkbox = $(row).find(".edit_sample_checkbox")
- checked = $(checkbox).attr('checked')
-
- if checked and is_number(real_value) and real_value != ""
- real_value = parseFloat(real_value)
- if _(category).startsWith("Primary")
- sample_sets.primary_only.add_value(real_value)
- else if _(category).startsWith("Other")
- sample_sets.other_only.add_value(real_value)
- sample_sets.all_cases.add_value(real_value)
- console.log("towards end:", sample_sets)
- update_stat_values(sample_sets)
-
-
- make_table = ->
- header = " "
- console.log("js_data.sample_groups:", js_data.sample_groups)
- for key, value of js_data.sample_groups
- console.log("aa key:", key)
- console.log("aa value:", value)
- the_id = process_id("column", key)
- header += """#{ value } """
- header += " "
- console.log("windex header is:", header)
-
- rows = [
- {
- vn: "n_of_samples"
- pretty: "N of Samples"
- },
- {
- vn: "mean"
- pretty: "Mean"
- },
- {
- vn: "median"
- pretty: "Median"
- },
- {
- vn: "std_error"
- pretty: "Standard Error (SE)"
- },
- {
- vn: "std_dev"
- pretty: "Standard Deviation (SD)"
- }
- ]
-
- console.log("rows are:", rows)
- the_rows = ""
- console.log("length of rows:", rows.length)
- for row in rows
- console.log("rowing")
- row_line = """"""
- row_line += """#{ row.pretty } """
- console.log("box - js_data.sample_groups:", js_data.sample_groups)
- for key, value of js_data.sample_groups
- console.log("apple key:", key)
- the_id = process_id(key, row.vn)
- console.log("the_id:", the_id)
- row_line += """foo """
- row_line += """ """
- console.log("row line:", row_line)
- the_rows += row_line
- the_rows += " "
- table = header + the_rows
- console.log("table is:", table)
- $("#stats_table").append(table)
-
-
-
- process_id = (values...) ->
- ### Make an id or a class valid javascript by, for example, eliminating spaces ###
- processed = ""
- for value in values
- console.log("value:", value)
- value = value.replace(" ", "_")
- if processed.length
- processed += "-"
- processed += value
- return processed
-
-
- show_hide_outliers = ->
- console.log("FOOBAR in beginning of show_hide_outliers")
- label = $('#show_hide_outliers').val()
- console.log("lable is:", label)
- if label == "Hide Outliers"
- $('#show_hide_outliers').val("Show Outliers")
- else if label == "Show Outliers"
- console.log("Found Show Outliers")
- $('#show_hide_outliers').val("Hide Outliers")
- console.log("Should be now Hide Outliers")
-
-
- #Calculate Correlations Code
-
-
- on_corr_method_change = ->
- console.log("in beginning of on_corr_method_change")
- corr_method = $('select[name=corr_method]').val()
- console.log("corr_method is:", corr_method)
- $('.correlation_desc').hide()
- $('#' + corr_method + "_r_desc").show().effect("highlight")
- if corr_method == "lit"
- $("#corr_sample_method_options").hide()
- else
- $("#corr_sample_method_options").show()
-
- $('select[name=corr_method]').change(on_corr_method_change)
-
-
- #End Calculate Correlations Code
-
-
- console.log("before registering show_hide_outliers")
- $('#show_hide_outliers').click(show_hide_outliers)
- console.log("after registering show_hide_outliers")
-
- _.mixin(_.str.exports()); # Add string fuctions directly to underscore
- $('#value_table').change(edit_data_change)
- console.log("loaded")
- #console.log("basic_table is:", basic_table)
- # Add back following two lines later
- make_table()
- edit_data_change() # Set the values at the beginning
- #$("#all-mean").html('foobar8')
- console.log("end")
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
deleted file mode 100644
index 55bc1302..00000000
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
+++ /dev/null
@@ -1,207 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var is_number,
- __slice = [].slice;
-
- console.log("start_b");
-
- is_number = function(o) {
- return !isNaN((o - 0) && o !== null);
- };
-
- $(function() {
- var change_stats_value, edit_data_change, hide_tabs, make_table, on_corr_method_change, process_id, show_hide_outliers, stats_mdp_change, update_stat_values;
- hide_tabs = function(start) {
- var x, _i, _results;
- _results = [];
- for (x = _i = start; start <= 10 ? _i <= 10 : _i >= 10; x = start <= 10 ? ++_i : --_i) {
- _results.push($("#stats_tabs" + x).hide());
- }
- return _results;
- };
- hide_tabs(1);
- stats_mdp_change = function() {
- var selected;
- selected = $(this).val();
- hide_tabs(0);
- return $("#stats_tabs" + selected).show();
- };
- $(".stats_mdp").change(stats_mdp_change);
- change_stats_value = function(sample_sets, category, value_type, decimal_places) {
- var current_value, id, in_box, the_value;
- id = "#" + process_id(category, value_type);
- console.log("the_id:", id);
- in_box = $(id).html;
- current_value = parseFloat($(in_box)).toFixed(decimal_places);
- the_value = sample_sets[category][value_type]();
- if (decimal_places > 0) {
- the_value = the_value.toFixed(decimal_places);
- }
- if (the_value !== current_value) {
- return $(id).html(the_value).effect("highlight");
- }
- };
- update_stat_values = function(sample_sets) {
- var category, stat, _i, _len, _ref, _results;
- _ref = ['primary_only', 'other_only', 'all_cases'];
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- category = _ref[_i];
- change_stats_value(sample_sets, category, "n_of_samples", 0);
- _results.push((function() {
- var _j, _len1, _ref1, _results1;
- _ref1 = ["mean", "median", "std_dev", "std_error"];
- _results1 = [];
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
- stat = _ref1[_j];
- _results1.push(change_stats_value(sample_sets, category, stat, 2));
- }
- return _results1;
- })());
- }
- return _results;
- };
- edit_data_change = function() {
- var category, checkbox, checked, real_value, row, sample_sets, value, values, _i, _len;
- sample_sets = {
- primary_only: new Stats([]),
- other_only: new Stats([]),
- all_cases: new Stats([])
- };
- console.log("at beginning:", sample_sets);
- values = $('#value_table').find(".edit_sample_value");
- for (_i = 0, _len = values.length; _i < _len; _i++) {
- value = values[_i];
- real_value = $(value).val();
- row = $(value).closest("tr");
- category = row[0].id;
- checkbox = $(row).find(".edit_sample_checkbox");
- checked = $(checkbox).attr('checked');
- if (checked && is_number(real_value) && real_value !== "") {
- real_value = parseFloat(real_value);
- if (_(category).startsWith("Primary")) {
- sample_sets.primary_only.add_value(real_value);
- } else if (_(category).startsWith("Other")) {
- sample_sets.other_only.add_value(real_value);
- }
- sample_sets.all_cases.add_value(real_value);
- }
- }
- console.log("towards end:", sample_sets);
- return update_stat_values(sample_sets);
- };
- make_table = function() {
- var header, key, row, row_line, rows, table, the_id, the_rows, value, _i, _len, _ref, _ref1;
- header = " ";
- console.log("js_data.sample_groups:", js_data.sample_groups);
- _ref = js_data.sample_groups;
- for (key in _ref) {
- value = _ref[key];
- console.log("aa key:", key);
- console.log("aa value:", value);
- the_id = process_id("column", key);
- header += "" + value + " ";
- }
- header += " ";
- console.log("windex header is:", header);
- rows = [
- {
- vn: "n_of_samples",
- pretty: "N of Samples"
- }, {
- vn: "mean",
- pretty: "Mean"
- }, {
- vn: "median",
- pretty: "Median"
- }, {
- vn: "std_error",
- pretty: "Standard Error (SE)"
- }, {
- vn: "std_dev",
- pretty: "Standard Deviation (SD)"
- }
- ];
- console.log("rows are:", rows);
- the_rows = "";
- console.log("length of rows:", rows.length);
- for (_i = 0, _len = rows.length; _i < _len; _i++) {
- row = rows[_i];
- console.log("rowing");
- row_line = "";
- row_line += "" + row.pretty + " ";
- console.log("box - js_data.sample_groups:", js_data.sample_groups);
- _ref1 = js_data.sample_groups;
- for (key in _ref1) {
- value = _ref1[key];
- console.log("apple key:", key);
- the_id = process_id(key, row.vn);
- console.log("the_id:", the_id);
- row_line += "foo ";
- }
- row_line += " ";
- console.log("row line:", row_line);
- the_rows += row_line;
- }
- the_rows += " ";
- table = header + the_rows;
- console.log("table is:", table);
- return $("#stats_table").append(table);
- };
- process_id = function() {
- var processed, value, values, _i, _len;
- values = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- /* Make an id or a class valid javascript by, for example, eliminating spaces
- */
-
- processed = "";
- for (_i = 0, _len = values.length; _i < _len; _i++) {
- value = values[_i];
- console.log("value:", value);
- value = value.replace(" ", "_");
- if (processed.length) {
- processed += "-";
- }
- processed += value;
- }
- return processed;
- };
- show_hide_outliers = function() {
- var label;
- console.log("FOOBAR in beginning of show_hide_outliers");
- label = $('#show_hide_outliers').val();
- console.log("lable is:", label);
- if (label === "Hide Outliers") {
- return $('#show_hide_outliers').val("Show Outliers");
- } else if (label === "Show Outliers") {
- console.log("Found Show Outliers");
- $('#show_hide_outliers').val("Hide Outliers");
- return console.log("Should be now Hide Outliers");
- }
- };
- on_corr_method_change = function() {
- var corr_method;
- console.log("in beginning of on_corr_method_change");
- corr_method = $('select[name=corr_method]').val();
- console.log("corr_method is:", corr_method);
- $('.correlation_desc').hide();
- $('#' + corr_method + "_r_desc").show().effect("highlight");
- if (corr_method === "lit") {
- return $("#corr_sample_method_options").hide();
- } else {
- return $("#corr_sample_method_options").show();
- }
- };
- $('select[name=corr_method]').change(on_corr_method_change);
- console.log("before registering show_hide_outliers");
- $('#show_hide_outliers').click(show_hide_outliers);
- console.log("after registering show_hide_outliers");
- _.mixin(_.str.exports());
- $('#value_table').change(edit_data_change);
- console.log("loaded");
- make_table();
- edit_data_change();
- return console.log("end");
- });
-
-}).call(this);
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
new file mode 100644
index 00000000..7d0e671f
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -0,0 +1,1346 @@
+
+ {% extends "base.html" %}
+ {% block title %}Trait Data and Analysis{% endblock %}
+ {% block content %}
+
+
+
+
+
+
+
+
+
+ -->
+
+
+
+
+
+
+
+
+
+
+
+ {% endblock %}
diff --git a/wqflask/wqflask/templates/trait_data_and_analysis.html b/wqflask/wqflask/templates/trait_data_and_analysis.html
deleted file mode 100644
index 7d0e671f..00000000
--- a/wqflask/wqflask/templates/trait_data_and_analysis.html
+++ /dev/null
@@ -1,1346 +0,0 @@
-
- {% extends "base.html" %}
- {% block title %}Trait Data and Analysis{% endblock %}
- {% block content %}
-
-
-
-
-
-
-
-
-
- -->
-
-
-
-
-
-
-
-
-
-
-
- {% endblock %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index bc80a1e6..4da1082f 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -76,7 +76,7 @@ def show_trait():
# Here it's currently too complicated not to use an fd that is a webqtlFormData
fd = webqtlFormData.webqtlFormData(request.args)
#template_vars = show_trait_page.ShowTraitPage(fd)
- template_vars = DataEditingPage.DataEditingPage(fd)
+ template_vars = show_trait.show_trait(fd)
template_vars.js_data = json.dumps(template_vars.js_data)
print("show_trait template_vars:", pf(template_vars.__dict__))
--
cgit v1.2.3
From f309b5144bfedc4aeaab0193f5be24a71737fc28 Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Wed, 3 Oct 2012 16:02:34 -0500
Subject: Changed css classes used in trait data table and wrote coffeescript
code that grabs the list of samples with an attribute value matching the
value the user chose to exclude by.
Added HTML5 data properties to table cells as data-column_name to use when
excluding samples.
---
web/css/general_flask.css | 54 +++++++++++++++-------
.../collection/ExportSelectionDetailInfoPage.py | 2 +-
wqflask/wqflask/show_trait/SampleList.py | 13 ------
wqflask/wqflask/show_trait/show_trait.py | 7 ++-
.../static/new/javascript/show_trait.coffee | 38 +++++++++++----
.../wqflask/static/new/javascript/show_trait.js | 41 ++++++++++++++--
wqflask/wqflask/templates/search_result_page.html | 14 +++---
wqflask/wqflask/templates/show_trait.html | 43 +++++++++++------
wqflask/wqflask/views.py | 1 +
9 files changed, 146 insertions(+), 67 deletions(-)
(limited to 'web/webqtl')
diff --git a/web/css/general_flask.css b/web/css/general_flask.css
index d0cffbc4..d40fa267 100755
--- a/web/css/general_flask.css
+++ b/web/css/general_flask.css
@@ -10,6 +10,8 @@ Blockquote {
margin : 14px 18px 14px 18px;
}
+/********** All this font size stuff, etc. needs to be replaced/removed ********** /
+
/*Font size*/
.fs10 {font-size : 10px}
.fs11 {font-size : 11px}
@@ -218,27 +220,47 @@ color: #999999;
/*For font style and color of commands and keywords in the scriptable interface page*/
.keywords
{
-font-family : "CourierNew", Courier, mono;
-font-size : 15px;
-color : #0000FF;
-font-weight : Normal
+ font-family : "CourierNew", Courier, mono;
+ font-size : 15px;
+ color : #0000FF;
+ font-weight : Normal
}
+
/*For RIsample.html page*/
.strains
{
-border:1px solid #999999;
-border-top:1px solid #940;
-border-bottom:1px solid #940;
-padding:5;
-background-color:#ddf;
-font-family:verdana;
+ border:1px solid #999999;
+ border-top:1px solid #940;
+ border-bottom:1px solid #940;
+ padding:5;
+ background-color:#ddf;
+ font-family:verdana;
}
+
.values
{
-border:1px solid #999999;
-border-top:1px solid #940;
-border-bottom:1px solid #940;
-padding:5;
-background-color:#eee;
-font-family:courier;
+ border:1px solid #999999;
+ border-top:1px solid #940;
+ border-bottom:1px solid #940;
+ padding:5;
+ background-color:#eee;
+ font-family:courier;
}
+
+/*****************************************/
+
+/* Standard table cell */
+.std_cell
+{
+ border : 1px solid #999999;
+ color : #222;
+ font-size : 13px;
+ padding : 3px;
+}
+
+/*Input field used to enter sample values, SE, etc.*/
+.trait_value_input
+{
+ font-style : Italic
+}
+
diff --git a/web/webqtl/collection/ExportSelectionDetailInfoPage.py b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
index a61b6f6e..7238c797 100755
--- a/web/webqtl/collection/ExportSelectionDetailInfoPage.py
+++ b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
@@ -128,7 +128,7 @@ class ExportSelectionDetailInfoPage(templatePage):
count = count + 1
except:
pass
- if count = 0:
+ if count == 0:
mean = 0
else:
mean = sum/count
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py
index d39559d3..df0dc61e 100644
--- a/wqflask/wqflask/show_trait/SampleList.py
+++ b/wqflask/wqflask/show_trait/SampleList.py
@@ -112,19 +112,6 @@ class SampleList(object):
self.attributes[key].distinct_values.sort(key=natural_sort_key)
- # exclude_menu = HT.Select(name="exclude_menu")
- # dropdown_menus = [] #ZS: list of dropdown menus with the distinct values of each attribute (contained in DIVs so the style parameter can be edited and they can be hidden)
- # for this_attr_name in attribute_names:
- # exclude_menu.append((this_attr_name.capitalize(), this_attr_name))
- # attr_value_menu_div = HT.Div(style="display:none;", Class="attribute_values") #container used to show/hide dropdown menus
- # attr_value_menu = HT.Select(name=this_attr_name)
- # attr_value_menu.append(("None", "show_all"))
- # for value in distinct_values:
- # attr_value_menu.append((str(value[0]), value[0]))
- # attr_value_menu_div.append(attr_value_menu)
- # dropdown_menus.append(attr_value_menu_div)
-
-
def get_extra_attribute_values(self, sample_name):
attribute_values = {}
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 9bad6154..d34ae9a6 100755
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -161,7 +161,12 @@ class ShowTrait(templatePage):
self.sample_group_types['primary_only'] = fd.RISet + " Only"
self.sample_group_types['other_only'] = "Non-" + fd.RISet
self.sample_group_types['all_cases'] = "All Cases"
- js_data = dict(sample_groups = self.sample_group_types,
+ sample_lists = []
+ for group in self.sample_groups:
+ sample_lists.append(group.sample_list)
+ print("sample_lists is:", pf(sample_lists))
+ js_data = dict(sample_group_types = self.sample_group_types,
+ sample_lists = sample_lists,
attribute_names = self.sample_groups[0].attributes)
print("js_data:", pf(js_data))
self.js_data = js_data
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee
index a91e9681..e22f1c21 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.coffee
+++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee
@@ -68,8 +68,8 @@ $ ->
make_table = ->
header = " "
- console.log("js_data.sample_groups:", js_data.sample_groups)
- for own key, value of js_data.sample_groups
+ console.log("js_data.sample_group_types:", js_data.sample_group_types)
+ for own key, value of js_data.sample_group_types
console.log("aa key:", key)
console.log("aa value:", value)
the_id = process_id("column", key)
@@ -107,8 +107,8 @@ $ ->
console.log("rowing")
row_line = """"""
row_line += """#{ row.pretty } """
- console.log("box - js_data.sample_groups:", js_data.sample_groups)
- for own key, value of js_data.sample_groups
+ console.log("box - js_data.sample_group_types:", js_data.sample_group_types)
+ for own key, value of js_data.sample_group_types
console.log("apple key:", key)
the_id = process_id(key, row.vn)
console.log("the_id:", the_id)
@@ -147,7 +147,7 @@ $ ->
console.log("Should be now Hide Outliers")
- #Calculate Correlations Code
+ ##Calculate Correlations Code
on_corr_method_change = ->
@@ -164,9 +164,9 @@ $ ->
$('select[name=corr_method]').change(on_corr_method_change)
- #End Calculate Correlations Code
+ ##End Calculate Correlations Code
- #Populate Samples Attribute Values Code
+ ##Populate Samples Attribute Values Code
create_value_dropdown = (value) ->
return """#{value} """
@@ -187,9 +187,29 @@ $ ->
populate_sample_attributes_values_dropdown()
$('#exclude_menu').change(populate_sample_attributes_values_dropdown)
+ ##End Populate Samples Attribute Values Codess
+
+ ##Block Samples By Attribute Value Code
+ block_by_attribute_value = ->
+ console.log("in beginning of bbav code")
+ attribute_name = $('#exclude_menu').val()
+ console.log("attribute_name is:", attribute_name)
+ exclude_by_value = $('#attribute_values').val()
+ console.log("exclude_by_value is:", exclude_by_value)
+ sample_lists = js_data['sample_lists']
+ console.log("sample_lists is:", sample_lists)
+ for sample_list in sample_lists
+ for sample in sample_list
+ console.log("sample is:", sample)
+ if sample.extra_attributes[attribute_name] == exclude_by_value
+ console.log("is exclude_by_value")
+ sample_row = $('')
+
+
+
+ $('#exclude_group').click(block_by_attribute_value)
-
- #End Populate Samples Attribute Values Code
+ ##End Block Samples By Attribute Value Code
console.log("before registering show_hide_outliers")
$('#show_hide_outliers').click(show_hide_outliers)
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 039a5e04..65440427 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -11,7 +11,7 @@
};
$(function() {
- var change_stats_value, create_value_dropdown, edit_data_change, hide_tabs, make_table, on_corr_method_change, populate_sample_attributes_values_dropdown, process_id, show_hide_outliers, stats_mdp_change, update_stat_values;
+ var block_by_attribute_value, change_stats_value, create_value_dropdown, edit_data_change, hide_tabs, make_table, on_corr_method_change, populate_sample_attributes_values_dropdown, process_id, show_hide_outliers, stats_mdp_change, update_stat_values;
hide_tabs = function(start) {
var x, _i, _results;
_results = [];
@@ -94,8 +94,8 @@
make_table = function() {
var header, key, row, row_line, rows, table, the_id, the_rows, value, _i, _len, _ref, _ref1;
header = " ";
- console.log("js_data.sample_groups:", js_data.sample_groups);
- _ref = js_data.sample_groups;
+ console.log("js_data.sample_group_types:", js_data.sample_group_types);
+ _ref = js_data.sample_group_types;
for (key in _ref) {
if (!__hasProp.call(_ref, key)) continue;
value = _ref[key];
@@ -132,8 +132,8 @@
console.log("rowing");
row_line = "";
row_line += "" + row.pretty + " ";
- console.log("box - js_data.sample_groups:", js_data.sample_groups);
- _ref1 = js_data.sample_groups;
+ console.log("box - js_data.sample_group_types:", js_data.sample_group_types);
+ _ref1 = js_data.sample_group_types;
for (key in _ref1) {
if (!__hasProp.call(_ref1, key)) continue;
value = _ref1[key];
@@ -222,6 +222,37 @@
};
populate_sample_attributes_values_dropdown();
$('#exclude_menu').change(populate_sample_attributes_values_dropdown);
+ block_by_attribute_value = function() {
+ var attribute_name, exclude_by_value, sample, sample_list, sample_lists, sample_row, _i, _len, _results;
+ console.log("in beginning of bbav code");
+ attribute_name = $('#exclude_menu').val();
+ console.log("attribute_name is:", attribute_name);
+ exclude_by_value = $('#attribute_values').val();
+ console.log("exclude_by_value is:", exclude_by_value);
+ sample_lists = js_data['sample_lists'];
+ console.log("sample_lists is:", sample_lists);
+ _results = [];
+ for (_i = 0, _len = sample_lists.length; _i < _len; _i++) {
+ sample_list = sample_lists[_i];
+ _results.push((function() {
+ var _j, _len1, _results1;
+ _results1 = [];
+ for (_j = 0, _len1 = sample_list.length; _j < _len1; _j++) {
+ sample = sample_list[_j];
+ console.log("sample is:", sample);
+ if (sample.extra_attributes[attribute_name] === exclude_by_value) {
+ console.log("is exclude_by_value");
+ _results1.push(sample_row = $(''));
+ } else {
+ _results1.push(void 0);
+ }
+ }
+ return _results1;
+ })());
+ }
+ return _results;
+ };
+ $('#exclude_group').click(block_by_attribute_value);
console.log("before registering show_hide_outliers");
$('#show_hide_outliers').click(show_hide_outliers);
console.log("after registering show_hide_outliers");
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 572f7fcc..c20efe40 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -171,9 +171,9 @@
{{ loop.index }}
-
+
{# - #}
-
+
{{ thisTrait.name.upper() }}
@@ -182,11 +182,11 @@
{{ thisTrait.symbol }}
- {{ thisTrait.description_display }}
- {{ thisTrait.trait_location_repr }}
- {{ thisTrait.mean }}
- {{ thisTrait.LRS_score_repr }}
- {{ thisTrait.LRS_location_repr }}
+ {{ thisTrait.description_display }}
+ {{ thisTrait.trait_location_repr }}
+ {{ thisTrait.mean }}
+ {{ thisTrait.LRS_score_repr }}
+ {{ thisTrait.LRS_location_repr }}
{% endfor %}
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index 3d24e738..0ef86685 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -1238,7 +1238,7 @@
{% endif %}
-
+
Options:
@@ -1253,9 +1253,14 @@
- Outliers highlighted in yellow can be hidden using
- the Hide Outliers button,
- and samples with no value (x) can be hidden by clicking Hide No Value .
+ Outliers highlighted in
+ yellow
+ can be hidden using
+ the Hide Outliers button,
+
+ and samples with no value (x) can be hidden by clicking
+ Hide No Value t.
+
@@ -1280,36 +1285,44 @@
{% endif %}
{% for attribute in sample_type.attributes|sort() %}
-
{{ sample_type.attributes[attribute].name }}
+
+ {{ sample_type.attributes[attribute].name }}
+
{% endfor %}
{% for sample in sample_type.sample_list %}
-
+
{{ loop.index }}
-
+
-
- {{ sample.name }}
+
+
+ {{ sample.name }}
+
{# Todo: Add IDs #}
-
-
+
{% if sample_type.se_exists() %}
-
+
±
{# Todo: Add IDs #}
-
-
+
@@ -1317,7 +1330,7 @@
{# Loop through each attribute type and input value #}
{% for attribute in sample_type.attributes|sort() %}
-
+
{{ sample.extra_attributes[sample_type.attributes[attribute].name] }}
{% endfor %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index c38ecb47..82a08c71 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -94,6 +94,7 @@ def corr_compute_page():
# Todo: Can we simplify this? -Sam
def sharing_info_page():
+ """Info page displayed when the user clicks the "Info" button next to the dataset selection"""
print("In sharing_info_page")
fd = webqtlFormData.webqtlFormData(request.args)
print("2Have fd")
--
cgit v1.2.3
From d53c70c1f2eb71077086ca7ad13eb59158d1351b Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Fri, 19 Oct 2012 14:39:37 -0500
Subject: Reindented genSelectDatasetJS as gen_select_dataset
---
web/webqtl/maintainance/genSelectDatasetJS.py | 3 +
wqflask/maintenance/gen_select_dataset.py | 640 ++++++++++++++++++++++++++
wqflask/wqflask/views.py | 1 +
3 files changed, 644 insertions(+)
create mode 100644 wqflask/maintenance/gen_select_dataset.py
(limited to 'web/webqtl')
diff --git a/web/webqtl/maintainance/genSelectDatasetJS.py b/web/webqtl/maintainance/genSelectDatasetJS.py
index bc88beec..d03cc7af 100755
--- a/web/webqtl/maintainance/genSelectDatasetJS.py
+++ b/web/webqtl/maintainance/genSelectDatasetJS.py
@@ -27,6 +27,9 @@
# created by Ning Liu 07/01/2010
# This script is to generate selectDatasetMenu.js file for cascade menu in the main search page http://www.genenetwork.org/.
# This script will be run automatically every one hour or manually when database has been changed .
+
+from __future__ import print_function, division
+
import sys, os
current_file_name = __file__
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
new file mode 100644
index 00000000..7d2605c1
--- /dev/null
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -0,0 +1,640 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by NL 2011/01/27
+
+# created by Ning Liu 07/01/2010
+# This script is to generate selectDatasetMenu.js file for cascade menu in the main search page http://www.genenetwork.org/.
+# This script will be run automatically every one hour or manually when database has been changed .
+
+from __future__ import print_function, division
+
+import sys, os
+
+current_file_name = __file__
+pathname = os.path.dirname( current_file_name )
+abs_path = os.path.abspath(pathname)
+sys.path.insert(0, abs_path + '/..')
+
+import MySQLdb
+import os
+import string
+import time
+import datetime
+
+from base import template
+from base import webqtlConfig
+
+#################################################################################
+# input: searchArray, targetValue
+# function: retrieve index info of target value in designated array (searchArray)
+# output: return index info
+##################################################################################
+def getIndex(searchArray=None, targetValue=None):
+ for index in range(len(searchArray)):
+ if searchArray[index][0]==targetValue:
+ return index
+
+# build MySql database connection
+con = MySQLdb.Connect(db=webqtlConfig.DB_NAME,host=webqtlConfig.MYSQL_SERVER, user=webqtlConfig.DB_USER,passwd=webqtlConfig.DB_PASSWD)
+cursor = con.cursor()
+
+# create js_select.js file
+fileHandler = open(webqtlConfig.HTMLPATH + 'javascript/selectDatasetMenu.js', 'w')
+
+# define SpeciesString, GroupString, TypeString, DatabasingString, LinkageString for output
+# outputSpeciesStr is for building Species Array(sArr) in js file; outputGroupStr is for Group Array(gArr)
+# outputTypeStr is for Type Array(tArr); outputDatabaseStr is for Database Array(dArr)
+# outputLinkStr is for Linkage Array(lArr)
+outputTimeStr ="/* Generated Date : %s , Time : %s */ \n" % (datetime.date.today(),time.strftime("%H:%M ", time.localtime()))
+outputTimeStr =""
+outputSpeciesStr ='var sArr = [\n{txt:\'\',val:\'\'},\n'
+outputGroupStr ='var gArr = [\n{txt:\'\',val:\'\'},\n'
+outputTypeStr ='var tArr = [\n{txt:\'\',val:\'\'},\n'
+outputDatabaseStr ='var dArr = [\n{txt:\'\',val:\'\'},\n'
+outputLinkStr ='var lArr = [\n null,\n'
+
+# built speices array in js file for select menu in the main search page http://www.genenetwork.org/
+cursor.execute("select Name, MenuName from Species order by OrderId")
+speciesResult = cursor.fetchall()
+speciesTotalResult = list(speciesResult)
+speciesResultsTotalNum = cursor.rowcount
+if speciesResultsTotalNum >0:
+ for speciesItem in speciesResult:
+ speciesVal = speciesItem[0]
+ speciesTxt = speciesItem[1]
+ outputSpeciesStr += '{txt:\'%s\',val:\'%s\'},\n'%(speciesTxt,speciesVal)
+# 'All Species' option for 'Species' select menu
+outputSpeciesStr +='{txt:\'All Species\',val:\'All Species\'}];\n\n'
+#speciesTotalResult is a list which inclues all species' options
+speciesTotalResult.append(('All Species','All Species'))
+
+# built group array in js file for select menu in the main search page http://www.genenetwork.org/
+cursor.execute("select distinct InbredSet.Name, InbredSet.FullName from InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze where InbredSet.SpeciesId= Species.Id and InbredSet.Name != 'BXD300' and (PublishFreeze.InbredSetId = InbredSet.Id or GenoFreeze.InbredSetId = InbredSet.Id or ProbeFreeze.InbredSetId = InbredSet.Id) order by InbredSet.Name")
+groupResults = cursor.fetchall()
+groupTotalResults = list(groupResults)
+groupResultsTotalNum = cursor.rowcount
+if groupResultsTotalNum > 0:
+ for groupItem in groupResults:
+ groupVal = groupItem[0]
+ groupTxt = groupItem[1]
+ outputGroupStr += '{txt:\'%s\',val:\'%s\'},\n'%(groupTxt,groupVal)
+# add 'All Groups' option for 'Group' select menu
+outputGroupStr +='{txt:\'All Groups\',val:\'all groups\'}];\n\n'
+# groupTotalResults is a list which inclues all groups' options
+groupTotalResults.append(('all groups','All Groups'))
+
+# built type array in js file for select menu in the main search page http://www.genenetwork.org/
+cross = groupVal
+cursor.execute("select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue where ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.public > %d order by Tissue.Name" % (webqtlConfig.PUBLICTHRESH))
+typeResults = cursor.fetchall()
+typeTotalResults = list(typeResults)
+typeResultsTotalNum = cursor.rowcount
+if typeResultsTotalNum > 0:
+ for typeItem in typeResults:
+ typeVal = typeItem[0]
+ typeTxt = typeItem[1]
+ outputTypeStr += '{txt:\'%s\',val:\'%s\'},\n'%(typeTxt,typeVal)
+# add 'Phenotypes' and 'Genotypes' options for 'Type' select menu
+outputTypeStr +='{txt:\'Phenotypes\',val:\'Phenotypes\'},\n'
+outputTypeStr +='{txt:\'Genotypes\',val:\'Genotypes\'}];\n\n'
+# typeTotalResults is a list which inclues all types' options
+typeTotalResults.append(('Phenotypes','Phenotypes'))
+typeTotalResults.append(('Genotypes','Genotypes'))
+
+# built dataset array in js file for select menu in the main search page http://www.genenetwork.org/
+tissue = typeVal
+cursor.execute("select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue where ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.public > %d order by ProbeSetFreeze.CreateTime desc" % (webqtlConfig.PUBLICTHRESH))
+datasetResults = cursor.fetchall()
+datasetTotalResults = list(datasetResults)
+datasetResultsTotalNum = cursor.rowcount
+if datasetResultsTotalNum > 0:
+ for datasetItem in datasetResults:
+ datasetVal = datasetItem[0]
+ datasetTxt = datasetItem[1]
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'%(datasetTxt,datasetVal)
+
+# This part is to built linkage array in js file, the linkage is among Species, Group, Type and Database.
+# The format of linkage array is [speciesIndex, groupIndex, typeIndex, databaseIndex]
+if speciesResultsTotalNum >0:
+ for speciesItem in speciesResult:
+ speciesVal = speciesItem[0]
+ sIndex = getIndex(searchArray=speciesTotalResult,targetValue=speciesVal)+1
+
+ # retrieve group info based on specie
+ cursor.execute("select distinct InbredSet.Name, InbredSet.FullName from InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze where InbredSet.SpeciesId= Species.Id and Species.Name='%s' and InbredSet.Name != 'BXD300' and (PublishFreeze.InbredSetId = InbredSet.Id or GenoFreeze.InbredSetId = InbredSet.Id or ProbeFreeze.InbredSetId = InbredSet.Id) order by InbredSet.Name" % speciesVal)
+ groupResults = cursor.fetchall()
+ groupResultsNum = cursor.rowcount
+
+ if groupResultsNum > 0:
+ for groupItem in groupResults:
+ groupVal = groupItem[0]
+ gIndex = getIndex(searchArray=groupTotalResults, targetValue=groupVal)+1
+
+ cross = groupVal
+ # if group also exists in PublishFreeze table, then needs to add related Published Phenotypes in Database Array(dArr) and Linkage Array(lArr)
+ # 'MDP' case is related to 'Mouse Phenome Database'
+ cursor.execute("select PublishFreeze.Id from PublishFreeze, InbredSet where PublishFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = '%s'" % cross)
+ if (cursor.fetchall()):
+ typeVal = "Phenotypes"
+ if cross=='MDP':
+ datasetTxt = "Mouse Phenome Database"
+ else:
+ datasetTxt = "%s Published Phenotypes" % cross
+ datasetVal = "%sPublish" % cross
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'% (datasetTxt,datasetVal)
+ datasetTotalResults.append(('%s'% datasetVal,'%s' % datasetTxt))
+
+ tIndex = getIndex(searchArray=typeTotalResults,targetValue=typeVal)+1
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+ # if group also exists in GenoFreeze table, then needs to add related Genotypes in database Array(dArr)
+ cursor.execute("select GenoFreeze.Id from GenoFreeze, InbredSet where GenoFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = '%s'" % cross)
+ if (cursor.fetchall()):
+ typeVal = "Genotypes"
+ datasetTxt = "%s Genotypes" % cross
+ datasetVal = "%sGeno" % cross
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'%(datasetTxt,datasetVal)
+ typeTotalResults.append(('Genotypes','Genotypes'))
+ datasetTotalResults.append(('%s'% datasetVal,'%s' % datasetTxt))
+
+ tIndex = getIndex(searchArray=typeTotalResults,targetValue=typeVal)+1
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+ # retrieve type(tissue) info based on group
+ # if cross is equal to 'BXD', then need to seach for 'BXD' and 'BXD300' InbredSet
+ if cross == "BXD":
+ cross2 = "BXD', 'BXD300"
+ else:
+ cross2 = cross
+ cursor.execute("select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue where ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name in ('%s') and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.public > %d order by Tissue.Name" % (cross2, webqtlConfig.PUBLICTHRESH))
+ typeResults = cursor.fetchall()
+ typeResultsNum = cursor.rowcount
+
+ if typeResultsNum > 0:
+ for typeItem in typeResults:
+ typeVal = typeItem[0]
+ tIndex = getIndex(searchArray=typeTotalResults, targetValue=typeVal)+1
+ # retrieve database(dataset) info based on group(InbredSet) and type(Tissue)
+ tissue = typeVal
+ cursor.execute("select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue where ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name in ('%s') and Tissue.name = '%s' and ProbeSetFreeze.public > %d order by ProbeSetFreeze.CreateTime desc" % (cross2, tissue, webqtlConfig.PUBLICTHRESH))
+ datasetResults = cursor.fetchall()
+ datasetResultsNum = cursor.rowcount
+
+ if datasetResultsNum > 0:
+ for datasetItem in datasetResults:
+ datasetVal = datasetItem[0]
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+# add 'All Phenotypes' option for 'Database' select menu
+# for 'All Species'option in 'Species' select menu, 'Database' select menu will show 'All Phenotypes' option
+outputDatabaseStr += '{txt:\'%s\',val:\'%s\'}];\n\n'%('All Phenotypes','_allPublish')
+datasetTotalResults.append(('_allPublish','All Phenotypes'))
+
+sIndex = getIndex(searchArray=speciesTotalResult,targetValue='All Species')+1
+gIndex = getIndex(searchArray=groupTotalResults, targetValue='all groups')+1
+tIndex = getIndex(searchArray=typeTotalResults,targetValue='Phenotypes')+1
+dIndex = getIndex(searchArray=datasetTotalResults, targetValue='_allPublish')+1
+outputLinkStr +='[%d,%d,%d,%d]];\n\n'%(sIndex,gIndex,tIndex,dIndex)
+
+# Combine sArr, gArr, tArr, dArr and lArr output string together
+outputStr = outputTimeStr+outputSpeciesStr+outputGroupStr+outputTypeStr+outputDatabaseStr+outputLinkStr
+outputStr +='''
+
+/*
+* function: based on different browser use, will have different initial actions;
+* Once the index.html page is loaded, this function will be called
+*/
+function initialDatasetSelection()
+{
+ defaultSpecies =getDefaultValue('species');
+ defaultSet =getDefaultValue('cross');
+ defaultType =getDefaultValue('tissue');
+ defaultDB =getDefaultValue('database');
+
+ if (navigator.userAgent.indexOf('MSIE')>=0)
+ {
+ sOptions = fillOptionsForIE(null,defaultSpecies);
+ var menu0 =""+sOptions+" ";
+ document.getElementById('menu0').innerHTML = menu0;
+
+ gOptions = fillOptionsForIE('species',defaultSet);
+ var menu1 =""+gOptions+" ";
+ document.getElementById('menu1').innerHTML =menu1;
+
+ tOptions = fillOptionsForIE('cross',defaultType);
+ var menu2 =""+tOptions+" ";
+ document.getElementById('menu2').innerHTML =menu2;
+
+ dOptions = fillOptionsForIE('tissue',defaultDB);
+ var menu3 =""+dOptions+" ";
+ document.getElementById('menu3').innerHTML =menu3;
+
+ }else{
+ fillOptions(null);
+ }
+ searchtip();
+}
+
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* defaultValue (default Value of species, cross,tissue or database)
+* function: special for IE browser,setting options value for select menu dynamically based on linkage array(lArr),
+* output: options string
+*/
+function fillOptionsForIE(selectObjId,defaultValue)
+{
+ var options='';
+ if(selectObjId==null)
+ {
+ var len = sArr.length;
+ for (var i=1; i < len; i++) {
+ // setting Species' option
+ if( sArr[i].val==defaultValue){
+ options =options+""+sArr[i].txt+" ";
+ }else{
+ options =options+""+sArr[i].txt+" ";
+ }
+ }
+ }else if(selectObjId=='species')
+ {
+ var speciesObj = document.getElementById('species');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get group(cross) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&!Contains(arr,lArr[i][1]))
+ {
+ arr[idx++]=lArr[i][1];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("cross");
+ for (var i=0; i < len; i++) {
+ // setting Group's option
+ if( gArr[arr[i]].val==defaultValue){
+ options =options+""+gArr[arr[i]].txt+" ";
+ }else{
+ options =options+""+gArr[arr[i]].txt+" ";
+ }
+
+ }
+ }else if(selectObjId=='cross')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get type(tissue) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&!Contains(arr,lArr[i][2]))
+ {
+ arr[idx++]=lArr[i][2];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("tissue");
+ for (var i=0; i < len; i++) {
+ // setting Type's option
+ if( tArr[arr[i]].val==defaultValue){
+ options =options+""+tArr[arr[i]].txt+" ";
+ }else{
+ options =options+""+tArr[arr[i]].txt+" ";
+ }
+ }
+
+ }else if(selectObjId=='tissue')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get dataset(database) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&lArr[i][2]==(getIndexByValue('tissue',typeObj.value)).toString()&&!Contains(arr,lArr[i][3]))
+ {
+ arr[idx++]=lArr[i][3];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("database");
+ for (var i=0; i < len; i++) {
+ // setting Database's option
+ if( dArr[arr[i]].val==defaultValue){
+ options =options+""+dArr[arr[i]].txt+" ";
+ }else{
+ options =options+""+dArr[arr[i]].txt+" ";
+ }
+ }
+ }
+ return options;
+}
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* function: setting options value for select menu dynamically based on linkage array(lArr)
+* output: null
+*/
+function fillOptions(selectObjId)
+{
+ if(selectObjId==null)
+ {
+
+ var speciesObj = document.getElementById('species');
+ var len = sArr.length;
+ for (var i=1; i < len; i++) {
+ // setting Species' option
+ speciesObj.options[i-1] = new Option(sArr[i].txt, sArr[i].val);
+ }
+ updateChocie('species');
+
+ }else if(selectObjId=='species')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get group(cross) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&!Contains(arr,lArr[i][1]))
+ {
+ arr[idx++]=lArr[i][1];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("cross");
+ for (var i=0; i < len; i++) {
+ // setting Group's option
+ groupObj.options[idx++] = new Option(gArr[arr[i]].txt, gArr[arr[i]].val);
+ }
+ updateChocie('cross');
+
+ }else if(selectObjId=='cross')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get type(tissue) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&!Contains(arr,lArr[i][2]))
+ {
+ arr[idx++]=lArr[i][2];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("tissue");
+ for (var i=0; i < len; i++) {
+ // setting Type's option
+ typeObj.options[idx++] = new Option(tArr[arr[i]].txt, tArr[arr[i]].val);
+ }
+ updateChocie('tissue');
+
+ }else if(selectObjId=='tissue')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+ var databaseObj = document.getElementById('database');
+
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get dataset(database) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&lArr[i][2]==(getIndexByValue('tissue',typeObj.value)).toString()&&!Contains(arr,lArr[i][3]))
+ {
+ arr[idx++]=lArr[i][3];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("database");
+ for (var i=0; i < len; i++) {
+ // setting Database's option
+ databaseObj.options[idx++] = new Option(dArr[arr[i]].txt, dArr[arr[i]].val);
+ }
+ updateChocie('database');
+ }
+}
+
+/*
+* input: arr (targeted array); obj (targeted value)
+* function: check whether targeted array contains targeted value or not
+* output: return true, if array contains targeted value, otherwise return false
+*/
+function Contains(arr,obj) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] == obj) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+* input: selectObj (designated select menu, such as species, cross, etc... )
+* function: clear designated select menu's option
+* output: null
+*/
+function removeOptions(selectObj) {
+ if (typeof selectObj != 'object'){
+ selectObj = document.getElementById(selectObj);
+ }
+ var len = selectObj.options.length;
+ for (var i=0; i < len; i++) {
+ // clear current selection
+ selectObj.options[0] = null;
+ }
+}
+
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* Value: target value
+* function: retrieve Index info of target value in designated array
+* output: index info
+*/
+function getIndexByValue(selectObjId,val)
+{
+ if(selectObjId=='species')
+ {
+ for(var i=1;i=0){
+ //setting option's selected status
+ Obj.options[idx].selected=true;
+ //update the following select menu
+ fillOptions(objId);
+ }else{
+ Obj.options[0].selected=true;
+ fillOptions(objId);
+ }
+}
+
+// setting option's selected status based on default setting or cookie setting for Species, Group, Type and Database select menu in the main search page http://www.genenetwork.org/
+function updateChocie(selectObjId){
+
+ if (selectObjId =='species')
+ {
+ defaultSpecies= getDefaultValue('species');
+ //setting option's selected status
+ setChoice('species',defaultSpecies);
+ }else if (selectObjId =='cross')
+ {
+ defaultSet= getDefaultValue('cross');
+ //setting option's selected status
+ setChoice('cross',defaultSet);
+ }else if (selectObjId =='tissue')
+ {
+ defaultType= getDefaultValue('tissue');
+ //setting option's selected status
+ setChoice('tissue',defaultType);
+ }else if (selectObjId =='database')
+ {
+ defaultDB= getDefaultValue('database');
+ //setting option's selected status
+ setChoice('database',defaultDB);
+ }
+}
+
+//get default value;if cookie exists, then use cookie value, otherwise use default value
+function getDefaultValue(selectObjId){
+ //define default value
+ var defaultSpecies = 'mouse'
+ var defaultSet = 'BXD'
+ var defaultType = 'Hippocampus'
+ var defaultDB = 'HC_M2_0606_P'
+
+ if (selectObjId =='species')
+ {
+ //if cookie exists, then use cookie value, otherwise use default value
+ var cookieSpecies = getCookie('defaultSpecies');
+ if(cookieSpecies)
+ {
+ defaultSpecies= cookieSpecies;
+ }
+ return defaultSpecies;
+ }else if (selectObjId =='cross'){
+ var cookieSet = getCookie('defaultSet');
+ if(cookieSet){
+ defaultSet= cookieSet;
+ }
+ return defaultSet;
+ }else if (selectObjId =='tissue'){
+ var cookieType = getCookie('defaultType');
+ if(cookieType){
+ defaultType= cookieType;
+ }
+ return defaultType;
+ }else if (selectObjId =='database')
+ {
+ var cookieDB = getCookie('defaultDB');
+ if(cookieDB){
+ defaultDB= cookieDB;
+ }
+ return defaultDB;
+ }
+
+}
+
+//setting default value into cookies for the dropdown menus: Species,Group, Type, and Database
+function setDefault(thisform){
+
+ setCookie('cookieTest', 'cookieTest', 1);
+ var cookieTest = getCookie('cookieTest');
+ delCookie('cookieTest');
+ if (cookieTest){
+ var defaultSpecies = thisform.species.value;
+ setCookie('defaultSpecies', defaultSpecies, 10);
+ var defaultSet = thisform.cross.value;
+ setCookie('defaultSet', defaultSet, 10);
+ var defaultType = thisform.tissue.value;
+ setCookie('defaultType', defaultType, 10);
+ var defaultDB = thisform.database.value;
+ setCookie('defaultDB', defaultDB, 10);
+ updateChocie('species');
+ updateChocie('cross');
+ updateChocie('tissue');
+ updateChocie('database');
+ alert("The current settings are now your default");
+ }
+ else{
+ alert("You need to enable Cookies in your browser.");
+ }
+}
+
+'''
+# write all strings' info into selectDatasetMenu.js file
+fileHandler.write(outputStr)
+fileHandler.close()
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 2933b428..e7e260fe 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -33,6 +33,7 @@ def index_page():
@app.route("/new")
def new_index_page():
print("Sending index_page")
+
return render_template("new_index_page.html")
@app.route("/data_sharing")
--
cgit v1.2.3
From 65a6a9c5f21d42fa43d13823be632760abbc4891 Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Fri, 2 Nov 2012 18:11:55 -0500
Subject: Created search objects for GeneRIF and GeneWiki searches
Got search results to display
Refactored the template for show_trait page
---
web/webqtl/base/webqtlTrait.py | 9 +
wqflask/wqflask/do_search.py | 89 +-
wqflask/wqflask/parser.py | 7 +-
wqflask/wqflask/search_results.py | 966 +------
.../new/javascript/dataset_menu_structure.json | 2904 ++++++++++++++++++++
wqflask/wqflask/templates/show_trait.html | 1218 +-------
.../show_trait_calculate_correlations.html | 130 +
wqflask/wqflask/templates/show_trait_details.html | 63 +
.../wqflask/templates/show_trait_edit_data.html | 163 ++
.../templates/show_trait_mapping_tools.html | 382 +++
.../wqflask/templates/show_trait_statistics.html | 433 +++
11 files changed, 4249 insertions(+), 2115 deletions(-)
create mode 100644 wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
create mode 100644 wqflask/wqflask/templates/show_trait_calculate_correlations.html
create mode 100644 wqflask/wqflask/templates/show_trait_details.html
create mode 100644 wqflask/wqflask/templates/show_trait_edit_data.html
create mode 100644 wqflask/wqflask/templates/show_trait_mapping_tools.html
create mode 100644 wqflask/wqflask/templates/show_trait_statistics.html
(limited to 'web/webqtl')
diff --git a/web/webqtl/base/webqtlTrait.py b/web/webqtl/base/webqtlTrait.py
index f5051e45..2469504f 100644
--- a/web/webqtl/base/webqtlTrait.py
+++ b/web/webqtl/base/webqtlTrait.py
@@ -9,6 +9,10 @@ from dbFunction import webqtlDatabaseFunction
from utility import webqtlUtil
+from __future__ import print_function, division
+
+from pprint import pformat as pf
+
class webqtlTrait:
"""
Trait class defines a trait in webqtl, can be either Microarray,
@@ -215,6 +219,9 @@ class webqtlTrait:
def retrieveData(self, strainlist=[]):
assert self.db and self.cursor
+ debug_file = open("/home/zas1024/gn/web/traitlist_debug.txt", "w")
+ debug_file.write("strianlist is:" + strainlist + "\n")
+
if self.db.type == 'Temp':
query = '''
SELECT
@@ -341,6 +348,8 @@ class webqtlTrait:
#end if
else:
pass
+
+ debug_file.write("self.data is:", pf(self.data) + "\n")
def keys(self):
return self.__dict__.keys()
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index 19c6fa74..2641431c 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -9,6 +9,9 @@ from pprint import pformat as pf
class DoSearch(object):
"""Parent class containing parameters/functions used for all searches"""
+ # Used to translate search phrases into classes
+ search_types = dict()
+
def __init__(self, search_term, dataset, cursor, db_conn):
self.search_term = search_term
self.dataset = dataset
@@ -28,14 +31,20 @@ class DoSearch(object):
return self.db_conn.escape_string(str(stringy))
def normalize_spaces(self, stringy):
- """Strips out newlines extra spaces and replaces them with just spaces"""
+ """Strips out newlines/extra spaces and replaces them with just spaces"""
step_one = " ".join(stringy.split())
return step_one
+
+ @classmethod
+ def get_search(cls, search_type):
+ return cls.search_types[search_type]
class ProbeSetSearch(DoSearch):
"""A search within an mRNA expression dataset"""
+ DoSearch.search_types['ProbeSet'] = "ProbeSetSearch"
+
base_query = """SELECT ProbeSet.Name as TNAME,
0 as thistable,
ProbeSetXRef.Mean as TMEAN,
@@ -47,6 +56,24 @@ class ProbeSetSearch(DoSearch):
ProbeSet.name_num as TNAME_NUM
FROM ProbeSetXRef, ProbeSet """
+ def compile_final_query(self, from_clause, where_clause):
+ """Generates the final query string"""
+
+ from_clause = self.normalize_spaces(from_clause)
+
+ query = (self.base_query +
+ """%s
+ WHERE %s
+ and ProbeSet.Id = ProbeSetXRef.ProbeSetId
+ and ProbeSetXRef.ProbeSetFreezeId = %s
+ """ % (self.escape(from_clause),
+ where_clause,
+ self.escape(self.dataset.id)))
+
+ print("query is:", pf(query))
+
+ return query
+
def run(self):
"""Generates and runs a simple search of an mRNA expression dataset"""
@@ -73,6 +100,8 @@ class ProbeSetSearch(DoSearch):
class PhenotypeSearch(DoSearch):
"""A search within a phenotype dataset"""
+ DoSearch.search_types['Publish'] = "PhenotypeSearch"
+
base_query = """SELECT PublishXRef.Id,
PublishFreeze.createtime as thistable,
Publication.PubMed_ID as Publication_PubMed_ID,
@@ -128,6 +157,8 @@ class PhenotypeSearch(DoSearch):
class GenotypeSearch(DoSearch):
"""A search within a genotype dataset"""
+
+ DoSearch.search_types['Geno'] = "GenotypeSearch"
base_query = """SELECT Geno.Name,
GenoFreeze.createtime as thistable,
@@ -169,9 +200,42 @@ class GenotypeSearch(DoSearch):
return self.execute(query)
+class RifSearch(ProbeSetSearch):
+ """Searches for traits with a Gene RIF entry including the search term."""
+
+ DoSearch.search_types['RIF'] = "RifSearch"
+
+ def run(self):
+ where_clause = """( %s.symbol = GeneRIF_BASIC.symbol and
+ MATCH (GeneRIF_BASIC.comment)
+ AGAINST ('+%s' IN BOOLEAN MODE)) """ % (self.dataset.type, self.search_term)
+
+ from_clause = ", GeneRIF_BASIC "
+ query = self.compile_final_query(from_clause, where_clause)
+
+ return self.execute(query)
+
+class WikiSearch(ProbeSetSearch):
+ """Searches GeneWiki for traits other people have annotated"""
+
+ DoSearch.search_types['WIKI'] = "WikiSearch"
+
+ def run(self):
+ where_clause = """%s.symbol = GeneRIF.symbol
+ and GeneRIF.versionId=0 and GeneRIF.display>0
+ and (GeneRIF.comment REGEXP '%s' or GeneRIF.initial = '%s')
+ """ % (self.dataset.type, "[[:<:]]"+self.search_term+"[[:>:]]", self.search_term)
+
+ from_clause = ", GeneRIF "
+ query = self.compile_final_query(from_clause, where_clause)
+
+ return self.execute(query)
+
class GoSearch(ProbeSetSearch):
"""Searches for synapse-associated genes listed in the Gene Ontology."""
+ DoSearch.search_types['GO'] = "GoSearch"
+
def run(self):
field = 'GOterm.acc'
go_id = 'GO:' + ('0000000'+self.search_term)[-7:]
@@ -181,23 +245,13 @@ class GoSearch(ProbeSetSearch):
GOterm.id=GOassociation.term_id""" % (
self.db_conn.escape_string(self.dataset.type)))
- clause_item = " %s = '%s' and %s " % (field, go_id, statements)
+ where_clause = " %s = '%s' and %s " % (field, go_id, statements)
- #
- gene_ontology_from_table = """ , db_GeneOntology.term as GOterm,
+ from_clause = """ , db_GeneOntology.term as GOterm,
db_GeneOntology.association as GOassociation,
db_GeneOntology.gene_product as GOgene_product """
-
- gene_ontology_from_table = self.normalize_spaces(gene_ontology_from_table)
-
- query = (self.base_query +
- """%s
- WHERE %s
- and ProbeSet.Id = ProbeSetXRef.ProbeSetId
- and ProbeSetXRef.ProbeSetFreezeId = %s
- """ % (self.db_conn.escape_string(gene_ontology_from_table),
- clause_item,
- self.db_conn.escape_string(str(self.dataset.id))))
+
+ query = self.compile_final_query(from_clause, where_clause)
return self.execute(query)
@@ -227,8 +281,11 @@ if __name__ == "__main__":
dataset_name = "HC_M2_0606_P"
dataset = webqtlDataset(dataset_name, cursor)
- results = ProbeSetSearch("salt", dataset, cursor, db_conn).run()
+ #results = ProbeSetSearch("salt", dataset, cursor, db_conn).run()
+ #results = RifSearch("diabetes", dataset, cursor, db_conn).run()
+ results = WikiSearch("nicotine", dataset, cursor, db_conn).run()
#results = PhenotypeSearch("brain", dataset, cursor, db_conn).run()
#results = GenotypeSearch("rs13475699", dataset, cursor, db_conn).run()
#results = GoSearch("0045202", dataset, cursor, db_conn).run()
+
print("results are:", pf(results))
\ No newline at end of file
diff --git a/wqflask/wqflask/parser.py b/wqflask/wqflask/parser.py
index e34992a0..e693b2b8 100644
--- a/wqflask/wqflask/parser.py
+++ b/wqflask/wqflask/parser.py
@@ -4,6 +4,7 @@ import re
from pprint import pformat as pf
+
def parse(pstring):
pstring = re.split(r"""(?:(\w+\s*=\s*\([^)]*\))|(\w+\s*[=:]\w+)|(\w+))""", pstring)
pstring = [item.strip() for item in pstring if item and item.strip()]
@@ -28,9 +29,11 @@ def parse(pstring):
value = [value.strip() for value in values if value.strip()]
term = dict(key=key,
seperator=seperator,
- value=value)
+ search_term=value)
else:
- term = dict(search_term = item)
+ term = dict(key=None,
+ seperator=None,
+ search_term = item)
items.append(term)
print(pf(items))
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index c82f16c1..a97ea8fd 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -42,7 +42,6 @@ from utility import formatting
#from base.JinjaPage import JinjaEnv, JinjaPage
-
class SearchResultPage(templatePage):
maxReturn = 3000
@@ -144,20 +143,6 @@ class SearchResultPage(templatePage):
self.species_id = webqtlDatabaseFunction.retrieveSpeciesId(self.cursor,
self.dataset.group)
- ###########################################
- # make sure search from same type of datasets
- ###########################################
- #dbTypes = map(lambda X: X.type, self.dataset)
- #db_types = [table.type for table in self.dataset]
- #self.db_type = db_types[0]
- #for item in dbTypes:
- # if item != self.dbType:
- # heading = "Search Result"
- # detail = ["Search can only be performed among the same type of datasets"]
- # self.error(heading=heading,detail=detail,error="Error")
- # return
-
-
#self.db_type = self.dataset.type
if self.dataset.type == "Publish":
self.search_fields = ['Phenotype.Post_publication_description',
@@ -191,273 +176,61 @@ class SearchResultPage(templatePage):
elif self.dataset.type == "Geno":
self.search_fields = ['Name','Chr']
-
self.search()
self.gen_search_result()
- ###########################################
- # Search Options
- ###########################################
- #self.matchwhole = fd['matchwhole']
- #split result into pages
- #self.pageNumber = fd.get('pageno', 0)
- #
- #try:
- # self.pageNumber = int(self.pageNumber)
- #except Exception as why:
- # print(why)
- # self.pageNumber = 0
-
-
- ###########################################
- # Generate Mysql Query
- ###########################################
-
- # Sam: We presume lines below aren't used...
- #geneIdListQuery = fd.get('geneId', '')
- #if geneIdListQuery:
- # geneIdListQuery = string.replace(geneIdListQuery, ",", " ")
- # geneIdListQuery = " geneId=%s" % string.join(string.split(geneIdListQuery), "-")
-
- #self.ANDkeyword = fd.get('ANDkeyword', "")
- #self.ORkeyword = fd.get('ORkeyword', "")
-
- #self.ORkeyword += geneIdListQuery
-
- #self.ANDkeyword = self.ANDkeyword.replace("\\", "").strip()
- #self.ORkeyword = self.ORkeyword.replace("\\", "").strip()
- #user defined sort option
- #self.orderByUserInput = fd.get('orderByUserInput', "").strip()
- #default sort option if user have not defined
- #self.orderByDefalut = ""
-
- #XZ, Dec/16/2010: I add examples to help understand this block of code. See details in function pattersearch.
- #
- ##XZ: self._1mPattern examples: WIKI=xxx, RIF=xxx, GO:0045202
- #self._1mPattern = re.compile('\s*(\S+)\s*[:=]\s*([a-zA-Z-\+\d\.]+)\s*')
- #
- ##XZ: self._2mPattern examples: Mean=(15.0 16.0), Range=(10 100), LRS=(Low_LRS_limit, High_LRS_limit), pvalue=(Low_limit, High_limit), Range=(10 100)
- #self._2mPattern = re.compile('\s*(\S+)\s*[=in]{1,2}\s*\(\s*([-\d\.]+)[, \t]+([-\d\.]+)[, \t]*([-\d\.]*)\s*\)')
- #
- ##XZ: self._3mPattern examples: Position=(Chr1 98 104), Pos=(Chr1 98 104), Mb=(Chr1 98 104), CisLRS=(Low_LRS_limit, High_LRS_limit, Mb_buffer), TransLRS=(Low_LRS_limit, High_LRS_limit, Mb_buffer)
- #self._3mPattern = re.compile('\s*(\S+)\s*[=in]{1,2}\s*\(\s*[Cc][Hh][Rr]([^, \t]+)[, \t]+([-\d\.]+)[, \t]+([-\d\.]+)\s*\)')
- #
- ##XZ: self._5mPattern examples: LRS=(Low_LRS_limit, High_LRS_limit, ChrNN, Mb_Low_Limit, Mb_High_Limit)
- #self._5mPattern = re.compile('\s*(\S+)\s*[=in]{1,2}\s*\(\s*([-\d\.]+)[, \t]+([-\d\.]+)[, \t]+[Cc][Hh][Rr]([^, \t]+)[, \t]+([-\d\.]+)[, \t]+([-\d\.]+)\s*\)')
-
- #Error, No keyword input
- #if not (self.ORkeyword or self.ANDkeyword):
- # heading = "Search Result"
- # detail = ["Please make sure to enter either your search terms (genes, traits, markers), or advanced search commands."]
- # self.error(heading=heading,detail=detail,error="No search terms were entered")
- # return
-
- #query clauses
- #self.ANDQuery = []
- #self.ORQuery = []
- ##descriptions, one for OR search, one for AND search
- #self.ANDDescriptionText = []
- #self.ORDescriptionText = []
-
- #if not self.normalSearch():
- # return
- #if not self.patternSearch():
- # return
- #if not self.assembleQuery():
- # return
- #self.nresults = self.executeQuery()
- #
- #if len(self.dataset) > 1:
- # dbUrl = "Multiple phenotype datasets"
- # dbUrlLink = " were"
- #else:
- # dbUrl = self.dataset[0].genHTML()
- # dbUrlLink = " was"
-
- #SearchText = HT.Blockquote('GeneNetwork searched the ', dbUrl, ' for all records ')
- #if self.ORkeyword2:
- # NNN = len(self.ORkeyword2)
- # if NNN > 1:
- # SearchText.append(' that match the terms ')
- # else:
- # SearchText.append(' that match the term ')
- # for j, term in enumerate(self.ORkeyword2):
- # SearchText.append(HT.U(term))
- # if NNN > 1 and j < NNN-2:
- # SearchText.append(", ")
- # elif j == NNN-2:
- # SearchText.append(", or ")
- # else:
- # pass
- #if self.ORDescriptionText:
- # if self.ORkeyword2:
- # SearchText.append("; ")
- # else:
- # SearchText.append(" ")
- # for j, item in enumerate(self.ORDescriptionText):
- # SearchText.append(item)
- # if j < len(self.ORDescriptionText) -1:
- # SearchText.append(";")
- #
- #if (self.ORkeyword2 or self.ORDescriptionText) and (self.ANDkeyword2 or self.ANDDescriptionText):
- # SearchText.append("; ")
- #if self.ANDkeyword2:
- # if (self.ORkeyword2 or self.ORDescriptionText):
- # SearchText.append(' records')
- # NNN = len(self.ANDkeyword2)
- # if NNN > 1:
- # SearchText.append(' that match the terms ')
- # else:
- # SearchText.append(' that match the term ')
- # for j, term in enumerate(self.ANDkeyword2):
- # SearchText.append(HT.U(term))
- # if NNN > 1 and j < NNN-2:
- # SearchText.append(", ")
- # elif j == NNN-2:
- # SearchText.append(", and ")
- # else:
- # pass
- #if self.ANDDescriptionText:
- # if self.ANDkeyword2:
- # SearchText.append(" and ")
- # else:
- # SearchText.append(" ")
- # for j, item in enumerate(self.ANDDescriptionText):
- # SearchText.append(item)
- # if j < len(self.ANDDescriptionText) -1:
- # SearchText.append(" and ")
- #
- #SearchText.append(". ")
- #if self.nresults == 0:
- # heading = "Search Result"
- # detail = ["Sorry, GeneNetwork did not find any records matching your request. Please check the syntax or try the ANY rather than the ALL field."]
- # self.error(heading=heading,intro = SearchText.contents,detail=detail,error="Not Found")
- # return
- #elif self.nresults == 1:
- # SearchText.append(HT.P(), 'GeneNetwork found one record that matches your request. To study this record, click on its text below. To add this record to your Selection window, use the checkbox and then click the ', HT.Strong('Add to Collection'),' button. ')
- #elif self.nresults >= 1 and self.nresults <= self.maxReturn:
- # SearchText.append(HT.P(), 'GeneNetwork found a total of ', HT.Span(self.nresults, Class='fwb cr'), ' records. To study any one of these records, click on its ID below. To add one or more records to your Selection window, use the checkbox and then click the ' , HT.Strong('Add to Collection'),' button. ')
- #else:
- # SearchText.append(' A total of ',HT.Span(self.nresults, Class='fwb cr'), ' records were found.')
- # heading = "Search Result"
- # # Modified by Hongqiang Li
- # # detail = ["The terms you entered match %d records. Please modify your search to generate %d or fewer matches, or review " % (self.nresults, self.maxReturn), HT.Href(text='Search Help', target='_blank', url='http://web2qtl.utmem.edu/searchHelp.html', Class='fs14'), " to learn more about syntax and the use of wildcard characters."]
- # detail = ["The terms you entered match %d records. Please modify your search to generate %d or fewer matches, or review " % (self.nresults, self.maxReturn), HT.Href(text='Search Help', target='_blank', url='%s/searchHelp.html' % webqtlConfig.PORTADDR, Class='fs14'), " to learn more about syntax and the use of wildcard characters."]
- # #
- # self.error(heading=heading,intro = SearchText.contents,detail=detail,error="Over %d" % self.maxReturn)
- # return
-
-
- #TD_LR.append(HT.Paragraph('Search Results', Class="title"), SearchText)
-
- #self.dict['body'] = str(TD_LR)
- #self.dict['js1'] = ''
- #self.dict['js2'] = 'onLoad="pageOffset()"'
- #self.dict['layer'] = self.generateWarningLayer()
-
def gen_search_result(self):
- #pageTable = HT.TableLite(cellSpacing=2,cellPadding=0,width="100%",border=0)
-
- #last_result = False
-
self.trait_list = []
# result_set represents the results for each search term; a search of
# "shh grin2b" would have two sets of results, one for each term
- for result_set in self.results:
- for result in result_set:
- if not result:
- continue
- #last_result = False
-
- seq = 1
- group = self.dataset.group
- self.form_name = form_name = 'show_dataset_'+group
-
- tblobj = {}
- species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=group)
-
- #### Excel file
-
- # Todo: Replace this with official Python temp file naming functions?
- filename= webqtlUtil.genRandStr("Search_")
- #xlsUrl = HT.Input(type='button', value = 'Download Table', onClick= "location.href='/tmp/%s.xls'" % filename, Class='button')
- # Create a new Excel workbook
- #workbook = xl.Writer('%s.xls' % (webqtlConfig.TMPDIR+filename))
- #headingStyle = workbook.add_format(align = 'center', bold = 1, border = 1, size=13, fg_color = 0x1E, color="white")
-
- #XZ, 3/18/2010: pay attention to the line number of header in this file. As of today, there are 7 lines.
- #worksheet = self.createExcelFileWithTitleAndFooter(workbook=workbook, db=this_trait.db, returnNumber=len(self.trait_list))
- newrow = 7
-
- #### Excel file stuff stops
-
- if self.dataset.type == "ProbeSet":
- #for item in result:
- print("foo locals are:", locals())
- probe_set_id = result[1]
- print("probe_set_id is:", pf(probe_set_id))
- this_trait = webqtlTrait(db=self.dataset, name=probe_set_id, cursor=self.cursor)
- this_trait.retrieveInfo(QTL=True)
- print("this_trait is:", pf(this_trait))
- self.trait_list.append(this_trait)
- print("self.trait_list is:", pf(self.trait_list))
-
- #tblobj['header'] = self.getTableHeaderForProbeSet(worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
-
- #newrow += 1
-
- sortby = self.getSortByValue(datasetType="ProbeSet")
-
- tblobj['body'] = self.getTableBodyForProbeSet(trait_list=self.trait_list, formName=self.form_name, newrow=newrow, species=species)
-
- #workbook.close()
- #objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb')
- #cPickle.dump(tblobj, objfile)
- #objfile.close()
-
- #div = HT.Div(webqtlUtil.genTableObj(tblobj, filename, sortby), Id="sortable")
-
- #pageTable.append(HT.TR(HT.TD(div)))
- elif self.dataset.type == "Publish":
- #tblobj['header'] = self.getTableHeaderForPublish(worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
-
- #newrow += 1
-
- sortby = self.getSortByValue(datasetType="Publish")
-
- #tblobj['body'] = self.getTableBodyForPublish(trait_list=self.trait_list, formName=mainfmName, worksheet=worksheet, newrow=newrow, species=species)
-
- #workbook.close()
- #objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb')
- #cPickle.dump(tblobj, objfile)
- #objfile.close()
-
- #div = HT.Div(webqtlUtil.genTableObj(tblobj, filename, sortby), Id="sortable")
-
- #pageTable.append(HT.TR(HT.TD(div)))
- elif self.dataset.type == "Geno":
- tblobj['header'] = self.getTableHeaderForGeno(worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
-
- newrow += 1
- sortby = self.getSortByValue(datasetType="Geno")
-
- #tblobj['body'] = self.getTableBodyForGeno(trait_list=self.trait_list, form_name=form_name, worksheet=worksheet, newrow=newrow)
-
- #workbook.close()
- #objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb')
- #cPickle.dump(tblobj, objfile)
- #objfile.close()
-
- #div = HT.Div(webqtlUtil.genTableObj(tblobj, filename, sortby), Id="sortable")
- #
- #pageTable.append(HT.TR(HT.TD(div)))
-
-
- #traitForm = HT.Form(cgi= os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name=thisFormName, submit=HT.Input(type='hidden'))
- hddn = {'FormID':'showDatabase','ProbeSetID':'_','database':'_','CellID':'_','group':group}
- hddn['incparentsf1']='ON'
+ print("self.results is:", pf(self.results))
+ for result in self.results:
+ if not result:
+ continue
+
+ seq = 1
+ group = self.dataset.group
+ self.form_name = form_name = 'show_dataset_'+group
+
+ tblobj = {}
+ species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=group)
+
+ #### Excel file
+
+ # Todo: Replace this with official Python temp file naming functions?
+ filename= webqtlUtil.genRandStr("Search_")
+ #xlsUrl = HT.Input(type='button', value = 'Download Table', onClick= "location.href='/tmp/%s.xls'" % filename, Class='button')
+ # Create a new Excel workbook
+ #workbook = xl.Writer('%s.xls' % (webqtlConfig.TMPDIR+filename))
+ #headingStyle = workbook.add_format(align = 'center', bold = 1, border = 1, size=13, fg_color = 0x1E, color="white")
+
+ #XZ, 3/18/2010: pay attention to the line number of header in this file. As of today, there are 7 lines.
+ #worksheet = self.createExcelFileWithTitleAndFooter(workbook=workbook, db=this_trait.db, returnNumber=len(self.trait_list))
+ newrow = 7
+
+ #### Excel file stuff stops
+
+ if self.dataset.type == "ProbeSet":
+ #for item in result:
+ print("foo locals are:", locals())
+ probe_set_id = result[0]
+ print("probe_set_id is:", pf(probe_set_id))
+ this_trait = webqtlTrait(db=self.dataset, name=probe_set_id, cursor=self.cursor)
+ this_trait.retrieveInfo(QTL=True)
+ print("this_trait is:", pf(this_trait))
+ self.trait_list.append(this_trait)
+ elif self.dataset.type == "Publish":
+ newrow += 1
+ tblobj['body'] = self.getTableBodyForPublish(trait_list=self.trait_list, formName=mainfmName, worksheet=worksheet, newrow=newrow, species=species)
+ elif self.dataset.type == "Geno":
+ newrow += 1
+ tblobj['body'] = self.getTableBodyForGeno(trait_list=self.trait_list, form_name=form_name, worksheet=worksheet, newrow=newrow)
+
+ #traitForm = HT.Form(cgi= os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name=thisFormName, submit=HT.Input(type='hidden'))
+ hddn = {'FormID':'showDatabase','ProbeSetID':'_','database':'_','CellID':'_','group':group}
+ hddn['incparentsf1']='ON'
# for key in hddn.keys():
# traitForm.append(HT.Input(name=key, value=hddn[key], type='hidden'))
#
@@ -468,169 +241,13 @@ class SearchResultPage(templatePage):
# last_result = True
#if last_result:
# TD_LR.contents.pop()
-
- def executeQuery(self):
-
- ##construct sorting
- if self.dbType == "Publish":
- sortQuery = " order by Publication_PubMed_ID desc, Phenotype_Name, thistable"
- elif self.dbType == "Geno":
- if not self.orderByUserInput:
- if self.orderByDefalut:
- self.orderByUserInput = self.orderByDefalut
- else:
- self.orderByUserInput = "POSITION"
- if self.orderByUserInput.upper() in ["POS", "POSITION", "MB"]:
- self.orderByUserInput = "POSITION"
- else:
- pass
- self.orderByUserInput = self.orderByUserInput.upper()
- self.orderByUserInputOrig = self.orderByUserInput[:]
- if self.orderByUserInput == "NAME":
- sortQuery = " order by Geno_Name, Geno_chr_num, Geno_Mb"
- elif self.orderByUserInput == "SOURCE":
- sortQuery = " order by Geno_Source2, Geno_chr_num, Geno_Mb"
- else:
- sortQuery = " order by Geno_chr_num, Geno_Mb"
- #ProbeSet
- else:
- if not self.orderByUserInput:
- if self.orderByDefalut:
- self.orderByUserInput = self.orderByDefalut
- else:
- self.orderByUserInput = "POSITION"
-
- self.orderByUserInput = self.orderByUserInput.upper()
- self.orderByUserInputOrig = self.orderByUserInput[:]
- #XZ: 8/18/2009: "POSITION-"
- if self.orderByUserInput[-1] == '-':
- self.orderByUserInput = self.orderByUserInput[:-1]
- sortDesc = 'desc'
- else:
- sortDesc = ''
-
- if self.orderByUserInput in ["MEAN", "LRS", "PVALUE"]:
- #sortQuery = " order by T%s %s, TNAME, thistable desc" % (self.orderByUserInput, sortDesc)
- sortQuery = " order by T%s desc, TNAME, thistable desc" % self.orderByUserInput
- elif self.orderByUserInput in ["POS", "POSITION", "MB"]:
- sortQuery = " order by TCHR_NUM %s, TMB %s, TNAME, thistable desc" % (sortDesc, sortDesc)
- elif self.orderByUserInput == 'SYMBOL':
- sortQuery = " order by TSYMBOL, thistable desc"
- else:
- sortQuery = " order by TNAME_NUM, thistable desc"
-
- if self.singleCross:
- if len(self.query) > 1:
- searchQuery = map(lambda X:'(%s)' % X, self.query)
- searchQuery = string.join(searchQuery, ' UNION ALL ')
- else:
- searchQuery = self.query[0]
- searchQuery += sortQuery
- #searchCountQuery retrieve all the results
- searchCountQuery = [searchQuery]
- #searchQuery = searchQuery + " limit %d,%d" % (self.pageNumber*self.NPerPage, self.NPerPage) // We removed the page limit - Zach 2/22/11
- searchQuery = [searchQuery]
- else:
- searchCountQuery = searchQuery = map(lambda X: X+sortQuery, self.query)
-
- allResults = []
- self.results = []
- for item in searchCountQuery:
- start_time = datetime.datetime.now()
- _log.info("Executing query: %s"%(item))
- self.cursor.execute(item)
- allResults.append(self.cursor.fetchall())
- end_time = datetime.datetime.now()
- _log.info("Total time: %s"%(end_time-start_time))
-
- _log.info("Done executing queries")
-
- #searchCountQuery retrieve all the results, for counting use only
- if searchCountQuery != searchQuery:
- for item in searchQuery:
- self.cursor.execute(item)
- self.results.append(self.cursor.fetchall())
- else:
- self.results = allResults
-
- nresults = reduce(lambda Y,X:len(X)+Y, allResults, 0)
- return nresults
-
-
- def assembleQuery(self):
- self.query = []
- if self.ANDQuery or self.ORQuery:
- clause = self.ORQuery[:]
-
- for j, database in enumerate(self.dataset):
- if self.ANDQuery:
- clause.append(" (%s) " % string.join(self.ANDQuery, " AND "))
-
- newclause = []
-
- for item in clause:
- ##need to retrieve additional field which won't be used
- ##in the future, for sorting purpose only
- if self.dbType == "Publish":
- if item.find("Geno.name") < 0:
- incGenoTbl = ""
- else:
- incGenoTbl = " Geno, "
- newclause.append("""SELECT %d, PublishXRef.Id,
- PublishFreeze.createtime as thistable,
- Publication.PubMed_ID as Publication_PubMed_ID,
- Phenotype.Post_publication_description as Phenotype_Name
- FROM %s PublishFreeze, Publication, PublishXRef,
- Phenotype WHERE PublishXRef.InbredSetId = %d and %s and
- PublishXRef.PhenotypeId = Phenotype.Id and
- PublishXRef.PublicationId = Publication.Id and
- PublishFreeze.Id = %d""" % (j, incGenoTbl,
- self.dataset_group_ids[j], item, database.id))
- elif self.dbType == "ProbeSet":
- if item.find("GOgene") < 0:
- incGoTbl = ""
- else:
- incGoTbl = """ ,db_GeneOntology.term as GOterm,
- db_GeneOntology.association as GOassociation,
- db_GeneOntology.gene_product as GOgene_product """
- if item.find("Geno.name") < 0:
- incGenoTbl = ""
- else:
- incGenoTbl = " Geno, "
- if item.find("GeneRIF_BASIC.") < 0:
- incGeneRIFTbl = ""
- else:
- incGeneRIFTbl = " GeneRIF_BASIC, "
- if item.find("GeneRIF.") < 0:
- incGeneRIFTbl += ""
- else:
- incGeneRIFTbl += " GeneRIF, "
- newclause.append("""SELECT distinct %d, ProbeSet.Name as TNAME, 0 as thistable,
- ProbeSetXRef.Mean as TMEAN, ProbeSetXRef.LRS as TLRS, ProbeSetXRef.PVALUE as TPVALUE,
- ProbeSet.Chr_num as TCHR_NUM, ProbeSet.Mb as TMB, ProbeSet.Symbol as TSYMBOL,
- ProbeSet.name_num as TNAME_NUM FROM %s%s ProbeSetXRef, ProbeSet %s
- WHERE %s and ProbeSet.Id = ProbeSetXRef.ProbeSetId and ProbeSetXRef.ProbeSetFreezeId = %d
- """ % (j, incGeneRIFTbl, incGenoTbl, incGoTbl, item, database.id))
- elif self.dbType == "Geno":
- newclause.append("""SELECT %d, Geno.Name, GenoFreeze.createtime as thistable,
- Geno.Name as Geno_Name, Geno.Source2 as Geno_Source2,
- Geno.chr_num as Geno_chr_num, Geno.Mb as Geno_Mb FROM
- GenoXRef, GenoFreeze, Geno WHERE %s and Geno.Id
- = GenoXRef.GenoId and GenoXRef.GenoFreezeId =
- GenoFreeze.Id and GenoFreeze.Id = %d""" % (
- j, item, database.id))
- else:
- pass
-
- searchQuery = map(lambda X:'(%s)' % X, newclause)
- searchQuery = string.join(searchQuery, ' UNION ')
- self.query.append(searchQuery)
- return 1
- else:
- heading = "Search Result"
- detail = ["No keyword was entered for this search, please go back and enter your keyword."]
- self.error(heading=heading,detail=detail,error="No Keyword")
- return 0
+
+ if self.dataset.type == "ProbeSet":
+ tblobj['body'] = self.getTableBodyForProbeSet(trait_list=self.trait_list, formName=self.form_name, newrow=newrow, species=species)
+ elif self.dataset.type == "Publish":
+ tblobj['body'] = self.getTableBodyForPublish(trait_list=self.trait_list, formName=mainfmName, worksheet=worksheet, newrow=newrow, species=species)
+ elif self.dataset.type == "Geno":
+ tblobj['body'] = self.getTableBodyForGeno(trait_list=self.trait_list, form_name=form_name, worksheet=worksheet, newrow=newrow)
def search(self):
@@ -641,165 +258,20 @@ class SearchResultPage(templatePage):
self.results = []
for a_search in self.search_terms:
print("[kodak] item is:", pf(a_search))
- search_term = None
- search_type = None
- if "search_term" in a_search:
- search_term = a_search['search_term']
- elif key in a_search:
- search_type = a_search['key']
+ search_term = a_search['search_term']
+ search_type = a_search['key']
+ if not search_type:
+ # We fall back to the dataset type as the key to get the right object
+ search_type = self.dataset.type
+
+ search_ob = do_search.DoSearch.get_search(search_type)
+ search_class = getattr(do_search, search_ob)
+ self.results.extend(search_class(search_term,
+ self.dataset,
+ self.cursor,
+ self.db_conn).run())
-
- if search_term:
- searches = dict(
- ProbeSet = "ProbeSetSearch",
- Publish = "PhenotypeSearch",
- Geno = "GenotypeSearch",
- )
- if self.dataset.type in searches:
- search_ob = searches[self.dataset.type]
- #if self.dataset.type == "ProbeSet":
- # search_ob = "ProbeSetSearch"
- #elif self.dataset.type == "Publish":
- # search_ob = "PhenotypeSearch"
- #elif self.dataset.type == "Geno":
- # search_ob = "GenotypeSearch"
- else:
- SearchTermNeedsToBeDefined # Cause an error on purpose
- search_class = getattr(do_search, search_ob)
- results = search_class(search_term,
- self.dataset,
- self.cursor,
- self.db_conn).run()
-
- print("in the search results are:", results)
-
-## clause_item = (
-##""" MATCH (ProbeSet.Name,
-## ProbeSet.description,
-## ProbeSet.symbol,
-## alias,
-## GenbankId,
-## UniGeneId,
-## Probe_Target_Description)
-## AGAINST ('%s' IN BOOLEAN MODE) """ % self.db_conn.escape_string(search_term))
-# if self.dataset.type == "ProbeSet":
-#
-# query = (
-#"""SELECT distinct 0,
-# ProbeSet.Name as TNAME,
-# 0 as thistable,
-# ProbeSetXRef.Mean as TMEAN,
-# ProbeSetXRef.LRS as TLRS,
-# ProbeSetXRef.PVALUE as TPVALUE,
-# ProbeSet.Chr_num as TCHR_NUM,
-# ProbeSet.Mb as TMB,
-# ProbeSet.Symbol as TSYMBOL,
-# ProbeSet.name_num as TNAME_NUM
-# FROM ProbeSetXRef, ProbeSet
-# WHERE (MATCH (ProbeSet.Name,
-# ProbeSet.description,
-# ProbeSet.symbol,
-# alias,
-# GenbankId,
-# UniGeneId,
-# Probe_Target_Description)
-# AGAINST ('%s' IN BOOLEAN MODE))
-# and ProbeSet.Id = ProbeSetXRef.ProbeSetId
-# and ProbeSetXRef.ProbeSetFreezeId = %s
-# """ % (self.db_conn.escape_string(search_term),
-# self.db_conn.escape_string(str(self.dataset.id))))
-#
-# elif self.dataset.type == "Publish":
-# include_geno = ""
-# if search_term.find("Geno.name") >= 0:
-# include_geno = " Geno, "
-#
-# if self.matchwhole and item.find("'") < 0:
-# item = "[[:<:]]"+ item+"[[:>:]]"
-# clause2 = []
-# for field in self.searchField:
-# if self.dbType == "Publish":
-# clause2.append("%s REGEXP \"%s\"" % (field,item))
-# else:
-# clause2.append("%s REGEXP \"%s\"" % ("%s.%s" % (self.dbType,field),item))
-#
-#
-# query = (
-#"""SELECT 0, PublishXRef.Id, PublishFreeze.createtime as thistable,
-# Publication.PubMed_ID as Publication_PubMed_ID,
-# Phenotype.Post_publication_description as Phenotype_Name
-# FROM %s PublishFreeze, Publication, PublishXRef, Phenotype
-# WHERE (MATCH (ProbeSet.Name,
-# ProbeSet.description,
-# ProbeSet.symbol,
-# alias,
-# GenbankId,
-# UniGeneId,
-# Probe_Target_Description)
-# AGAINST ('%s' IN BOOLEAN MODE)) and
-# PublishXRef.InbredSetId = %s and
-# PublishXRef.PhenotypeId = Phenotype.Id and
-# PublishXRef.PublicationId = Publication.Id and
-# PublishFreeze.Id = %s
-# """ % (include_geno,
-# self.db_conn.escape_string(search_term),
-# self.db_conn.escape_string(str(self.dataset.group_id)),
-# self.db_conn.escape_string(str(self.dataset.id))))
-#
-# elif self.dataset.type == "Geno":
-# query = (
-#"""SELECT 0, Geno.Name, GenoFreeze.createtime as thistable,
-# Geno.Name as Geno_Name,
-# Geno.Source2 as Geno_Source2,
-# Geno.chr_num as Geno_chr_num,
-# Geno.Mb as Geno_Mb
-# FROM GenoXRef, GenoFreeze, Geno
-# WHERE (MATCH (ProbeSet.Name,
-# ProbeSet.description,
-# ProbeSet.symbol,
-# alias,
-# GenbankId,
-# UniGeneId,
-# Probe_Target_Description)
-# AGAINST ('%s' IN BOOLEAN MODE)) and
-# and Geno.Id = GenoXRef.GenoId and
-# GenoXRef.GenoFreezeId = GenoFreeze.Id and
-# GenoFreeze.Id = %d
-# """% (self.db_conn.escape_string(search_term),
-# self.db_conn.escape_string(str(self.dataset.id))))
-#
-#
-# self.cursor.execute(query)
-# self.results.append(self.cursor.fetchall())
-#
-# print("self.results is:", pf(self.results))
-#
-#
-#
-#
-# #if self.dataset.type == "ProbeSet" and search_term.find('.') < 0 and search_term.find('\'') < 0:
-# # full_text.append(search_term)
-# #else:
-# # if self.matchwhole and search_term.find("'") < 0:
-# # search_term = "[[:<:]]"+ search_term+"[[:>:]]"
-# # clause2 = []
-# # for field in self.search_fields:
-# # if self.dataset.type == "Publish":
-# # clause2.append("%s REGEXP \"%s\"" % (field,search_term))
-# # else:
-# # clause2.append("%s REGEXP \"%s\"" % ("%s.%s" % (self.dataset.type,field),search_term))
-# # clause_item = "(%s)" % string.join(clause2, clausejoin)
-# # query.append(" (%s) " % clause_item)
-# #if ANDFulltext:
-# # clauseItem = """ MATCH (ProbeSet.Name,ProbeSet.description,ProbeSet.symbol,
-# # alias,GenbankId, UniGeneId, Probe_Target_Description)
-# # AGAINST ('+%s' IN BOOLEAN MODE) """ % string.join(ANDFulltext, " +")
-# # self.ANDQuery.append(" (%s) " % clauseItem)
-# #if ORFulltext:
-# #clauseItem = """ MATCH (ProbeSet.Name,ProbeSet.description,ProbeSet.symbol,alias,
-# #GenbankId, UniGeneId, Probe_Target_Description) AGAINST ('%s' IN BOOLEAN MODE)
-# #""" % string.join(full_text, " ")
-# #self.query.append(" (%s) " % clauseItem)
+ print("in the search results are:", self.results)
def encregexp(self,str):
@@ -819,239 +291,6 @@ class SearchResultPage(templatePage):
return wildcardkeyword
-
- def patternSearch(self):
- # Lei Yan
- ##Process Inputs
- m1_AND = self._1mPattern.findall(self.ANDkeyword)
- m2_AND = self._2mPattern.findall(self.ANDkeyword)
- m3_AND = self._3mPattern.findall(self.ANDkeyword)
- m5_AND = self._5mPattern.findall(self.ANDkeyword)
- m1_OR = self._1mPattern.findall(self.ORkeyword)
- m2_OR = self._2mPattern.findall(self.ORkeyword)
- m3_OR = self._3mPattern.findall(self.ORkeyword)
- m5_OR = self._5mPattern.findall(self.ORkeyword)
-
- #pattern search
- if m1_AND or m1_OR or m2_AND or m2_OR or m3_AND or m3_OR or m5_AND or m5_OR:
-
- self.orderByDefalut = 'PROBESETID'
-
- _1Cmds = map(string.upper, map(lambda x:x[0], m1_AND + m1_OR))
- _2Cmds = map(string.upper, map(lambda x:x[0], m2_AND + m2_OR))
- _3Cmds = map(string.upper, map(lambda x:x[0], m3_AND + m3_OR))
- _5Cmds = map(string.upper, map(lambda x:x[0], m5_AND + m5_OR))
-
- self.nkeywords += len(_1Cmds) + len(_2Cmds) + len(_3Cmds)
-
- if self.dbType == "Publish" and \
- ( (_2Cmds and reduce(lambda x, y: (y not in ["LRS"]) or x, _2Cmds, False))\
- or (_5Cmds and reduce(lambda x, y: (y not in ["LRS"]) or x, _5Cmds, False)) ):
- heading = "Search Result"
- detail = ["Pattern search is not available for phenotype databases at this time."]
- self.error(heading=heading,detail=detail,error="Error")
- return 0
- elif (self.dbType == "ProbeSet" and
- ((_2Cmds and reduce(lambda x, y: (y not in [
- "MEAN", "LRS", "PVALUE", "TRANSLRS", "CISLRS", "RANGE", "H2"
- ]) or x, _2Cmds, False))\
- or (_3Cmds and reduce(lambda x, y: (y not in ["POS", "POSITION", "MB"]) or x, _3Cmds, False))\
- or (_5Cmds and reduce(lambda x, y: (y not in ["LRS"]) or x, _5Cmds, False))\
- or (_1Cmds and reduce(lambda x, y: (
- y not in ["FLAG", "STRAND_PROBE", "STRAND_GENE", "GO", "WIKI", "RIF", "GENEID"]
- ) or x, _1Cmds, False)))):
- heading = "Search Result"
- detail = ["You entered at least one incorrect search command."]
- self.error(heading=heading,detail=detail,error="Error")
- return 0
- elif self.dbType == "Geno" and (_1Cmds or _2Cmds or _5Cmds or (_3Cmds and reduce(
- lambda x, y: (y not in ["POS", "POSITION", "MB"]) or x, _3Cmds, False)) ):
- heading = "Search Result"
- detail = ["You entered at least one incorrect search command."]
- self.error(heading=heading,detail=detail,error="Error")
- return 0
- else:
- for k, item in enumerate(m1_OR+m1_AND):
- if k >=len(m1_OR):
- query = self.ANDQuery
- DescriptionText = self.ANDDescriptionText
- else:
- query = self.ORQuery
- DescriptionText = self.ORDescriptionText
-
- if item[1] == '-':
- strandName = 'minus'
- elif item[1] == '+':
- strandName = 'plus'
- else:
- strandName = item[1]
-
- if item[0].upper() in ("FLAG"):
- clauseItem = " %s.%s = %s " % (self.dbType, item[0], item[1])
- DescriptionText.append(HT.Span(' with ', HT.U('FLAG'), ' equal to ', item[1]))
- elif item[0].upper() in ("WIKI"):
- clauseItem = " %s.symbol = GeneRIF.symbol and GeneRIF.versionId=0 and GeneRIF.display>0 and (GeneRIF.comment REGEXP \"%s\" or GeneRIF.initial = \"%s\") " % (self.dbType, "[[:<:]]"+ item[1]+"[[:>:]]", item[1])
- DescriptionText.append(HT.Span(' with GeneWiki contains ', HT.U(item[1])))
- elif item[0].upper() in ("RIF"):
- clauseItem = " %s.symbol = GeneRIF_BASIC.symbol and MATCH (GeneRIF_BASIC.comment) AGAINST ('+%s' IN BOOLEAN MODE) " % (self.dbType, item[1])
- DescriptionText.append(HT.Span(' with GeneRIF contains ', HT.U(item[1])))
- elif item[0].upper() in ("GENEID"):
- clauseItem = " %s.GeneId in ( %s ) " % (self.dbType, string.replace(item[1], '-', ', '))
- DescriptionText.append(HT.Span(' with Entrez Gene ID in ', HT.U(string.replace(item[1], '-', ', '))))
- elif item[0].upper() in ("GO"):
- Field = 'GOterm.acc'
- Id = 'GO:'+('0000000'+item[1])[-7:]
- Statements = '%s.symbol=GOgene_product.symbol and GOassociation.gene_product_id=GOgene_product.id and GOterm.id=GOassociation.term_id' % (self.dbType);
- clauseItem = " %s = '%s' and %s " % (Field, Id, Statements)
- #self.incGoTbl = " ,db_GeneOntology.term as GOterm, db_GeneOntology.association as GOassociation, db_GeneOntology.gene_product as GOgene_product "
- DescriptionText.append(HT.Span(' with ', HT.U('GO'), ' ID equal to ', Id))
- else:
- clauseItem = " %s.%s = '%s' " % (self.dbType, item[0], item[1])
- if item[0].upper() in ["STRAND_PROBE"]:
- DescriptionText.append(' with probe on the %s strand' % strandName)
- elif item[0].upper() in ["STRAND_GENE"]:
- DescriptionText.append(' with gene on the %s strand' % strandName)
- else:
- pass
- query.append(" (%s) " % clauseItem)
-
- for k, item in enumerate(m2_OR+m2_AND):
- if k >=len(m2_OR):
- query = self.ANDQuery
- DescriptionText = self.ANDDescriptionText
- else:
- query = self.ORQuery
- DescriptionText = self.ORDescriptionText
-
- itemCmd = item[0]
- lower_limit = float(item[1])
- upper_limit = float(item[2])
-
- if itemCmd.upper() in ("TRANSLRS", "CISLRS"):
- if item[3]:
- mthresh = float(item[3])
- clauseItem = " %sXRef.LRS > %2.7f and %sXRef.LRS < %2.7f " % \
- (self.dbType, min(lower_limit, upper_limit), self.dbType, max(lower_limit, upper_limit))
- if itemCmd.upper() == "CISLRS":
- clauseItem += """ and %sXRef.Locus = Geno.name and Geno.SpeciesId = %s and %s.Chr = Geno.Chr and ABS(%s.Mb-Geno.Mb) < %2.7f """ % (self.dbType, self.speciesId, self.dbType, self.dbType, mthresh)
- DescriptionText.append(HT.Span(' with a ', HT.U('cis-QTL'), ' having an LRS between %g and %g using a %g Mb exclusion buffer' % (min(lower_limit, upper_limit), max(lower_limit, upper_limit), mthresh)))
- else:
- clauseItem += """ and %sXRef.Locus = Geno.name and Geno.SpeciesId = %s and (%s.Chr != Geno.Chr or (%s.Chr != Geno.Chr and ABS(%s.Mb-Geno.Mb) > %2.7f)) """ % (self.dbType, self.speciesId, self.dbType, self.dbType, self.dbType, mthresh)
- DescriptionText.append(HT.Span(' with a ', HT.U('trans-QTL'), ' having an LRS between %g and %g using a %g Mb exclusion buffer' % (min(lower_limit, upper_limit), max(lower_limit, upper_limit), mthresh)))
- query.append(" (%s) " % clauseItem)
- self.orderByDefalut = "LRS"
- else:
- pass
- elif itemCmd.upper() in ("RANGE"):
- #XZ, 03/05/2009: Xiaodong changed Data to ProbeSetData
- clauseItem = " (select Pow(2, max(value) -min(value)) from ProbeSetData where Id = ProbeSetXRef.dataId) > %2.7f and (select Pow(2, max(value) -min(value)) from ProbeSetData where Id = ProbeSetXRef.dataId) < %2.7f " % (min(lower_limit, upper_limit), max(lower_limit, upper_limit))
- query.append(" (%s) " % clauseItem)
- DescriptionText.append(HT.Span(' with a range of expression that varied between %g and %g' % (min(lower_limit, upper_limit), max(lower_limit, upper_limit)), " (fold difference)"))
- else:
- clauseItem = " %sXRef.%s > %2.7f and %sXRef.%s < %2.7f " % \
- (self.dbType, itemCmd, min(lower_limit, upper_limit), self.dbType, itemCmd, max(lower_limit, upper_limit))
- query.append(" (%s) " % clauseItem)
- self.orderByDefalut = itemCmd
- DescriptionText.append(HT.Span(' with ', HT.U(itemCmd), ' between %g and %g' % (min(lower_limit, upper_limit), max(lower_limit, upper_limit))))
-
- for k, item in enumerate(m3_OR+m3_AND):
- print("enumerating m3_OR+m3_AND with k: %s - item %s" % (k, item))
- if self.dbType not in ("ProbeSet", "Geno"):
- continue
- if k >=len(m3_OR):
- query = self.ANDQuery
- DescriptionText = self.ANDDescriptionText
- else:
- query = self.ORQuery
- DescriptionText = self.ORDescriptionText
- itemCmd = item[0]
-
-
- chr_number = item[1] # chromosome number
- lower_limit = float(item[2])
- upper_limit = float(item[3])
-
- if self.dbType == "ProbeSet":
- fname = 'target genes'
- elif self.dbType == "Geno":
- fname = 'loci'
-
- if lower_limit > upper_limit:
- lower_limit, upper_limit = upper_limit, lower_limit
-
-
- clauseItem = " %s.Chr = '%s' and %s.Mb > %2.7f and %s.Mb < %2.7f " % (
- self.dbType, chr_number, self.dbType, lower_limit, self.dbType, upper_limit)
-
-
- query.append(" (%s) " % clauseItem)
- self.orderByDefalut = itemCmd
-
- self.results_desc = dict()
- #DescriptionText.append(HT.Span(' with ', HT.U('target genes'), ' on chromosome %s between %g and %g Mb' % \
- # (chr_number, min(lower_limit, upper_limit), max(lower_limit, upper_limit))))
-
- for k, item in enumerate(m5_OR+m5_AND):
- if k >=len(m5_OR):
- query = self.ANDQuery
- DescriptionText = self.ANDDescriptionText
- else:
- query = self.ORQuery
- DescriptionText = self.ORDescriptionText
- itemCmd = item[0]
- lower_limit = float(item[1])
- upper_limit = float(item[2])
- chr_number = item[3]
- mb_lower_limit = float(item[4])
- mb_upper_limit = float(item[5])
- if self.dbType == "ProbeSet" or self.dbType == "Publish":
- clauseItem = " %sXRef.LRS > %2.7f and %sXRef.LRS < %2.7f " % \
- (self.dbType, min(lower_limit, upper_limit), self.dbType, max(lower_limit, upper_limit))
- clauseItem += " and %sXRef.Locus = Geno.name and Geno.SpeciesId = %s and Geno.Chr = '%s' and Geno.Mb > %2.7f and Geno.Mb < %2.7f" \
- % (self.dbType, self.speciesId, chr_number, min(mb_lower_limit, mb_upper_limit), max(mb_lower_limit, mb_upper_limit))
- query.append(" (%s) " % clauseItem)
- self.orderByDefalut = "MB"
- DescriptionText.append(HT.Span(' with ', HT.U('LRS'), ' between %g and %g' % \
- (min(lower_limit, upper_limit), max(lower_limit, upper_limit)), \
- ' on chromosome %s between %g and %g Mb' % \
- (chr_number, min(mb_lower_limit, mb_upper_limit), max(mb_lower_limit, mb_upper_limit))))
- pass
-
- return 1
-
- def generateWarningLayer(self):
-
- layerString = """
-
-
-
-
-
-
-
-
- Sort Table
-
-
-
-
-
- Resorting this table
-
-
-
-
-
-
-
-
-
-
- """
-
- return layerString
-
def getTableHeaderForGeno(self, worksheet=None, newrow=None, headingStyle=None):
tblobj_header = []
@@ -1112,26 +351,7 @@ class SearchResultPage(templatePage):
newrow += 1
return tblobj_body
-
- def getTableHeaderForPublish(self, worksheet=None, newrow=None, headingStyle=None):
-
- tblobj_header = []
-
- className = "fs13 fwb ffl b1 cw cbrb"
-
- tblobj_header = [[THCell(HT.TD(' ', Class=className, nowrap="on"), sort=0),
- THCell(HT.TD('Record',HT.BR(), 'ID',HT.BR(), Class=className, nowrap="on"), text="recond_id", idx=1),
- THCell(HT.TD('Phenotype',HT.BR(),HT.BR(), Class=className, nowrap="on"), text="pheno", idx=2),
- THCell(HT.TD('Authors',HT.BR(),HT.BR(), Class=className, nowrap="on"), text="auth", idx=3),
- THCell(HT.TD('Year',HT.BR(),HT.BR(), Class=className, nowrap="on"), text="year", idx=4),
- THCell(HT.TD('Max',HT.BR(), 'LRS', HT.BR(), Class="fs13 fwb ffl b1 cw cbrb", nowrap="on"), text="lrs", idx=5),
- THCell(HT.TD('Max LRS Location',HT.BR(),'Chr and Mb',HT.BR(), Class="fs13 fwb ffl b1 cw cbrb", nowrap="on"), text="lrs_location", idx=6)]]
-
- for ncol, item in enumerate(["Record", "Phenotype", "Authors", "Year", "Pubmed Id", "Max LRS", "Max LRS Location (Chr: Mb)"]):
- worksheet.write([newrow, ncol], item, headingStyle)
- worksheet.set_column([ncol, ncol], 2*len(item))
-
- return tblobj_header
+
def getTableBodyForPublish(self, trait_list, formName=None, worksheet=None, newrow=None, species=''):
@@ -1225,32 +445,13 @@ class SearchResultPage(templatePage):
return tblobj_body
- def getTableHeaderForProbeSet(self, worksheet=None, newrow=None, headingStyle=None):
-
- tblobj_header = []
-
- className = "fs13 fwb ffl b1 cw cbrb"
-
- #tblobj_header = [[THCell(HT.TD(' ', Class="fs13 fwb ffl b1 cw cbrb",nowrap='ON'), sort=0),
- # THCell(HT.TD('Record',HT.BR(), 'ID',HT.BR(), Class="fs13 fwb ffl b1 cw cbrb"), text="record_id", idx=1),
- # THCell(HT.TD('Symbol',HT.BR(),HT.BR(), Class="fs13 fwb ffl b1 cw cbrb"), text="symbol", idx=2),
- # THCell(HT.TD('Description',HT.BR(),HT.BR(), Class="fs13 fwb ffl b1 cw cbrb"), text="desc", idx=3),
- # THCell(HT.TD('Location',HT.BR(), 'Chr and Mb', HT.BR(), Class="fs13 fwb ffl b1 cw cbrb"), text="location", idx=4),
- # THCell(HT.TD('Mean',HT.BR(),'Expr',HT.BR(), Class="fs13 fwb ffl b1 cw cbrb"), text="mean", idx=5),
- # THCell(HT.TD('Max',HT.BR(),'LRS',HT.BR(), Class="fs13 fwb ffl b1 cw cbrb", nowrap='ON'), text="lrs", idx=6),
- # THCell(HT.TD('Max LRS Location',HT.BR(),'Chr and Mb',HT.BR(), Class="fs13 fwb ffl b1 cw cbrb", nowrap='ON'), text="lrs_location", idx=7)]]
- #
- #for ncol, item in enumerate(['Record', 'Gene ID', 'Homologene ID', 'Symbol', 'Description', 'Location (Chr, Mb)', 'Mean Expr', 'Max LRS', 'Max LRS Location (Chr: Mb)']):
- # worksheet.write([newrow, ncol], item, headingStyle)
- # worksheet.set_column([ncol, ncol], 2*len(item))
- return tblobj_header
-
- def getTableBodyForProbeSet(self, trait_list=[], primaryTrait=None, formName=None, worksheet=None, newrow=None, species=''):
+ def getTableBodyForProbeSet(self, trait_list=None, primaryTrait=None, formName=None, worksheet=None, newrow=None, species=''):
# Note: setting trait_list to [] is probably not a great idea.
tblobj_body = []
- className = "fs12 fwn b1 c222"
+ if not trait_list:
+ trait_list = []
for this_trait in trait_list:
@@ -1298,8 +499,6 @@ class SearchResultPage(templatePage):
if len(description_display) > 1 and description_display != 'N/A' and len(target_string) > 1 and target_string != 'None':
description_display = description_display + '; ' + target_string.strip()
- #tr.append(TDCell(HT.TD(description_display, Class=className), description_display, description_display))
-
# Save it for the jinja2 tablet
this_trait.description_display = description_display
@@ -1319,7 +518,6 @@ class SearchResultPage(templatePage):
trait_location_repr = 'Chr %s: %.4f Mb' % (this_trait.chr, float(this_trait.mb) )
this_trait.trait_location_repr = trait_location_repr
#this_trait.trait_location_value = trait_location_value
- tr.append(TDCell(HT.TD(trait_location_repr, Class=className, nowrap="on"), trait_location_repr, trait_location_value))
#XZ, 01/12/08: This SQL query is much faster.
query = (
@@ -1397,34 +595,10 @@ class SearchResultPage(templatePage):
tblobj_body.append(tr)
- #for ncol, item in enumerate([this_trait.name, this_trait.geneid, this_trait.homologeneid, this_trait.symbol, description_display, trait_location_repr, mean, LRS_score_repr, LRS_location_repr]):
- # worksheet.write([newrow, ncol], item)
-
-
newrow += 1
return tblobj_body
- def createExcelFileWithTitleAndFooter(self, workbook=None, identification=None, db=None, returnNumber=None):
-
- worksheet = workbook.add_worksheet()
-
- titleStyle = workbook.add_format(align = 'left', bold = 0, size=14, border = 1, border_color="gray")
-
- ##Write title Info
- # Modified by Hongqiang Li
- worksheet.write([1, 0], "Citations: Please see %s/reference.html" % webqtlConfig.PORTADDR, titleStyle)
- worksheet.write([1, 0], "Citations: Please see %s/reference.html" % webqtlConfig.PORTADDR, titleStyle)
- worksheet.write([2, 0], "Trait : %s" % identification, titleStyle)
- worksheet.write([3, 0], "Database : %s" % db.fullname, titleStyle)
- worksheet.write([4, 0], "Date : %s" % time.strftime("%B %d, %Y", time.gmtime()), titleStyle)
- worksheet.write([5, 0], "Time : %s GMT" % time.strftime("%H:%M ", time.gmtime()), titleStyle)
- worksheet.write([6, 0], "Status of data ownership: Possibly unpublished data; please see %s/statusandContact.html for details on sources, ownership, and usage of these data." % webqtlConfig.PORTADDR, titleStyle)
- #Write footer info
- worksheet.write([9 + returnNumber, 0], "Funding for The GeneNetwork: NIAAA (U01AA13499, U24AA13513), NIDA, NIMH, and NIAAA (P20-DA21131), NCI MMHCC (U01CA105417), and NCRR (U01NR 105417)", titleStyle)
- worksheet.write([10 + returnNumber, 0], "PLEASE RETAIN DATA SOURCE INFORMATION WHENEVER POSSIBLE", titleStyle)
-
- return worksheet
def getSortByValue(self, datasetType=''):
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
new file mode 100644
index 00000000..898ffa02
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -0,0 +1,2904 @@
+{
+ "datasets": {
+ "All Species": {
+ "All Groups": {
+ "Phenotypes": [
+ [
+ "All Phenotypes",
+ "All Phenotypes"
+ ]
+ ]
+ }
+ },
+ "arabidopsis": {
+ "BayXSha": {
+ "Genotypes": [
+ [
+ "BayXShaGeno",
+ "BayXSha Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BayXShaPublish",
+ "BayXSha Published Phenotypes"
+ ]
+ ]
+ },
+ "ColXBur": {
+ "Genotypes": [
+ [
+ "ColXBurGeno",
+ "ColXBur Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "ColXBurPublish",
+ "ColXBur Published Phenotypes"
+ ]
+ ]
+ },
+ "ColXCvi": {
+ "Genotypes": [
+ [
+ "ColXCviGeno",
+ "ColXCvi Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "ColXCviPublish",
+ "ColXCvi Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "barley": {
+ "QSM": {
+ "Genotypes": [
+ [
+ "QSMGeno",
+ "QSM Genotypes"
+ ]
+ ],
+ "Leaf": [
+ [
+ "B1LI0809R",
+ "Barley1 Leaf INOC TTKS (Aug09) RMA"
+ ],
+ [
+ "B1LI0809M5",
+ "Barley1 Leaf INOC TTKS (Aug09) MAS5"
+ ],
+ [
+ "B1MI0809M5",
+ "Barley1 Leaf MOCK TTKS (Aug09) MAS5"
+ ],
+ [
+ "B1MI0809R",
+ "Barley1 Leaf MOCK TTKS (Aug09) RMA"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "QSMPublish",
+ "QSM Published Phenotypes"
+ ]
+ ]
+ },
+ "SXM": {
+ "Embryo": [
+ [
+ "B139_K_1206_R",
+ "Barley1 Embryo gcRMA SCRI (Dec06)"
+ ],
+ [
+ "B139_K_1206_M",
+ "Barley1 Embryo MAS 5.0 SCRI (Dec06)"
+ ],
+ [
+ "B150_K_0406_R",
+ "Barley1 Embryo0 gcRMA SCRI (Apr06)"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "SXMGeno",
+ "SXM Genotypes"
+ ]
+ ],
+ "Leaf": [
+ [
+ "B30_K_1206_M",
+ "Barley1 Leaf MAS 5.0 SCRI (Dec06)"
+ ],
+ [
+ "B30_K_1206_Rn",
+ "Barley1 Leaf gcRMAn SCRI (Dec06)"
+ ],
+ [
+ "B30_K_1206_R",
+ "Barley1 Leaf gcRMA SCRI (Dec06)"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "SXMPublish",
+ "SXM Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "drosophila": {
+ "DGRP": {
+ "Genotypes": [
+ [
+ "DGRPGeno",
+ "DGRP Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "DGRPPublish",
+ "DGRP Published Phenotypes"
+ ]
+ ],
+ "Whole Body": [
+ [
+ "NCSU_DrosWB_LC_RMA_0111",
+ "NCSU Drosophila Whole Body (Jan11) RMA"
+ ]
+ ]
+ },
+ "Oregon-R_x_2b3": {
+ "Genotypes": [
+ [
+ "Oregon-R_x_2b3Geno",
+ "Oregon-R_x_2b3 Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "Oregon-R_x_2b3Publish",
+ "Oregon-R_x_2b3 Published Phenotypes"
+ ]
+ ],
+ "Whole Body": [
+ [
+ "UAB_DrosWB_LC_RMA_1009",
+ "UAB Whole body D.m. mRNA control (Oct09) RMA"
+ ],
+ [
+ "UAB_DrosWB_LE_RMA_1009",
+ "UAB Whole body D.m. mRNA lead (pbAc) (Oct09) RMA"
+ ]
+ ]
+ }
+ },
+ "human": {
+ "AD-cases-controls": {
+ "Brain": [
+ [
+ "GSE5281_F_RMA_N_0709",
+ "GSE5281 Human Brain Normal Full Liang (Jul09) RMA"
+ ],
+ [
+ "GSE5281_F_RMA_Alzh_0709",
+ "GSE5281 Human Brain Alzheimer Full Liang (Jul09) RMA"
+ ],
+ [
+ "GSE5281_F_RMA0709",
+ "GSE5281 Human Brain Full Liang (Jul09) RMA"
+ ],
+ [
+ "GSE5281_RMA0709",
+ "GSE5281 Human Brain Best 102 Liang (Jul09) RMA"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "AD-cases-controlsGeno",
+ "AD-cases-controls Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "AD-cases-controlsPublish",
+ "AD-cases-controls Published Phenotypes"
+ ]
+ ]
+ },
+ "AD-cases-controls-Myers": {
+ "Brain": [
+ [
+ "GSE15222_F_A_RI_0409",
+ "GSE15222 Human Brain Alzheimer Myers (Apr09) RankInv"
+ ],
+ [
+ "GSE15222_F_N_RI_0409",
+ "GSE15222 Human Brain Normal Myers (Apr09) RankInv"
+ ],
+ [
+ "GSE15222_F_RI_0409",
+ "GSE15222 Human Brain Myers (Apr09) RankInv"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "AD-cases-controls-MyersGeno",
+ "AD-cases-controls-Myers Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "AD-cases-controls-MyersPublish",
+ "AD-cases-controls-Myers Published Phenotypes"
+ ]
+ ]
+ },
+ "CANDLE": {
+ "Genotypes": [
+ [
+ "CANDLEGeno",
+ "CANDLE Genotypes"
+ ]
+ ],
+ "Newborn Cord Blood": [
+ [
+ "CANDLE_NB_0711",
+ "CANDLE Newborn Cord ILMv6.3 (Jun11) QUANT **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "CANDLEPublish",
+ "CANDLE Published Phenotypes"
+ ]
+ ]
+ },
+ "CEPH-2004": {
+ "Genotypes": [
+ [
+ "CEPH-2004Geno",
+ "CEPH-2004 Genotypes"
+ ]
+ ],
+ "Lymphoblast B-cell": [
+ [
+ "UT_CEPH_RankInv0909",
+ "UTHSC CEPH B-cells Illumina (Sep09) RankInv"
+ ],
+ [
+ "Human_1008",
+ "Monks CEPH B-cells Agilent (Dec04) Log10Ratio"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "CEPH-2004Publish",
+ "CEPH-2004 Published Phenotypes"
+ ]
+ ]
+ },
+ "HB": {
+ "Cerebellum": [
+ [
+ "HBTRC-MLC_0611",
+ "HBTRC-MLC Human Cerebellum Agilent (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLC_N_0611",
+ "HBTRC-MLC Human Cerebellum Agilent Normal (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLC_AD_0611",
+ "HBTRC-MLC Human Cerebellum Agilent AD (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLC_HD_0611",
+ "HBTRC-MLC Human Cerebellum Agilent HD (Jun11) mlratio"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "HBGeno",
+ "HB Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HBPublish",
+ "HB Published Phenotypes"
+ ]
+ ],
+ "Prefrontal Cortex": [
+ [
+ "HBTRC-MLPFC_0611",
+ "HBTRC-MLC Human Prefrontal Cortex Agilent (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLPFC_N_0611",
+ "HBTRC-MLC Human Prefrontal Cortex Agilent Normal (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLPFC_AD_0611",
+ "HBTRC-MLC Human Prefrontal Cortex Agilent AD (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLPFC_HD_0611",
+ "HBTRC-MLC Human Prefrontal Cortex Agilent HD (Jun11) mlratio"
+ ]
+ ],
+ "Primary Visual Cortex": [
+ [
+ "HBTRC-MLVC_0611",
+ "HBTRC-MLC Human Visual Cortex Agilent (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLVC_N_0611",
+ "HBTRC-MLC Human Visual Cortex Agilent Normal (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLVC_AD_0611",
+ "HBTRC-MLC Human Visual Cortex Agilent AD (Jun11) mlratio"
+ ],
+ [
+ "HBTRC-MLVC_HD_0611",
+ "HBTRC-MLC Human Visual Cortex Agilent HD (Jun11) mlratio"
+ ]
+ ]
+ },
+ "HLC": {
+ "Genotypes": [
+ [
+ "HLCGeno",
+ "HLC Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "HLC_0311",
+ "GSE9588 Human Liver Normal (Mar11) Both Sexes"
+ ],
+ [
+ "HLCM_0311",
+ "GSE9588 Human Liver Normal (Mar11) Males"
+ ],
+ [
+ "HLCF_0311",
+ "GSE9588 Human Liver Normal (Mar11) Females"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HLCPublish",
+ "HLC Published Phenotypes"
+ ]
+ ]
+ },
+ "HSB": {
+ "Amygdala": [
+ [
+ "KIN_YSM_AMY_0711",
+ "KIN/YSM Human AMY Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Caudal Ganglionic Eminence": [
+ [
+ "KIN_YSM_CGE_0711",
+ "KIN/YSM Human CGE Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Cerebellar Cortex": [
+ [
+ "KIN_YSM_CBC_0711",
+ "KIN/YSM Human CBC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Diencephalon": [
+ [
+ "KIN_YSM_DIE_0711",
+ "KIN/YSM Human DIE Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Dorsal Thalamus": [
+ [
+ "KIN_YSM_DTH_0711",
+ "KIN/YSM Human DTH Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Dorsolateral Prefrontal Cortex": [
+ [
+ "KIN_YSM_DFC_0711",
+ "KIN/YSM Human DFC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Frontal Cerebral Wall": [
+ [
+ "KIN_YSM_FC_0711",
+ "KIN/YSM Human FC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "HSBGeno",
+ "HSB Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "KIN_YSM_HIP_0711",
+ "KIN/YSM Human HIP Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Inferior Temporal Cortex": [
+ [
+ "KIN_YSM_ITC_0711",
+ "KIN/YSM Human ITC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Lateral Ganglionic Eminence": [
+ [
+ "KIN_YSM_LGE_0711",
+ "KIN/YSM Human LGE Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Medial Ganglionic Eminence": [
+ [
+ "KIN_YSM_MGE_0711",
+ "KIN/YSM Human MGE Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Medial Prefrontal Cortex": [
+ [
+ "KIN_YSM_MFC_0711",
+ "KIN/YSM Human MFC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Mediodorsal Nucleus of Thalamus": [
+ [
+ "KIN_YSM_MD_0711",
+ "KIN/YSM Human MD Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Occipital Cerebral Wall": [
+ [
+ "KIN_YSM_OC_0711",
+ "KIN/YSM Human OC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Orbital Prefrontal Cortex": [
+ [
+ "KIN_YSM_OFC_0711",
+ "KIN/YSM Human OFC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Parietal Cerebral Wall": [
+ [
+ "KIN_YSM_PC_0711",
+ "KIN/YSM Human PC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HSBPublish",
+ "HSB Published Phenotypes"
+ ]
+ ],
+ "Posterior Inferior Parietal Cortex": [
+ [
+ "KIN_YSM_IPC_0711",
+ "KIN/YSM Human IPC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Posterior Superior Temporal Cortex": [
+ [
+ "KIN_YSM_STC_0711",
+ "KIN/YSM Human STC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Primary Auditory (A1) Cortex": [
+ [
+ "KIN_YSM_A1C_0711",
+ "KIN/YSM Human A1C Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Primary Motor (M1) Cortex": [
+ [
+ "KIN_YSM_M1C_0711",
+ "KIN/YSM Human M1C Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Primary Somatosensory (S1) Cortex": [
+ [
+ "KIN_YSM_S1C_0711",
+ "KIN/YSM Human S1C Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Primary Visual Cortex": [
+ [
+ "KIN_YSM_V1C_0711",
+ "KIN/YSM Human V1C Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Striatum": [
+ [
+ "KIN_YSM_STR_0711",
+ "KIN/YSM Human STR Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Temporal Cerebral Wall": [
+ [
+ "KIN_YSM_TC_0711",
+ "KIN/YSM Human TC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Upper (Rostral) Rhombic Lip": [
+ [
+ "KIN_YSM_URL_0711",
+ "KIN/YSM Human URL Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Ventral Forebrain": [
+ [
+ "KIN_YSM_VF_0711",
+ "KIN/YSM Human VF Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ],
+ "Ventrolateral Prefrontal Cortex": [
+ [
+ "KIN_YSM_VFC_0711",
+ "KIN/YSM Human VFC Affy Hu-Exon 1.0 ST (Jul11) Quantile **"
+ ]
+ ]
+ }
+ },
+ "macaque monkey": {
+ "Macaca-fasicularis": {
+ "Amygdala": [
+ [
+ "INIA_MacFas_AMGc_RMA_0110",
+ "INIA Macaca fasicularis Amygdala control (Jan10) RMA **"
+ ],
+ [
+ "INIA_MacFas_AMGe_RMA_0110",
+ "INIA Macaca fasicularis Amygdala ethanol (Jan10) RMA **"
+ ]
+ ],
+ "Brain": [
+ [
+ "INIA_MacFas_brain_RMA_0110",
+ "INIA Macaca fasicularis Brain (Jan10) RMA **"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "Macaca-fasicularisGeno",
+ "Macaca-fasicularis Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "INIA_MacFas_Hc_RMA_0110",
+ "INIA Macaca fasicularis Hippocampus control (Jan10) RMA **"
+ ],
+ [
+ "INIA_MacFas_He_RMA_0110",
+ "INIA Macaca fasicularis Hippocampus ethanol (Jan10) RMA **"
+ ]
+ ],
+ "Nucleus Accumbens": [
+ [
+ "INIA_MacFas_Ac_RMA_0110",
+ "INIA Macaca fasicularis Nucleus Accumbens control (Jan10) RMA **"
+ ],
+ [
+ "INIA_MacFas_Ae_RMA_0110",
+ "INIA Macaca fasicularis Nucleus Accumbens ethanol (Jan10) RMA **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "Macaca-fasicularisPublish",
+ "Macaca-fasicularis Published Phenotypes"
+ ]
+ ],
+ "Prefrontal Cortex": [
+ [
+ "INIA_MacFas_Pf_RMA_0110",
+ "INIA Macaca fasicularis Prefrontal Cortex control (Jan10) RMA **"
+ ],
+ [
+ "INIA_MacFas_PfE_RMA_0110",
+ "INIA Macaca fasicularis Prefrontal Cortex ethanol (Jan10) RMA **"
+ ]
+ ]
+ }
+ },
+ "mouse": {
+ "AKXD": {
+ "Genotypes": [
+ [
+ "AKXDGeno",
+ "AKXD Genotypes"
+ ]
+ ],
+ "Mammary Tumors": [
+ [
+ "NCI_Agil_Mam_Tum_RMA_0409",
+ "NCI Mammary LMT miRNA v2 (Apr09) RMA"
+ ],
+ [
+ "MA_M_0704_R",
+ "NCI Mammary mRNA M430 (July04) RMA"
+ ],
+ [
+ "MA_M_0704_M",
+ "NCI Mammary mRNA M430 (July04) MAS5"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "AKXDPublish",
+ "AKXD Published Phenotypes"
+ ]
+ ]
+ },
+ "AXBXA": {
+ "Eye": [
+ [
+ "Eye_AXBXA_1008_RankInv",
+ "Eye AXBXA Illumina V6.2(Oct08) RankInv Beta"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "AXBXAGeno",
+ "AXBXA Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "AXBXAPublish",
+ "AXBXA Published Phenotypes"
+ ]
+ ]
+ },
+ "B6BTBRF2": {
+ "Genotypes": [
+ [
+ "B6BTBRF2Geno",
+ "B6BTBRF2 Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "LVF2_M_0704_R",
+ "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA"
+ ],
+ [
+ "LVF2_M_0704_M",
+ "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "B6BTBRF2Publish",
+ "B6BTBRF2 Published Phenotypes"
+ ]
+ ]
+ },
+ "B6D2F2": {
+ "Brain": [
+ [
+ "BRF2_M_0805_M",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5"
+ ],
+ [
+ "BRF2_M_0805_P",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
+ ],
+ [
+ "BRF2_M_0805_R",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
+ ],
+ [
+ "BRF2_M_0304_P",
+ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN"
+ ],
+ [
+ "BRF2_M_0304_R",
+ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA"
+ ],
+ [
+ "BRF2_M_0304_M",
+ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "B6D2F2Geno",
+ "B6D2F2 Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "B6D2F2Publish",
+ "B6D2F2 Published Phenotypes"
+ ]
+ ]
+ },
+ "BDF2-1999": {
+ "Genotypes": [
+ [
+ "BDF2-1999Geno",
+ "BDF2-1999 Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "UCLA_BDF2_LIVER_1999",
+ "UCLA BDF2 Liver (1999) mlratio"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BDF2-1999Publish",
+ "BDF2-1999 Published Phenotypes"
+ ]
+ ]
+ },
+ "BDF2-2005": {
+ "Genotypes": [
+ [
+ "BDF2-2005Geno",
+ "BDF2-2005 Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BDF2-2005Publish",
+ "BDF2-2005 Published Phenotypes"
+ ]
+ ],
+ "Striatum": [
+ [
+ "SA_M2_0905_R",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA"
+ ],
+ [
+ "SA_M2_0905_M",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
+ ],
+ [
+ "SA_M2_0905_P",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN"
+ ]
+ ]
+ },
+ "BHF2": {
+ "Adipose": [
+ [
+ "UCLA_BHF2_ADIPOSE_MALE",
+ "UCLA BHF2 Adipose Male mlratio"
+ ],
+ [
+ "UCLA_BHF2_ADIPOSE_FEMALE",
+ "UCLA BHF2 Adipose Female mlratio"
+ ],
+ [
+ "UCLA_BHF2_ADIPOSE_0605",
+ "UCLA BHF2 Adipose (June05) mlratio"
+ ]
+ ],
+ "Brain": [
+ [
+ "UCLA_BHF2_BRAIN_MALE",
+ "UCLA BHF2 Brain Male mlratio"
+ ],
+ [
+ "UCLA_BHF2_BRAIN_FEMALE",
+ "UCLA BHF2 Brain Female mlratio"
+ ],
+ [
+ "UCLA_BHF2_BRAIN_0605",
+ "UCLA BHF2 Brain (June05) mlratio"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "BHF2Geno",
+ "BHF2 Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "UCLA_BHF2_LIVER_MALE",
+ "UCLA BHF2 Liver Male mlratio"
+ ],
+ [
+ "UCLA_BHF2_LIVER_FEMALE",
+ "UCLA BHF2 Liver Female mlratio"
+ ],
+ [
+ "UCLA_BHF2_LIVER_0605",
+ "UCLA BHF2 Liver (June05) mlratio"
+ ]
+ ],
+ "Muscle": [
+ [
+ "UCLA_BHF2_MUSCLE_MALE",
+ "UCLA BHF2 Muscle Male mlratio **"
+ ],
+ [
+ "UCLA_BHF2_MUSCLE_FEMALE",
+ "UCLA BHF2 Muscle Female mlratio **"
+ ],
+ [
+ "UCLA_BHF2_MUSCLE_0605",
+ "UCLA BHF2 Muscle (June05) mlratio **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BHF2Publish",
+ "BHF2 Published Phenotypes"
+ ]
+ ]
+ },
+ "BHHBF2": {
+ "Adipose": [
+ [
+ "UCLA_BHHBF2_ADIPOSE_MALE",
+ "UCLA BHHBF2 Adipose Male Only"
+ ],
+ [
+ "UCLA_BHHBF2_ADIPOSE_FEMALE",
+ "UCLA BHHBF2 Adipose Female Only"
+ ],
+ [
+ "UCLA_BHHBF2_ADIPOSE_2005",
+ "UCLA BHHBF2 Adipose (2005) mlratio **"
+ ]
+ ],
+ "Brain": [
+ [
+ "UCLA_BHHBF2_BRAIN_MALE",
+ "UCLA BHHBF2 Brain Male Only"
+ ],
+ [
+ "UCLA_BHHBF2_BRAIN_FEMALE",
+ "UCLA BHHBF2 Brain Female Only"
+ ],
+ [
+ "UCLA_BHHBF2_BRAIN_2005",
+ "UCLA BHHBF2 Brain (2005) mlratio **"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "BHHBF2Geno",
+ "BHHBF2 Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "UCLA_BHHBF2_LIVER_MALE",
+ "UCLA BHHBF2 Liver Male Only"
+ ],
+ [
+ "UCLA_BHHBF2_LIVER_FEMALE",
+ "UCLA BHHBF2 Liver Female Only"
+ ],
+ [
+ "UCLA_BHHBF2_LIVER_2005",
+ "UCLA BHHBF2 Liver (2005) mlratio **"
+ ]
+ ],
+ "Muscle": [
+ [
+ "UCLA_BHHBF2_MUSCLE_MALE",
+ "UCLA BHHBF2 Muscle Male Only"
+ ],
+ [
+ "UCLA_BHHBF2_MUSCLE_FEMALE",
+ "UCLA BHHBF2 Muscle Female Only"
+ ],
+ [
+ "UCLA_BHHBF2_MUSCLE_2005",
+ "UCLA BHHBF2 Muscle (2005) mlratio **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BHHBF2Publish",
+ "BHHBF2 Published Phenotypes"
+ ]
+ ]
+ },
+ "BXD": {
+ "Amygdala": [
+ [
+ "INIA_AmgCoh_0311",
+ "INIA Amygdala Cohort Affy MoGene 1.0 ST (Mar11) RMA"
+ ],
+ [
+ "INIA_Amg_BLA_RMA_1110",
+ "INIA Amygdala Affy MoGene 1.0 ST (Nov10) RMA"
+ ],
+ [
+ "INIA_Amg_BLA_RMA_M_1110",
+ "INIA Amygdala Affy MoGene 1.0 ST (Nov10) RMA Male"
+ ],
+ [
+ "INIA_Amg_BLA_RMA_F_1110",
+ "INIA Amygdala Affy MoGene 1.0 ST (Nov10) RMA Female"
+ ]
+ ],
+ "Brain": [
+ [
+ "BR_M2_1106_R",
+ "UCHSC BXD Whole Brain M430 2.0 (Nov06) RMA"
+ ],
+ [
+ "BR_U_1105_P",
+ "UTHSC Brain mRNA U74Av2 (Nov05) PDNN"
+ ],
+ [
+ "BR_U_0805_M",
+ "UTHSC Brain mRNA U74Av2 (Aug05) MAS5"
+ ],
+ [
+ "BR_U_0805_R",
+ "UTHSC Brain mRNA U74Av2 (Aug05) RMA"
+ ],
+ [
+ "BR_U_0805_P",
+ "UTHSC Brain mRNA U74Av2 (Aug05) PDNN"
+ ],
+ [
+ "CB_M_0204_P",
+ "INIA Brain mRNA M430 (Feb04) PDNN"
+ ]
+ ],
+ "Cartilage": [
+ [
+ "UCLA_BXDBXH_CARTILAGE_V2",
+ "UCLA BXD and BXH Cartilage v2"
+ ],
+ [
+ "UCLA_BXDBXH_CARTILAGE",
+ "UCLA BXD and BXH Cartilage"
+ ],
+ [
+ "UCLA_BXD_CARTILAGE",
+ "UCLA BXD Cartilage"
+ ]
+ ],
+ "Cerebellum": [
+ [
+ "CB_M_1004_M",
+ "SJUT Cerebellum mRNA M430 (Oct04) MAS5"
+ ],
+ [
+ "CB_M_1004_R",
+ "SJUT Cerebellum mRNA M430 (Oct04) RMA"
+ ],
+ [
+ "CB_M_1004_P",
+ "SJUT Cerebellum mRNA M430 (Oct04) PDNN"
+ ],
+ [
+ "CB_M_1003_M",
+ "SJUT Cerebellum mRNA M430 (Oct03) MAS5"
+ ]
+ ],
+ "Eye": [
+ [
+ "Eye_M2_0908_R",
+ "Eye M430v2 (Sep08) RMA"
+ ],
+ [
+ "Eye_M2_0908_R_NB",
+ "Eye M430v2 Mutant Gpnmb (Sep08) RMA **"
+ ],
+ [
+ "Eye_M2_0908_R_ND",
+ "Eye M430v2 WT Gpnmb (Sep08) RMA **"
+ ],
+ [
+ "Eye_M2_0908_WTWT",
+ "Eye M430v2 WT WT (Sep08) RMA **"
+ ],
+ [
+ "Eye_M2_0908_R_MT",
+ "Eye M430v2 Mutant Tyrp1 (Sep08) RMA **"
+ ],
+ [
+ "Eye_M2_0908_R_WT",
+ "Eye M430v2 WT Tyrp1 (Sep08) RMA **"
+ ],
+ [
+ "BXD_GLA_0911",
+ "BXD Glaucoma Affy M430 2.0 Trial (Sep11) RMA **"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "BXDGeno",
+ "BXD Genotypes"
+ ]
+ ],
+ "Hematopoietic Cells": [
+ [
+ "UMCG_0907_HemaStem_ori",
+ "UMCG Stem Cells ILM6v1.1 (Apr09) original"
+ ],
+ [
+ "UMCG_0907_HemaStem",
+ "UMCG Stem Cells ILM6v1.1 (Apr09) transformed"
+ ],
+ [
+ "UMCG_0907_Pro_ori",
+ "UMCG Progenitor Cells ILM6v1.1 (Apr09) original"
+ ],
+ [
+ "UMCG_0907_Pro",
+ "UMCG Progenitor Cells ILM6v1.1 (Apr09) transformed"
+ ],
+ [
+ "UMCG_0907_Eryth_ori",
+ "UMCG Erythroid Cells ILM6v1.1 (Apr09) original"
+ ],
+ [
+ "UMCG_0907_Eryth",
+ "UMCG Erythroid Cells ILM6v1.1 (Apr09) transformed"
+ ],
+ [
+ "UMCG_0907_Myeloid_ori",
+ "UMCG Myeloid Cells ILM6v1.1 (Apr09) original"
+ ],
+ [
+ "UMCG_0907_Myeloid",
+ "UMCG Myeloid Cells ILM6v1.1 (Apr09) transformed"
+ ],
+ [
+ "HC_U_0304_R",
+ "GNF Stem Cells U74Av2 (Mar04) RMA"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "HC_M2_0606_P",
+ "Hippocampus Consortium M430v2 (Jun06) PDNN"
+ ],
+ [
+ "HC_M2_0606_M",
+ "Hippocampus Consortium M430v2 (Jun06) MAS5"
+ ],
+ [
+ "HC_M2_0606_R",
+ "Hippocampus Consortium M430v2 (Jun06) RMA"
+ ],
+ [
+ "UMUTAffyExon_0209_RMA",
+ "UMUTAffy Hippocampus Exon (Feb09) RMA"
+ ],
+ [
+ "UT_ILM_BXD_hipp_NON_0909",
+ "UTHSC Hippocampus Illumina v6.1 NON (Sep09) RankInv"
+ ],
+ [
+ "UT_ILM_BXD_hipp_NOS_0909",
+ "UTHSC Hippocampus Illumina v6.1 NOS (Sep09) RankInv"
+ ],
+ [
+ "UT_ILM_BXD_hipp_NOE_0909",
+ "UTHSC Hippocampus Illumina v6.1 NOE (Sep09) RankInv"
+ ],
+ [
+ "UT_ILM_BXD_hipp_RSS_0909",
+ "UTHSC Hippocampus Illumina v6.1 RSS (Sep09) RankInv"
+ ],
+ [
+ "UT_ILM_BXD_hipp_RSE_0909",
+ "UTHSC Hippocampus Illumina v6.1 RSE (Sep09) RankInv"
+ ]
+ ],
+ "Hypothalamus": [
+ [
+ "INIA_Hyp_RMA_1110",
+ "INIA Hypothalamus Affy MoGene 1.0 ST (Nov10)"
+ ],
+ [
+ "INIA_Hyp_M_RMA_1110",
+ "INIA Hypothalamus Affy MoGene 1.0 ST (Nov10) Male"
+ ],
+ [
+ "INIA_Hyp_F_RMA_1110",
+ "INIA Hypothalamus Affy MoGene 1.0 ST (Nov10) Female"
+ ]
+ ],
+ "Kidney": [
+ [
+ "MA_M2M_0706_R",
+ "Mouse kidney M430v2 Male (Aug06) RMA"
+ ],
+ [
+ "MA_M2F_0706_R",
+ "Mouse kidney M430v2 Female (Aug06) RMA"
+ ],
+ [
+ "MA_M2_0806_R",
+ "Mouse kidney M430v2 Sex Balanced (Aug06) RMA"
+ ],
+ [
+ "MA_M2_0806_P",
+ "Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN"
+ ],
+ [
+ "MA_M2_0706_P",
+ "Mouse Kidney M430v2 (Jul06) PDNN"
+ ],
+ [
+ "MA_M2_0706_R",
+ "Mouse Kidney M430v2 (Jul06) RMA"
+ ]
+ ],
+ "Leucocytes": [
+ [
+ "Illum_BXD_PBL_1108",
+ "UWA Illumina PBL (Nov08) RSN **"
+ ]
+ ],
+ "Liver": [
+ [
+ "GSE16780_UCLA_ML0911",
+ "GSE16780 UCLA Hybrid MDP Liver Affy HT M430A (Sep11) RMA"
+ ],
+ [
+ "GenEx_BXD_liverSal_RMA_F_0211",
+ "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Females **"
+ ],
+ [
+ "GenEx_BXD_liverSal_RMA_M_0211",
+ "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Males **"
+ ],
+ [
+ "GenEx_BXD_liverSal_RMA_0211",
+ "GenEx BXD Sal Liver Affy M430 2.0 (Feb11) RMA Both Sexes **"
+ ],
+ [
+ "GenEx_BXD_liverEt_RMA_F_0211",
+ "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Females **"
+ ],
+ [
+ "GenEx_BXD_liverEt_RMA_M_0211",
+ "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Males **"
+ ],
+ [
+ "GenEx_BXD_liverEt_RMA_0211",
+ "GenEx BXD EtOH Liver Affy M430 2.0 (Feb11) RMA Both Sexes **"
+ ],
+ [
+ "SUH_Liv_RMA_0611",
+ "SUH BXD Liver Affy Mouse Gene 1.0 ST (Jun11) RMA **"
+ ]
+ ],
+ "Lung": [
+ [
+ "HZI_0408_R",
+ "HZI Lung M430v2 (Apr08) RMA"
+ ],
+ [
+ "HZI_0408_M",
+ "HZI Lung M430v2 (Apr08) MAS5"
+ ]
+ ],
+ "Midbrain": [
+ [
+ "VUBXDMouseMidBrainQ0212",
+ "VU BXD Midbrain Agilent SurePrint G3 Mouse GE (Feb12) Quantile"
+ ]
+ ],
+ "Muscle": [
+ [
+ "EPFLMouseMuscleRMA1211",
+ "EPFL/LISP BXD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA **"
+ ],
+ [
+ "EPFLMouseMuscleHFDRMA1211",
+ "EPFL/LISP BXD HFD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA **"
+ ],
+ [
+ "EPFLMouseMuscleCDRMA1211",
+ "EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA **"
+ ]
+ ],
+ "Neocortex": [
+ [
+ "DevNeocortex_ILM6.2P14RInv_1111",
+ "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv **"
+ ],
+ [
+ "DevNeocortex_ILM6.2P3RInv_1111",
+ "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv **"
+ ],
+ [
+ "HQFNeoc_1210v2_RankInv",
+ "HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv"
+ ],
+ [
+ "HQFNeoc_1210_RankInv",
+ "HQF BXD Neocortex ILM6v1.1 (Dec10) RankInv"
+ ],
+ [
+ "HQFNeoc_0208_RankInv",
+ "HQF BXD Neocortex ILM6v1.1 (Feb08) RankInv"
+ ],
+ [
+ "DevNeocortex_ILM6.2P3RInv_1110",
+ "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov10) RankInv **"
+ ],
+ [
+ "DevNeocortex_ILM6.2P14RInv_1110",
+ "BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov10) RankInv **"
+ ]
+ ],
+ "Nucleus Accumbens": [
+ [
+ "VCUSalo_1007_R",
+ "VCU BXD NA Sal M430 2.0 (Oct07) RMA"
+ ],
+ [
+ "VCUEtOH_1007_R",
+ "VCU BXD NA EtOH M430 2.0 (Oct07) RMA **"
+ ],
+ [
+ "VCUSal_1007_R",
+ "VCU BXD NA Et vs Sal M430 2.0 (Oct07) Sscore **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BXDPublish",
+ "BXD Published Phenotypes"
+ ]
+ ],
+ "Prefrontal Cortex": [
+ [
+ "VCUEtOH_1206_R",
+ "VCU BXD PFC EtOH M430 2.0 (Dec06) RMA"
+ ],
+ [
+ "VCUSal_1206_R",
+ "VCU BXD PFC Sal M430 2.0 (Dec06) RMA"
+ ],
+ [
+ "VCUSal_1006_R",
+ "VCU BXD PFC Et vs Sal M430 2.0 (Dec06) Sscore"
+ ],
+ [
+ "VCU_PF_Air_0111_R",
+ "VCU BXD PFC CIE Air M430 2.0 (Jan11) RMA **"
+ ],
+ [
+ "VCU_PF_Et_0111_R",
+ "VCU BXD PFC CIE EtOH M430 2.0 (Jan11) RMA **"
+ ],
+ [
+ "VCU_PF_AvE_0111_Ss",
+ "VCU BXD PFC EtOH vs CIE Air M430 2.0 (Jan11) Sscore **"
+ ]
+ ],
+ "Retina": [
+ [
+ "Illum_Retina_BXD_RankInv0410",
+ "HEI Retina Illumina V6.2 (April 2010) RankInv"
+ ],
+ [
+ "B6D2ONCILM_0412",
+ "B6D2 ONC Illumina v6.1 (Apr12) RankInv **"
+ ],
+ [
+ "ONCRetILM6_0412",
+ "ONC Retina Illumina V6.2 (Apr12) RankInv **"
+ ],
+ [
+ "HEIONCvsCRetILM6_0911",
+ "HEI ONC vs Control Retina Illumina V6.2 (Sep11) RankInv **"
+ ],
+ [
+ "G2HEIONCRetILM6_0911",
+ "G2 HEI ONC Retina Illumina V6.2 (Sep11) RankInv **"
+ ],
+ [
+ "HEIONCRetILM6_0911",
+ "HEI ONC Retina Illumina V6.2 (Sep11) RankInv **"
+ ],
+ [
+ "ILM_Retina_BXD_F_RankInv1210",
+ "HEI Retina Females Illumina V6.2 (Dec10) RankInv **"
+ ],
+ [
+ "ILM_Retina_BXD_M_RankInv1210",
+ "HEI Retina Males Illumina V6.2 (Dec10) RankInv **"
+ ],
+ [
+ "ILM_Retina_BXD_FM_RankInv1210",
+ "HEI Retina F-M Illumina V6.2 (Dec10) RankInv **"
+ ],
+ [
+ "G2NEI_ILM_Retina_BXD_RI0410",
+ "G2NEI Retina Illumina V6.2 (April 2010) RankInv **"
+ ]
+ ],
+ "Spleen": [
+ [
+ "UTHSC_SPL_RMA_1210",
+ "UTHSC Affy MoGene 1.0 ST Spleen (Dec10) RMA"
+ ],
+ [
+ "UTHSC_SPL_RMA_1010",
+ "UTHSC Affy MoGene 1.0 ST Spleen (Oct10) RMA"
+ ],
+ [
+ "IoP_SPL_RMA_0509",
+ "IoP Affy MOE 430v2 Spleen (May09) RMA"
+ ],
+ [
+ "Illum_BXD_Spl_1108",
+ "UWA Illumina Spleen (Nov08) RSN **"
+ ],
+ [
+ "UTK_BXDSpl_VST_0110",
+ "UTK Spleen ILM6.1 (Jan10) VST"
+ ]
+ ],
+ "Striatum": [
+ [
+ "DevStriatum_ILM6.2P3RInv_1111",
+ "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov11) RankInv **"
+ ],
+ [
+ "DevStriatum_ILM6.2P14RInv_1111",
+ "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov11) RankInv **"
+ ],
+ [
+ "UTHSC_Striatum_RankInv_1210",
+ "HQF BXD Striatum ILM6.1 (Dec10v2) RankInv"
+ ],
+ [
+ "UTHSC_Str_RankInv_1210",
+ "HQF BXD Striatum ILM6.1 (Dec10) RankInv"
+ ],
+ [
+ "UTHSC_1107_RankInv",
+ "HQF BXD Striatum ILM6.1 (Nov07) RankInv"
+ ],
+ [
+ "SA_M2_0405_MC",
+ "HBP Rosen Striatum M430V2 (Apr05) MAS5 Clean"
+ ],
+ [
+ "SA_M2_0405_RC",
+ "HBP Rosen Striatum M430V2 (Apr05) RMA Clean"
+ ],
+ [
+ "SA_M2_0405_PC",
+ "HBP Rosen Striatum M430V2 (Apr05) PDNN Clean"
+ ],
+ [
+ "SA_M2_0405_SS",
+ "HBP Rosen Striatum M430V2 (Apr05) SScore"
+ ],
+ [
+ "SA_M2_0405_RR",
+ "HBP Rosen Striatum M430V2 (Apr05) RMA Orig"
+ ],
+ [
+ "Striatum_Exon_0209",
+ "HQF Striatum Exon (Feb09) RMA"
+ ],
+ [
+ "DevStriatum_ILM6.2P14RInv_1110",
+ "BIDMC/UTHSC Dev Striatum P14 ILMv6.2 (Nov10) RankInv **"
+ ],
+ [
+ "DevStriatum_ILM6.2P3RInv_1110",
+ "BIDMC/UTHSC Dev Striatum P3 ILMv6.2 (Nov10) RankInv **"
+ ]
+ ],
+ "T Cell (helper)": [
+ [
+ "RTHC_0211_R",
+ "HZI Thelp M430v2 (Feb11) RMA"
+ ]
+ ],
+ "T Cell (regulatory)": [
+ [
+ "RTC_1106_R",
+ "HZI Treg M430v2 (Feb11) RMA"
+ ]
+ ],
+ "Thymus": [
+ [
+ "Illum_BXD_Thy_1108",
+ "UWA Illumina Thymus (Nov08) RSN **"
+ ]
+ ],
+ "Ventral Tegmental Area": [
+ [
+ "VCUEtOH_0609_R",
+ "VCU BXD VTA EtOH M430 2.0 (Jun09) RMA **"
+ ],
+ [
+ "VCUSal_0609_R",
+ "VCU BXD VTA Sal M430 2.0 (Jun09) RMA **"
+ ],
+ [
+ "VCUEtvsSal_0609_R",
+ "VCU BXD VTA Et vs Sal M430 2.0 (Jun09) Sscore **"
+ ]
+ ]
+ },
+ "BXH": {
+ "Cartilage": [
+ [
+ "UCLA_BXHBXD_CARTILAGE_V2",
+ "UCLA BXH and BXD Cartilage v2"
+ ],
+ [
+ "UCLA_BXHBXD_CARTILAGE",
+ "UCLA BXH and BXD Cartilage"
+ ],
+ [
+ "UCLA_BXH_CARTILAGE",
+ "UCLA BXH Cartilage"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "BXHGeno",
+ "BXH Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "BXHPublish",
+ "BXH Published Phenotypes"
+ ]
+ ]
+ },
+ "CTB6F2": {
+ "Adipose": [
+ [
+ "UCLA_CTB6B6CTF2_ADIPOSE_MALE",
+ "UCLA CTB6B6CTF2 Adipose Male mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_ADIPOSE_FEMALE",
+ "UCLA CTB6B6CTF2 Adipose Female mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_ADIPOSE_2005",
+ "UCLA CTB6/B6CTF2 Adipose (2005) mlratio **"
+ ]
+ ],
+ "Brain": [
+ [
+ "UCLA_CTB6B6CTF2_BRAIN_MALE",
+ "UCLA CTB6B6CTF2 Brain Male mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_BRAIN_FEMALE",
+ "UCLA CTB6B6CTF2 Brain Female mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_BRAIN_2005",
+ "UCLA CTB6/B6CTF2 Brain (2005) mlratio **"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "CTB6F2Geno",
+ "CTB6F2 Genotypes"
+ ]
+ ],
+ "Liver": [
+ [
+ "UCLA_CTB6B6CTF2_LIVER_MALE",
+ "UCLA CTB6B6CTF2 Liver Male mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_LIVER_FEMALE",
+ "UCLA CTB6B6CTF2 Liver Female mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_LIVER_2005",
+ "UCLA CTB6/B6CTF2 Liver (2005) mlratio **"
+ ]
+ ],
+ "Muscle": [
+ [
+ "UCLA_CTB6B6CTF2_MUSCLE_MALE",
+ "UCLA CTB6B6CTF2 Muscle Male mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_MUSCLE_FEMALE",
+ "UCLA CTB6B6CTF2 Muscle Female mlratio **"
+ ],
+ [
+ "UCLA_CTB6B6CTF2_MUSCLE_2005",
+ "UCLA CTB6/B6CTF2 Muscle (2005) mlratio **"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "CTB6F2Publish",
+ "CTB6F2 Published Phenotypes"
+ ]
+ ]
+ },
+ "CXB": {
+ "Genotypes": [
+ [
+ "CXBGeno",
+ "CXB Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "HC_M2CB_1205_R",
+ "Hippocampus Consortium M430v2 CXB (Dec05) RMA"
+ ],
+ [
+ "HC_M2CB_1205_P",
+ "Hippocampus Consortium M430v2 CXB (Dec05) PDNN"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "CXBPublish",
+ "CXB Published Phenotypes"
+ ]
+ ],
+ "Spleen": [
+ [
+ "STSPL_1107_R",
+ "Stuart Spleen M430v2 (Nov07) RMA"
+ ]
+ ]
+ },
+ "HS": {
+ "Genotypes": [
+ [
+ "HSGeno",
+ "HS Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "OXUKHS_ILMHipp_RI0510",
+ "OX UK HS ILM6v1.1 Hippocampus (May 2010) RankInv"
+ ]
+ ],
+ "Liver": [
+ [
+ "OXUKHS_ILMLiver_RI0510",
+ "OX UK HS ILM6v1.1 Liver (May 2010) RankInv"
+ ]
+ ],
+ "Lung": [
+ [
+ "OXUKHS_ILMLung_RI0510",
+ "OX UK HS ILM6v1.1 Lung (May 2010) RankInv"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HSPublish",
+ "HS Published Phenotypes"
+ ]
+ ]
+ },
+ "HS-CC": {
+ "Genotypes": [
+ [
+ "HS-CCGeno",
+ "HS-CC Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HS-CCPublish",
+ "HS-CC Published Phenotypes"
+ ]
+ ],
+ "Striatum": [
+ [
+ "OHSU_HS-CC_ILMStr_0211",
+ "OHSU HS-CC Striatum ILM6v1 (Feb11) RankInv"
+ ]
+ ]
+ },
+ "LXS": {
+ "Genotypes": [
+ [
+ "LXSGeno",
+ "LXS Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "Illum_LXS_Hipp_loess0807",
+ "Hippocampus Illumina (Aug07) LOESS"
+ ],
+ [
+ "Illum_LXS_Hipp_loess_nb0807",
+ "Hippocampus Illumina (Aug07) LOESS_NB"
+ ],
+ [
+ "Illum_LXS_Hipp_quant0807",
+ "Hippocampus Illumina (Aug07) QUANT"
+ ],
+ [
+ "Illum_LXS_Hipp_quant_nb0807",
+ "Hippocampus Illumina (Aug07) QUANT_NB"
+ ],
+ [
+ "Illum_LXS_Hipp_rsn0807",
+ "Hippocampus Illumina (Aug07) RSN"
+ ],
+ [
+ "Illum_LXS_Hipp_rsn_nb0807",
+ "Hippocampus Illumina (Aug07) RSN_NB"
+ ],
+ [
+ "Hipp_Illumina_RankInv_0507",
+ "Hippocampus Illumina (May07) RankInv"
+ ],
+ [
+ "Illum_LXS_Hipp_NON_1008",
+ "Hippocampus Illumina NON (Oct08) RankInv beta"
+ ],
+ [
+ "Illum_LXS_Hipp_RSE_1008",
+ "Hippocampus Illumina RSE (Oct08) RankInv beta"
+ ],
+ [
+ "Illum_LXS_Hipp_NOE_1008",
+ "Hippocampus Illumina NOE (Oct08) RankInv beta"
+ ],
+ [
+ "Illum_LXS_Hipp_RSS_1008",
+ "Hippocampus Illumina RSS (Oct08) RankInv beta"
+ ],
+ [
+ "Illum_LXS_Hipp_NOS_1008",
+ "Hippocampus Illumina NOS (Oct08) RankInv beta"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "LXSPublish",
+ "LXS Published Phenotypes"
+ ]
+ ],
+ "Prefrontal Cortex": [
+ [
+ "VCUEtOH_0806_R",
+ "VCU LXS PFC EtOH M430A 2.0 (Aug06) RMA **"
+ ],
+ [
+ "VCUSal_0806_R",
+ "VCU LXS PFC Sal M430A 2.0 (Aug06) RMA"
+ ],
+ [
+ "VCUEt_vs_Sal_0806_R",
+ "VCU LXS PFC Et vs Sal M430A 2.0 (Aug06) Sscore **"
+ ]
+ ]
+ },
+ "MDP": {
+ "Genotypes": [
+ [
+ "MDPGeno",
+ "MDP Genotypes"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "UMUTAffyExon_0209_RMA_MDP",
+ "UMUTAffy Hippocampus Exon (Feb09) RMA MDP"
+ ],
+ [
+ "HC_M2_0606_MDP",
+ "Hippocampus Consortium M430v2 (Jun06) RMA MDP"
+ ]
+ ],
+ "Liver": [
+ [
+ "JAX_CSB_L_0711",
+ "JAX Liver Affy M430 2.0 (Jul11) MDP"
+ ],
+ [
+ "JAX_CSB_L_HF_0711",
+ "JAX Liver HF Affy M430 2.0 (Jul11) MDP"
+ ],
+ [
+ "JAX_CSB_L_6C_0711",
+ "JAX Liver 6C Affy M430 2.0 (Jul11) MDP"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "MDPPublish",
+ "Mouse Phenome Database"
+ ]
+ ]
+ },
+ "NZBXFVB-N2": {
+ "Genotypes": [
+ [
+ "NZBXFVB-N2Geno",
+ "NZBXFVB-N2 Genotypes"
+ ]
+ ],
+ "Mammary Tumors": [
+ [
+ "NCI_Mam_Tum_RMA_0409",
+ "NCI Mammary M430v2 (Apr09) RMA"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "NZBXFVB-N2Publish",
+ "NZBXFVB-N2 Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "rat": {
+ "HXBBXH": {
+ "Adrenal Gland": [
+ [
+ "HXB_Adrenal_1208",
+ "MDC/CAS/UCL Adrenal 230A (Dec08) RMA"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "HXBBXHGeno",
+ "HXBBXH Genotypes"
+ ]
+ ],
+ "Heart": [
+ [
+ "HXB_Heart_1208",
+ "MDC/CAS/UCL Heart 230_V2 (Dec08) RMA"
+ ]
+ ],
+ "Hippocampus": [
+ [
+ "UT_HippRatEx_RMA_0709",
+ "UT Hippocampus Affy RaEx 1.0 Exon (Jul09) RMA"
+ ]
+ ],
+ "Kidney": [
+ [
+ "KI_2A_0405_M",
+ "MDC/CAS/ICL Kidney 230A (Apr05) MAS5"
+ ],
+ [
+ "KI_2A_0405_Rz",
+ "MDC/CAS/ICL Kidney 230A (Apr05) RMA 2z+8"
+ ],
+ [
+ "KI_2A_0405_R",
+ "MDC/CAS/ICL Kidney 230A (Apr05) RMA"
+ ]
+ ],
+ "Liver": [
+ [
+ "HXB_Liver_1208",
+ "MDC/CAS/UCL Liver 230v2 (Dec08) RMA"
+ ]
+ ],
+ "Peritoneal Fat": [
+ [
+ "FT_2A_0805_M",
+ "MDC/CAS/ICL Peritoneal Fat 230A (Aug05) MAS5"
+ ],
+ [
+ "FT_2A_0605_Rz",
+ "MDC/CAS/ICL Peritoneal Fat 230A (Jun05) RMA 2z+8"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "HXBBXHPublish",
+ "HXBBXH Published Phenotypes"
+ ]
+ ]
+ },
+ "SRxSHRSPF2": {
+ "Eye": [
+ [
+ "UIOWA_Eye_RMA_0906",
+ "UIOWA Eye mRNA RAE230v2 (Sep06) RMA"
+ ]
+ ],
+ "Genotypes": [
+ [
+ "SRxSHRSPF2Geno",
+ "SRxSHRSPF2 Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "SRxSHRSPF2Publish",
+ "SRxSHRSPF2 Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "soybean": {
+ "J12XJ58F2": {
+ "Genotypes": [
+ [
+ "J12XJ58F2Geno",
+ "J12XJ58F2 Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "J12XJ58F2Publish",
+ "J12XJ58F2 Published Phenotypes"
+ ]
+ ]
+ }
+ },
+ "tomato": {
+ "LXP": {
+ "Genotypes": [
+ [
+ "LXPGeno",
+ "LXP Genotypes"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "LXPPublish",
+ "LXP Published Phenotypes"
+ ]
+ ]
+ }
+ }
+ },
+ "groups": {
+ "All Species": [
+ [
+ "All Groups",
+ "All Groups"
+ ]
+ ],
+ "arabidopsis": [
+ [
+ "BayXSha",
+ "BayXSha"
+ ],
+ [
+ "ColXBur",
+ "ColXBur"
+ ],
+ [
+ "ColXCvi",
+ "ColXCvi"
+ ]
+ ],
+ "barley": [
+ [
+ "QSM",
+ "QSM"
+ ],
+ [
+ "SXM",
+ "SXM"
+ ]
+ ],
+ "drosophila": [
+ [
+ "DGRP",
+ "Drosophila Genetic Reference Panel"
+ ],
+ [
+ "Oregon-R_x_2b3",
+ "Oregon-R x 2b3"
+ ]
+ ],
+ "human": [
+ [
+ "AD-cases-controls",
+ "AD Cases & Controls (Liang)"
+ ],
+ [
+ "AD-cases-controls-Myers",
+ "AD Cases & Controls (Myers)"
+ ],
+ [
+ "CANDLE",
+ "CANDLE"
+ ],
+ [
+ "CEPH-2004",
+ "CEPH Families"
+ ],
+ [
+ "HB",
+ "Harvard Brain Tissue Resource Center"
+ ],
+ [
+ "HLC",
+ "Human Liver Cohort"
+ ],
+ [
+ "HSB",
+ "KIN/YSM"
+ ]
+ ],
+ "macaque monkey": [
+ [
+ "Macaca-fasicularis",
+ "Macaca fasicularis (Cynomolgus monkey)"
+ ]
+ ],
+ "mouse": [
+ [
+ "AKXD",
+ "AKXD"
+ ],
+ [
+ "AXBXA",
+ "AXB/BXA"
+ ],
+ [
+ "B6BTBRF2",
+ "B6BTBRF2"
+ ],
+ [
+ "B6D2F2",
+ "B6D2F2"
+ ],
+ [
+ "BDF2-1999",
+ "BDF2 UCLA"
+ ],
+ [
+ "BDF2-2005",
+ "BDF2-2005"
+ ],
+ [
+ "BHF2",
+ "BHF2 (Apoe Null) UCLA"
+ ],
+ [
+ "BHHBF2",
+ "BH/HB F2 UCLA"
+ ],
+ [
+ "BXD",
+ "BXD"
+ ],
+ [
+ "BXH",
+ "BXH"
+ ],
+ [
+ "CTB6F2",
+ "CastB6/B6Cast F2 UCLA"
+ ],
+ [
+ "CXB",
+ "CXB"
+ ],
+ [
+ "HS",
+ "Heterogeneous Stock"
+ ],
+ [
+ "HS-CC",
+ "Heterogeneous Stock Collaborative Cross"
+ ],
+ [
+ "LXS",
+ "LXS"
+ ],
+ [
+ "MDP",
+ "Mouse Diversity Panel"
+ ],
+ [
+ "NZBXFVB-N2",
+ "NZB/FVB N2 NCI"
+ ]
+ ],
+ "rat": [
+ [
+ "HXBBXH",
+ "HXB/BXH"
+ ],
+ [
+ "SRxSHRSPF2",
+ "UIOWA SRxSHRSP F2"
+ ]
+ ],
+ "soybean": [
+ [
+ "J12XJ58F2",
+ "J12XJ58F2"
+ ]
+ ],
+ "tomato": [
+ [
+ "LXP",
+ "LXP"
+ ]
+ ]
+ },
+ "species": [
+ [
+ "human",
+ "Human"
+ ],
+ [
+ "macaque monkey",
+ "Macaque monkey"
+ ],
+ [
+ "mouse",
+ "Mouse"
+ ],
+ [
+ "rat",
+ "Rat"
+ ],
+ [
+ "drosophila",
+ "Drosophila"
+ ],
+ [
+ "arabidopsis",
+ "Arabidopsis thaliana"
+ ],
+ [
+ "barley",
+ "Barley"
+ ],
+ [
+ "soybean",
+ "Soybean"
+ ],
+ [
+ "tomato",
+ "Tomato"
+ ],
+ [
+ "All Species",
+ "All Species"
+ ]
+ ],
+ "types": {
+ "All Species": {
+ "All Groups": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ]
+ ]
+ },
+ "arabidopsis": {
+ "BayXSha": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ]
+ ],
+ "ColXBur": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ]
+ ],
+ "ColXCvi": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ]
+ ]
+ },
+ "barley": {
+ "QSM": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Leaf",
+ "Leaf mRNA"
+ ]
+ ],
+ "SXM": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Embryo",
+ "Embryo mRNA"
+ ],
+ [
+ "Leaf",
+ "Leaf mRNA"
+ ]
+ ]
+ },
+ "drosophila": {
+ "DGRP": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Whole Body",
+ "Whole Body mRNA"
+ ]
+ ],
+ "Oregon-R_x_2b3": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Whole Body",
+ "Whole Body mRNA"
+ ]
+ ]
+ },
+ "human": {
+ "AD-cases-controls": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ]
+ ],
+ "AD-cases-controls-Myers": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ]
+ ],
+ "CANDLE": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Newborn Cord Blood",
+ "Newborn Cord Blood mRNA"
+ ]
+ ],
+ "CEPH-2004": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Lymphoblast B-cell",
+ "Lymphoblast B-cell mRNA"
+ ]
+ ],
+ "HB": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Cerebellum",
+ "Cerebellum mRNA"
+ ],
+ [
+ "Prefrontal Cortex",
+ "Prefrontal Cortex mRNA"
+ ],
+ [
+ "Primary Visual Cortex",
+ "Primary Visual Cortex mRNA"
+ ]
+ ],
+ "HLC": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ]
+ ],
+ "HSB": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Amygdala",
+ "Amygdala mRNA"
+ ],
+ [
+ "Caudal Ganglionic Eminence",
+ "Caudal Ganglionic Eminence mRNA"
+ ],
+ [
+ "Cerebellar Cortex",
+ "Cerebellar Cortex mRNA"
+ ],
+ [
+ "Diencephalon",
+ "Diencephalon mRNA"
+ ],
+ [
+ "Dorsal Thalamus",
+ "Dorsal Thalamus mRNA"
+ ],
+ [
+ "Dorsolateral Prefrontal Cortex",
+ "Dorsolateral Prefrontal Cortex mRNA"
+ ],
+ [
+ "Frontal Cerebral Wall",
+ "Frontal Cerebral Wall mRNA"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Inferior Temporal Cortex",
+ "Inferior Temporal Cortex mRNA"
+ ],
+ [
+ "Lateral Ganglionic Eminence",
+ "Lateral Ganglionic Eminence mRNA"
+ ],
+ [
+ "Medial Ganglionic Eminence",
+ "Medial Ganglionic Eminence mRNA"
+ ],
+ [
+ "Medial Prefrontal Cortex",
+ "Medial Prefrontal Cortex mRNA"
+ ],
+ [
+ "Mediodorsal Nucleus of Thalamus",
+ "Mediodorsal Nucleus of Thalamus mRNA"
+ ],
+ [
+ "Occipital Cerebral Wall",
+ "Occipital Cerebral Wall mRNA"
+ ],
+ [
+ "Orbital Prefrontal Cortex",
+ "Orbital Prefrontal Cortex mRNA"
+ ],
+ [
+ "Parietal Cerebral Wall",
+ "Parietal Cerebral Wall mRNA"
+ ],
+ [
+ "Posterior Inferior Parietal Cortex",
+ "Posterior Inferior Parietal Cortex mRNA"
+ ],
+ [
+ "Posterior Superior Temporal Cortex",
+ "Posterior Superior Temporal Cortex mRNA"
+ ],
+ [
+ "Primary Auditory (A1) Cortex",
+ "Primary Auditory (A1) Cortex mRNA"
+ ],
+ [
+ "Primary Motor (M1) Cortex",
+ "Primary Motor (M1) Cortex mRNA"
+ ],
+ [
+ "Primary Somatosensory (S1) Cortex",
+ "Primary Somatosensory (S1) Cortex mRNA"
+ ],
+ [
+ "Primary Visual Cortex",
+ "Primary Visual Cortex mRNA"
+ ],
+ [
+ "Striatum",
+ "Striatum mRNA"
+ ],
+ [
+ "Temporal Cerebral Wall",
+ "Temporal Cerebral Wall mRNA"
+ ],
+ [
+ "Upper (Rostral) Rhombic Lip",
+ "Upper (Rostral) Rhombic Lip mRNA"
+ ],
+ [
+ "Ventral Forebrain",
+ "Ventral Forebrain mRNA"
+ ],
+ [
+ "Ventrolateral Prefrontal Cortex",
+ "Ventrolateral Prefrontal Cortex mRNA"
+ ]
+ ]
+ },
+ "macaque monkey": {
+ "Macaca-fasicularis": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Amygdala",
+ "Amygdala mRNA"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Nucleus Accumbens",
+ "Nucleus Accumbens mRNA"
+ ],
+ [
+ "Prefrontal Cortex",
+ "Prefrontal Cortex mRNA"
+ ]
+ ]
+ },
+ "mouse": {
+ "AKXD": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Mammary Tumors",
+ "Mammary Tumors mRNA"
+ ]
+ ],
+ "AXBXA": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Eye",
+ "Eye mRNA"
+ ]
+ ],
+ "B6BTBRF2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ]
+ ],
+ "B6D2F2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ]
+ ],
+ "BDF2-1999": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ]
+ ],
+ "BDF2-2005": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Striatum",
+ "Striatum mRNA"
+ ]
+ ],
+ "BHF2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Adipose",
+ "Adipose mRNA"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Muscle",
+ "Muscle mRNA"
+ ]
+ ],
+ "BHHBF2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Adipose",
+ "Adipose mRNA"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Muscle",
+ "Muscle mRNA"
+ ]
+ ],
+ "BXD": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Amygdala",
+ "Amygdala mRNA"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ],
+ [
+ "Cartilage",
+ "Cartilage mRNA"
+ ],
+ [
+ "Cerebellum",
+ "Cerebellum mRNA"
+ ],
+ [
+ "Eye",
+ "Eye mRNA"
+ ],
+ [
+ "Hematopoietic Cells",
+ "Hematopoietic Cells mRNA"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Hypothalamus",
+ "Hypothalamus mRNA"
+ ],
+ [
+ "Kidney",
+ "Kidney mRNA"
+ ],
+ [
+ "Leucocytes",
+ "Leucocytes mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Lung",
+ "Lung mRNA"
+ ],
+ [
+ "Midbrain",
+ "Midbrain mRNA"
+ ],
+ [
+ "Muscle",
+ "Muscle mRNA"
+ ],
+ [
+ "Neocortex",
+ "Neocortex mRNA"
+ ],
+ [
+ "Nucleus Accumbens",
+ "Nucleus Accumbens mRNA"
+ ],
+ [
+ "Prefrontal Cortex",
+ "Prefrontal Cortex mRNA"
+ ],
+ [
+ "Retina",
+ "Retina mRNA"
+ ],
+ [
+ "Spleen",
+ "Spleen mRNA"
+ ],
+ [
+ "Striatum",
+ "Striatum mRNA"
+ ],
+ [
+ "T Cell (helper)",
+ "T Cell (helper) mRNA"
+ ],
+ [
+ "T Cell (regulatory)",
+ "T Cell (regulatory) mRNA"
+ ],
+ [
+ "Thymus",
+ "Thymus mRNA"
+ ],
+ [
+ "Ventral Tegmental Area",
+ "Ventral Tegmental Area mRNA"
+ ]
+ ],
+ "BXH": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Cartilage",
+ "Cartilage mRNA"
+ ]
+ ],
+ "CTB6F2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Adipose",
+ "Adipose mRNA"
+ ],
+ [
+ "Brain",
+ "Brain mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Muscle",
+ "Muscle mRNA"
+ ]
+ ],
+ "CXB": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Spleen",
+ "Spleen mRNA"
+ ]
+ ],
+ "HS": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Lung",
+ "Lung mRNA"
+ ]
+ ],
+ "HS-CC": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Striatum",
+ "Striatum mRNA"
+ ]
+ ],
+ "LXS": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Prefrontal Cortex",
+ "Prefrontal Cortex mRNA"
+ ]
+ ],
+ "MDP": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ]
+ ],
+ "NZBXFVB-N2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Mammary Tumors",
+ "Mammary Tumors mRNA"
+ ]
+ ]
+ },
+ "rat": {
+ "HXBBXH": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Adrenal Gland",
+ "Adrenal Gland mRNA"
+ ],
+ [
+ "Heart",
+ "Heart mRNA"
+ ],
+ [
+ "Hippocampus",
+ "Hippocampus mRNA"
+ ],
+ [
+ "Kidney",
+ "Kidney mRNA"
+ ],
+ [
+ "Liver",
+ "Liver mRNA"
+ ],
+ [
+ "Peritoneal Fat",
+ "Peritoneal Fat mRNA"
+ ]
+ ],
+ "SRxSHRSPF2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Eye",
+ "Eye mRNA"
+ ]
+ ]
+ },
+ "soybean": {
+ "J12XJ58F2": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ]
+ ]
+ },
+ "tomato": {
+ "LXP": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ]
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index 79f6e78e..b5c1d6ac 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -11,1211 +11,27 @@
+
-
-
-
-
+
diff --git a/wqflask/wqflask/templates/show_trait_calculate_correlations.html b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
new file mode 100644
index 00000000..543afadd
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
@@ -0,0 +1,130 @@
+
+
+
+
+
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
new file mode 100644
index 00000000..e45886b4
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -0,0 +1,63 @@
+
+ Aliases
+ {{ this_trait.alias_fmt }}
+
+ Location
+ {{ this_trait.location_fmt }}
+
+ Database
+
+
+ {{ this_trait.database.name }}
+
+
+
+
+
+ BLAT Specifity
+
+
+ {{ "%.1f" % (this_trait.probe_set_specificity) }}
+
+ BLAT Score
+ {{ "%i" % (this_trait.probe_set_blat_score) }}
+
+
+
+
+
diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html
new file mode 100644
index 00000000..ce1642d3
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_edit_data.html
@@ -0,0 +1,163 @@
+
+
Review and Edit Data
+
+
+
+
+
+
+
+ {% for sample_type in sample_groups %}
+
+
{{ sample_type.header }}
+
+
+
+ {% endfor %}
+
+
+
+
+
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
new file mode 100644
index 00000000..90498e9a
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
new file mode 100644
index 00000000..eda5466e
--- /dev/null
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -0,0 +1,433 @@
+
+
+
+
Basic Statistics
+
+
+
Include:
+
+ {% for group, pretty_group in sample_group_types.items() %}
+
+ {{ pretty_group }}
+
+ {% endfor %}
+
+
+
+
+
+ {% for sd in stats_data %}
+
+
+
+
+
+
+
+
+
+ Statistic
+
+ Value
+
+
+
+ N of Samples
+
+ {{ sd.N }}
+
+
+
+ Mean
+
+ {{ "%2.3f" % sd.traitmean }}
+
+
+
+ Median
+
+ {{ "%2.3f" % sd.traitmedian }}
+
+
+
+ Standard Error (SE)
+
+ {{ "%2.3f" % sd.traitsem }}
+
+
+
+ Standard Deviation (SD)
+
+ {{ "%2.3f" % sd.traitstdev }}
+
+
+
+ Minimum
+
+ {{ "%2.3f" % sd.min }}
+
+
+
+ Maximum
+
+ {{ "%2.3f" % sd.max }}
+
+
+
+ Range (log2)
+
+ {{ "%2.3f" % sd.range_log2 }}
+
+
+
+ Range (fold)
+
+ {{ "%2.3f" % sd.range_fold }}
+
+
+
+ Interquartile Range
+
+ {{ "%2.3f" % sd.interquartile }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This plot evaluates whether data are normally distributed. Different symbols represent different groups.
+
+ More about Normal Probability Plots and more
+ about interpreting these plots from the glossary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% endfor %}
+ {# Not used now - Todo: Delete after we're sure this is right.
+
+
+
+
+
+
+
+
+
+ Statistic
+
+ Value
+
+
+
+ N of Samples
+
+ 71
+
+
+
+ Mean
+
+ 6.109
+
+
+
+ Median
+
+ 6.084
+
+
+
+ Standard Error (SE)
+
+ 0.022
+
+
+
+ Standard Deviation (SD)
+
+ 0.187
+
+
+
+ Minimum
+
+ 5.782
+
+
+
+ Maximum
+
+ 6.579
+
+
+
+ Range (log2)
+
+ 0.797
+
+
+
+ Range (fold)
+
+ 1.74
+
+
+
+ Interquartile Range
+
+ 1.13
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This plot evaluates whether data are normally distributed. Different symbols represent different groups.
+
+ More about Normal Probability Plots and more
+ about interpreting these plots from the glossary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Statistic
+
+ Value
+
+
+
+ N of Samples
+
+ 32
+
+
+
+ Mean
+
+ 6.176
+
+
+
+ Median
+
+ 6.170
+
+
+
+ Standard Error (SE)
+
+ 0.027
+
+
+
+ Standard Deviation (SD)
+
+ 0.150
+
+
+
+ Minimum
+
+ 5.906
+
+
+
+ Maximum
+
+ 6.485
+
+
+
+ Range (log2)
+
+ 0.579
+
+
+
+ Range (fold)
+
+ 1.49
+
+
+
+ Interquartile Range
+
+ 1.15
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This plot evaluates whether data are normally distributed. Different symbols represent different groups.
+
+ More about Normal Probability Plots and more
+ about interpreting these plots from the glossary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #}
--
cgit v1.2.3
From 94dd9844fb55f4576d3a079e9d5e59ebbf911b8c Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Tue, 27 Nov 2012 17:59:17 -0600
Subject: Created subclass for each main data set type and moved the code for
getting trait info that was in search_results.py into its respective class
Renamed webqtlDataset to DataSet/create_dataset in webqtlTrait.py,
webqtlDatabaseFunction.py, and CorrelationPage.py
Got search page running again for mRNA assay data sets with these changes
---
web/webqtl/search/SearchResultPage.py | 6 +-
wqflask/base/data_set.py | 556 ++++++++++++++++++++-----
wqflask/base/webqtlTrait.py | 25 +-
wqflask/dbFunction/webqtlDatabaseFunction.py | 23 +-
wqflask/wqflask/correlation/CorrelationPage.py | 4 +-
wqflask/wqflask/do_search.py | 22 +-
wqflask/wqflask/search_results.py | 325 +--------------
7 files changed, 514 insertions(+), 447 deletions(-)
(limited to 'web/webqtl')
diff --git a/web/webqtl/search/SearchResultPage.py b/web/webqtl/search/SearchResultPage.py
index 029a54c4..d62bb449 100755
--- a/web/webqtl/search/SearchResultPage.py
+++ b/web/webqtl/search/SearchResultPage.py
@@ -14,7 +14,7 @@ from htmlgen import HTMLgen2 as HT
from base import webqtlConfig
from utility.THCell import THCell
from utility.TDCell import TDCell
-from base.webqtlDataset import webqtlDataset
+from base.data_set import DataSet
from base.webqtlTrait import webqtlTrait
from base.templatePage import templatePage
from utility import webqtlUtil
@@ -65,12 +65,12 @@ class SearchResultPage(templatePage):
InbredSet where PublishFreeze.Name not like 'BXD300%' and InbredSet.Id =
PublishFreeze.InbredSetId""")
results = self.cursor.fetchall()
- self.database = map(lambda x: webqtlDataset(x[0], self.cursor), results)
+ self.database = map(lambda x: DataSet(x[0], self.cursor), results)
self.databaseCrosses = map(lambda x: x[1], results)
self.databaseCrossIds = map(lambda x: x[2], results)
self.singleCross = False
else:
- self.database = map(lambda x: webqtlDataset(x, self.cursor), self.database)
+ self.database = map(lambda x: DataSet(x, self.cursor), self.database)
#currently, webqtl wouldn't allow multiple crosses
#for other than multiple publish db search
#so we can use the first database as example
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 992c673e..9e3e6d81 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -19,64 +19,64 @@
#
#
# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by GeneNetwork Core Team 2010/10/20
+
+from __future__ import print_function, division
from htmlgen import HTMLgen2 as HT
import webqtlConfig
+from pprint import pformat as pf
+# Used by create_database to instantiate objects
+DS_NAME_MAP = {}
+
+def create_dataset(db_conn, dataset_name):
+ cursor = db_conn.cursor()
+ cursor.execute("""
+ SELECT DBType.Name
+ FROM DBList, DBType
+ WHERE DBList.Name = %s and
+ DBType.Id = DBList.DBTypeId
+ """, (dataset_name))
+ print("dataset_name:", dataset_name)
+ dataset_type = cursor.fetchone()[0]
+ print("dataset_type:", pf(dataset_type))
+
+ dataset_ob = DS_NAME_MAP[dataset_type]
+ #dataset_class = getattr(data_set, dataset_ob)
+
+ print("DS_NAME_MAP:", pf(DS_NAME_MAP))
+
+ dataset_class = globals()[dataset_ob]
+ return dataset_class(dataset_name, db_conn)
class DataSet(object):
"""
- Dataset class defines a dataset in webqtl, can be either Microarray,
+ DataSet class defines a dataset in webqtl, can be either Microarray,
Published phenotype, genotype, or user input dataset(temp)
"""
- def __init__(self, dbName, cursor=None):
-
- assert dbName
- self.id = 0
- self.name = ''
- self.type = ''
- self.group = ''
- self.cursor = cursor
-
- #temporary storage
- if dbName.find('Temp') >= 0:
- self.searchfield = ['name','description']
- self.disfield = ['name','description']
- self.type = 'Temp'
- self.id = 1
- self.fullname = 'Temporary Storage'
- self.shortname = 'Temp'
- elif dbName.find('Publish') >= 0:
- pass
- elif dbName.find('Geno') >= 0:
- self.searchfield = ['name','chr']
- self.disfield = ['name','chr','mb', 'source2', 'sequence']
- self.type = 'Geno'
- else: #ProbeSet
- self.searchfield = ['name','description','probe_target_description',
- 'symbol','alias','genbankid','unigeneid','omim',
- 'refseq_transcriptid','probe_set_specificity', 'probe_set_blat_score']
- self.disfield = ['name','symbol','description','probe_target_description',
- 'chr','mb','alias','geneid','genbankid', 'unigeneid', 'omim',
- 'refseq_transcriptid','blatseq','targetseq','chipid', 'comments',
- 'strand_probe','strand_gene','probe_set_target_region',
- 'probe_set_specificity', 'probe_set_blat_score','probe_set_blat_mb_start',
- 'probe_set_blat_mb_end', 'probe_set_strand',
- 'probe_set_note_by_rw', 'flag']
- self.type = 'ProbeSet'
- self.name = dbName
- if self.cursor and self.id == 0:
- self.retrieveName()
-
-
+ def __init__(self, name, db_conn):
+
+ assert name
+ self.name = name
+ self.db_conn = db_conn
+ self.cursor = self.db_conn.cursor()
+ self.id = None
+ self.type = None
+ self.group = None
+
+ #if self.cursor and self.id == 0:
+ self.setup()
+
+ self.check_confidentiality()
+
+ self.retrieve_name()
+ self.get_group()
+
+
# Delete this eventually
@property
def riset():
@@ -85,8 +85,93 @@ class DataSet(object):
def get_group(self):
assert self.cursor
- if self.type == 'Publish':
- query = '''
+ self.cursor.execute(self.query)
+ self.group, self.group_id = self.cursor.fetchone()
+ if self.group == 'BXD300':
+ self.group = "BXD"
+ #return group
+
+
+ def retrieve_name(self):
+ """
+ If the data set name parameter is not found in the 'Name' field of the data set table,
+ check if it is actually the FullName or ShortName instead.
+
+ This is not meant to retrieve the data set info if no name at all is passed.
+
+ """
+
+ query_args = tuple(self.db_conn.escape_string(x) for x in (
+ (self.type + "Freeze"),
+ str(webqtlConfig.PUBLICTHRESH),
+ self.name,
+ self.name,
+ self.name))
+ print("query_args are:", query_args)
+
+ query = '''
+ SELECT
+ Id, Name, FullName, ShortName
+ FROM
+ %s
+ WHERE
+ public > %s AND
+ (Name = "%s" OR FullName = "%s" OR ShortName = "%s")
+ ''' % (query_args)
+
+ self.cursor.execute(query)
+ self.id, self.name, self.fullname, self.shortname = self.cursor.fetchone()
+
+
+ #def genHTML(self, Class='c0dd'):
+ # return HT.Href(text = HT.Span('%s Database' % self.fullname, Class= "fwb " + Class),
+ # url= webqtlConfig.INFOPAGEHREF % self.name,target="_blank")
+
+class PhenotypeDataSet(DataSet):
+ DS_NAME_MAP['Publish'] = 'PhenotypeDataSet'
+
+ def setup(self):
+ # Fields in the database table
+ self.search_fields = ['Phenotype.Post_publication_description',
+ 'Phenotype.Pre_publication_description',
+ 'Phenotype.Pre_publication_abbreviation',
+ 'Phenotype.Post_publication_abbreviation',
+ 'Phenotype.Lab_code',
+ 'Publication.PubMed_ID',
+ 'Publication.Abstract',
+ 'Publication.Title',
+ 'Publication.Authors',
+ 'PublishXRef.Id']
+
+ # Figure out what display_fields is
+ self.display_fields = ['name',
+ 'pubmed_id',
+ 'pre_publication_description',
+ 'post_publication_description',
+ 'original_description',
+ 'pre_publication_abbreviation',
+ 'post_publication_abbreviation',
+ 'lab_code',
+ 'submitter', 'owner',
+ 'authorized_users',
+ 'authors', 'title',
+ 'abstract', 'journal',
+ 'volume', 'pages',
+ 'month', 'year',
+ 'sequence', 'units', 'comments']
+
+ # Fields displayed in the search results table header
+ self.header_fields = ['',
+ 'ID',
+ 'Description',
+ 'Authors',
+ 'Year',
+ 'Max LRS',
+ 'Max LRS Location']
+
+ self.type = 'Publish'
+
+ self.query = '''
SELECT
InbredSet.Name, InbredSet.Id
FROM
@@ -94,69 +179,336 @@ class DataSet(object):
WHERE
PublishFreeze.InbredSetId = InbredSet.Id AND
PublishFreeze.Name = "%s"
- ''' % self.name
- elif self.type == 'Geno':
- query = '''
- SELECT
- InbredSet.Name, InbredSet.Id
- FROM
- InbredSet, GenoFreeze
- WHERE
- GenoFreeze.InbredSetId = InbredSet.Id AND
- GenoFreeze.Name = "%s"
- ''' % self.name
- elif self.type == 'ProbeSet':
- query = '''
- SELECT
- InbredSet.Name, InbredSet.Id
- FROM
- InbredSet, ProbeSetFreeze, ProbeFreeze
- WHERE
- ProbeFreeze.InbredSetId = InbredSet.Id AND
- ProbeFreeze.Id = ProbeSetFreeze.ProbeFreezeId AND
- ProbeSetFreeze.Name = "%s"
- ''' % self.name
- else:
- return ""
- self.cursor.execute(query)
- group, RIID = self.cursor.fetchone()
- if group == 'BXD300':
- group = "BXD"
- self.group = group
- self.group_id = RIID
- return group
+ ''' % self.db_conn.escape_string(self.name)
+
+ def check_confidentiality(self):
+ # (Urgently?) Need to write this
+ pass
+
+ def get_trait_info(self, trait_list, species = ''):
+ for this_trait in trait_list:
+ if not this_trait.haveinfo:
+ this_trait.retrieveInfo(QTL=1)
+
+ description = this_trait.post_publication_description
+ if this_trait.confidential:
+ if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
+ description = this_trait.pre_publication_description
+ this_trait.description_display = description
+
+ if not this_trait.year.isdigit():
+ this_trait.pubmed_text = "N/A"
+
+ if this_trait.pubmed_id:
+ this_trait.pubmed_link = webqtlConfig.PUBMEDLINK_URL % this_trait.pubmed_id
+
+ #LRS and its location
+ this_trait.LRS_score_repr = "N/A"
+ this_trait.LRS_score_value = 0
+ this_trait.LRS_location_repr = "N/A"
+ this_trait.LRS_location_value = 1000000
+
+ if this_trait.lrs:
+ self.cursor.execute("""
+ select Geno.Chr, Geno.Mb from Geno, Species
+ where Species.Name = '%s' and
+ Geno.Name = '%s' and
+ Geno.SpeciesId = Species.Id
+ """ % (species, this_trait.locus))
+ result = self.cursor.fetchone()
+ if result:
+ if result[0] and result[1]:
+ LRS_Chr = result[0]
+ LRS_Mb = result[1]
- def retrieveName(self):
- assert self.id == 0 and self.cursor
+ #XZ: LRS_location_value is used for sorting
+ try:
+ LRS_location_value = int(LRS_Chr)*1000 + float(LRS_Mb)
+ except:
+ if LRS_Chr.upper() == 'X':
+ LRS_location_value = 20*1000 + float(LRS_Mb)
+ else:
+ LRS_location_value = ord(str(LRS_chr).upper()[0])*1000 + float(LRS_Mb)
+
+ this_trait.LRS_score_repr = LRS_score_repr = '%3.1f' % this_trait.lrs
+ this_trait.LRS_score_value = LRS_score_value = this_trait.lrs
+ this_trait.LRS_location_repr = LRS_location_repr = 'Chr %s: %.4f Mb' % (LRS_Chr, float(LRS_Mb) )
+
+class GenotypeDataSet(DataSet):
+ DS_NAME_MAP['Geno'] = 'GenotypeDataSet'
+
+ def setup(self):
+ # Fields in the database table
+ self.search_fields = ['Name',
+ 'Chr']
+
+ # Find out what display_fields is
+ self.display_fields = ['name',
+ 'chr',
+ 'mb',
+ 'source2',
+ 'sequence']
+
+ # Fields displayed in the search results table header
+ self.header_fields = ['',
+ 'ID',
+ 'Location']
+
+ # Todo: Obsolete or rename this field
+ self.type = 'Geno'
+
query = '''
SELECT
- Id, Name, FullName, ShortName
+ InbredSet.Name, InbredSet.Id
FROM
- %sFreeze
+ InbredSet, GenoFreeze
WHERE
- public > %d AND
- (Name = "%s" OR FullName = "%s" OR ShortName = "%s")
- '''% (self.type, webqtlConfig.PUBLICTHRESH, self.name, self.name, self.name)
- try:
+ GenoFreeze.InbredSetId = InbredSet.Id AND
+ GenoFreeze.Name = "%s"
+ ''' % self.db_conn.escape_string(self.name)
+
+ def check_confidentiality(self):
+ return geno_mrna_confidentiality(self)
+
+ def get_trait_info(self, trait_list):
+ for this_trait in trait_list:
+ if not this_trait.haveinfo:
+ this_trait.retrieveInfo()
+
+ #XZ: trait_location_value is used for sorting
+ trait_location_repr = 'N/A'
+ trait_location_value = 1000000
+
+ if this_trait.chr and this_trait.mb:
+ try:
+ trait_location_value = int(this_trait.chr)*1000 + this_trait.mb
+ except:
+ if this_trait.chr.upper() == 'X':
+ trait_location_value = 20*1000 + this_trait.mb
+ else:
+ trait_location_value = ord(str(this_trait.chr).upper()[0])*1000 + this_trait.mb
+
+ this_trait.location_repr = 'Chr%s: %.4f' % (this_trait.chr, float(this_trait.mb) )
+ this_trait.location_value = trait_location_value
+
+
+class MrnaAssayDataSet(DataSet):
+ '''
+ An mRNA Assay is a quantitative assessment (assay) associated with an mRNA trait
+
+ This used to be called ProbeSet, but that term only refers specifically to the Affymetrix
+ platform and is far too specific.
+
+ '''
+ DS_NAME_MAP['ProbeSet'] = 'MrnaAssayDataSet'
+
+ def setup(self):
+ # Fields in the database table
+ self.search_fields = ['Name',
+ 'Description',
+ 'Probe_Target_Description',
+ 'Symbol',
+ 'Alias',
+ 'GenbankId',
+ 'UniGeneId',
+ 'RefSeq_TranscriptId']
+
+ # Find out what display_fields is
+ self.display_fields = ['name', 'symbol',
+ 'description', 'probe_target_description',
+ 'chr', 'mb',
+ 'alias', 'geneid',
+ 'genbankid', 'unigeneid',
+ 'omim', 'refseq_transcriptid',
+ 'blatseq', 'targetseq',
+ 'chipid', 'comments',
+ 'strand_probe', 'strand_gene',
+ 'probe_set_target_region',
+ 'probe_set_specificity',
+ 'probe_set_blat_score',
+ 'probe_set_blat_mb_start',
+ 'probe_set_blat_mb_end',
+ 'probe_set_strand',
+ 'probe_set_note_by_rw',
+ 'flag']
+
+ # Fields displayed in the search results table header
+ self.header_fields = ['',
+ 'ID',
+ 'Symbol',
+ 'Description',
+ 'Location',
+ 'Mean Expr',
+ 'Max LRS',
+ 'Max LRS Location']
+
+ # Todo: Obsolete or rename this field
+ self.type = 'ProbeSet'
+
+ self.query = '''
+ SELECT
+ InbredSet.Name, InbredSet.Id
+ FROM
+ InbredSet, ProbeSetFreeze, ProbeFreeze
+ WHERE
+ ProbeFreeze.InbredSetId = InbredSet.Id AND
+ ProbeFreeze.Id = ProbeSetFreeze.ProbeFreezeId AND
+ ProbeSetFreeze.Name = "%s"
+ ''' % self.db_conn.escape_string(self.name)
+
+
+ def check_confidentiality(self):
+ return geno_mrna_confidentiality(self)
+
+ def get_trait_info(self, trait_list=None, species=''):
+
+ # Note: setting trait_list to [] is probably not a great idea.
+ if not trait_list:
+ trait_list = []
+
+ for this_trait in trait_list:
+
+ if not this_trait.haveinfo:
+ this_trait.retrieveInfo(QTL=1)
+
+ if this_trait.symbol:
+ pass
+ else:
+ this_trait.symbol = "N/A"
+
+ #XZ, 12/08/2008: description
+ #XZ, 06/05/2009: Rob asked to add probe target description
+ description_string = str(this_trait.description).strip()
+ target_string = str(this_trait.probe_target_description).strip()
+
+ description_display = ''
+
+ if len(description_string) > 1 and description_string != 'None':
+ description_display = description_string
+ else:
+ description_display = this_trait.symbol
+
+ if len(description_display) > 1 and description_display != 'N/A' and len(target_string) > 1 and target_string != 'None':
+ description_display = description_display + '; ' + target_string.strip()
+
+ # Save it for the jinja2 tablet
+ this_trait.description_display = description_display
+
+ #XZ: trait_location_value is used for sorting
+ trait_location_repr = 'N/A'
+ trait_location_value = 1000000
+
+ if this_trait.chr and this_trait.mb:
+ try:
+ trait_location_value = int(this_trait.chr)*1000 + this_trait.mb
+ except:
+ if this_trait.chr.upper() == 'X':
+ trait_location_value = 20*1000 + this_trait.mb
+ else:
+ trait_location_value = ord(str(this_trait.chr).upper()[0])*1000 + this_trait.mb
+
+ this_trait.location_repr = 'Chr %s: %.4f Mb' % (this_trait.chr, float(this_trait.mb) )
+ this_trait.location_value = trait_location_value
+ #this_trait.trait_location_value = trait_location_value
+
+ #XZ, 01/12/08: This SQL query is much faster.
+ query = (
+"""select ProbeSetXRef.mean from ProbeSetXRef, ProbeSet
+ where ProbeSetXRef.ProbeSetFreezeId = %s and
+ ProbeSet.Id = ProbeSetXRef.ProbeSetId and
+ ProbeSet.Name = '%s'
+ """ % (self.db_conn.escape_string(str(this_trait.db.id)),
+ self.db_conn.escape_string(this_trait.name)))
+
+ print("query is:", pf(query))
+
self.cursor.execute(query)
- self.id,self.name,self.fullname,self.shortname=self.cursor.fetchone()
- except:
- raise KeyError, `self.name`+' doesn\'t exist.'
+ result = self.cursor.fetchone()
+ if result:
+ if result[0]:
+ mean = result[0]
+ else:
+ mean=0
+ else:
+ mean = 0
- def genHTML(self, Class='c0dd'):
- return HT.Href(text = HT.Span('%s Database' % self.fullname, Class= "fwb " + Class),
- url= webqtlConfig.INFOPAGEHREF % self.name,target="_blank")
+ #XZ, 06/05/2009: It is neccessary to turn on nowrap
+ this_trait.mean = repr = "%2.3f" % mean
-class PhenotypeDataSet(DataSet):
+ #LRS and its location
+ this_trait.LRS_score_repr = 'N/A'
+ this_trait.LRS_score_value = 0
+ this_trait.LRS_location_repr = 'N/A'
+ this_trait.LRS_location_value = 1000000
+
+ #Max LRS and its Locus location
+ if this_trait.lrs and this_trait.locus:
+ self.cursor.execute("""
+ select Geno.Chr, Geno.Mb from Geno, Species
+ where Species.Name = '%s' and
+ Geno.Name = '%s' and
+ Geno.SpeciesId = Species.Id
+ """ % (species, this_trait.locus))
+ result = self.cursor.fetchone()
+
+ if result:
+ if result[0] and result[1]:
+ LRS_Chr = result[0]
+ LRS_Mb = result[1]
+
+ #XZ: LRS_location_value is used for sorting
+ try:
+ LRS_location_value = int(LRS_Chr)*1000 + float(LRS_Mb)
+ except:
+ if LRS_Chr.upper() == 'X':
+ LRS_location_value = 20*1000 + float(LRS_Mb)
+ else:
+ LRS_location_value = ord(str(LRS_chr).upper()[0])*1000 + float(LRS_Mb)
+
+ this_trait.LRS_score_repr = LRS_score_repr = '%3.1f' % this_trait.lrs
+ this_trait.LRS_score_value = LRS_score_value = this_trait.lrs
+ this_trait.LRS_location_repr = LRS_location_repr = 'Chr %s: %.4f Mb' % (LRS_Chr, float(LRS_Mb) )
+
+
+class TempDataSet(DataSet):
+ '''Temporary user-generated data set'''
- def __init__(self):
- self.searchfield = ['name','post_publication_description','abstract','title','authors']
- self.disfield = ['name','pubmed_id',
- 'pre_publication_description', 'post_publication_description', 'original_description',
- 'pre_publication_abbreviation', 'post_publication_abbreviation',
- 'lab_code', 'submitter', 'owner', 'authorized_users',
- 'authors','title','abstract', 'journal','volume','pages','month',
- 'year','sequence', 'units', 'comments']
- self.type = 'Publish'
\ No newline at end of file
+ def setup(self):
+ self.search_fields = ['name',
+ 'description']
+
+ self.display_fields = ['name',
+ 'description']
+
+ self.header_fields = ['Name',
+ 'Description']
+
+ self.type = 'Temp'
+
+ # Need to double check later how these are used
+ self.id = 1
+ self.fullname = 'Temporary Storage'
+ self.shortname = 'Temp'
+
+
+def geno_mrna_confidentiality(ob):
+ dataset_table = ob.type + "Freeze"
+ print("dataset_table [%s]: %s" % (type(dataset_table), dataset_table))
+
+ query = '''SELECT Id, Name, FullName, confidentiality,
+ AuthorisedUsers FROM %s WHERE Name = %%s''' % (dataset_table)
+
+ ob.cursor.execute(query, ob.name)
+
+ (dataset_id,
+ name,
+ full_name,
+ confidential,
+ authorized_users) = ob.cursor.fetchall()[0]
+
+ if confidential:
+ # Allow confidential data later
+ NoConfindetialDataForYouTodaySorry
+
\ No newline at end of file
diff --git a/wqflask/base/webqtlTrait.py b/wqflask/base/webqtlTrait.py
index 51d36ab2..29087721 100755
--- a/wqflask/base/webqtlTrait.py
+++ b/wqflask/base/webqtlTrait.py
@@ -6,7 +6,7 @@ from htmlgen import HTMLgen2 as HT
import webqtlConfig
from webqtlCaseData import webqtlCaseData
-from webqtlDataset import webqtlDataset
+from data_set import create_dataset
from dbFunction import webqtlDatabaseFunction
from utility import webqtlUtil
@@ -20,9 +20,10 @@ class webqtlTrait:
"""
- def __init__(self, cursor = None, **kw):
+ def __init__(self, db_conn, **kw):
print("in webqtlTrait")
- self.cursor = cursor
+ self.db_conn = db_conn
+ self.cursor = self.db_conn.cursor()
self.db = None # database object
self.name = '' # Trait ID, ProbeSet ID, Published ID, etc.
self.cellid = ''
@@ -50,7 +51,7 @@ class webqtlTrait:
if self.db and isinstance(self.db, basestring):
assert self.cursor, "Don't have a cursor"
- self.db = webqtlDataset(self.db, self.cursor)
+ self.db = create_dataset(self.db_conn, self.db)
#if self.db == None, not from a database
print("self.db is:", self.db, type(self.db))
@@ -396,8 +397,8 @@ class webqtlTrait:
#XZ, 05/08/2009: Xiaodong add this block to use ProbeSet.Id to find the probeset instead of just using ProbeSet.Name
#XZ, 05/08/2009: to avoid the problem of same probeset name from different platforms.
elif self.db.type == 'ProbeSet':
- disfieldString = string.join(self.db.disfield,',ProbeSet.')
- disfieldString = 'ProbeSet.' + disfieldString
+ display_fields_string = ',ProbeSet.'.join(self.db.display_fields)
+ display_fields_string = 'ProbeSet.' + display_fields_string
query = """
SELECT %s
FROM ProbeSet, ProbeSetFreeze, ProbeSetXRef
@@ -406,12 +407,12 @@ class webqtlTrait:
ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
ProbeSetFreeze.Name = '%s' AND
ProbeSet.Name = '%s'
- """ % (disfieldString, self.db.name, self.name)
+ """ % (display_fields_string, self.db.name, self.name)
#XZ, 05/08/2009: We also should use Geno.Id to find marker instead of just using Geno.Name
# to avoid the problem of same marker name from different species.
elif self.db.type == 'Geno':
- disfieldString = string.join(self.db.disfield,',Geno.')
- disfieldString = 'Geno.' + disfieldString
+ display_fields_string = string.join(self.db.display_fields,',Geno.')
+ display_fields_string = 'Geno.' + display_fields_string
query = """
SELECT %s
FROM Geno, GenoFreeze, GenoXRef
@@ -420,10 +421,10 @@ class webqtlTrait:
GenoXRef.GenoId = Geno.Id AND
GenoFreeze.Name = '%s' AND
Geno.Name = '%s'
- """ % (disfieldString, self.db.name, self.name)
+ """ % (display_fields_string, self.db.name, self.name)
else: #Temp type
query = 'SELECT %s FROM %s WHERE Name = "%s"' % \
- (string.join(self.db.disfield,','), self.db.type, self.name)
+ (string.join(self.db.display_fields,','), self.db.type, self.name)
self.cursor.execute(query)
@@ -432,7 +433,7 @@ class webqtlTrait:
self.haveinfo = 1
#XZ: assign SQL query result to trait attributes.
- for i, field in enumerate(self.db.disfield):
+ for i, field in enumerate(self.db.display_fields):
setattr(self, field, traitInfo[i])
if self.db.type == 'Publish':
diff --git a/wqflask/dbFunction/webqtlDatabaseFunction.py b/wqflask/dbFunction/webqtlDatabaseFunction.py
index 7e33da3f..8f923b8a 100755
--- a/wqflask/dbFunction/webqtlDatabaseFunction.py
+++ b/wqflask/dbFunction/webqtlDatabaseFunction.py
@@ -19,14 +19,7 @@
#
#
# This module is used by GeneNetwork project (www.genenetwork.org)
-#
-# Created by GeneNetwork Core Team 2010/08/10
-#
-# Last updated by Xiaodong Zhou 2011/Jan/20
-#webqtlDatabaseFunction.py
-#
-#This file consists of various database related functions; the names are generally self-explanatory.
import MySQLdb
import string
@@ -206,21 +199,21 @@ def getTissueCountByTissueProbeSetFreezeId(cursor=None, TissueProbeSetFreezeId=N
###########################################################################
# input: cursor, TissueProbeSetFreezeId (int)
-# output: DatasetName(string),DatasetFullName(string)
-# function: retrieve DatasetName, DatasetFullName based on TissueProbeSetFreezeId
+# output: DataSetName(string),DataSetFullName(string)
+# function: retrieve DataSetName, DataSetFullName based on TissueProbeSetFreezeId
###########################################################################
-def getDatasetNamesByTissueProbeSetFreezeId(cursor=None, TissueProbeSetFreezeId=None):
+def getDataSetNamesByTissueProbeSetFreezeId(cursor=None, TissueProbeSetFreezeId=None):
query ="select Name, FullName from TissueProbeSetFreeze where Id=%s" % TissueProbeSetFreezeId
try:
cursor.execute(query)
result = cursor.fetchone()
- DatasetName = result[0]
- DatasetFullName =result[1]
+ DataSetName = result[0]
+ DataSetFullName =result[1]
except:
- DatasetName =None
- DatasetFullName =None
+ DataSetName =None
+ DataSetFullName =None
- return DatasetName, DatasetFullName
+ return DataSetName, DataSetFullName
###########################################################################
# input: cursor, geneIdLst (list)
diff --git a/wqflask/wqflask/correlation/CorrelationPage.py b/wqflask/wqflask/correlation/CorrelationPage.py
index e48ea412..8af30d1e 100644
--- a/wqflask/wqflask/correlation/CorrelationPage.py
+++ b/wqflask/wqflask/correlation/CorrelationPage.py
@@ -47,7 +47,7 @@ from base import webqtlConfig
from utility.THCell import THCell
from utility.TDCell import TDCell
from base.webqtlTrait import webqtlTrait
-from base.webqtlDataset import webqtlDataset
+from base.data_set import create_dataset
from base.templatePage import templatePage
from utility import webqtlUtil
from dbFunction import webqtlDatabaseFunction
@@ -310,7 +310,7 @@ class CorrelationPage(templatePage):
#try:
#print("target_db_name is:", target_db_name)
- self.db = webqtlDataset(self.target_db_name, self.cursor)
+ self.db = create_dataset(self.db_conn, self.target_db_name)
#except:
# detail = ["The database you just requested has not been established yet."]
# self.error(detail)
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index e2bafb3a..73a72e00 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -147,7 +147,7 @@ class GenotypeSearch(DoSearch):
"""WHERE %s and
Geno.Id = GenoXRef.GenoId and
GenoXRef.GenoFreezeId = GenoFreeze.Id and
- GenoFreeze.Id = %s"""% (
+ GenoFreeze.Id = %s""" % (
self.get_where_clause(),
self.escape(self.dataset.id)))
@@ -257,7 +257,7 @@ class GoSearch(ProbeSetSearch):
statements = ("""%s.symbol=GOgene_product.symbol and
GOassociation.gene_product_id=GOgene_product.id and
GOterm.id=GOassociation.term_id""" % (
- self.db_conn.escape_string(self.dataset.type)))
+ self.escape(self.dataset.type)))
where_clause = " %s = '%s' and %s " % (field, go_id, statements)
@@ -317,14 +317,14 @@ class CisLrsSearch(ProbeSetSearch):
Geno.SpeciesId = %s and
%s.Chr = Geno.Chr and
ABS(%s.Mb-Geno.Mb) < %s """ % (
- self.dataset.type,
+ self.escape(self.dataset.type),
min(lower_limit, upper_limit),
- self.dataset.type,
+ self.escape(self.dataset.type),
max(lower_limit, upper_limit),
- self.dataset.type,
+ self.escape(self.dataset.type),
self.species_id,
- self.dataset.type,
- self.dataset.type,
+ self.escape(self.dataset.type),
+ self.escape(self.dataset.type),
min_threshold
)
else:
@@ -437,7 +437,7 @@ if __name__ == "__main__":
from base import webqtlConfig
- from base.webqtlDataset import webqtlDataset
+ from base.data_set import create_dataset
from base.templatePage import templatePage
from utility import webqtlUtil
from dbFunction import webqtlDatabaseFunction
@@ -449,13 +449,13 @@ if __name__ == "__main__":
cursor = db_conn.cursor()
dataset_name = "HC_M2_0606_P"
- dataset = webqtlDataset(dataset_name, cursor)
+ dataset = create_dataset(db_conn, dataset_name)
#results = ProbeSetSearch("salt", dataset, cursor, db_conn).run()
#results = RifSearch("diabetes", dataset, cursor, db_conn).run()
#results = WikiSearch("nicotine", dataset, cursor, db_conn).run()
- results = TransLrsSearch(['25','99','10'], dataset, cursor, db_conn).run()
- #results = TransLrsSearch(['9', '999', '10'], dataset, cursor, db_conn).run()
+ results = CisLrsSearch(['25','99','10'], dataset, cursor, db_conn).run()
+ #results = TransLrsSearch(['25', '999', '10'], dataset, cursor, db_conn).run()
#results = PhenotypeSearch("brain", dataset, cursor, db_conn).run()
#results = GenotypeSearch("rs13475699", dataset, cursor, db_conn).run()
#results = GoSearch("0045202", dataset, cursor, db_conn).run()
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 05f062fc..b50e45d5 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -10,7 +10,7 @@ from flask import render_template
# #
###################################################
-import string
+#import string
import os
import cPickle
import re
@@ -29,7 +29,7 @@ from htmlgen import HTMLgen2 as HT
from base import webqtlConfig
from utility.THCell import THCell
from utility.TDCell import TDCell
-from base.webqtlDataset import webqtlDataset
+from base.data_set import create_dataset
from base.webqtlTrait import webqtlTrait
from base.templatePage import templatePage
from wqflask import parser
@@ -43,14 +43,13 @@ from utility import formatting
class SearchResultPage(templatePage):
+ #maxReturn = 3000
- maxReturn = 3000
- nkeywords = 0
def __init__(self, fd):
print("initing SearchResultPage")
- import logging_tree
- logging_tree.printout()
+ #import logging_tree
+ #logging_tree.printout()
self.fd = fd
templatePage.__init__(self, fd)
assert self.openMysql(), "Couldn't open MySQL"
@@ -59,127 +58,40 @@ class SearchResultPage(templatePage):
self.dataset = fd['dataset']
# change back to self.dataset
- if not self.dataset or self.dataset == 'spacer':
- #Error, No dataset selected
- heading = "Search Result"
- detail = ['''No dataset was selected for this search, please
- go back and SELECT at least one dataset.''']
- self.error(heading=heading,detail=detail,error="No dataset Selected")
- return
+ #if not self.dataset or self.dataset == 'spacer':
+ # #Error, No dataset selected
+ # heading = "Search Result"
+ # detail = ['''No dataset was selected for this search, please
+ # go back and SELECT at least one dataset.''']
+ # self.error(heading=heading,detail=detail,error="No dataset Selected")
+ # return
###########################################
# Names and IDs of RISet / F2 set
###########################################
+
+ # All Phenotypes is a special case we'll deal with later
if self.dataset == "All Phenotypes":
self.cursor.execute("""
select PublishFreeze.Name, InbredSet.Name, InbredSet.Id from PublishFreeze,
InbredSet where PublishFreeze.Name not like 'BXD300%' and InbredSet.Id =
PublishFreeze.InbredSetId""")
results = self.cursor.fetchall()
- self.dataset = map(lambda x: webqtlDataset(x[0], self.cursor), results)
+ self.dataset = map(lambda x: DataSet(x[0], self.cursor), results)
self.dataset_groups = map(lambda x: x[1], results)
self.dataset_group_ids = map(lambda x: x[2], results)
- self.single_group = False
else:
print("self.dataset is:", pf(self.dataset))
- self.dataset = webqtlDataset(self.dataset, self.cursor)
+ self.dataset = create_dataset(self.db_conn, self.dataset)
print("self.dataset is now:", pf(self.dataset))
- if self.dataset.type in ("Geno", "ProbeSet"):
- db_type = self.dataset.type + "Freeze"
- print("db_type [%s]: %s" % (type(db_type), db_type))
-
- query = '''SELECT Id, Name, FullName, confidentiality,
- AuthorisedUsers FROM %s WHERE Name = %%s''' % (db_type)
-
- self.cursor.execute(query, self.dataset.name)
-
- (indId,
- indName,
- indFullName,
- confidential,
- AuthorisedUsers) = self.cursor.fetchall()[0]
-
- if confidential:
- # Allow confidential data later
- NoConfindetialDataForYouTodaySorry
- #access_to_confidential_dataset = 0
- #
- ##for the dataset that confidentiality is 1
- ##1. 'admin' and 'root' can see all of the dataset
- ##2. 'user' can see the dataset that AuthorisedUsers contains his id(stored in the Id field of User table)
- #if webqtlConfig.USERDICT[self.privilege] > webqtlConfig.USERDICT['user']:
- # access_to_confidential_dataset = 1
- #else:
- # AuthorisedUsersList=AuthorisedUsers.split(',')
- # if AuthorisedUsersList.__contains__(self.userName):
- # access_to_confidential_dataset = 1
- #
- #if not access_to_confidential_dataset:
- # Some error
-
- #else:
- # heading = "Search Result"
- # detail = ['''The dataset has not been established yet, please
- # go back and SELECT at least one dataset.''']
- # self.error(heading=heading,detail=detail,error="No dataset Selected")
- # return
-
- self.dataset.get_group()
- self.single_group = True
- #XZ, August 24,2010: Since self.single_group = True, it's safe to assign one species Id.
- self.species_id = webqtlDatabaseFunction.retrieveSpeciesId(self.cursor,
- self.dataset.group)
-
- #self.db_type = self.dataset.type
- if self.dataset.type == "Publish":
- self.search_fields = ['Phenotype.Post_publication_description',
- 'Phenotype.Pre_publication_description',
- 'Phenotype.Pre_publication_abbreviation',
- 'Phenotype.Post_publication_abbreviation',
- 'Phenotype.Lab_code',
- 'Publication.PubMed_ID',
- 'Publication.Abstract',
- 'Publication.Title',
- 'Publication.Authors',
- 'PublishXRef.Id']
- self.header_fields = ['',
- 'ID',
- 'Description',
- 'Authors',
- 'Year',
- 'Max LRS',
- 'Max LRS Location']
-
- elif self.dataset.type == "ProbeSet":
- self.search_fields = ['Name',
- 'Description',
- 'Probe_Target_Description',
- 'Symbol',
- 'Alias',
- 'GenbankId',
- 'UniGeneId',
- 'RefSeq_TranscriptId']
- self.header_fields = ['',
- 'ID',
- 'Symbol',
- 'Description',
- 'Location',
- 'Mean Expr',
- 'Max LRS',
- 'Max LRS Location']
- elif self.dataset.type == "Geno":
- self.search_fields = ['Name',
- 'Chr']
- self.header_fields = ['',
- 'ID',
- 'Location']
-
+
self.search()
self.gen_search_result()
def gen_search_result(self):
- """Get the info displayed in the search result table from the set of results computed in
+ """
+ Get the info displayed in the search result table from the set of results computed in
the "search" function
"""
@@ -191,26 +103,19 @@ class SearchResultPage(templatePage):
if not result:
continue
- seq = 1
group = self.dataset.group
-
species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=group)
#### Excel file needs to be generated ####
print("foo locals are:", locals())
trait_id = result[0]
- this_trait = webqtlTrait(db=self.dataset, name=trait_id, cursor=self.cursor)
+ this_trait = webqtlTrait(self.db_conn, db=self.dataset, name=trait_id)
this_trait.retrieveInfo(QTL=True)
print("this_trait is:", pf(this_trait))
self.trait_list.append(this_trait)
-
- if self.dataset.type == "ProbeSet":
- self.getTraitInfoForProbeSet(trait_list=self.trait_list, species=species)
- elif self.dataset.type == "Publish":
- self.getTraitInfoForPublish(trait_list=self.trait_list, species=species)
- elif self.dataset.type == "Geno":
- self.getTraitInfoForGeno(trait_list=self.trait_list)
+
+ self.dataset.get_trait_info(self.trait_list, species)
def search(self):
@@ -222,7 +127,7 @@ class SearchResultPage(templatePage):
print("[kodak] item is:", pf(a_search))
search_term = a_search['search_term']
if a_search['key']:
- search_type = string.upper(a_search['key'])
+ search_type = a_search['key'].upper()
else:
# We fall back to the dataset type as the key to get the right object
search_type = self.dataset.type
@@ -258,187 +163,3 @@ class SearchResultPage(templatePage):
keyword = string.replace(keyword,"?",".")
wildcardkeyword[i] = keyword#'[[:<:]]'+ keyword+'[[:>:]]'
return wildcardkeyword
-
-
- def getTraitInfoForGeno(self, trait_list):
- for this_trait in trait_list:
- if not this_trait.haveinfo:
- this_trait.retrieveInfo()
-
- #XZ: trait_location_value is used for sorting
- trait_location_repr = 'N/A'
- trait_location_value = 1000000
-
- if this_trait.chr and this_trait.mb:
- try:
- trait_location_value = int(this_trait.chr)*1000 + this_trait.mb
- except:
- if this_trait.chr.upper() == 'X':
- trait_location_value = 20*1000 + this_trait.mb
- else:
- trait_location_value = ord(str(this_trait.chr).upper()[0])*1000 + this_trait.mb
-
- this_trait.location_repr = 'Chr%s: %.4f' % (this_trait.chr, float(this_trait.mb) )
- this_trait.location_value = trait_location_value
-
-
- def getTraitInfoForPublish(self, trait_list, species = ''):
- for this_trait in trait_list:
- if not this_trait.haveinfo:
- this_trait.retrieveInfo(QTL=1)
-
- description = this_trait.post_publication_description
- if this_trait.confidential:
- if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait(privilege=self.privilege, userName=self.userName, authorized_users=this_trait.authorized_users):
- description = this_trait.pre_publication_description
- this_trait.description_display = description
-
- if not this_trait.year.isdigit():
- this_trait.pubmed_text = "N/A"
-
- if this_trait.pubmed_id:
- this_trait.pubmed_link = webqtlConfig.PUBMEDLINK_URL % this_trait.pubmed_id
-
- #LRS and its location
- this_trait.LRS_score_repr = "N/A"
- this_trait.LRS_score_value = 0
- this_trait.LRS_location_repr = "N/A"
- this_trait.LRS_location_value = 1000000
-
- if this_trait.lrs:
- self.cursor.execute("""
- select Geno.Chr, Geno.Mb from Geno, Species
- where Species.Name = '%s' and
- Geno.Name = '%s' and
- Geno.SpeciesId = Species.Id
- """ % (species, this_trait.locus))
- result = self.cursor.fetchone()
-
- if result:
- if result[0] and result[1]:
- LRS_Chr = result[0]
- LRS_Mb = result[1]
-
- #XZ: LRS_location_value is used for sorting
- try:
- LRS_location_value = int(LRS_Chr)*1000 + float(LRS_Mb)
- except:
- if LRS_Chr.upper() == 'X':
- LRS_location_value = 20*1000 + float(LRS_Mb)
- else:
- LRS_location_value = ord(str(LRS_chr).upper()[0])*1000 + float(LRS_Mb)
-
- this_trait.LRS_score_repr = LRS_score_repr = '%3.1f' % this_trait.lrs
- this_trait.LRS_score_value = LRS_score_value = this_trait.lrs
- this_trait.LRS_location_repr = LRS_location_repr = 'Chr %s: %.4f Mb' % (LRS_Chr, float(LRS_Mb) )
-
-
- def getTraitInfoForProbeSet(self, trait_list=None, species=''):
-
- # Note: setting trait_list to [] is probably not a great idea.
- if not trait_list:
- trait_list = []
-
- for this_trait in trait_list:
-
- if not this_trait.haveinfo:
- this_trait.retrieveInfo(QTL=1)
-
- if this_trait.symbol:
- pass
- else:
- this_trait.symbol = "N/A"
-
- #XZ, 12/08/2008: description
- #XZ, 06/05/2009: Rob asked to add probe target description
- description_string = str(this_trait.description).strip()
- target_string = str(this_trait.probe_target_description).strip()
-
- description_display = ''
-
- if len(description_string) > 1 and description_string != 'None':
- description_display = description_string
- else:
- description_display = this_trait.symbol
-
- if len(description_display) > 1 and description_display != 'N/A' and len(target_string) > 1 and target_string != 'None':
- description_display = description_display + '; ' + target_string.strip()
-
- # Save it for the jinja2 tablet
- this_trait.description_display = description_display
-
- #XZ: trait_location_value is used for sorting
- trait_location_repr = 'N/A'
- trait_location_value = 1000000
-
- if this_trait.chr and this_trait.mb:
- try:
- trait_location_value = int(this_trait.chr)*1000 + this_trait.mb
- except:
- if this_trait.chr.upper() == 'X':
- trait_location_value = 20*1000 + this_trait.mb
- else:
- trait_location_value = ord(str(this_trait.chr).upper()[0])*1000 + this_trait.mb
-
- this_trait.location_repr = 'Chr %s: %.4f Mb' % (this_trait.chr, float(this_trait.mb) )
- this_trait.location_value = trait_location_value
- #this_trait.trait_location_value = trait_location_value
-
- #XZ, 01/12/08: This SQL query is much faster.
- query = (
-"""select ProbeSetXRef.mean from ProbeSetXRef, ProbeSet
- where ProbeSetXRef.ProbeSetFreezeId = %s and
- ProbeSet.Id = ProbeSetXRef.ProbeSetId and
- ProbeSet.Name = '%s'
- """ % (self.db_conn.escape_string(str(this_trait.db.id)),
- self.db_conn.escape_string(this_trait.name)))
-
- print("query is:", pf(query))
-
- self.cursor.execute(query)
- result = self.cursor.fetchone()
-
- if result:
- if result[0]:
- mean = result[0]
- else:
- mean=0
- else:
- mean = 0
-
- #XZ, 06/05/2009: It is neccessary to turn on nowrap
- this_trait.mean = repr = "%2.3f" % mean
-
- #LRS and its location
- this_trait.LRS_score_repr = 'N/A'
- this_trait.LRS_score_value = 0
- this_trait.LRS_location_repr = 'N/A'
- this_trait.LRS_location_value = 1000000
-
- #Max LRS and its Locus location
- if this_trait.lrs and this_trait.locus:
- self.cursor.execute("""
- select Geno.Chr, Geno.Mb from Geno, Species
- where Species.Name = '%s' and
- Geno.Name = '%s' and
- Geno.SpeciesId = Species.Id
- """ % (species, this_trait.locus))
- result = self.cursor.fetchone()
-
- if result:
- if result[0] and result[1]:
- LRS_Chr = result[0]
- LRS_Mb = result[1]
-
- #XZ: LRS_location_value is used for sorting
- try:
- LRS_location_value = int(LRS_Chr)*1000 + float(LRS_Mb)
- except:
- if LRS_Chr.upper() == 'X':
- LRS_location_value = 20*1000 + float(LRS_Mb)
- else:
- LRS_location_value = ord(str(LRS_chr).upper()[0])*1000 + float(LRS_Mb)
-
- this_trait.LRS_score_repr = LRS_score_repr = '%3.1f' % this_trait.lrs
- this_trait.LRS_score_value = LRS_score_value = this_trait.lrs
- this_trait.LRS_location_repr = LRS_location_repr = 'Chr %s: %.4f Mb' % (LRS_Chr, float(LRS_Mb) )
--
cgit v1.2.3