From 4695840f6100d566c251eaa09498a60f6d7cfe29 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 24 Aug 2016 19:01:20 +0000 Subject: Replaced post-publication description with pre-publication description for confidential phenotype traits in search results and trait pages Fixed table style for mapping results and interval analyst tables and added additive/dominance effect columns to the former Fixed mapping figure X-axis to accurately label Centimorgans vs Megabases (previously it would always say Megabases) Removed the "Sequence Site" marker from mapping result figure when mapping with genetics (centimorgans) scale Removed some unused javascript libary imports from search/global search pages --- wqflask/base/trait.py | 15 +++-- .../wqflask/marker_regression/marker_regression.py | 2 - .../marker_regression/marker_regression_gn1.py | 13 ++-- wqflask/wqflask/templates/gsearch_gene.html | 2 +- wqflask/wqflask/templates/gsearch_pheno.html | 2 +- .../wqflask/templates/marker_regression_gn1.html | 77 ++++++++++++++++------ wqflask/wqflask/templates/search_result_page.html | 2 - 7 files changed, 78 insertions(+), 35 deletions(-) diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index f18481a8..900e050c 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -322,7 +322,7 @@ class GeneralTrait(object): #phenotype traits, then display the pre-publication description instead #of the post-publication description if self.confidential: - self.description_display = "" + self.description_display = self.pre_publication_description #if not webqtlUtil.hasAccessToConfidentialPhenotypeTrait( # privilege=self.dataset.privilege, @@ -330,11 +330,11 @@ class GeneralTrait(object): # authorized_users=self.authorized_users): # # description = self.pre_publication_description - - if description: - self.description_display = description.strip() else: - self.description_display = "" + if description: + self.description_display = description.strip() + else: + self.description_display = "" if not self.year.isdigit(): self.pubmed_text = "N/A" @@ -612,7 +612,10 @@ class GeneralTrait(object): if self.probe_target_description: formatted += "; " + self.probe_target_description elif self.dataset.type == 'Publish': - formatted = self.post_publication_description + if self.confidential: + formatted = self.pre_publication_description + else: + formatted = self.post_publication_description else: formatted = "Not available" return formatted.capitalize() diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 89af856e..a53afd5a 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -702,8 +702,6 @@ class MarkerRegression(object): control = control_geno, nboot = self.num_bootstrap) else: - # reaper_results = genotype.regression(strains = self.samples, - # trait = self.vals) reaper_results = genotype.regression(strains = trimmed_samples, trait = trimmed_values) diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py index 4f52bd55..f902afb7 100644 --- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py +++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py @@ -810,7 +810,7 @@ class MarkerRegression(object): #draw bootstap #if self.bootChecked and not self.multipleInterval: - # self.drawBootStrapResult(canvas, self.nboot, drawAreaHeight, plotXScale, offset=newoffset) + # self.drawBootStrapResult(canvas, self.nboot, drawAreaHeight, plotXScale, offset=newoffset, zoom= zoom, startMb=startMb, endMb = endMb) # Draw clickable region and gene band if selected if self.plotScale == 'physic' and self.selectedChr > -1: @@ -857,7 +857,7 @@ class MarkerRegression(object): BootCoord = [] i = 0 startX = xLeftOffset - + if self.selectedChr == -1: #ZS: If viewing full genome/all chromosomes for j, _chr in enumerate(self.genotype): BootCoord.append( []) @@ -876,7 +876,7 @@ class MarkerRegression(object): for _locus in _chr: if _chr.name == self.ChrList[self.selectedChr][0]: if self.plotScale == 'physic': - Xc = startX + (_locus.Mb-self.startMb)*plotXScale + Xc = startX + (_locus.Mb-startMb)*plotXScale else: Xc = startX + (_locus.cM-_chr[0].cM)*plotXScale BootCoord[-1].append([Xc, self.bootResult[i]]) @@ -1017,7 +1017,7 @@ class MarkerRegression(object): else: locPixel += (Mb*(_chr[-1].cM-_chr[0].cM)/self.ChrLengthCMList[i])*plotXScale break - if locPixel >= 0: + if locPixel >= 0 and self.plotScale == 'physic': traitPixel = ((locPixel, yZero), (locPixel-6, yZero+12), (locPixel+6, yZero+12)) canvas.drawPolygon(traitPixel, edgeColor=pid.black, fillColor=self.TRANSCRIPT_LOCATION_COLOR, closed=1) @@ -1762,6 +1762,7 @@ class MarkerRegression(object): strYLoc + canvas.fontHeight(MBLabelFont)+ 10*(zoom%2) + 10, font=megabaseLabelFont, color=pid.black) pass else: + strYLoc = yZero + spacingFromLabelToAxis + canvas.fontHeight(MBLabelFont) + 8 ChrAInfo = [] preLpos = -1 distinctCount = 0.0 @@ -1847,6 +1848,10 @@ class MarkerRegression(object): if j == 0: canvas.drawLine(startPosX,yZero,startPosX,yZero+40, color=lineColor) startPosX += (self.ChrLengthDistList[j]+self.GraphInterval)*plotXScale + + centimorganLabelFont = pid.Font(ttf="verdana", size=18*zoom*1.5, bold=0) + canvas.drawString("Centimorgans", xLeftOffset + (plotWidth - canvas.stringWidth("Megabases", font=centimorganLabelFont))/2, + strYLoc + canvas.fontHeight(MBLabelFont)+ 10*(zoom%2) + 10, font=centimorganLabelFont, color=pid.black) canvas.drawLine(xLeftOffset, yZero, xLeftOffset+plotWidth, yZero, color=pid.black, width=X_AXIS_THICKNESS) # Draw the X axis itself diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index a50157ce..2d970b36 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -93,7 +93,7 @@ {% block js %} - + diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index b28a34df..be4981bb 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -86,7 +86,7 @@ {% block js %} - + diff --git a/wqflask/wqflask/templates/marker_regression_gn1.html b/wqflask/wqflask/templates/marker_regression_gn1.html index c5cb278c..7454b650 100644 --- a/wqflask/wqflask/templates/marker_regression_gn1.html +++ b/wqflask/wqflask/templates/marker_regression_gn1.html @@ -169,14 +169,16 @@ -
- {% if selectedChr == -1 %} + {% if selectedChr == -1 %} +

