From 0682e3c081932c77cb4cbf856e41a9735bd09276 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Wed, 29 Jul 2015 19:26:49 +0000 Subject: Committer: Lei Yan On branch master --- wqflask/wqflask/templates/base.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 79eeae9c..af7ddeb6 100755 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -77,10 +77,10 @@
-
+
-- cgit v1.2.3 From 505cc52b2c0b7afb8e1b3c3e414ef68632f5e518 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Fri, 31 Jul 2015 18:53:36 +0000 Subject: Committer: Lei Yan On branch master --- wqflask/wqflask/gsearch.py | 21 ++++++++++++--- wqflask/wqflask/templates/gsearch_pheno.html | 38 +++++++++++++++------------- 2 files changed, 39 insertions(+), 20 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index dd0815b1..396da4cf 100755 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -1,6 +1,9 @@ from __future__ import absolute_import, print_function, division from flask import Flask, g +from base.data_set import create_dataset +from base.trait import GeneralTrait +from dbFunction import webqtlDatabaseFunction class GSearch(object): @@ -41,6 +44,7 @@ class GSearch(object): SELECT Species.`Name`, InbredSet.`Name`, + PublishFreeze.`Name`, PublishXRef.`Id`, Phenotype.`Post_publication_description`, Publication.`Authors`, @@ -48,8 +52,9 @@ class GSearch(object): PublishXRef.`LRS`, PublishXRef.`Locus`, PublishXRef.`additive` - FROM Species,InbredSet,PublishXRef,Phenotype,Publication + FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication WHERE PublishXRef.`InbredSetId`=InbredSet.`Id` + AND PublishFreeze.`InbredSetId`=InbredSet.`Id` AND InbredSet.`SpeciesId`=Species.`Id` AND PublishXRef.`PhenotypeId`=Phenotype.`Id` AND PublishXRef.`PublicationId`=Publication.`Id` @@ -63,6 +68,16 @@ class GSearch(object): OR Publication.Title REGEXP "[[:<:]]%s[[:>:]]" OR Publication.Authors REGEXP "[[:<:]]%s[[:>:]]" OR PublishXRef.Id REGEXP "[[:<:]]%s[[:>:]]") - ORDER BY Species.`Name`, InbredSet.`Name`, Phenotype.`Post_publication_description` + ORDER BY Species.`Name`, InbredSet.`Name`, PublishXRef.`Id` + LIMIT 1000 """ % (self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms, self.terms) - self.results = g.db.execute(sql).fetchall() + re = g.db.execute(sql).fetchall() + self.trait_list = [] + for line in re: + dataset = create_dataset(line[2], "Publish") + trait_id = line[3] + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True) + self.trait_list.append(this_trait) + species = webqtlDatabaseFunction.retrieve_species(dataset.group.name) + dataset.get_trait_info([this_trait], species) + diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index f6b6efa3..8701673f 100755 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -23,33 +23,37 @@

- +
- + - - - - - - - + + + + + + + - - {% for this_trait in results %} - - - {% for item in this_trait %} - - {% endfor %} + {% for this_trait in trait_list %} + + + + + + + + + + + {% endfor %} -
IndexIndex Species GroupRecord IDPhenotypeAuthorsYearMax LRSLocusAdditiveRecordDescriptionAuthorsYearMax  
LRS ?
Max LRS LocationAdditive
Effect ?
{{ loop.index }}{{ item }}
{{ loop.index }}{{ this_trait.dataset.group.species }}{{ this_trait.dataset.group.name }}{{ this_trait.name }}{{ this_trait.description_display }}{{ this_trait.authors }}{{ this_trait.pubmed_text }}{{ this_trait.LRS_score_repr }}{{ this_trait.LRS_location_repr }}{{ '%0.3f' % this_trait.additive|float }}
-- cgit v1.2.3 From 7bb0af72804d8112f41927e8184247c7447b1780 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Thu, 6 Aug 2015 16:59:31 +0000 Subject: Committer: Lei Yan On branch master --- wqflask/wqflask/templates/gsearch_pheno.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 8701673f..c25b71a2 100755 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -26,6 +26,7 @@ + @@ -41,7 +42,8 @@ {% for this_trait in trait_list %} - + + @@ -122,6 +124,7 @@ console.time("Creating table"); $('#trait_table').DataTable( { "columns": [ + { "bSortClasses": false }, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, -- cgit v1.2.3 From bb6a7d24e00a0449899ebae719f346072136be1d Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Thu, 6 Aug 2015 18:44:34 +0000 Subject: Committer: Lei Yan On branch master --- wqflask/wqflask/gsearch.py | 18 +++++++-- wqflask/wqflask/templates/gsearch_gene.html | 62 +++++++++++++++-------------- 2 files changed, 46 insertions(+), 34 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 396da4cf..7e647b76 100755 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -16,7 +16,7 @@ class GSearch(object): Species.`Name` AS species_name, InbredSet.`Name` AS inbredset_name, Tissue.`Name` AS tissue_name, - ProbeSetFreeze.FullName AS probesetfreeze_fullname, + ProbeSetFreeze.Name AS probesetfreeze_name, ProbeSet.Name AS probeset_name, ProbeSet.Symbol AS probeset_symbol, ProbeSet.`description` AS probeset_description, @@ -35,10 +35,21 @@ 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 - ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_fullname, probeset_name + AND ProbeSetFreeze.public > 0 + ORDER BY species_name, inbredset_name, tissue_name, probesetfreeze_name, probeset_name LIMIT 1000 """ % (self.terms) - self.results = g.db.execute(sql).fetchall() + re = g.db.execute(sql).fetchall() + self.trait_list = [] + for line in re: + dataset = create_dataset(line[3], "ProbeSet") + print("dataset: %s %s %s" % (line[3], dataset.name, dataset.id)) + trait_id = line[4] + this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True) + self.trait_list.append(this_trait) + species = webqtlDatabaseFunction.retrieve_species(dataset.group.name) + dataset.get_trait_info([this_trait], species) + elif self.type == "phenotype": sql = """ SELECT @@ -80,4 +91,3 @@ class GSearch(object): self.trait_list.append(this_trait) species = webqtlDatabaseFunction.retrieve_species(dataset.group.name) dataset.get_trait_info([this_trait], species) - diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 3e1cb32e..6cf16c08 100755 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -24,37 +24,44 @@

Index Species Group
{{ loop.index }}{{ loop.index }} {{ this_trait.dataset.group.species }} {{ this_trait.dataset.group.name }} {{ this_trait.name }}
- - + + + - - - - - + + + + - - - - - - - + + + + + - {% for this_trait in results %} - - - {% for item in this_trait %} - - {% endfor %} - - {% endfor %} + {% for this_trait in trait_list %} + + + + + + + + + + + + + + + + + {% endfor %} -
IndexSymbolRecordDescription Species Group Tissue DatasetChrMbRecordSymbolDescriptionLocation MeanMax LRSLocusPvalueAdditive
Max  
LRS ?
Max LRS LocationAdditive
Effect ?
{{ loop.index }}{{ item }}
{{ loop.index }}{{ this_trait.dataset.group.species }}{{ this_trait.dataset.group.name }}{{ this_trait.dataset.name }}{{ this_trait.dataset.name }}{{ this_trait.name }}{{ this_trait.symbol }}{{ this_trait.description_display }}{{ this_trait.location_repr }}{{ '%0.3f' % this_trait.mean|float }}{{ '%0.3f' % this_trait.LRS_score_repr|float }}{{ this_trait.LRS_location_repr }}{{ '%0.3f' % this_trait.additive|float }}
@@ -123,7 +130,7 @@ console.time("Creating table"); $('#trait_table').DataTable( { "columns": [ - { "type": "natural" }, + { "bSortClasses": false }, { "type": "natural" }, { "type": "natural", "width": "35%" }, { "type": "natural", "width": "15%" }, @@ -136,16 +143,11 @@ { "type": "natural", "width": "15%" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural" }, - { "type": "cust-txt" } + { "type": "natural" } ], - "sDom": "RJtir", - "iDisplayLength": -1, "autoWidth": true, "bLengthChange": true, "bDeferRender": true, - "bSortClasses": false, - "scrollY": "700px", "scrollCollapse": false, "colResize": { "tableWidthFixed": false, -- cgit v1.2.3 From 88a0b3a0fc0a344ccbd73598ae7b7cb3c7b43e9a Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Thu, 6 Aug 2015 21:18:48 +0000 Subject: Committer: Lei Yan On branch master --- wqflask/wqflask/gsearch.py | 1 - 1 file changed, 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 7e647b76..3d693a4c 100755 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -43,7 +43,6 @@ class GSearch(object): self.trait_list = [] for line in re: dataset = create_dataset(line[3], "ProbeSet") - print("dataset: %s %s %s" % (line[3], dataset.name, dataset.id)) trait_id = line[4] this_trait = GeneralTrait(dataset=dataset, name=trait_id, get_qtl_info=True) self.trait_list.append(this_trait) -- cgit v1.2.3