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 @@

- - + + + - - - - - + + + + - - - - - - - + + + + + - {% 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