From 64526b27922053d608147b2ce896b42ee9e5c2dc Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 10 Apr 2015 19:08:18 +0000 Subject: Added git large file system (the .gitattributes files) and fixed an issue where rat trait pages wouldn't work --- genotype_files/genotypes/.gitattributes | 1 + genotype_files/new_genotypes/.gitattributes | 1 + web/images/edit.png | Bin 4322 -> 0 bytes wqflask/base/trait.py | 3 ++ wqflask/wqflask/show_trait/show_trait.py | 41 +++++----------------------- 5 files changed, 12 insertions(+), 34 deletions(-) create mode 100644 genotype_files/genotypes/.gitattributes create mode 100644 genotype_files/new_genotypes/.gitattributes delete mode 100644 web/images/edit.png diff --git a/genotype_files/genotypes/.gitattributes b/genotype_files/genotypes/.gitattributes new file mode 100644 index 00000000..c311ac85 --- /dev/null +++ b/genotype_files/genotypes/.gitattributes @@ -0,0 +1 @@ +*.geno filter=lfs -crlf diff --git a/genotype_files/new_genotypes/.gitattributes b/genotype_files/new_genotypes/.gitattributes new file mode 100644 index 00000000..912ed80c --- /dev/null +++ b/genotype_files/new_genotypes/.gitattributes @@ -0,0 +1 @@ +*.json filter=lfs -crlf diff --git a/web/images/edit.png b/web/images/edit.png deleted file mode 100644 index dda50521..00000000 Binary files a/web/images/edit.png and /dev/null differ diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 58bed865..f3648b80 100755 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -549,6 +549,9 @@ class GeneralTrait(object): if self.alias: alias = string.replace(self.alias, ";", " ") alias = string.join(string.split(alias), ", ") + else: + alias = 'Not available' + return alias diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 929f5abb..836a0be5 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -283,13 +283,13 @@ class ShowTrait(object): # else: # pass - g.db.execute("SELECT Name FROM InbredSet WHERE Name=%s", self.dataset.group.name) + 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 self.cursor.fetchall(): + 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) @@ -368,7 +368,7 @@ class ShowTrait(object): blatsequence = '' for seqt in seqs: if int(seqt[1][-1]) % 2 == 1: - blatsequence += string.strip(seqt[0]) + 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' @@ -469,52 +469,25 @@ class ShowTrait(object): #XZ: Resource Links: if this_trait.symbol: - linkStyle = "background:#dddddd;padding:2" - tSpan = HT.Span(style="font-family:verdana,serif;font-size:13px") - #XZ,12/26/2008: Gene symbol may contain single quotation mark. #For example, Affymetrix, mouse430v2, 1440338_at, the symbol is 2'-Pde (geneid 211948) #I debug this by using double quotation marks. if _Species == "rat": - - #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more - #symatlas_species = "Rattus norvegicus" - - #self.cursor.execute("SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = '%s'" % this_trait.symbol) - self.cursor.execute('SELECT kgID, chromosome,txStart,txEnd FROM GeneList_rn33 WHERE geneSymbol = "%s"' % this_trait.symbol) - try: - kgId, chr, txst, txen = self.cursor.fetchall()[0] + 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) - #tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\ - # title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('rn3',kgId,chr,txst,txen),Class="fs14 fwn"), style=linkStyle) - # , " "*2) - except: - pass if _Species == "mouse": - - #XZ, 7/16/2009: The url for SymAtlas (renamed as BioGPS) has changed. We don't need this any more - #symatlas_species = "Mus musculus" - - #self.cursor.execute("SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = '%s'" % this_trait.symbol) - #try: print("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] - #this_chr, txst, txen = g.db.execute("SELECT chromosome,txStart,txEnd FROM GeneList WHERE geneSymbol = %s", (this_trait.symbol)).fetchone() if this_chr and txst and txen and this_trait.refseq_transcriptid : txst = int(txst*1000000) txen = int(txen*1000000) - #tSpan.append(HT.Span(HT.Href(text= 'UCSC',target="mainFrame",\ - # title= 'Info from UCSC Genome Browser', url = webqtlConfig.UCSC_REFSEQ % ('mm9', - # this_trait.refseq_transcriptid, - # this_chr, - # txst, - # txen), - # Class="fs14 fwn"), style=linkStyle) - # , " "*2) + ## 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",\ -- cgit v1.2.3