aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression_gn1.py4
-rw-r--r--wqflask/wqflask/marker_regression/plink_mapping.py6
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json6
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js15
-rw-r--r--wqflask/wqflask/submit_bnw.py11
-rw-r--r--wqflask/wqflask/templates/show_trait.html3
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html4
-rw-r--r--wqflask/wqflask/templates/show_trait_statistics.html2
-rw-r--r--wqflask/wqflask/views.py6
9 files changed, 44 insertions, 13 deletions
diff --git a/wqflask/wqflask/marker_regression/marker_regression_gn1.py b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
index ff1fb492..93bd9d42 100644
--- a/wqflask/wqflask/marker_regression/marker_regression_gn1.py
+++ b/wqflask/wqflask/marker_regression/marker_regression_gn1.py
@@ -1801,9 +1801,9 @@ class MarkerRegression(object):
distScale = 10
else:
distScale = 5
- for i, tickdists in enumerate(range(distScale, int(ceil(distLen)), distScale)):
+ for j, tickdists in enumerate(range(distScale, int(ceil(distLen)), distScale)):
canvas.drawLine(startPosX + tickdists*plotXScale, yZero, startPosX + tickdists*plotXScale, yZero + 7, color=pid.black, width=1*zoom)
- if i % 2 == 0:
+ if j % 2 == 0:
canvas.drawString(str(tickdists), startPosX+tickdists*plotXScale, yZero + 10*zoom, color=pid.black, font=MBLabelFont, angle=270)
startPosX += (self.ChrLengthDistList[i]+self.GraphInterval)*plotXScale
diff --git a/wqflask/wqflask/marker_regression/plink_mapping.py b/wqflask/wqflask/marker_regression/plink_mapping.py
index 3d31da1a..4de88f00 100644
--- a/wqflask/wqflask/marker_regression/plink_mapping.py
+++ b/wqflask/wqflask/marker_regression/plink_mapping.py
@@ -14,7 +14,7 @@ def run_plink(this_trait, dataset, species, vals, maf):
gen_pheno_txt_file(dataset, vals)
#gen_pheno_txt_file_plink(this_trait, dataset, vals, pheno_filename = plink_output_filename)
- plink_command = PLINK_COMMAND + ' --noweb --bfile %s/%s --no-fid --no-parents --no-sex --maf %s --missing-phenotype -9 --out %s/%s --assoc ' % (
+ plink_command = PLINK_COMMAND + ' --noweb --bfile %s/%s --no-pheno --no-fid --no-parents --no-sex --maf %s --out %s%s --assoc ' % (
flat_files('mapping'), dataset.group.name, maf, TMPDIR, plink_output_filename)
logger.debug("plink_command:", plink_command)
@@ -48,7 +48,7 @@ def gen_pheno_txt_file(this_dataset, vals):
this_val = -9
else:
this_val = vals[i]
- outfile.write(line[1] + " " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n")
+ outfile.write("0 " + line[1] + " " + line[2] + " " + line[3] + " " + line[4] + " " + str(this_val) + "\n")
def gen_pheno_txt_file_plink(this_trait, dataset, vals, pheno_filename = ''):
ped_sample_list = get_samples_from_ped_file(dataset)
@@ -106,7 +106,7 @@ def parse_plink_output(output_filename, species):
threshold_p_value = 1
- result_fp = open("%s/%s.qassoc"% (TMPDIR, output_filename), "rb")
+ result_fp = open("%s%s.qassoc"% (TMPDIR, output_filename), "rb")
header_line = result_fp.readline()# read header line
line = result_fp.readline()
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index eabddbc4..8de85a86 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -1918,12 +1918,12 @@
[
"797",
"EPFL_AdiPro0416",
- "EPFL/ETHZ BXD Brown Adipose, Total Tissue Proteome, Chow Diet (Apr16) Light SWATH **"
+ "EPFL/ETHZ BXD Brown Adipose, Total Tissue Proteome, Chow Diet (Apr16) Light SWATH"
],
[
"798",
"EPFL_AdiMitPro0416",
- "EPFL/ETHZ BXD Brown Adipose, Isolated Mitochondria Proteome, Chow Diet (Apr16) Light SWATH **"
+ "EPFL/ETHZ BXD Brown Adipose, Isolated Mitochondria Proteome, Chow Diet (Apr16) Light SWATH"
]
],
"Adipose mRNA": [
@@ -3583,7 +3583,7 @@
[
"799",
"FGUCAS_BAdip0516",
- "FGUCAS BXH/HXB Brown Adipose Affy Rat Gene 2.0 ST (May16) log2 **"
+ "FGUCAS BXH/HXB Brown Adipose Affy Rat Gene 2.0 ST (May16) log2"
]
],
"Adrenal Gland mRNA": [
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js
index 40fdff70..2b878087 100644
--- a/wqflask/wqflask/static/new/javascript/search_results.js
+++ b/wqflask/wqflask/static/new/javascript/search_results.js
@@ -154,11 +154,15 @@ $(function() {
}
};
+ submit_bnw = function() {
+ trait_data = get_traits_from_table("trait_table", "submit_bnw")
+ }
+
export_traits = function() {
- trait_data = get_traits_from_table("trait_table")
+ trait_data = get_traits_from_table("trait_table", "export_csv")
};
- get_traits_from_table = function(table_name) {
+ get_traits_from_table = function(table_name, destination) {
trait_table = $('#'+table_name);
table_dict = {};
@@ -199,7 +203,11 @@ $(function() {
json_table_dict = JSON.stringify(table_dict);
$('input[name=export_data]').val(json_table_dict);
- $('#export_form').attr('action', '/export_traits_csv');
+ if (destination == "export_csv"){
+ $('#export_form').attr('action', '/export_traits_csv');
+ } else{
+ $('#export_form').attr('action', '/submit_bnw');
+ }
$('#export_form').submit();
};
@@ -208,6 +216,7 @@ $(function() {
$("#invert").click(invert);
$("#add").click(add);
$("#remove").click(remove);
+ $("#submit_bnw").click(submit_bnw);
$("#export_traits").click(export_traits);
$('.trait_checkbox, .btn').click(change_buttons);
}); \ No newline at end of file
diff --git a/wqflask/wqflask/submit_bnw.py b/wqflask/wqflask/submit_bnw.py
new file mode 100644
index 00000000..59e60dfd
--- /dev/null
+++ b/wqflask/wqflask/submit_bnw.py
@@ -0,0 +1,11 @@
+from __future__ import absolute_import, print_function, division
+
+from base.trait import GeneralTrait
+from base import data_set
+from utility import helper_functions
+
+import utility.logger
+logger = utility.logger.getLogger(__name__ )
+
+def get_bnw_input(start_vars):
+ logger.debug("BNW VARS:", start_vars) \ No newline at end of file
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index d41f4dfb..a291baf3 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -141,7 +141,8 @@
<script type="text/javascript" src="/static/new/javascript/box_plot.js"></script>
<script type="text/javascript" src="/static/new/javascript/scatterplot.js"></script>
<script type="text/javascript" src="/static/new/javascript/scatter-matrix.js"></script>
- <script type="text/javascript" src="/static/new/javascript/draw_probability_plot.js"></script>
+ <script type="text/javascript" src="/static/new/javascript/draw_probability_plot.js"></script>
+ <!--<script type="text/javascript" src="/static/new/javascript/plotly_probability_plot.js"></script>-->
<script type="text/javascript" src="/static/new/javascript/compare_traits_scatterplot.js"></script>
<script language="javascript" type="text/javascript" src="/static/new/javascript/get_covariates_from_collection.js"></script>
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index a0c40c7f..2a62733e 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -70,6 +70,10 @@
Genotation
</a>
&nbsp;&nbsp;
+ <a href="https://www.gtexportal.org/home/gene/{{ this_trait.symbol }}" title="GTEx Portal">
+ GTEx Portal
+ </a>
+ &nbsp;&nbsp;
{% endif %}
</td>
</tr>
diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html
index 48ac468a..aa95b083 100644
--- a/wqflask/wqflask/templates/show_trait_statistics.html
+++ b/wqflask/wqflask/templates/show_trait_statistics.html
@@ -105,7 +105,6 @@
<option value="{{ group }}">{{ pretty_group }}</option>
{% endfor %}
</select>
- <!--<button type="button" class="btn btn-default" id="down_prob_plot">Export as PNG</button>-->
<br>
<br>
{% endif %}
@@ -113,6 +112,7 @@
<div id="prob_plot_container">
<div id="prob_plot_title"></div>
<svg></svg>
+ <!--<div id="prob_plot_div"></div>-->
</div>
<div id="shapiro_wilk_text"></div>
<div>
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 40806450..68e779a1 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -38,6 +38,7 @@ from wqflask import gsearch
from wqflask import update_search_results
from wqflask import docs
from wqflask import news
+from wqflask.submit_bnw import get_bnw_input
from base.data_set import DataSet # Used by YAML in marker_regression
from wqflask.show_trait import show_trait
from wqflask.show_trait import export_trait_data
@@ -760,6 +761,11 @@ def corr_scatter_plot_page():
indent=" ")
return render_template("corr_scatterplot.html", **template_vars.__dict__)
+@app.route("/submit_bnw", methods=('POST',))
+def submit_bnw():
+ logger.error(request.url)
+ template_vars = get_bnw_input(request.form)
+ return render_template("empty_collection.html", **{'tool':'Correlation Matrix'})
# Todo: Can we simplify this? -Sam
def sharing_info_page():