aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorzsloan2016-12-15 15:13:02 -0600
committerGitHub2016-12-15 15:13:02 -0600
commit7ea8ee22074c297925335cc048777f0ce8cb3912 (patch)
treec499ba97a0dcffe4383a0b7a6adc4efa6919ac34 /wqflask/wqflask
parent45c7ffe78337e0ef051ee96a751d4ee8cf809acb (diff)
parentb88eb7fcbd24462efb34fd3e30bfb64483223935 (diff)
downloadgenenetwork2-7ea8ee22074c297925335cc048777f0ce8cb3912.tar.gz
Merge pull request #234 from zsloan/master
Various changes
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r--wqflask/wqflask/collect.py10
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py2
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py6
-rw-r--r--wqflask/wqflask/ctl/ctl_analysis.py2
-rw-r--r--wqflask/wqflask/gsearch.py1
-rw-r--r--wqflask/wqflask/search_results.py10
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py463
-rw-r--r--wqflask/wqflask/static/new/javascript/create_corr_matrix.js101
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json263
-rw-r--r--wqflask/wqflask/static/new/javascript/get_traits_from_collection.js12
-rw-r--r--wqflask/wqflask/static/new/javascript/loadings_plot.js109
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js6
-rw-r--r--wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css20
-rw-r--r--wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css2
-rw-r--r--wqflask/wqflask/static/packages/bootstrap/css/non-responsive.css2
-rw-r--r--wqflask/wqflask/templates/collections/list.html30
-rw-r--r--wqflask/wqflask/templates/collections/view.html59
-rw-r--r--wqflask/wqflask/templates/correlation_matrix.html38
-rw-r--r--wqflask/wqflask/templates/correlation_page.html30
-rw-r--r--wqflask/wqflask/templates/gsearch_gene.html4
-rw-r--r--wqflask/wqflask/templates/search_result_page.html227
21 files changed, 622 insertions, 775 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 70ae2a1c..ba555094 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -34,6 +34,7 @@ from utility import Bunch, Struct
from utility.formatting import numify
from base import trait
+from base.data_set import create_dataset
def get_collection():
if g.user_session.logged_in:
@@ -375,12 +376,13 @@ def view_collection():
for atrait in traits:
name, dataset_name = atrait.split(':')
-
- trait_ob = trait.GeneralTrait(name=name, dataset_name=dataset_name)
- trait_ob.retrieve_info(get_qtl_info=True)
+ dataset = create_dataset(dataset_name)
+
+ trait_ob = trait.GeneralTrait(name=name, dataset=dataset)
+ trait_ob = trait.retrieve_trait_info(trait_ob, dataset, get_qtl_info=True)
trait_obs.append(trait_ob)
- json_version.append(trait_ob.jsonable())
+ json_version.append(trait.jsonable(trait_ob, dataset_name))
if "uc_id" in params:
collection_info = dict(trait_obs=trait_obs,
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 401059fd..cc21d1bf 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -216,7 +216,7 @@ class CorrelationResults(object):
for _trait_counter, trait in enumerate(self.correlation_data.keys()[:self.return_number]):
trait_object = GeneralTrait(dataset=self.target_dataset, name=trait, get_qtl_info=True, get_sample_info=False)
- if self.dataset.type == "ProbeSet" or self.dataset.type == "Geno":
+ if self.target_dataset.type == "ProbeSet" or self.target_dataset.type == "Geno":
#ZS: Convert trait chromosome to an int for the location range option
chr_as_int = 0
for order_id, chr_info in self.dataset.species.chromosomes.chromosomes.iteritems():
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index 70e21917..630980c7 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -207,7 +207,11 @@ class CorrelationMatrix(object):
print("before loop:", self.loadings[0])
for i in range(len(self.trait_list)):
loadings_row = []
- for j in range(3):
+ if len(self.trait_list) > 2:
+ the_range = 3
+ else:
+ the_range = 2
+ for j in range(the_range):
position = i + len(self.trait_list)*j
loadings_row.append(self.loadings[0][position])
loadings_array.append(loadings_row)
diff --git a/wqflask/wqflask/ctl/ctl_analysis.py b/wqflask/wqflask/ctl/ctl_analysis.py
index 3d2d7a37..9515d23a 100644
--- a/wqflask/wqflask/ctl/ctl_analysis.py
+++ b/wqflask/wqflask/ctl/ctl_analysis.py
@@ -144,7 +144,7 @@ class CTL(object):
if trait != "":
ts = trait.split(':')
gt = TRAIT.GeneralTrait(name = ts[0], dataset_name = ts[1])
- gt.retrieve_sample_data(individuals)
+ gt = TRAIT.retrieve_sample_data(gt, dataset, individuals)
for ind in individuals:
if ind in gt.data.keys():
traits.append(gt.data[ind].value)
diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py
index 64d638b2..e33e04e1 100644
--- a/wqflask/wqflask/gsearch.py
+++ b/wqflask/wqflask/gsearch.py
@@ -40,6 +40,7 @@ class GSearch(object):
AND ( 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=ProbeSetFreeze.Id
+ AND ProbeSetFreeze.confidentiality < 1
AND ProbeSetFreeze.public > 0
ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_name, probeset_name
LIMIT 6000
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index a924c7c9..59e100d8 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -16,7 +16,7 @@ from pprint import pformat as pf
import json
from base.data_set import create_dataset
-from base.trait import GeneralTrait
+from base import trait
from wqflask import parser
from wqflask import do_search
from utility import webqtlUtil,tools
@@ -86,12 +86,13 @@ views.py).
"""
self.trait_list = []
+ json_trait_list = []
species = webqtlDatabaseFunction.retrieve_species(self.dataset.group.name)
# result_set represents the results for each search term; a search of
# "shh grin2b" would have two sets of results, one for each term
logger.debug("self.results is:", pf(self.results))
- for result in self.results:
+ for index, result in enumerate(self.results):
if not result:
continue
@@ -99,8 +100,11 @@ views.py).
#logger.debug("foo locals are:", locals())
trait_id = result[0]
- this_trait = GeneralTrait(dataset=self.dataset, name=trait_id, get_qtl_info=True, get_sample_info=False)
+ this_trait = trait.GeneralTrait(dataset=self.dataset, name=trait_id, get_qtl_info=True, get_sample_info=False)
self.trait_list.append(this_trait)
+ json_trait_list.append(trait.jsonable_table_row(this_trait, self.dataset.name, index + 1))
+
+ self.json_trait_list = json.dumps(json_trait_list)
#def get_group_species_tree(self):
# self.species_groups = collections.default_dict(list)
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 8aff5482..091db50f 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -95,7 +95,7 @@ class ShowTrait(object):
# this_trait.mysqlid)
# heritability = self.cursor.fetchone()
- self.dispTraitInformation(kw, "", hddn, self.this_trait) #Display trait information + function buttons
+ #self.dispTraitInformation(kw, "", hddn, self.this_trait) #Display trait information + function buttons
self.build_correlation_tools(self.this_trait)
@@ -262,467 +262,6 @@ class ShowTrait(object):
logger.debug("allTraitData is:", pf(self.allTraitData))
- def dispTraitInformation(self, args, title1Body, hddn, this_trait):
-
- self.species_name = webqtlDatabaseFunction.retrieve_species(group=self.dataset.group.name)
-
- #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.dataset.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.dataset.type != 'Temp':
- # if this_trait.dataset.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
-
- result = g.db.execute("SELECT Name FROM InbredSet WHERE Name=%s", self.dataset.group.name)
- if this_trait:
- addSelectionButton = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (self.dataset.group.name, '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 result.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.dataset and this_trait.dataset.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 self.species_name == 'mouse':
- geneName = g.db.execute("SELECT geneSymbol FROM GeneList WHERE geneSymbol = %s", this_trait.symbol).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;")
- 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;")
- geneWikiText = 'GeneWiki'
-
- #XZ: display similar traits in other selected datasets
- if this_trait and this_trait.dataset and this_trait.dataset.type=="ProbeSet" and this_trait.symbol:
- if self.species_name in ("mouse", "rat", "human"):
- similarUrl = "%s?cmd=sch&gene=%s&alias=1&species=%s" % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.symbol, self.species_name)
- 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;")
- similarText = "Find"
- else:
- pass
- 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.dataset.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])## NEEDED FOR UCSC GENOME BROWSER LINK
-
- #--------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.
- query = """SELECT Probe.Sequence, Probe.Name
- FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
- WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
- ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
- ProbeSetFreeze.Name = '{}' AND
- ProbeSet.Name = '{}' AND
- Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""".format(this_trait.dataset.name, this_trait.name)
-
- logger.sql(query)
- seqs = g.db.execute(query).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: Pay attention to the parameter of version (rn, mm, hg). They need to be changed if necessary.
- if self.species_name == "rat":
- self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', blatsequence)
- self.UTHSC_BLAT_URL = ""
- elif self.species_name == "mouse":
- self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', blatsequence)
- self.UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', blatsequence)
- elif self.species_name == "human":
- self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
- self.UTHSC_BLAT_URL = ""
- else:
- self.UCSC_BLAT_URL = ""
- self.UTHSC_BLAT_URL = ""
-
- if self.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 self.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.dataset.name.find('Liver') >= 0 and this_trait.dataset.name.find('F2') < 0:
- pass
- else:
- query = """SELECT count(*)
- FROM Probe, ProbeSet
- WHERE ProbeSet.Name = '%s' AND Probe.ProbeSetId = ProbeSet.Id""" % (this_trait.name)
- #query database for number of probes associated with trait; if count > 0, set probe tool button and text
- logger.sql(query)
- probeResult = g.db.execute(query).fetchone()
- if probeResult[0] > 0:
- self.show_probes = "True"
- probeurl = "%s?FormID=showProbeInfo&database=%s&ProbeSetID=%s&CellID=%s&group=%s&incparentsf1=ON" \
- % (os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), this_trait.dataset, this_trait.name, this_trait.cellid, self.dataset.group.name)
- 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"
-
- this_trait.species = self.species_name # 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), "&nbsp;"*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), "&nbsp;"*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), "&nbsp;"*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), "&nbsp;"*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), "&nbsp;"*2)
-
- #XZ: Resource Links:
- if this_trait.symbol:
- #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 self.species_name == "rat":
- result = g.db.execute("SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = %s", (this_trait.symbol)).fetchone()
- if result != None:
- kgId, chr, txst, txen = result[0], result[1], result[2], result[3]
- if chr and txst and txen and kgId:
- txst = int(txst*1000000)
- txen = int(txen*1000000)
- if self.species_name == "mouse":
- logger.debug("this_trait.symbol:", this_trait.symbol)
- result = g.db.execute("SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = %s", (this_trait.symbol)).fetchone()
- if result != None:
- this_chr, txst, txen = result[0], result[1], result[2]
- if this_chr and txst and txen and this_trait.refseq_transcriptid :
- txst = int(txst*1000000)
- txen = int(txen*1000000)
- ## NEEDED FOR UCSC GENOME BROWSER LINK
-
- #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), "&nbsp;"*2)
- if this_trait.geneid and (self.species_name == "mouse" or self.species_name == "rat" or self.species_name == "human"):
- #tSpan.append(HT.Span(HT.Href(text= 'BioGPS',target="mainFrame",\
- # url="http://biogps.gnf.org/?org=%s#goto=genereport&id=%s" \
- # % (self.species_name, this_trait.geneid),Class="fs14 fwn", \
- # title="Expression across many tissues and cell types"), style=linkStyle), "&nbsp;"*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), "&nbsp;"*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 self.species_name == "mouse":
- species_scientific = "Mus%20musculus"
- elif self.species_name == "rat":
- species_scientific = "Rattus%20norvegicus"
- elif self.species_name == "human":
- species_scientific = "Homo%20sapiens"
- elif self.species_name == "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), "&nbsp;"*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), "&nbsp;"*2)
- #if this_trait.geneid and (self.species_name == "mouse" or self.species_name == "rat" or self.species_name == "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), "&nbsp;"*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), "&nbsp;"*2)
- #if self.species_name == "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), "&nbsp;"*2)
-
- if this_trait.geneid:
- #if self.species_name == "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), "&nbsp;"*2)
- if self.species_name == "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), "&nbsp;"*2)
- pass
-
- #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())
-
- elif this_trait and this_trait.dataset and this_trait.dataset.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
-
- elif this_trait and this_trait.dataset and this_trait.dataset.type == 'Geno': #Check if trait is genotype
-
- 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 self.species_name == "rat":
- # UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', this_trait.sequence)
- # UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('rat', 'rn3', this_trait.sequence)
- # elif self.species_name == "mouse":
- # UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
- # UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', this_trait.sequence)
- # elif self.species_name == "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)
- # ))
-
-
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.
diff --git a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
index adb91295..44ed3c81 100644
--- a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
+++ b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
@@ -1,48 +1,47 @@
// Generated by CoffeeScript 1.8.0
-var get_data, get_options, root;
+// var get_data, get_options, root;
-root = typeof exports !== "undefined" && exports !== null ? exports : this;
+// root = typeof exports !== "undefined" && exports !== null ? exports : this;
-$(function() {
- var chartOpts, data, mychart;
- console.log("js_data:", js_data);
- chartOpts = get_options();
- data = get_data();
- console.log(data);
- return mychart = corr_matrix(data, chartOpts);
-});
-
-get_options = function() {
- var chartOpts;
- chartOpts = {
- cortitle: "Correlation Matrix",
- scattitle: "Scatterplot",
- h: 450,
- w: 450,
- margin: {
- left: 100,
- top: 40,
- right: 5,
- bottom: 70,
- inner: 5
- }
- };
- return chartOpts;
-};
+// $(function() {
+ // var chartOpts, data, mychart;
+ // console.log("js_data:", js_data);
+ // chartOpts = get_options();
+ // data = get_data();
+ // console.log(data);
+ // return mychart = corr_matrix(data, chartOpts);
+// });
-get_data = function() {
- var data;
- data = {};
- data["var"] = js_data.traits;
- data.group = js_data.groups;
- data.indID = js_data.samples;
- data.dat = js_data.sample_data;
- data.corr = js_data.corr_results;
- data.cols = js_data.cols;
- data.rows = js_data.rows;
- return data;
-};
+// get_options = function() {
+ // var chartOpts;
+ // chartOpts = {
+ // cortitle: "Correlation Matrix",
+ // scattitle: "Scatterplot",
+ // h: 450,
+ // w: 450,
+ // margin: {
+ // left: 100,
+ // top: 40,
+ // right: 5,
+ // bottom: 70,
+ // inner: 5
+ // }
+ // };
+ // return chartOpts;
+// };
+// get_data = function() {
+ // var data;
+ // data = {};
+ // data["var"] = js_data.traits;
+ // data.group = js_data.groups;
+ // data.indID = js_data.samples;
+ // data.dat = js_data.sample_data;
+ // data.corr = js_data.corr_results;
+ // data.cols = js_data.cols;
+ // data.rows = js_data.rows;
+ // return data;
+// };
var neg_color_scale = chroma.scale(['#FF0000', 'white']).domain([-1, -0.4]);
var pos_color_scale = chroma.scale(['white', 'aqua']).domain([0.4, 1])
@@ -57,4 +56,26 @@ $('.corr_cell').each( function () {
else {
$(this).css('background-color', 'white')
}
+});
+
+$('#short_labels').click( function (){
+ $('.shortName').each( function() {
+ if ($(this).css("display") == "none"){
+ $(this).css("display", "block");
+ }
+ else {
+ $(this).css("display", "none");
+ }
+ });
+});
+
+$('#long_labels').click( function (){
+ $('.verboseName').each( function() {
+ if ($(this).css("display") == "none"){
+ $(this).css("display", "block");
+ }
+ else {
+ $(this).css("display", "none");
+ }
+ });
}); \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index d3db1853..2f332a4a 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -117,14 +117,14 @@
"Barley1 Leaf MAS 5.0 SCRI (Dec06)"
],
[
- "125",
- "B30_K_1206_R",
- "Barley1 Leaf gcRMA SCRI (Dec06)"
- ],
- [
"126",
"B30_K_1206_Rn",
"Barley1 Leaf gcRMAn SCRI (Dec06)"
+ ],
+ [
+ "125",
+ "B30_K_1206_R",
+ "Barley1 Leaf gcRMA SCRI (Dec06)"
]
],
"Phenotypes": [
@@ -1526,14 +1526,14 @@
"NCI Mammary LMT miRNA v2 (Apr09) RMA"
],
[
- "36",
- "MA_M_0704_M",
- "NCI Mammary mRNA M430 (July04) MAS5"
- ],
- [
"37",
"MA_M_0704_R",
"NCI Mammary mRNA M430 (July04) RMA"
+ ],
+ [
+ "36",
+ "MA_M_0704_M",
+ "NCI Mammary mRNA M430 (July04) MAS5"
]
]
},
@@ -1591,14 +1591,14 @@
],
"Liver mRNA": [
[
- "38",
- "LVF2_M_0704_M",
- "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5"
- ],
- [
"39",
"LVF2_M_0704_R",
"(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) RMA"
+ ],
+ [
+ "38",
+ "LVF2_M_0704_M",
+ "(B6 x BTBR)F2-ob/ob Liver mRNA M430 (Jul04) MAS5"
]
],
"Phenotypes": [
@@ -1616,23 +1616,11 @@
"B6D2Publish",
"B6D2 Published Phenotypes"
]
- ],
- "Retina mRNA": [
- [
- "803",
- "UTHSC_mm9_B6D2_Ret_0916",
- "UTHSC B6D2 Retina Affy MoGene 1.0ST (Sep16) Gene Level RMA"
- ]
]
},
"B6D2F2": {
"Brain mRNA": [
[
- "78",
- "BRF2_M_0805_P",
- "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
- ],
- [
"77",
"BRF2_M_0805_R",
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
@@ -1643,19 +1631,24 @@
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5"
],
[
+ "78",
+ "BRF2_M_0805_P",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
+ ],
+ [
"33",
"BRF2_M_0304_P",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN"
],
[
- "31",
- "BRF2_M_0304_M",
- "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5"
- ],
- [
"32",
"BRF2_M_0304_R",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) RMA"
+ ],
+ [
+ "31",
+ "BRF2_M_0304_M",
+ "OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) MAS5"
]
],
"Genotypes": [
@@ -1683,6 +1676,23 @@
]
},
"B6D2RI": {
+ "Hippocampus mRNA": [
+ [
+ "712",
+ "UTHSC_BXDAged_0615",
+ "UTHSC BXD Aged Hippocampus Affy Mouse Gene 1.0 ST (Jun15) RMA"
+ ],
+ [
+ "805",
+ "UTHSC_BXDAgedEx_1116",
+ "UTHSC BXD Aged Hippocampus Affy Mouse Gene 1.0 ST (Jun15) Exon Level RMA"
+ ],
+ [
+ "391",
+ "UTHSC_B6D2RI_H_0912",
+ "UTHSC B6D2RI Aged Hippocampus Affy Mouse Gene 1.0 ST (Sep12) RMA"
+ ]
+ ],
"Phenotypes": [
[
"None",
@@ -1717,11 +1727,6 @@
],
"Striatum mRNA": [
[
- "83",
- "SA_M2_0905_M",
- "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
- ],
- [
"85",
"SA_M2_0905_P",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) PDNN"
@@ -1730,6 +1735,11 @@
"84",
"SA_M2_0905_R",
"OHSU/VA B6D2F2 Striatum M430v2 (Sep05) RMA"
+ ],
+ [
+ "83",
+ "SA_M2_0905_M",
+ "OHSU/VA B6D2F2 Striatum M430v2 (Sep05) MAS5"
]
]
},
@@ -2071,11 +2081,6 @@
"Eye M430v2 WT Gpnmb (Sep08) RMA"
],
[
- "382",
- "Eye_M2_0908_WTWT",
- "Eye M430v2 WT WT (Sep08) RMA"
- ],
- [
"279",
"Eye_M2_0908_R_WT",
"Eye M430v2 WT Tyrp1 (Sep08) RMA"
@@ -2086,6 +2091,11 @@
"Eye M430v2 Mutant Tyrp1 (Sep08) RMA"
],
[
+ "382",
+ "Eye_M2_0908_WTWT",
+ "Eye M430v2 WT WT (Sep08) RMA"
+ ],
+ [
"400",
"DBA2J-ONH-1212",
"Howell et al. 2011, DBA/2J Glaucoma Optic Nerve Head M430 2.0 (Dec12) RMA"
@@ -2322,16 +2332,16 @@
],
"Kidney mRNA": [
[
- "240",
- "MA_M2M_0706_R",
- "Mouse kidney M430v2 Male (Aug06) RMA"
- ],
- [
"239",
"MA_M2F_0706_R",
"Mouse kidney M430v2 Female (Aug06) RMA"
],
[
+ "240",
+ "MA_M2M_0706_R",
+ "Mouse kidney M430v2 Male (Aug06) RMA"
+ ],
+ [
"118",
"MA_M2_0806_R",
"Mouse kidney M430v2 Sex Balanced (Aug06) RMA"
@@ -2342,14 +2352,14 @@
"Mouse Kidney M430v2 Sex Balanced (Aug06) PDNN"
],
[
- "115",
- "MA_M2_0706_R",
- "Mouse Kidney M430v2 (Jul06) RMA"
- ],
- [
"116",
"MA_M2_0706_P",
"Mouse Kidney M430v2 (Jul06) PDNN"
+ ],
+ [
+ "115",
+ "MA_M2_0706_R",
+ "Mouse Kidney M430v2 (Jul06) RMA"
]
],
"Liver Metabolome": [
@@ -2418,8 +2428,23 @@
],
"Liver mRNA": [
[
+ "430",
+ "EPFLMouseLiverRMA0413",
+ "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
+ ],
+ [
+ "431",
+ "EPFLMouseLiverHFDRMA0413",
+ "EPFL/LISP BXD HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
+ ],
+ [
+ "432",
+ "EPFLMouseLiverCDRMA0413",
+ "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
+ ],
+ [
"700",
- "UT-VGX_HGL1014",
+ "UTHSC-VGX_MmBXDHepatocytesRMA1014",
"UT-VGX Hepatocytes Affy Mouse Gene 1.0 ST Gene Level (Oct14) RMA"
],
[
@@ -2441,21 +2466,6 @@
"702",
"SUH_Liv_RMAEx_0611",
"SUH BXD Liver CCl4-treated Affy Mouse Gene 1.0 ST Exon Level (Jun11) RMA"
- ],
- [
- "430",
- "EPFLMouseLiverRMA0413",
- "EPFL/LISP BXD CD+HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
- ],
- [
- "431",
- "EPFLMouseLiverHFDRMA0413",
- "EPFL/LISP BXD HFD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
- ],
- [
- "432",
- "EPFLMouseLiverCDRMA0413",
- "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Apr13) RMA"
]
],
"Lung mRNA": [
@@ -2479,21 +2489,6 @@
],
"Muscle mRNA": [
[
- "395",
- "EPFLMouseMuscleRMA_Ex1112",
- "EPFL/LISP BXD CD+HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
- ],
- [
- "396",
- "EPFLMouseMuscleHFDRMAEx1112",
- "EPFL/LISP BXD HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
- ],
- [
- "397",
- "EPFLMouseMuscleCDRMAEx1112",
- "EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
- ],
- [
"378",
"EPFLMouseMuscleRMA1211",
"EPFL/LISP BXD CD+HFD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA"
@@ -2507,20 +2502,35 @@
"379",
"EPFLMouseMuscleCDRMA1211",
"EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Dec11) RMA"
+ ],
+ [
+ "395",
+ "EPFLMouseMuscleRMA_Ex1112",
+ "EPFL/LISP BXD CD+HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
+ ],
+ [
+ "396",
+ "EPFLMouseMuscleHFDRMAEx1112",
+ "EPFL/LISP BXD HFD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
+ ],
+ [
+ "397",
+ "EPFLMouseMuscleCDRMAEx1112",
+ "EPFL/LISP BXD CD Muscle Affy Mouse Gene 1.0 ST (Nov12) RMA Exon Level"
]
],
"Neocortex mRNA": [
[
- "374",
- "DevNeocortex_ILM6.2P3RInv_1111",
- "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv"
- ],
- [
"375",
"DevNeocortex_ILM6.2P14RInv_1111",
"BIDMC/UTHSC Dev Neocortex P14 ILMv6.2 (Nov11) RankInv"
],
[
+ "374",
+ "DevNeocortex_ILM6.2P3RInv_1111",
+ "BIDMC/UTHSC Dev Neocortex P3 ILMv6.2 (Nov11) RankInv"
+ ],
+ [
"284",
"HQFNeoc_1210v2_RankInv",
"HQF BXD Neocortex ILM6v1.1 (Dec10v2) RankInv"
@@ -2751,11 +2761,6 @@
],
"Ventral Tegmental Area mRNA": [
[
- "228",
- "VCUSal_0609_R",
- "VCU BXD VTA Sal M430 2.0 (Jun09) RMA"
- ],
- [
"230",
"VCUEtvsSal_0609_R",
"VCU BXD VTA Et vs Sal M430 2.0 (Jun09) RMA"
@@ -2764,6 +2769,20 @@
"229",
"VCUEtOH_0609_R",
"VCU BXD VTA EtOH M430 2.0 (Jun09) RMA"
+ ],
+ [
+ "228",
+ "VCUSal_0609_R",
+ "VCU BXD VTA Sal M430 2.0 (Jun09) RMA"
+ ]
+ ]
+ },
+ "BXD-Bone": {
+ "Phenotypes": [
+ [
+ "None",
+ "BXD-BonePublish",
+ "BXD-Bone Published Phenotypes"
]
]
},
@@ -2959,14 +2978,14 @@
],
"Hippocampus mRNA": [
[
- "99",
- "HC_M2CB_1205_P",
- "Hippocampus Consortium M430v2 CXB (Dec05) PDNN"
- ],
- [
"100",
"HC_M2CB_1205_R",
"Hippocampus Consortium M430v2 CXB (Dec05) RMA"
+ ],
+ [
+ "99",
+ "HC_M2CB_1205_P",
+ "Hippocampus Consortium M430v2 CXB (Dec05) PDNN"
]
],
"Phenotypes": [
@@ -3033,16 +3052,6 @@
],
"Hippocampus mRNA": [
[
- "214",
- "Illum_LXS_Hipp_NOE_1008",
- "Hippocampus Illumina NOE (Oct08) RankInv beta"
- ],
- [
- "211",
- "Illum_LXS_Hipp_RSS_1008",
- "Hippocampus Illumina RSS (Oct08) RankInv beta"
- ],
- [
"213",
"Illum_LXS_Hipp_NOS_1008",
"Hippocampus Illumina NOS (Oct08) RankInv beta"
@@ -3058,6 +3067,16 @@
"Hippocampus Illumina RSE (Oct08) RankInv beta"
],
[
+ "214",
+ "Illum_LXS_Hipp_NOE_1008",
+ "Hippocampus Illumina NOE (Oct08) RankInv beta"
+ ],
+ [
+ "211",
+ "Illum_LXS_Hipp_RSS_1008",
+ "Hippocampus Illumina RSS (Oct08) RankInv beta"
+ ],
+ [
"143",
"Illum_LXS_Hipp_loess0807",
"Hippocampus Illumina (Aug07) LOESS"
@@ -3148,14 +3167,14 @@
],
"Hippocampus mRNA": [
[
- "272",
- "HC_M2_0606_MDP",
- "Hippocampus Consortium M430v2 (Jun06) RMA MDP"
- ],
- [
"273",
"UMUTAffyExon_0209_RMA_MDP",
"UMUTAffy Hippocampus Exon (Feb09) RMA MDP"
+ ],
+ [
+ "272",
+ "HC_M2_0606_MDP",
+ "Hippocampus Consortium M430v2 (Jun06) RMA MDP"
]
],
"Liver mRNA": [
@@ -3524,6 +3543,10 @@
"BXD"
],
[
+ "BXD-Bone",
+ "BXD Bone"
+ ],
+ [
"BXH",
"BXH"
],
@@ -4387,10 +4410,6 @@
[
"Phenotypes",
"Phenotypes"
- ],
- [
- "Retina mRNA",
- "Retina mRNA"
]
],
"B6D2F2": [
@@ -4417,6 +4436,10 @@
[
"Phenotypes",
"Phenotypes"
+ ],
+ [
+ "Hippocampus mRNA",
+ "Hippocampus mRNA"
]
],
"BDF2-1999": [
@@ -4621,6 +4644,12 @@
"Ventral Tegmental Area mRNA"
]
],
+ "BXD-Bone": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ]
+ ],
"BXH": [
[
"Phenotypes",
diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
index a73eafe4..bcd83889 100644
--- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
+++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
@@ -226,10 +226,8 @@ back_to_collections = function() {
return $('#collections_holder').colorbox.resize();
};
-$(function() {
- console.log("inside get_traits_from_collection");
- $(document).on("click", ".collection_line", collection_click);
- $(document).on("click", "#submit", submit_click);
- $(document).on("click", ".trait", trait_click);
- return $(document).on("click", "#back_to_collections", back_to_collections);
-});
+console.log("inside get_traits_from_collection");
+$(".collection_line").on("click", collection_click);
+$("#submit").on("click", submit_click);
+$(".trait").on("click", trait_click);
+$("#back_to_collections").on("click", back_to_collections); \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/loadings_plot.js b/wqflask/wqflask/static/new/javascript/loadings_plot.js
new file mode 100644
index 00000000..c44288c0
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/loadings_plot.js
@@ -0,0 +1,109 @@
+var margin = {top: 20, right: 70, bottom: 60, left: 60}
+ , width = 960 - margin.left - margin.right
+ , height = 500 - margin.top - margin.bottom;
+
+var x = d3.scale.linear()
+ .domain([d3.min(loadings, function(d) { return d[0]; }) + 0.1*d3.min(loadings, function(d) { return d[0]; }), d3.max(loadings, function(d) { return d[0]; })])
+ .range([ 0, width ]);
+
+var y = d3.scale.linear()
+ .domain([d3.min(loadings, function(d) { return d[1]; }) + 0.1*d3.min(loadings, function(d) { return d[1]; }), d3.max(loadings, function(d) { return d[1]; })])
+ .range([ height, 0 ]);
+
+var chart = d3.select('#loadings_plot')
+ .append('svg:svg')
+ .attr('width', width + margin.right + margin.left)
+ .attr('height', height + margin.top + margin.bottom)
+ .attr('class', 'chart')
+
+var main = chart.append('g')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')')
+ .attr('width', width)
+ .attr('height', height)
+ .attr('class', 'main')
+
+// draw the x axis
+var xAxis = d3.svg.axis()
+ .scale(x)
+ .orient('bottom');
+
+main.append('g')
+ .attr('transform', 'translate(0,' + height + ')')
+ .attr('class', 'x axis')
+ .call(xAxis);
+
+chart.append("text")
+ .attr("class", "x label")
+ .attr("text-anchor", "end")
+ .attr("x", 550)
+ .attr("y", 480)
+ .style("font-size", 14)
+ .style("fill", "blue")
+ .text("Factor (1)");
+
+chart.append("text")
+ .attr("class", "y label")
+ .attr("text-anchor", "end")
+ .attr("x", -200)
+ .attr("y", 5)
+ .attr("dy", ".75em")
+ .attr("transform", "rotate(-90)")
+ .style("font-size", 14)
+ .style("fill", "blue")
+ .text("Factor (2)");
+
+// draw the y axis
+var yAxis = d3.svg.axis()
+ .scale(y)
+ .orient('left');
+
+main.append('g')
+ .attr('transform', 'translate(0,0)')
+ .attr('class', 'y axis')
+ .call(yAxis);
+
+chart.select('.x.axis')
+ .selectAll("text")
+ .style("font-size","14px");
+
+chart.select('.y.axis')
+ .selectAll("text")
+ .style("font-size","14px");
+
+var g = main.append("svg:g");
+
+g.selectAll("scatter-dots")
+ .data(loadings)
+ .enter().append("svg:circle")
+ .attr("cx", function (d,i) { return x(d[0]); } )
+ .attr("cy", function (d) { return y(d[1]); } )
+ .attr("r", 4)
+ .style("fill", "blue");
+
+traits_and_loadings = []
+for (i = 0; i < js_data.traits.length; i++) {
+ this_trait_loadings = []
+ this_trait_loadings[0] = js_data.traits[i]
+ this_trait_loadings[1] = [loadings[i][0], loadings[i][1]]
+ traits_and_loadings[i] = this_trait_loadings
+}
+
+g.selectAll("scatter-dots")
+ .data(traits_and_loadings)
+ .enter().append("text")
+ .attr("x", function(d, i) { return x(d[1][0]); })
+ .attr("y", function(d) { return y(d[1][1]); })
+ .text(function(d) { return d[0]; })
+ .style("font-size", 12)
+ .style("fill", "blue");
+
+g.selectAll("scatter-lines")
+ .data(loadings)
+ .enter().append("svg:line")
+ .attr("x1", x(0))
+ .attr("y1", y(0))
+ .attr("x2", function (d,i) {return x(d[0]); } )
+ .attr("y2", function (d) { return y(d[1]); } )
+ .attr("stroke-width", 1)
+ .attr("stroke", "red");
+ \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
index e7df9228..c1c25a58 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
@@ -168,7 +168,7 @@
//$("#progress_bar_container").modal();
url = "/marker_regression";
$('input[name=method]').val("pylmm");
- $('input[name=genofile').val($('#genofile_pylmm').val());
+ $('input[name=genofile]').val($('#genofile_pylmm').val());
$('input[name=num_perm]').val($('input[name=num_perm_pylmm]').val());
$('input[name=manhattan_plot]').val($('input[name=manhattan_plot_pylmm]:checked').val());
form_data = $('#trait_data_form').serialize();
@@ -184,7 +184,7 @@
//$("#progress_bar_container").modal();
url = "/marker_regression";
$('input[name=method]').val("rqtl_geno");
- $('input[name=genofile').val($('#genofile_rqtl_geno').val());
+ $('input[name=genofile]').val($('#genofile_rqtl_geno').val());
$('input[name=num_perm]').val($('input[name=num_perm_rqtl_geno]').val());
$('input[name=manhattan_plot]').val($('input[name=manhattan_plot_rqtl]:checked').val());
$('input[name=control_marker]').val($('input[name=control_rqtl_geno]').val());
@@ -244,7 +244,7 @@
//$("#progress_bar_container").modal();
url = "/marker_regression";
$('input[name=method]').val("reaper");
- $('input[name=genofile').val($('#genofile_reaper').val());
+ $('input[name=genofile]').val($('#genofile_reaper').val());
$('input[name=num_perm]').val($('input[name=num_perm_reaper]').val());
$('input[name=control_marker]').val($('input[name=control_reaper]').val());
$('input[name=do_control]').val($('input[name=do_control_reaper]:checked').val());
diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
index 6540d01f..6e0e7348 100644
--- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
+++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
@@ -20,8 +20,14 @@ table.dataTable tfoot th {
}
table.dataTable thead th,
table.dataTable thead td {
- padding: 10px 18px 10px 0px;
- border-bottom: 1px solid #111;
+ font: bold 12px/20px Arial, Sans-serif;
+ color: #000000;
+ background-color: #ffffff;
+ border-collapse: collapse;
+ border-bottom: #cccccc 2px solid;
+ padding: 0;
+ //padding: 10px 18px 10px 0px;
+ //border-bottom: 1px solid #111;
}
table.dataTable thead th:active,
table.dataTable thead td:active {
@@ -29,8 +35,13 @@ table.dataTable thead td:active {
}
table.dataTable tfoot th,
table.dataTable tfoot td {
- padding: 10px 18px 6px 18px;
- border-top: 1px solid #111;
+ font: bold 12px/20px Arial, Sans-serif;
+ color: #000000;
+ background-color: #ffffff;
+ border-collapse: collapse;
+ padding: 0;
+ //padding: 10px 18px 6px 18px;
+ //border-top: 1px solid #111;
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
@@ -69,6 +80,7 @@ table.dataTable tbody tr.selected {
}
table.dataTable tbody th,
table.dataTable tbody td {
+ font: 12px Arial, Sans-serif;
padding: 4px 5px;
}
table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
diff --git a/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css b/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css
index 2c20f635..91aaa98f 100644
--- a/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css
+++ b/wqflask/wqflask/static/packages/bootstrap/css/bootstrap.css
@@ -2088,7 +2088,7 @@ th {
border-top: 1px solid #ddd;
}
.table > thead > tr > th {
- vertical-align: bottom;
+ vertical-align: middle;
border-bottom: 2px solid #ddd;
}
.table > caption + thead > tr:first-child > th,
diff --git a/wqflask/wqflask/static/packages/bootstrap/css/non-responsive.css b/wqflask/wqflask/static/packages/bootstrap/css/non-responsive.css
index 076b6dae..9da73a8f 100644
--- a/wqflask/wqflask/static/packages/bootstrap/css/non-responsive.css
+++ b/wqflask/wqflask/static/packages/bootstrap/css/non-responsive.css
@@ -28,7 +28,7 @@ body {
/* Reset the container */
.container {
- width: 1200px;
+ width: 1400px;
max-width: none !important;
}
diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html
index 23e976e9..6dc52c4d 100644
--- a/wqflask/wqflask/templates/collections/list.html
+++ b/wqflask/wqflask/templates/collections/list.html
@@ -26,7 +26,7 @@
{% endif %}
</div>
- <div id="collections_list" style="width:75%;">
+ <div id="collections_list" style="width:50%;">
<table class="table table-hover table-striped" id='trait_table'>
<thead>
<tr>
@@ -49,15 +49,11 @@
{% endif %}
<td>{{ timeago(uc.created_timestamp.isoformat() + "Z") }}</td>
<td>{{ timeago(uc.changed_timestamp.isoformat() + "Z") }}</td>
- <td>{{ uc.num_members }}</td>
+ <td align="right">{{ uc.num_members }}</td>
</tr>
{% endfor %}
</tbody>
</table>
-
- {# if "color_by_trait" in params #}
- <script type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script>
- {# endif #}
</div>
</div>
@@ -78,17 +74,23 @@
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/DT_bootstrap/DT_bootstrap.js"></script>
<script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script>
+ {% if "color_by_trait" in params %}
+ <script type="text/javascript" src="/static/new/javascript/get_traits_from_collection.js"></script>
+ {% endif %}
<script>
$('#trait_table').dataTable( {
- "buttons": [
- {
- extend: 'csvHtml5',
- text: 'Download CSV',
- title: 'collection_list',
- fieldBoundary: '"'
- }
+ "columns": [
+ { "type": "natural",
+ "width": "10%" },
+ { "type": "natural" },
+ { "type": "natural",
+ "width": "25%" },
+ { "type": "natural",
+ "width": "25%" },
+ { "type": "natural",
+ "width": "10%" }
],
- "sDom": "RZBtir",
+ "sDom": "RZtr",
"iDisplayLength": -1,
"autoWidth": true,
"bDeferRender": true,
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 801266d3..9d03e6d7 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -79,20 +79,20 @@
<button class="btn btn-default" id="export_traits">Download CSV</button>
</form>
<br />
- <div style="background-color: #eeeeee; border: 1px solid black;">
- <table id="trait_table" class="table table-hover table-striped">
+ <div>
+ <table class="table table-hover table-striped nowrap" id='trait_table' style="float: left;">
<thead>
<tr>
- <th style="background-color: #eeeeee;"></th>
- <th data-export="Index" style="background-color: #eeeeee;">Index</th>
- <th data-export="Dataset" style="background-color: #eeeeee;">Dataset</th>
- <th data-export="Record" style="background-color: #eeeeee;">Record</th>
- <th data-export="Description" style="background-color: #eeeeee;">Description</th>
- <th data-export="Location" style="background-color: #eeeeee;">Location</th>
- <th data-export="Mean" style="background-color: #eeeeee;">Mean</th>
- <th data-export="Max LRS" style="background-color: #eeeeee;">Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th data-export="Max LRS Location" style="background-color: #eeeeee;">Max LRS Location</th>
- <th data-export="Additive Effect" style="background-color: #eeeeee;">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th></th>
+ <th data-export="Index">Index</th>
+ <th data-export="Dataset">Dataset</th>
+ <th data-export="Record">Record</th>
+ <th data-export="Description">Description</th>
+ <th data-export="Location">Location</th>
+ <th data-export="Mean">Mean</th>
+ <th data-export="Max LRS">Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Max LRS Location">Max LRS Location</th>
+ <th data-export="Additive Effect">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
@@ -103,7 +103,7 @@
<INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox"
VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}">
</TD>
- <TD data-export="{{ loop.index }}">{{ loop.index }}</TD>
+ <TD data-export="{{ loop.index }}" align="right">{{ loop.index }}</TD>
<TD data-export="{{ this_trait.dataset.name }}">{{ this_trait.dataset.name }}</TD>
<TD data-export="{{ this_trait.name }}">
<a href="{{ url_for('show_trait_page',
@@ -113,12 +113,12 @@
{{ this_trait.name }}
</a>
</TD>
- <TD data-export="{{ this_trait.description_display }}">{{ this_trait.description_display }}</TD>
+ <TD title="{{ this_trait.description_display }}" data-export="{{ this_trait.description_display }}">{{ this_trait.description_display }}</TD>
<TD data-export="{{ this_trait.location_repr }}">{{ this_trait.location_repr }}</TD>
- <TD data-export="{{ this_trait.mean }}">{{ '%0.3f' % this_trait.mean|float }}</TD>
- <TD data-export="{{ this_trait.LRS_score_repr }}">{{ '%0.3f' % this_trait.LRS_score_repr|float }}</TD>
+ <TD data-export="{{ this_trait.mean }}" align="right">{{ '%0.3f' % this_trait.mean|float }}</TD>
+ <TD data-export="{{ this_trait.LRS_score_repr }}" align="right">{{ '%0.3f' % this_trait.LRS_score_repr|float }}</TD>
<TD data-export="{{ this_trait.LRS_location_repr }}">{{ this_trait.LRS_location_repr }}</TD>
- <TD data-export="{{ this_trait.additive }}">{{ '%0.3f' % this_trait.additive|float }}</TD>
+ <TD data-export="{{ this_trait.additive }}" align="right">{{ '%0.3f' % this_trait.additive|float }}</TD>
</TR>
{% endfor %}
@@ -156,23 +156,34 @@
console.time("Creating table");
$('#trait_table').dataTable( {
+ "createdRow": function ( row, data, index ) {
+ if ($('td', row).eq(4).text().length > 50) {
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50));
+ $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
+ }
+ },
"columns": [
{ "type": "natural" },
- { "type": "natural" },
+ { "type": "natural", "width": "5%" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural",
- "width": "35%" },
+ "width": "30%" },
{ "type": "natural",
- "width": "15%" },
+ "width": "10%" },
{ "type": "cust-txt" },
{ "type": "natural",
- "width": "9%" },
+ "width": "6%" },
+ { "type": "natural",
+ "width": "10%" },
{ "type": "natural",
- "width": "15%" },
- { "type": "natural" }
+ "width": "8%" }
],
- "sDom": "ZRtir",
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
+ "sDom": "ZRtr",
"iDisplayLength": -1,
"autoWidth": true,
"bDeferRender": true,
diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html
index 593c7bea..eb675568 100644
--- a/wqflask/wqflask/templates/correlation_matrix.html
+++ b/wqflask/wqflask/templates/correlation_matrix.html
@@ -12,11 +12,12 @@
{{ header("Correlation Matrix") }}
+<div class="container">
{% if lowest_overlap < 8 %}
<div style="margin: 20px;" >Caution: This matrix of correlations contains some cells with small sample sizes of fewer than 8.</div>
{% endif %}
-<table class="matrix" border="1" cellpadding="5" cellspacing="1" style="margin: 20px;" width="80%">
+<table class="matrix" border="1" cellpadding="5" cellspacing="1" width="80%">
<tbody>
<tr>
<td style="background-color: royalblue;" ></td>
@@ -26,35 +27,53 @@
<td align="center" rowspan="{{traits|length + 1 }}" width="10" style="font-weight: Bold; border: 1px solid #999999; padding: 3px; color: #fff; background-color: royalblue;">P e a r s o n &nbsp;&nbsp;&nbsp; r</td>
<td width="300"></td>
{% for trait in traits %}
- <td align="center"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait{{ loop.index }}</a></td>
+ <td align="center">
+ <a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait{{ loop.index }}</a>
+ </td>
{% endfor %}
</tr>
{% for trait in traits %}
<tr>
- <td><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }}</a><div id="shortName_0" style="display:none">Symbol: {{ trait.symbol }} </div><div id="verboseName_0" style="display:none">{{ trait_symbol }} on Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div><div id="verboseName2_0" style="display:none">{{ trait.description }}</div><div id="verboseName3_0" style="display:none">{{ trait.probe_target_description }}</div></td>
+ <td>
+ <a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }}</a>
+ <div class="shortName" style="display:none">{% if trait.dataset.type == "ProbeSet" %}Symbol: {{ trait.symbol }}{% elif trait.dataset.type == "Publish" %}Phenotype: {{ trait.post_publication_abbreviation }}{% else %}Genotype{% endif %} </div>
+ <div class="verboseName" style="display: none;">
+ {% if trait.dataset.type == "ProbeSet" %}
+ <div>{{ trait.symbol }} on Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div><div>{{ trait.description }}</div><div>{{ trait.probe_target_description }}</div>
+ {% elif trait.dataset.type == "Publish" %}
+ <div>PubMed {{ trait.pubmed_id }}: RecordID/{{ trait.name }}</div><div>Phenotype: {{ trait.description_display }}</div>
+ {% else %}
+ <div>Locus {{ trait.name }}</div><div>Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div>
+ {% endif %}
+ </div>
+ </td>
{% for result in corr_results[loop.index-1] %}
{% if result[0].name == trait.name %}
- <td nowrap="ON" align="center" bgcolor="#cccccc"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}"><font style="font-size: 11px; color: #000000;" ><em>n</em><br>{{ result[2] }}</font></a></td>
+ <td nowrap="ON" align="center" bgcolor="#cccccc" style="line-height: 1.1;"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}"><font style="font-size: 12px; color: #000000;" ><em>n</em><br>{{ result[2] }}</font></a></td>
{% else %}
- <td nowrap="ON" align="middle" class="corr_cell"><a href="/corr_scatter_plot?dataset_1={{ trait.dataset.name }}&dataset_2={{ result[0].dataset.name }}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 11px; color: #000000;" ><span class="corr_value">{{ '%0.3f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
+ <td nowrap="ON" align="middle" class="corr_cell" style="line-height: 1.1;"><a href="/corr_scatter_plot?dataset_1={{ trait.dataset.name }}&dataset_2={{ result[0].dataset.name }}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #000000;" ><span class="corr_value">{{ '%0.3f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
-
<br>
-
+<button class="btn btn-default" id="short_labels">Short Labels</button>
+<button class="btn btn-default" id="long_labels">Long Labels</button>
+<br>
+<br>
+<h2>Factor Loadings Plot</h2>
<div id="loadings_plot"></div>
+<h2>Factor Loadings Table</h2>
<table class="table table-hover table-striped" border="1" id='trait_table' style="margin: 20px;" width="40%">
<thead>
<tr>
<th></th>
<th align="right" >Factor 1</th>
<th align="right" >Factor 2</th>
- <th align="right" >Factor 2</th>
+ {% if trait_list|length > 2 %}<th align="right" >Factor 3</th>{% endif %}
<!--
{% for row in loadings_array %}
<th>Factor {{ loop.index }}</th>
@@ -79,12 +98,14 @@
</tbody>
</table>
+</div>
{% endblock %}
{% block js %}
<script>
+ js_data = {{ js_data | safe }}
loadings = {{ loadings_array | safe }}
</script>
@@ -98,5 +119,6 @@
<script type="text/javascript" src="/static/new/javascript/panelutil.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/js_external/chroma.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/javascript/loadings_plot.js"></script>
+ <script type="text/javascript" src="/static/new/javascript/create_corr_matrix.js"></script>
{% endblock %}
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index c5b4477b..cedb65a1 100644
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -14,8 +14,8 @@
<h1>Correlation Table</h1>
</div>
- <p>Values of record {{ this_trait.name }} in the <a href="/static/dbdoc/{{dataset.fullname}}">{{ dataset.fullname }}</a>
- dataset were compared to all records in the <a href="/static/dbdoc/{{target_dataset.fullname}}">{{ target_dataset.fullname }}</a>
+ <p>Values of record {{ this_trait.name }} in the <a href="http://genenetwork.org/webqtl/main.py?FormID=sharinginfo&GN_AccessionId={{ dataset.group.accession_id }}">{{ dataset.fullname }}</a>
+ dataset were compared to all records in the <a href="http://genenetwork.org/webqtl/main.py?FormID=sharinginfo&GN_AccessionId={{ target_dataset.group.accession_id }}">{{ target_dataset.fullname }}</a>
dataset. The top {{ return_number }} correlations ranked by the {{ formatted_corr_type }} are displayed.
You can resort this list by clicking the headers. Select the Record ID to open the trait data
and analysis page.
@@ -220,6 +220,20 @@
};
+ jQuery.fn.dataTableExt.oSort['scientific-asc'] = function ( a, b ) {
+ var x = parseFloat(a);
+ var y = parseFloat(b);
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+ };
+
+ jQuery.fn.dataTableExt.oSort['scientific-desc'] = function ( a, b ) {
+ var x = parseFloat(a);
+ var y = parseFloat(b);
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+ };
+
+
+
$(document).ready( function () {
$('#trait_table tr').click(function(event) {
@@ -258,13 +272,13 @@
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
- { "type": "numeric-html" },
{ "type": "natural" },
{ "type": "natural" },
+ { "type": "scientific" },
{ "type": "natural" },
{ "type": "natural" }
],
- "order": [[10, "desc" ]],
+ "order": [[12, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,
@@ -304,9 +318,9 @@
{ "type": "natural" },
{ "type": "numeric-html" },
{ "type": "natural" },
- { "type": "natural" }
+ { "type": "scientific" }
],
- "order": [[9, "desc" ]],
+ "order": [[11, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,
@@ -337,9 +351,9 @@
{ "type": "natural" },
{ "type": "numeric-html" },
{ "type": "natural" },
- { "type": "natural" }
+ { "type": "scientific" }
],
- "order": [[4, "desc" ]],
+ "order": [[6, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html
index 8b8a9057..097d0d2c 100644
--- a/wqflask/wqflask/templates/gsearch_gene.html
+++ b/wqflask/wqflask/templates/gsearch_gene.html
@@ -42,9 +42,9 @@
<th data-export="Description" style="background-color: #eeeeee;">Description</th>
<th data-export="Location" style="background-color: #eeeeee;">Location</th>
<th data-export="Mean" style="background-color: #eeeeee;">Mean</th>
- <th data-export="Max LRS" style="background-color: #eeeeee;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Max LRS" style="background-color: #eeeeee;">Max LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
<th data-export="Max LRS Location" style="background-color: #eeeeee;">Max LRS Location</th>
- <th data-export="Additive Effect" style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Additive Effect" style="background-color: #eeeeee;">Additive Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
<tbody>
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 0f5e68d7..f7b450c1 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -2,16 +2,14 @@
{% block title %}Search Results{% endblock %}
{% block css %}
<link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" />
- <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/scroller/1.4.1/css/scroller.dataTables.min.css">
- <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" >
- <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css">
+ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/scroller.dataTables.min.css">
{% endblock %}
{% block content %}
<!-- Start of body -->
{{ header("Search Results",
'GeneNetwork found {}.'.format(numify(results|count, "record", "records"))) }}
- <div class="container">
+ <div>
<input type="hidden" name="uc_id" id="uc_id" value="{{ uc_id }}">
<!-- Need to customize text more for other types of searches -->
@@ -44,7 +42,7 @@
{% endfor %}
</p>
- <p>To study a record, click on its ID below. Check records below and click Add button to add to selection.</p>
+ <p>To study a record click on its ID below, and to view the whole description {% if dataset.type == "Publish" %}or list of authors {% endif %} hover over the table cell. Check records below and click Add button to add to selection.</p>
<div>
<br />
@@ -78,73 +76,33 @@
{% endif %}
-->
- <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
- <table class="table table-hover table-striped" id='trait_table' {% if dataset.type == 'Geno' %}width="400px"{% endif %} style="float: left;">
+ <div id="table_container" style="width: {% if dataset.type == 'ProbeSet' %}1300{% elif dataset.type == 'Publish' %}1200{% elif dataset.type == 'Geno' %}500{% endif %}px;">
+ <table class="table table-hover table-striped nowrap" id='trait_table' style="float: left;">
<thead>
<tr>
- <th style="background-color: #eeeeee;"></th>
+ <th></th>
{% for header in header_fields %}
{% if header == 'Max LRS' %}
- <th data-export="Max LRS" style="background-color: #eeeeee; text-align: right;">Max<br>LRS</th>
+ <th data-export="Max LRS">Max LRS</th>
{% elif header == 'Additive Effect' %}
- <th data-export="Additive Effect" style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Additive Effect">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
{% else %}
- <th data-export="{{header}}" style="background-color: #eeeeee;">{{header}}</th>
+ <th data-export="{{header}}">{{header}}</th>
{% endif %}
{% endfor %}
</tr>
</thead>
-
- <tbody>
- {% for this_trait in trait_list %}
- <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}">
- <TD><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}">
- </TD>
- <TD data-export="{{ loop.index }}" align="right">{{ loop.index }}</TD>
- <TD data-export="{{ this_trait.name }}">
- <a href="{{ url_for('show_trait_page',
- trait_id = this_trait.name,
- dataset = dataset.name
- )}}">
- {{ this_trait.name }}
- </a>
- </TD>
- {% if dataset.type == 'ProbeSet' %}
- <TD data-export="{{ this_trait.symbol }}">{{ this_trait.symbol }}</TD>
- <TD data-export="{{ this_trait.description_display }}">{{ this_trait.description_display }}</TD>
- <TD data-export="{{ this_trait.location_repr }}">{{ this_trait.location_repr }}</TD>
- <TD data-export="{{ '%0.3f' % this_trait.mean|float }}" align="right">{{ '%0.3f' % this_trait.mean|float }}</TD>
- <TD data-export="{{ '%0.3f' % this_trait.LRS_score_repr|float }}" align="right">{{ '%0.3f' % this_trait.LRS_score_repr|float }}</TD>
- <TD data-export="{{ this_trait.LRS_location_repr }}">{{ this_trait.LRS_location_repr }}</TD>
- <TD data-export="{{ '%0.3f' % this_trait.additive|float }}" align="right">{{ '%0.3f' % this_trait.additive|float }}</TD>
- {% elif dataset.type == 'Publish' %}
- <TD data-export="{{ this_trait.description_display }}">{{ this_trait.description_display }}</TD>
- <TD data-export="{{ this_trait.authors }}">{{ this_trait.authors }}</TD>
- <TD data-export="{{ this_trait.pubmed_text }}" data-sort="{{ this_trait.pubmed_text }}">
- <a href="{{ this_trait.pubmed_link }}">
- {{ this_trait.pubmed_text }}
- </a>
- </TD>
- <TD data-export="{{ '%0.3f' % this_trait.LRS_score_repr|float }}">{{ '%0.3f' % this_trait.LRS_score_repr|float }}</TD>
- <TD data-export="{{ this_trait.LRS_location_repr }}">{{ this_trait.LRS_location_repr }}</TD>
- <TD data-export="{{ '%0.3f' % this_trait.additive|float }}">{{ '%0.3f' % this_trait.additive|float }}</TD>
- {% elif dataset.type == 'Geno' %}
- <TD data-export="{{ this_trait.location_repr }}">{{ this_trait.location_repr }}</TD>
- {% endif %}
- </TR>
- {% endfor %}
- </tbody>
{% if trait_list|length > 20 %}
<tfoot>
<tr>
- <th style="width: 30px;"></th>
+ <th></th>
{% for header in header_fields %}
{% if header == 'Max LRS' %}
- <th style="text-align: right;">Max<br>LRS</th>
+ <th data-export="Max LRS">Max LRS</th>
{% elif header == 'Additive Effect' %}
- <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th data-export="Additive Effect">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
{% else %}
- <th>{{header}}</th>
+ <th data-export="{{header}}">{{header}}</th>
{% endif %}
{% endfor %}
</tr>
@@ -162,7 +120,7 @@
{% endblock %}
{% block js %}
- <script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script>
@@ -171,6 +129,10 @@
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.min.js"></script>
+ <script type='text/javascript'>
+ var json_trait_list = {{ json_trait_list|safe }};
+ </script>
+
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
@@ -180,71 +142,188 @@
}
});
+ function change_buttons() {
+ buttons = ["#add", "#remove"];
+ num_checked = $('.trait_checkbox:checked').length;
+ if (num_checked === 0) {
+ for (_i = 0, _len = buttons.length; _i < _len; _i++) {
+ button = buttons[_i];
+ $(button).prop("disabled", true);
+ }
+ } else {
+ for (_j = 0, _len2 = buttons.length; _j < _len2; _j++) {
+ button = buttons[_j];
+ $(button).prop("disabled", false);
+ }
+ }
+ //});
+ if ($(this).is(":checked")) {
+ if (!$(this).closest('tr').hasClass('selected')) {
+ $(this).closest('tr').addClass('selected')
+ }
+ }
+ else {
+ if ($(this).closest('tr').hasClass('selected')) {
+ $(this).closest('tr').removeClass('selected')
+ }
+ }
+ }
+
console.time("Creating table");
{% if dataset.type == 'ProbeSet' %}
//ZS: Need to make sort by symbol, also need to make sure blank symbol fields at the bottom and symbols starting with numbers below letters
$('#trait_table').DataTable( {
+ "drawCallback": function( settings ) {
+ $('#trait_table tr').click(function(event) {
+ if (event.target.type !== 'checkbox') {
+ $(':checkbox', this).trigger('click');
+ }
+ });
+ $('.trait_checkbox:checkbox').on("change", change_buttons);
+ },
+ "createdRow": function ( row, data, index ) {
+ $('td', row).eq(1).attr('align', 'right');
+ $('td', row).eq(1).attr('data-export', index+1);
+ $('td', row).eq(2).attr('data-export', $('td', row).eq(2).text());
+ $('td', row).eq(3).attr('title', $('td', row).eq(3).text());
+ $('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
+ $('td', row).eq(4).attr('title', $('td', row).eq(4).text());
+ $('td', row).eq(4).attr('data-export', $('td', row).eq(4).text());
+ if ($('td', row).eq(4).text().length > 50) {
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50));
+ $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
+ }
+ $('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
+ $('td', row).eq(6).attr('align', 'right');
+ $('td', row).eq(6).attr('data-export', $('td', row).eq(6).text());
+ $('td', row).eq(7).attr('align', 'right');
+ $('td', row).eq(7).attr('data-export', $('td', row).eq(7).text());
+ $('td', row).eq(8).attr('data-export', $('td', row).eq(8).text());
+ $('td', row).eq(9).attr('align', 'right');
+ $('td', row).eq(9).attr('data-export', $('td', row).eq(9).text());
+ },
+ "data": json_trait_list,
"columns": [
{ "type": "natural" },
+ { "type": "natural", "width": "4%" },
{ "type": "natural" },
{ "type": "natural" },
+ { "type": "natural", "width": "30%" },
+ { "type": "natural", "width": "10%" },
{ "type": "natural" },
- { "type": "natural", "width": "40%" },
- { "type": "natural", "width": "15%" },
- { "type": "natural" },
- { "type": "natural" },
- { "type": "natural", "width": "15%" },
+ { "type": "natural", "width": "6%" },
+ { "type": "natural", "width": "12%" },
{ "type": "natural" }
],
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
"order": [[1, "asc" ]],
"sDom": "RZtir",
"iDisplayLength": -1,
- "bDeferRender": true,
+ "deferRender": true,
"bSortClasses": false,
- "scrollY": true,
+ "scrollY": "600px",
"scrollCollapse": false,
+ "scroller": true,
"paging": false
} );
{% elif dataset.type == 'Publish' %}
$('#trait_table').DataTable( {
+ "drawCallback": function( settings ) {
+ $('#trait_table tr').click(function(event) {
+ if (event.target.type !== 'checkbox') {
+ $(':checkbox', this).trigger('click');
+ }
+ });
+ $('.trait_checkbox:checkbox').on("change", change_buttons);
+ },
+ "createdRow": function ( row, data, index ) {
+ $('td', row).eq(1).attr('align', 'right');
+ $('td', row).eq(1).attr('data-export', index+1);
+ $('td', row).eq(2).attr('data-export', $('td', row).eq(2).text());
+ $('td', row).eq(3).attr('title', $('td', row).eq(3).text());
+ $('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
+ if ($('td', row).eq(3).text().length > 40) {
+ $('td', row).eq(3).text($('td', row).eq(3).text().substring(0, 40));
+ $('td', row).eq(3).text($('td', row).eq(3).text() + '...')
+ }
+ $('td', row).eq(4).attr('title', $('td', row).eq(4).text());
+ $('td', row).eq(4).attr('data-export', $('td', row).eq(4).text());
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 30));
+ $('td', row).eq(5).attr('align', 'right');
+ $('td', row).eq(5).attr('data-export', $('td', row).eq(5).text());
+ $('td', row).eq(6).attr('align', 'right');
+ $('td', row).eq(6).attr('data-export', $('td', row).eq(6).text());
+ $('td', row).eq(7).attr('data-export', $('td', row).eq(7).text());
+ $('td', row).eq(8).attr('align', 'right');
+ $('td', row).eq(8).attr('data-export', $('td', row).eq(8).text());
+ },
+ "data": json_trait_list,
"columns": [
{ "type": "natural" },
+ { "type": "natural", "width": "5%" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
+ { "type": "natural", "width": "6%" },
{ "type": "natural" },
- { "type": "natural" },
- { "type": "natural", "width": "15%"},
- { "type": "natural" }
+ { "type": "natural", "width": "9%" }
],
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
"order": [[1, "asc" ]],
- "sDom": "RZtir",
+ "sDom": "RZtr",
"iDisplayLength": -1,
"autoWidth": false,
- "bDeferRender": true,
+ "deferRender": true,
"bSortClasses": false,
- "scrollY": "700px",
- "scrollCollapse": false,
+ "scrollY": "600px",
+ "scrollCollapse": true,
+ "scroller": true,
"paging": false
} );
{% elif dataset.type == 'Geno' %}
$('#trait_table').DataTable( {
+ "drawCallback": function( settings ) {
+ $('#trait_table tr').click(function(event) {
+ if (event.target.type !== 'checkbox') {
+ $(':checkbox', this).trigger('click');
+ }
+ });
+ $('.trait_checkbox:checkbox').on("change", change_buttons);
+ },
+ "createdRow": function ( row, data, index ) {
+ $('td', row).eq(1).attr('align', 'right');
+ $('td', row).eq(1).attr('data-export', index+1);
+ $('td', row).eq(2).attr('data-export', $('td', row).eq(2).text());
+ $('td', row).eq(3).attr('data-export', $('td', row).eq(3).text());
+ },
+ "data": json_trait_list,
"columns": [
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural", "width": "40%"}
],
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
"order": [[1, "asc" ]],
"sDom": "RZtir",
"iDisplayLength": -1,
- "autoWidth": true,
- "bDeferRender": true,
+ "autoWidth": false,
+ "deferRender": true,
"bSortClasses": false,
- "scrollY": "700px",
- "scrollCollapse": false,
+ "scrollY": "600px",
+ "scrollCollapse": true,
+ "scroller": true,
"paging": false
} );
{% endif %}