From 34d962fe1e0dd5e30f067e7a30fcbd8931f2aacb Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 4 Jun 2019 11:20:28 -0500 Subject: Added GeneMANIA link Fixed issue that caused error when creating UCSC RefSeq link Fixed issue that sometimes caused an error for phenotype searches Changed some text on collections page --- wqflask/base/webqtlConfig.py | 2 +- wqflask/wqflask/show_trait/show_trait.py | 11 ++++++++--- wqflask/wqflask/templates/collections/view.html | 4 ++-- wqflask/wqflask/templates/search_result_page.html | 6 +++++- wqflask/wqflask/templates/show_trait_details.html | 6 ++++++ 5 files changed, 22 insertions(+), 7 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index b14cc4b0..a08acb0a 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -43,6 +43,7 @@ HOMOLOGENE_ID = "http://www.ncbi.nlm.nih.gov/homologene/?term=%s" GENOTATION_URL = "http://www.genotation.org/Getd2g.pl?gene_list=%s" GTEX_URL = "https://www.gtexportal.org/home/gene/%s" GENEBRIDGE_URL = "https://www.systems-genetics.org/modules_by_gene/%s?organism=%s" +GENEMANIA_URL = "https://genemania.org/search/%s/%s" UCSC_REFSEQ = "http://genome.cse.ucsc.edu/cgi-bin/hgTracks?db=%s&hgg_gene=%s&hgg_chrom=chr%s&hgg_start=%s&hgg_end=%s" BIOGPS_URL = "http://biogps.org/?org=%s#goto=genereport&id=%s" STRING_URL = "http://string-db.org/newstring_cgi/show_network_section.pl?identifier=%s" @@ -87,4 +88,3 @@ if not valid_path(JSON_GENODIR): PORTADDR = "http://50.16.251.170" INFOPAGEHREF = '/dbdoc/%s.html' CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR' -SCRIPTFILE = 'main.py' diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 66d3a448..e10b31c0 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -257,7 +257,7 @@ class ShowTrait(object): self.genbank_link = webqtlConfig.GENBANK_ID % genbank_id self.genotation_link = self.gtex_link = self.genebridge_link = self.ucsc_blat_link = self.biogps_link = None - self.string_link = self.panther_link = self.aba_link = self.ebi_gwas_link = self.wiki_pi_link = None + self.string_link = self.panther_link = self.aba_link = self.ebi_gwas_link = self.wiki_pi_link = self.genemania_link = None if self.this_trait.symbol: self.genotation_link = webqtlConfig.GENOTATION_URL % self.this_trait.symbol self.gtex_link = webqtlConfig.GTEX_URL % self.this_trait.symbol @@ -266,7 +266,10 @@ class ShowTrait(object): self.ebi_gwas_link = webqtlConfig.EBIGWAS_URL % self.this_trait.symbol if self.dataset.group.species == "mouse" or self.dataset.group.species == "human": - self.genebridge_link = webqtlConfig.GENEBRIDGE_URL % (self.this_trait.symbol, self.dataset.group.species) + if self.dataset.group.species == "mouse": + self.genemania_link = webqtlConfig.GENEMANIA_URL % ("mus-musculus", self.this_trait.symbol) + else: + self.genemania_link = webqtlConfig.GENEMANIA_URL % ("homo-sapiens", self.this_trait.symbol) if self.dataset.group.species == "mouse": self.aba_link = webqtlConfig.ABA_URL % self.this_trait.symbol @@ -282,8 +285,10 @@ class ShowTrait(object): self.ucsc_blat_link = webqtlConfig.UCSC_REFSEQ % ('mm10', self.this_trait.refseq_transcriptid, chr, transcript_start, transcript_end) if self.dataset.group.species == "rat": + self.genemania_link = webqtlConfig.GENEMANIA_URL % ("rattus-norvegicus", self.this_trait.symbol) + query = """SELECT kgID, chromosome, txStart, txEnd - FROM GeneLink_rn33 + FROM GeneList_rn33 WHERE geneSymbol = '{}'""".format(self.this_trait.symbol) kgId, chr, transcript_start, transcript_end = g.db.execute(query).fetchall()[0] if len(g.db.execute(query).fetchall()) > 0 else None diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index 8d22b2a8..7e1001fc 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -84,8 +84,8 @@ - - + +

diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index e20ea2d3..bf434452 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -324,7 +324,11 @@ 'width': "500px", 'data': null, 'render': function(data, type, row, meta) { - return decodeURIComponent(escape(data.description)) + try { + return decodeURIComponent(escape(data.description)) + } catch { + return escape(data.description) + } } }, { diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index 09f36021..43efa314 100644 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -88,6 +88,12 @@    {% endif %} + {% if genemania_link %} + + GeneMANIA + +    + {% endif %} {% if unigene_link %} UniGene -- cgit v1.2.3