Results

+
- + + {% if plotScale == "centimorgan" %} @@ -184,7 +186,12 @@ {% else %} {% endif %} - + {% if 'additive' in trimmed_markers[0] %} + + {% endif %} + {% if 'dominance' in trimmed_markers[0] %} + + {% endif %} @@ -196,6 +203,7 @@ value="{{ marker.name }}" checked="checked"> + {% if LRS_LOD == "LOD" %} {% if 'lod_score' in marker %} @@ -211,13 +219,22 @@ {% endif %} - + {% if 'additive' in marker %} + + {% endif %} + {% if 'dominance' in marker %} + + {% endif %} {% endfor %}
IndexRowLocus {{ LRS_LOD }} ChrMbLocusAdd EffDom Eff
{{ loop.index }}{{ marker.name }}{{ '%0.2f' | format(marker.lod_score|float) }}{{marker.chr}} {{ '%0.6f' | format(marker.Mb|float) }}{{ marker.name }}{{ '%0.3f' | format(marker.additive|float) }}{{ '%0.2f' | format(marker.dominance|float) }}
- {% else %} +
+
+ {% else %} +

Interval Analyst

+
@@ -236,8 +253,9 @@ {% endfor %}
- {% endif %} +
+ {% endif %}
@@ -251,7 +269,7 @@ - + @@ -274,26 +292,35 @@ - @@ -171,7 +170,6 @@ -