aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/base/webqtlConfig.py4
-rwxr-xr-xwqflask/secure_server.py2
-rwxr-xr-xwqflask/wqflask/marker_regression/marker_regression.py26
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/bar_chart.css15
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/box_plot.css20
-rw-r--r--wqflask/wqflask/static/new/javascript/css/charts.css28
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/corr_matrix.css12
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/corr_scatter_plot.css13
-rw-r--r--wqflask/wqflask/static/new/javascript/css/d3-tip.min.css1
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/interval_mapping.css32
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/main.css4
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/marker_regression.css38
-rw-r--r--wqflask/wqflask/static/new/javascript/css/panelutil.css91
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/parsley.css20
-rw-r--r--wqflask/wqflask/static/new/javascript/css/scatter-matrix.css40
-rw-r--r--wqflask/wqflask/static/new/javascript/css/show_trait.css7
-rwxr-xr-xwqflask/wqflask/static/new/javascript/css/table.css36
-rw-r--r--wqflask/wqflask/templates/pair_scan_results.html91
-rwxr-xr-xwqflask/wqflask/templates/show_trait_calculate_correlations.html2
-rwxr-xr-xwqflask/wqflask/templates/show_trait_mapping_tools.html67
-rwxr-xr-xwqflask/wqflask/views.py15
21 files changed, 520 insertions, 44 deletions
diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py
index 019d592b..e74b9ce5 100755
--- a/wqflask/base/webqtlConfig.py
+++ b/wqflask/base/webqtlConfig.py
@@ -49,13 +49,13 @@ GENOMEBROWSER_URL="http://ucscbrowser.genenetwork.org/cgi-bin/hgTracks?clade=mam
ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?species=Mus_musculus;idx=Transcript;end=1;q=%s"
-GNROOT = "/home/danny/GeneNetwork/" # Will remove this and dependent items later
+GNROOT = "/home/zas1024/gene/" # Will remove this and dependent items later
SECUREDIR = GNROOT + 'secure/'
COMMON_LIB = GNROOT + 'support/admin'
HTMLPATH = GNROOT + 'web/'
PYLMM_PATH = '/home/zas1024/plink/'
SNP_PATH = '/home/zas1024/snps/'
-IMGDIR = HTMLPATH +'image/'
+IMGDIR = GNROOT + '/wqflask/wqflask/images/'
IMAGESPATH = HTMLPATH + 'images/'
UPLOADPATH = IMAGESPATH + 'upload/'
TMPDIR = '/tmp/'
diff --git a/wqflask/secure_server.py b/wqflask/secure_server.py
index 248559f3..975c97c0 100755
--- a/wqflask/secure_server.py
+++ b/wqflask/secure_server.py
@@ -72,7 +72,7 @@ if __name__ == '__main__':
app.run(host='0.0.0.0',
- port=5003,
+ port=5002,
use_debugger=True,
threaded=True,
use_reloader=True)
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index 8fb1d841..af441489 100755
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -69,7 +69,7 @@ class MarkerRegression(object):
self.maf = start_vars['maf'] # Minor allele frequency
self.suggestive = ""
self.significant = ""
- #print("self.maf:", self.maf)
+ self.pair_scan = False # Initializing this since it is checked in views to determine which template to use
self.dataset.group.get_markers()
if self.mapping_method == "gemma":
@@ -86,11 +86,8 @@ class MarkerRegression(object):
self.method = start_vars['mapmethod_rqtl_geno']
self.model = start_vars['mapmodel_rqtl_geno']
-
if start_vars['pair_scan'] == "true":
self.pair_scan = True
- else:
- self.pair_scan = False
print("pair scan:", self.pair_scan)
print("DOING RQTL GENO")
@@ -283,6 +280,10 @@ class MarkerRegression(object):
r_library = ro.r["library"] # Map the library function
r_c = ro.r["c"] # Map the c function
r_sum = ro.r["sum"] # Map the sum function
+ plot = ro.r["plot"] # Map the plot function
+ postscript = ro.r["postscript"] # Map the postscript function
+ png = ro.r["png"] # Map the png function
+ dev_off = ro.r["dev.off"] # Map the device off function
print(r_library("qtl")) # Load R/qtl
@@ -315,13 +316,19 @@ class MarkerRegression(object):
if self.pair_scan:
if(r_sum(covar)[0] > 0): # If sum(covar) > 0 we have a covariate matrix
- print("Using covariate"); result_data_frame = scantwo(cross_object, pheno = "the_pheno", addcovar = covar)
+ print("Using covariate"); result_data_frame = scantwo(cross_object, pheno = "the_pheno", addcovar = covar, model=self.model, method=self.method, n_cluster = 16)
else:
- print("No covariates"); result_data_frame = scantwo(cross_object, pheno = "the_pheno")
+ print("No covariates"); result_data_frame = scantwo(cross_object, pheno = "the_pheno", model=self.model, method=self.method, n_cluster = 16)
print("Pair scan results:", result_data_frame)
+
+ self.pair_scan_filename = webqtlUtil.genRandStr("scantwo_")
+ png(file=webqtlConfig.IMGDIR+self.pair_scan_filename+".png")
+ plot(result_data_frame)
+ dev_off()
+
+ return self.process_pair_scan_results(result_data_frame)
- return 0
else:
if(r_sum(covar)[0] > 0):
print("Using covariate"); result_data_frame = scanone(cross_object, pheno = "the_pheno", addcovar = covar, model=self.model, method=self.method)
@@ -373,6 +380,11 @@ class MarkerRegression(object):
pheno_as_string += ")"
return pheno_as_string
+ def process_pair_scan_results(self, result):
+ results = []
+
+ return results
+
def process_rqtl_results(self, result): # TODO: how to make this a one liner and not copy the stuff in a loop
qtl_results = []
diff --git a/wqflask/wqflask/static/new/javascript/css/bar_chart.css b/wqflask/wqflask/static/new/javascript/css/bar_chart.css
new file mode 100755
index 00000000..78d31eee
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/bar_chart.css
@@ -0,0 +1,15 @@
+.barchart .axis path,
+.barchart .axis line {
+ fill: none;
+ stroke: #000;
+ shape-rendering: crispEdges;
+}
+
+.bar {
+ fill: steelblue;
+ shape-rendering: crispEdges;
+}
+/*
+.x.axis path {
+ display: none;
+}*/ \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/box_plot.css b/wqflask/wqflask/static/new/javascript/css/box_plot.css
new file mode 100755
index 00000000..4c743b33
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/box_plot.css
@@ -0,0 +1,20 @@
+.box {
+ font: 10px sans-serif;
+}
+
+.box line,
+.box rect,
+.box circle {
+ fill: #fff;
+ stroke: #000;
+ stroke-width: 1.5px;
+}
+
+.box .center {
+ stroke-dasharray: 3,3;
+}
+
+.box .outlier {
+ fill: none;
+ stroke: #ccc;
+} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/charts.css b/wqflask/wqflask/static/new/javascript/css/charts.css
new file mode 100644
index 00000000..5f2d4d23
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/charts.css
@@ -0,0 +1,28 @@
+body {
+ font-family: sans-serif;
+}
+
+svg {
+ margin-top: 10px;
+ margin-left: 50px;
+}
+
+.line {
+ stroke-width: 1;
+ fill: none;
+}
+
+text {
+ font-family: sans-serif;
+ font-size: 11pt;
+}
+
+p {
+ font-family: sans-serif;
+ font-size: 12pt;
+}
+
+p#caption {
+ margin-left: 100px;
+ width: 500px;
+}
diff --git a/wqflask/wqflask/static/new/javascript/css/corr_matrix.css b/wqflask/wqflask/static/new/javascript/css/corr_matrix.css
new file mode 100755
index 00000000..f4838f77
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/corr_matrix.css
@@ -0,0 +1,12 @@
+.vertical_label {
+ -webkit-transform: rotate(-90deg);
+ -moz-transform: rotate(-90deg);
+ -ms-transform: rotate(-90deg);
+ -o-transform: rotate(-90deg);
+ trasnform: rotate(-90deg);
+ color: #000
+ font-size: 22px;
+ height: 50px;
+ width: 100px;
+ float: left;
+}
diff --git a/wqflask/wqflask/static/new/javascript/css/corr_scatter_plot.css b/wqflask/wqflask/static/new/javascript/css/corr_scatter_plot.css
new file mode 100755
index 00000000..c62d4c9a
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/corr_scatter_plot.css
@@ -0,0 +1,13 @@
+.chart {
+
+}
+
+.main text {
+ font: 10px sans-serif;
+}
+
+.axis line, .axis path {
+ shape-rendering: crispEdges;
+ stroke: black;
+ fill: none;
+}
diff --git a/wqflask/wqflask/static/new/javascript/css/d3-tip.min.css b/wqflask/wqflask/static/new/javascript/css/d3-tip.min.css
new file mode 100644
index 00000000..3d253caf
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/d3-tip.min.css
@@ -0,0 +1 @@
+.d3-tip{line-height:1;font-weight:bold;padding:12px;background:rgba(0,0,0,0.8);color:#fff;border-radius:2px;pointer-events:none}.d3-tip:after{box-sizing:border-box;display:inline;font-size:10px;width:100%;line-height:1;color:rgba(0,0,0,0.8);position:absolute;pointer-events:none}.d3-tip.n:after{content:"\25BC";margin:-1px 0 0 0;top:100%;left:0;text-align:center}.d3-tip.e:after{content:"\25C0";margin:-4px 0 0 0;top:50%;left:-8px}.d3-tip.s:after{content:"\25B2";margin:0 0 1px 0;top:-8px;left:0;text-align:center}.d3-tip.w:after{content:"\25B6";margin:-4px 0 0 -1px;top:50%;left:100%} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/interval_mapping.css b/wqflask/wqflask/static/new/javascript/css/interval_mapping.css
new file mode 100755
index 00000000..4a55d2e3
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/interval_mapping.css
@@ -0,0 +1,32 @@
+.chr_interval_map .y_axis path,
+.chr_interval_map .y_axis line {
+ fill: none;
+ stroke: black;
+ shape-rendering: crispEdges;
+}
+.chr_interval_map .y_axis text {
+ font-family: sans-serif;
+ font-size: 14px;
+}
+
+.chr_interval_map .x_axis path,
+.chr_interval_map .x_axis line {
+ fill: none;
+ stroke: black;
+ shape-rendering: crispEdges;
+}
+.chr_interval_map .x_axis text {
+ text-anchor: end;
+ font-family: sans-serif;
+ font-size: 8px;
+}
+/*
+interval_map rect {
+ stroke: WhiteSmoke;
+ fill: white;
+}
+
+interval_map path {
+ stroke: steelblue;
+ stroke-width: 1;
+}*/ \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/main.css b/wqflask/wqflask/static/new/javascript/css/main.css
new file mode 100755
index 00000000..017bbdb8
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/main.css
@@ -0,0 +1,4 @@
+.security_box {
+ padding-left: 30px;
+ padding-right: 30px;
+}
diff --git a/wqflask/wqflask/static/new/javascript/css/marker_regression.css b/wqflask/wqflask/static/new/javascript/css/marker_regression.css
new file mode 100755
index 00000000..d81b5021
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/marker_regression.css
@@ -0,0 +1,38 @@
+.chr_manhattan_plot .y_axis path,
+.chr_manhattan_plot .y_axis line {
+ fill: none;
+ stroke: black;
+ shape-rendering: crispEdges;
+}
+.chr_manhattan_plot .y_axis text {
+ font-family: sans-serif;
+ font-size: 14px;
+}
+
+.chr_manhattan_plot .x_axis path,
+.chr_manhattan_plot .x_axis line {
+ fill: none;
+ stroke: black;
+ shape-rendering: crispEdges;
+}
+
+.chr_manhattan_plot .x_axis text {
+ text-anchor: end;
+ font-family: sans-serif;
+ font-size: 10px;
+}
+
+rect.pane {
+ cursor: move;
+ fill: none;
+ pointer-events: all;
+}
+
+/*rect {
+ stroke: WhiteSmoke;
+ fill: lightgrey;
+}*/
+/*rect {
+ stroke: WhiteSmoke;
+ fill: Azure;
+}*/ \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/panelutil.css b/wqflask/wqflask/static/new/javascript/css/panelutil.css
new file mode 100644
index 00000000..ccd7eb01
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/panelutil.css
@@ -0,0 +1,91 @@
+
+/* figures will always be within a div with class="qtlcharts" */
+div.qtlcharts {
+ font-family: sans-serif;
+ font-size: 11pt;
+}
+
+div.qtlcharts .title text {
+ dominant-baseline: middle;
+ fill: blue;
+ text-anchor: middle;
+}
+
+div.qtlcharts .y.axis text {
+ dominant-baseline: middle;
+ text-anchor: end;
+}
+
+div.qtlcharts .y.axis text.title {
+ text-anchor: middle;
+ fill: slateblue;
+}
+
+div.qtlcharts .x.axis text {
+ dominant-baseline: hanging;
+ text-anchor: middle;
+}
+
+div.qtlcharts .x.axis text.title {
+ fill: slateblue;
+}
+
+/*div.qtlcharts line.axis.grid {
+ fill: none;
+ stroke-width: 1;
+ pointer-events: none;
+}
+
+div.qtlcharts line.x.axis.grid {
+ stroke: rgb(200, 200, 200);
+ stroke-width: 3;
+}
+
+div.qtlcharts line.y.axis.grid {
+ stroke: white;
+}*/
+
+div.qtlcharts .extent {
+ fill: #cac;
+ opacity: 0.3;
+}
+
+div.qtlcharts circle.selected {
+ fill: hotpink;
+ opacity: 1;
+}
+
+div.qtlcharts a {
+ color: #08c;
+ text-decoration: none;
+}
+
+div.qtlcharts a:hover {
+ color: #333;
+ text-decoration: underline;
+}
+
+
+/* figure captions */
+.caption {
+ font-family: Sans-serif;
+ font-size: 11pt;
+ margin-left: 60px;
+ width: 600px;
+}
+
+
+/* d3 tip for tool tips */
+.d3-tip {
+ background: darkslateblue;
+ color: #fff;
+ stroke: none;
+ font-weight: bold;
+ font-size: 16px;
+ font-family: sans-serif;
+ padding: 5px;
+}
+
+.d3-tip.e:after {
+ color: darkslateblue;
+} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/parsley.css b/wqflask/wqflask/static/new/javascript/css/parsley.css
new file mode 100755
index 00000000..7d244579
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/parsley.css
@@ -0,0 +1,20 @@
+/* Adapted from parsleyjs.org/documentation.html#parsleyclasses */
+
+input.parsley-success, textarea.parsley-success {
+ color: #468847 !important;
+ background-color: #DFF0D8 !important;
+ border: 1px solid #D6E9C6 !important;
+}
+input.parsley-error, textarea.parsley-error {
+ color: #B94A48 !important;
+ background-color: #F2DEDE !important;
+ border: 1px solid #EED3D7 !important;
+}
+ul.parsley-error-list {
+ font-size: 11px;
+ margin: 2px;
+ list-style-type:none;
+}
+ul.parsley-error-list li {
+ line-height: 11px;
+} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/scatter-matrix.css b/wqflask/wqflask/static/new/javascript/css/scatter-matrix.css
new file mode 100644
index 00000000..147903be
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/scatter-matrix.css
@@ -0,0 +1,40 @@
+#scatter-matrix { font-size: 14px; }
+
+.axis { shape-rendering: crispEdges; }
+.axis line { stroke: #ddd; stroke-width: 1px; }
+.axis path { display: none; }
+.axis text { font-size: 0.8em; }
+
+rect.extent { fill: #000; fill-opacity: .125; stroke: #fff; }
+rect.frame { fill: #fff; fill-opacity: .7; stroke: #aaa; }
+
+circle { fill: #ccc; fill-opacity: .5; }
+
+.legend circle { fill-opacity: 1; }
+.legend text { font-size: 18px; font-style: oblique; }
+
+.cell text { pointer-events: none; }
+
+.color-0 { fill: #800; }
+.color-1 { fill: #080; }
+.color-2 { fill: #008; }
+.color-3 { fill: #440; }
+.color-4 { fill: #044; }
+.color-5 { fill: #404; }
+.color-6 { fill: #400; }
+.color-7 { fill: #040; }
+.color-8 { fill: #004; }
+.color-9 { fill: #cc0; }
+.color-10 { fill: #0cc; }
+.color-11 { fill: #c0c; }
+.color-12 { fill: #880; }
+.color-13 { fill: #088; }
+.color-14 { fill: #808; }
+.color-15 { fill: #c00; }
+.color-16 { fill: #0c0; }
+.color-17 { fill: #00c; }
+
+.scatter-matrix-filter-control ul { list-style: none; padding-left: 10px; }
+.scatter-matrix-variable-control ul { list-style: none; padding-left: 10px; }
+.scatter-matrix-drill-control ul { list-style: none; padding-left: 10px; }
+
diff --git a/wqflask/wqflask/static/new/javascript/css/show_trait.css b/wqflask/wqflask/static/new/javascript/css/show_trait.css
new file mode 100644
index 00000000..9fc82a85
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/show_trait.css
@@ -0,0 +1,7 @@
+tr .outlier {
+ background-color: #ffff99;
+}
+
+#bar_chart_container {
+ overflow-x:scroll;
+} \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/css/table.css b/wqflask/wqflask/static/new/javascript/css/table.css
new file mode 100755
index 00000000..1910ef88
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/css/table.css
@@ -0,0 +1,36 @@
+/* Adapted from http://coding.smashingmagazine.com/2008/08/13/top-10-css-table-designs/ */
+
+.one-column-emphasis
+{
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 12px;
+ line-height: 1.6em;
+ margin: 45px;
+ width: 480px;
+ text-align: left;
+ border-collapse: collapse;
+}
+.one-column-emphasis th
+{
+ font-size: 14px;
+ font-weight: normal;
+ padding: 12px 15px;
+ color: #039;
+}
+.one-column-emphasis td
+{
+ padding: 10px 15px;
+ color: #669;
+ border-top: 1px solid #e8edff;
+}
+.oce-first
+{
+ background: #d0dafd;
+ border-right: 10px solid transparent;
+ border-left: 10px solid transparent;
+}
+.one-column-emphasis tr:hover td
+{
+ color: #339;
+ background: #eff2ff;
+}
diff --git a/wqflask/wqflask/templates/pair_scan_results.html b/wqflask/wqflask/templates/pair_scan_results.html
new file mode 100644
index 00000000..a0041e11
--- /dev/null
+++ b/wqflask/wqflask/templates/pair_scan_results.html
@@ -0,0 +1,91 @@
+{% extends "base.html" %}
+{% block title %}Interval Mapping{% endblock %}
+{% block css %}
+<!-- <link rel="stylesheet" type="text/css" href="/static/new/css/interval_mapping.css" />-->
+ <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" />
+ <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" />
+ <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" />
+ <link rel="stylesheet" type="text/css" href="/static/new/css/d3-tip.min.css" />
+ <link rel="stylesheet" type="text/css" href="/static/new/css/panelutil.css" />
+{% endblock %}
+{% block content %} <!-- Start of body -->
+
+ {{ header("Mapping",
+ '{}: {}'.format(this_trait.name, this_trait.description_fmt)) }}
+
+ <div class="container">
+ <div>
+ <h2>
+ Pair Scan
+ </h2>
+ </div>
+ <div id="chart_container">
+ <div class="pair_scan_figure" id="pair_scan_figure">
+ <img src="/images/{{ pair_scan_filename }}.png">
+ </div>
+ </div>
+ <div>
+ <h2>
+ Results
+ </h2>
+ </div>
+ </div>
+
+ <!-- End of body -->
+
+{% endblock %}
+
+{% block js %}
+ <script>
+ js_data = {{ js_data | safe }}
+ </script>
+
+ <!--[if lt IE 9]>
+<!-- <script language="javascript" type="text/javascript" src="/static/packages/jqplot/excanvas.js"></script>-->
+ <![endif]-->
+ <script language="javascript" type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/js_external/d3-tip.min.js"></script>
+<!-- <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/jspdf.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/libs/FileSaver.js/FileSaver.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/libs/Blob.js/BlobBuilder.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/jspdf.plugin.standard_fonts_metrics.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/jsPDF/jspdf.plugin.from_html.js"></script>-->
+ <script language="javascript" type="text/javascript" src="/static/new/javascript/panelutil.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/javascript/chr_lod_chart.js"></script>
+<!-- <script language="javascript" type="text/javascript" src="/static/new/javascript/manhattan_plot.js"></script>-->
+ <script language="javascript" type="text/javascript" src="/static/new/javascript/lod_chart.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/javascript/create_lodchart.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.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="/static/new/packages/DataTables/js/dataTables.scientific.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/packages/DT_bootstrap/DT_bootstrap.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script>
+ <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script>
+
+ <script type="text/javascript" charset="utf-8">
+ $(document).ready( function () {
+ console.time("Creating table");
+ $('#qtl_results').dataTable( {
+ //"sDom": "<<'span3'l><'span3'T><'span4'f>'row-fluid'r>t<'row-fluid'<'span6'i><'span6'p>>",
+ "sDom": "lTftipr",
+ "oTableTools": {
+ "aButtons": [
+ "copy",
+ "print",
+ {
+ "sExtends": "collection",
+ "sButtonText": 'Save <span class="caret" />',
+ "aButtons": [ "csv", "xls", "pdf" ]
+ }
+ ],
+ "sSwfPath": "/static/packages/TableTools/media/swf/copy_csv_xls_pdf.swf"
+ },
+ "iDisplayLength": 50,
+ "bLengthChange": true,
+ "bDeferRender": true,
+ "bSortClasses": false
+ } );
+ console.timeEnd("Creating table");
+ });
+ </script>
+{% endblock %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/show_trait_calculate_correlations.html b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
index 63bbd7b6..f02d1705 100755
--- a/wqflask/wqflask/templates/show_trait_calculate_correlations.html
+++ b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
@@ -2,7 +2,7 @@
<div style="padding: 20px" class="form-horizontal">
<div class="form-group">
- <label for="corr_method" class="col-xs-1 control-label">Method</label>
+ <label for="corr_type" class="col-xs-1 control-label">Method</label>
<div class="col-xs-2 controls">
<select name="corr_type" class="form-control">
<option value="sample">Sample r</option>
diff --git a/wqflask/wqflask/templates/show_trait_mapping_tools.html b/wqflask/wqflask/templates/show_trait_mapping_tools.html
index 7794fab5..426a5c5d 100755
--- a/wqflask/wqflask/templates/show_trait_mapping_tools.html
+++ b/wqflask/wqflask/templates/show_trait_mapping_tools.html
@@ -140,63 +140,68 @@
<label for="control_for" class="col-xs-2 control-label">Control&nbsp;for</label>
<div style="margin-left: 20px;" class="col-xs-4 controls">
{% if dataset.type == 'ProbeSet' and this_trait.locus_chr != "" %}
- <input name="control_rqtl_geno" value="{{ nearest_marker1+","+nearest_marker2 }}" type="text" />
+ <input name="control_rqtl_geno" value="{{ nearest_marker1+","+nearest_marker2 }}" type="text" style="width: 160px;" class="form-control" />
{% else %}
- <input name="control_rqtl_geno" value="" type="text" />
+ <input name="control_rqtl_geno" value="" type="text" class="form-control" />
{% endif %}
</div>
</div>
<div class="mapping_method_fields form-group">
- <label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label>
+ <label for="mapmethod_rqtl_geno" style="text-align:left;" class="col-xs-2 control-label">Method</label>
+ <div class="col-xs-4 controls">
+ <select name="mapmethod_rqtl_geno" class="form-control">
+ <option value="em">em</option>
+ <option value="imp">imp</option>
+ <option value="hk">hk</option>
+ <option value="ehk">ehk</option>
+ <option value="mr">mr</option>
+ <option value="mr-imp">mr-imp</option>
+ <option value="mr-argmax">mr-argmax</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="mapping_method_fields form-group">
+ <label for="mapmodel_rqtl_geno" style="text-align:left;" class="col-xs-2 control-label">Model</label>
+ <div class="col-xs-4 controls">
+ <select name="mapmodel_rqtl_geno" class="form-control">
+ <option value="normal">normal</option>
+ <option value="binary">binary</option>
+ <option value="2part">2part</option>
+ <option value="np">np</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="mapping_method_fields form-group">
+ <label style="text-align:left;" class="col-xs-12 control-label">Pair Scan</label>
<div class="col-xs-12 controls">
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_rqtl" value="true">
+ <input type="radio" name="pair_scan" value="true">
Yes
</label>
<label class="radio-inline">
- <input type="radio" name="manhattan_plot_rqtl" value="false" checked="">
+ <input type="radio" name="pair_scan" value="false" checked="">
No
</label>
</div>
</div>
<div class="mapping_method_fields form-group">
- <label style="text-align:left;" class="col-xs-12 control-label">Method</label>
- <select name="mapmethod_rqtl_geno">
- <option value="em">em</option>
- <option value="imp">imp</option>
- <option value="hk">hk</option>
- <option value="ehk">ehk</option>
- <option value="mr">mr</option>
- <option value="mr-imp">mr-imp</option>
- <option value="mr-argmax">mr-argmax</option>
- </select>
- </div>
-
- <div class="mapping_method_fields form-group">
- <label style="text-align:left;" class="col-xs-12 control-label">Model</label>
- <select name="mapmodel_rqtl_geno">
- <option value="normal">normal</option>
- <option value="binary">binary</option>
- <option value="2part">2part</option>
- <option value="np">np</option>
- </select>
- </div>
-
- <div class="mapping_method_fields form-group">
- <label style="text-align:left;" class="col-xs-12 control-label">Pair Scan</label>
+ <label style="text-align:left;" class="col-xs-12 control-label">Manhattan Plot</label>
<div class="col-xs-12 controls">
<label class="radio-inline">
- <input type="radio" name="pair_scan" value="true">
+ <input type="radio" name="manhattan_plot_rqtl" value="true">
Yes
</label>
<label class="radio-inline">
- <input type="radio" name="pair_scan" value="false" checked="">
+ <input type="radio" name="manhattan_plot_rqtl" value="false" checked="">
No
</label>
</div>
</div>
+
<div class="form-group">
<div style="padding-left:15px;" class="controls">
<button id="rqtl_geno_compute" class="btn submit_special btn-primary" data-url="/marker_regression" title="Compute Marker Regression">
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index bac553d7..4b7bd639 100755
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -82,6 +82,14 @@ def index_page():
#print("[orange] ds:", ds.datasets)
return render_template("index_page.html")
+
+@app.route("/tmp")
+def tmp_page():
+ print("In tmp_page")
+ initial_start_vars = request.form
+ print("initial_start_vars:", initial_start_vars)
+
+
@app.route("/data_sharing")
def data_sharing_page():
print("In data_sharing")
@@ -296,7 +304,7 @@ def marker_regression_page():
if key in wanted or key.startswith(('value:')):
start_vars[key] = value
- version = "v3"
+ version = "v4"
key = "marker_regression:{}:".format(version) + json.dumps(start_vars, sort_keys=True)
print("key is:", pf(key))
with Bench("Loading cache"):
@@ -335,7 +343,10 @@ def marker_regression_page():
Redis.expire(key, 1*60)
with Bench("Rendering template"):
- rendered_template = render_template("marker_regression.html", **result)
+ if result['pair_scan'] == True:
+ rendered_template = render_template("pair_scan_results.html", **result)
+ else:
+ rendered_template = render_template("marker_regression.html", **result)
return rendered_template