aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2016-08-24 19:01:20 +0000
committerzsloan2016-08-24 19:01:20 +0000
commit4695840f6100d566c251eaa09498a60f6d7cfe29 (patch)
tree486bea7fd4ef2b4a11c32cd2e7aa6c0504efe724 /wqflask
parent75b025f4cceb8c67aa487f3f8e4ef297dd6b1cbf (diff)
downloadgenenetwork2-4695840f6100d566c251eaa09498a60f6d7cfe29.tar.gz
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
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/trait.py15
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py2
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py13
-rw-r--r--wqflask/wqflask/templates/gsearch_gene.html2
-rw-r--r--wqflask/wqflask/templates/gsearch_pheno.html2
-rw-r--r--wqflask/wqflask/templates/marker_regression_gn1.html77
-rw-r--r--wqflask/wqflask/templates/search_result_page.html2
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 %}
<script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script>
+ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script>
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 %}
<script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script>
+ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script>
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 @@
</div>
</form>
- <div style="width:48%;">
- {% if selectedChr == -1 %}
+ {% if selectedChr == -1 %}
+ <div style="width:{% if 'additive' in trimmed_markers[0] %}50%{% else %}35%{% endif %};">
<h2>Results</h2>
+ <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
<table id="qtl_results" class="table table-hover table-striped">
<thead>
<tr>
<th></th>
- <th>Index</th>
+ <th>Row</th>
+ <th>Locus</th>
<th>{{ LRS_LOD }}</th>
<th>Chr</th>
{% if plotScale == "centimorgan" %}
@@ -184,7 +186,12 @@
{% else %}
<th>Mb</th>
{% endif %}
- <th>Locus</th>
+ {% if 'additive' in trimmed_markers[0] %}
+ <th>Add Eff</th>
+ {% endif %}
+ {% if 'dominance' in trimmed_markers[0] %}
+ <th>Dom Eff</th>
+ {% endif %}
</tr>
</thead>
<tbody>
@@ -196,6 +203,7 @@
value="{{ marker.name }}" checked="checked">
</td>
<td align="right">{{ loop.index }}</td>
+ <td>{{ marker.name }}</td>
{% if LRS_LOD == "LOD" %}
{% if 'lod_score' in marker %}
<td>{{ '%0.2f' | format(marker.lod_score|float) }}</td>
@@ -211,13 +219,22 @@
{% endif %}
<td>{{marker.chr}}</td>
<td>{{ '%0.6f' | format(marker.Mb|float) }}</td>
- <td>{{ marker.name }}</td>
+ {% if 'additive' in marker %}
+ <td>{{ '%0.3f' | format(marker.additive|float) }}</td>
+ {% endif %}
+ {% if 'dominance' in marker %}
+ <td>{{ '%0.2f' | format(marker.dominance|float) }}</td>
+ {% endif %}
</tr>
{% endfor %}
</tbody>
</table>
- {% else %}
+ </div>
+ </div>
+ {% else %}
+ <div>
<h2>Interval Analyst</h2>
+ <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
<table id="interval_analyst" class="table table-hover table-striped">
<thead>
<tr>
@@ -236,8 +253,9 @@
{% endfor %}
</tbody>
</table>
- {% endif %}
+ </div>
</div>
+ {% endif %}
</div>
<!-- End of body -->
@@ -251,7 +269,7 @@
<script type="text/javascript" src="/static/new/js_external/underscore.string.min.js"></script>
<script type="text/javascript" src="/static/new/js_external/d3-tip.min.js"></script>
- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.js"></script>
+ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script>
@@ -274,26 +292,35 @@
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {
console.time("Creating table");
- $('#qtl_results').dataTable( {
+ $('#qtl_results').DataTable( {
"columns": [
- { "type": "natural", "sWidth": "10%", "bSortable": false },
+ { "type": "natural", "width": "5%", "bSortable": false },
+ { "type": "natural", "width": "6%" },
+ { "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
- { "type": "natural", "sWidth": "30%"}
+ { "type": "natural" }
],
- "order": [[1, "asc"]],
+ "order": [[1, "asc" ]],
"buttons": [
- 'csv'
+ {
+ extend: 'csvHtml5',
+ text: 'Download CSV',
+ title: 'search_results',
+ fieldBoundary: '"',
+ exportOptions: {
+ columns: [1, 2, 3, 4, 5, 6, 7, 8]
+ }
+ }
],
"sDom": "RZBtir",
"iDisplayLength": -1,
- "autoWidth": true,
"bDeferRender": true,
"bSortClasses": false,
- "scrollY": "700px",
- "scrollCollapse": true,
+ "scrollY": true,
+ "scrollCollapse": false,
"paging": false
} );
@@ -302,12 +329,24 @@
"targets": 0,
"sortable": false
}],
- "order": [[3, "asc"]],
- "sDom": "RZtir",
+ "order": [[3, "asc" ]],
+ "buttons": [
+ {
+ extend: 'csvHtml5',
+ text: 'Download CSV',
+ title: 'search_results',
+ fieldBoundary: '"',
+ exportOptions: {
+ columns: [1, 2, 3, 4, 5, 6, 7, 8, 9]
+ }
+ }
+ ],
+ "sDom": "RZBtir",
"iDisplayLength": -1,
- "autoWidth": true,
"bDeferRender": true,
"bSortClasses": false,
+ "scrollY": true,
+ "scrollCollapse": false,
"paging": false
} );
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 4ba2d802..523037f8 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -163,7 +163,6 @@
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script>
- <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/scroller/1.4.1/js/dataTables.scroller.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script>
@@ -171,7 +170,6 @@
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colReorder.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.min.js"></script>
- <script language="javascript" type="text/javascript" src="//cdn.datatables.net/fixedcolumns/3.0.4/js/dataTables.fixedColumns.min.js"></script>
<script type="text/javascript" charset="utf-8">
function getValue(x) {