diff options
author | zsloan | 2019-08-01 12:08:33 -0500 |
---|---|---|
committer | zsloan | 2019-08-01 12:08:33 -0500 |
commit | 823169d970d8b64e955f7316e6df87c5204b4864 (patch) | |
tree | 7033865e45baea4b6b6b0b62813483c9bc8e37c2 /wqflask | |
parent | 8cf60da3d6acd18c84381bb51fde9968dc3d75e5 (diff) | |
download | genenetwork2-823169d970d8b64e955f7316e6df87c5204b4864.tar.gz |
Made some more aesthetic changes to various pages and charts/figures
Added some information to the mapping loading page
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/base/trait.py | 17 | ||||
-rw-r--r-- | wqflask/wqflask/show_trait/show_trait.py | 83 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/plotly_probability_plot.js | 19 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/show_trait.js | 73 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/base.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/correlation_matrix.html | 2 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/index_page_orig.html | 8 | ||||
-rw-r--r-- | wqflask/wqflask/templates/loading.html | 20 | ||||
-rw-r--r-- | wqflask/wqflask/templates/new_security/login_user.html | 83 | ||||
-rw-r--r-- | wqflask/wqflask/templates/search_result_page.html | 11 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 10 |
12 files changed, 194 insertions, 136 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 0527449b..39dd075e 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function import string import resource import codecs +import requests import redis Redis = redis.StrictRedis() @@ -120,11 +121,17 @@ class GeneralTrait(object): @property def alias_fmt(self): '''Return a text formatted alias''' - if self.alias: - alias = string.replace(self.alias, ";", " ") - alias = string.join(string.split(alias), ", ") - else: - alias = 'Not available' + + alias = 'Not available' + if self.symbol: + response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + self.symbol) + alias_list = json.loads(response.content) + alias = "; ".join(alias_list) + + if alias == 'Not available': + if self.alias: + alias = string.replace(self.alias, ";", " ") + alias = string.join(string.split(alias), ", ") return alias diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 1dd80962..f1f5840f 100644 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -142,40 +142,6 @@ class ShowTrait(object): self.qnorm_vals = quantile_normalize_vals(self.sample_groups) self.z_scores = get_z_scores(self.sample_groups) - # Todo: Add back in the ones we actually need from below, as we discover we need them - hddn = OrderedDict() - - if self.dataset.group.allsamples: - hddn['allsamples'] = string.join(self.dataset.group.allsamples, ' ') - - hddn['trait_id'] = self.trait_id - hddn['dataset'] = self.dataset.name - hddn['temp_trait'] = False - if self.temp_trait: - hddn['temp_trait'] = True - hddn['group'] = self.temp_group - hddn['species'] = self.temp_species - hddn['use_outliers'] = False - hddn['method'] = "gemma" - hddn['selected_chr'] = -1 - hddn['mapping_display_all'] = True - hddn['suggestive'] = 0 - hddn['num_perm'] = 0 - hddn['manhattan_plot'] = "" - hddn['control_marker'] = "" - if not self.temp_trait: - if hasattr(self.this_trait, 'locus_chr') and self.this_trait.locus_chr != "" and self.dataset.type != "Geno" and self.dataset.type != "Publish": - hddn['control_marker'] = self.nearest_marker - #hddn['control_marker'] = self.nearest_marker1+","+self.nearest_marker2 - hddn['do_control'] = False - hddn['maf'] = 0.05 - hddn['compare_traits'] = [] - hddn['export_data'] = "" - hddn['export_format'] = "excel" - - # We'll need access to this_trait and hddn in the Jinja2 Template, so we put it inside self - self.hddn = hddn - self.temp_uuid = uuid.uuid4() self.sample_group_types = OrderedDict() @@ -216,18 +182,61 @@ class ShowTrait(object): sample_column_width = max_samplename_width * 8 - if self.num_values >= 500: + if self.num_values >= 5000: self.maf = 0.01 else: self.maf = 0.05 trait_symbol = None + short_description = None if not self.temp_trait: if self.this_trait.symbol: trait_symbol = self.this_trait.symbol + short_description = trait_symbol + + elif self.this_trait.post_publication_abbreviation: + short_description = self.this_trait.post_publication_abbreviation + + elif self.this_trait.pre_publication_abbreviation: + short_description = self.this_trait.pre_publication_abbreviation + + # Todo: Add back in the ones we actually need from below, as we discover we need them + hddn = OrderedDict() + + if self.dataset.group.allsamples: + hddn['allsamples'] = string.join(self.dataset.group.allsamples, ' ') + hddn['primary_samples'] = string.join(self.primary_sample_names, ',') + hddn['trait_id'] = self.trait_id + hddn['dataset'] = self.dataset.name + hddn['temp_trait'] = False + if self.temp_trait: + hddn['temp_trait'] = True + hddn['group'] = self.temp_group + hddn['species'] = self.temp_species + hddn['use_outliers'] = False + hddn['method'] = "gemma" + hddn['selected_chr'] = -1 + hddn['mapping_display_all'] = True + hddn['suggestive'] = 0 + hddn['num_perm'] = 0 + hddn['manhattan_plot'] = "" + hddn['control_marker'] = "" + if not self.temp_trait: + if hasattr(self.this_trait, 'locus_chr') and self.this_trait.locus_chr != "" and self.dataset.type != "Geno" and self.dataset.type != "Publish": + hddn['control_marker'] = self.nearest_marker + #hddn['control_marker'] = self.nearest_marker1+","+self.nearest_marker2 + hddn['do_control'] = False + hddn['maf'] = 0.05 + hddn['compare_traits'] = [] + hddn['export_data'] = "" + hddn['export_format'] = "excel" + + # We'll need access to this_trait and hddn in the Jinja2 Template, so we put it inside self + self.hddn = hddn js_data = dict(trait_id = self.trait_id, trait_symbol = trait_symbol, + short_description = short_description, unit_type = trait_units, dataset_type = self.dataset.type, data_scale = self.dataset.data_scale, @@ -396,6 +405,8 @@ class ShowTrait(object): sample_group_type='primary', header="%s Only" % (self.dataset.group.name)) self.sample_groups = (primary_samples,) + + self.primary_sample_names = primary_sample_names self.dataset.group.allsamples = all_samples_ordered def quantile_normalize_vals(sample_groups): @@ -493,7 +504,7 @@ def get_genofiles(this_dataset): return jsondata['genofile'] def get_table_widths(sample_groups, has_num_cases=False): - stats_table_width = 200 + stats_table_width = 250 if len(sample_groups) > 1: stats_table_width = 450 diff --git a/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js b/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js index a9c5676c..cc4195e4 100644 --- a/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js +++ b/wqflask/wqflask/static/new/javascript/plotly_probability_plot.js @@ -171,22 +171,23 @@ } var layout = { - title: js_data.trait_id, + title: "<b>Trait " + js_data.trait_id + ": " + js_data.short_description + "</b>", margin: { - l: 65, + l: 100, r: 30, t: 80, - b: 80 + b: 60 }, xaxis: { - title: "Normal Theoretical Quantiles", + title: "<b>Normal Theoretical Quantiles</b>", range: [first_x, last_x], zeroline: false, visible: true, linecolor: 'black', linewidth: 1, titlefont: { - size: 16 + family: "arial", + size: 20 }, ticklen: 4, tickfont: { @@ -194,19 +195,21 @@ } }, yaxis: { - title: "Data Quantiles", + title: "<b>Data Quantiles</b>", zeroline: false, visible: true, linecolor: 'black', linewidth: 1, titlefont: { - size: 16 + family: "arial", + size: 20 }, ticklen: 4, tickfont: { size: 16 }, - tickformat: tick_digits + tickformat: tick_digits, + automargin: true }, hovermode: "closest" } diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 8366ec0a..48b6da5e 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -30,11 +30,11 @@ Stat_Table_Rows = [ }, { vn: "min", pretty: "Minimum", - digits: 2 + digits: 3 }, { vn: "max", pretty: "Maximum", - digits: 2 + digits: 3 } ] @@ -67,7 +67,7 @@ Stat_Table_Rows.push( digits: 3 }, { vn: "interquartile", - pretty: "<font color='blue'>Interquartile Range</font>", + pretty: "<font color='black'>Interquartile Range</font>", url: "http://www.genenetwork.org/glossary.html#Interquartile", digits: 3 }, { @@ -334,9 +334,9 @@ update_prob_plot = function() { make_table = function() { var header, key, row, row_line, table, the_id, the_rows, value, _i, _len, _ref, _ref1; if (js_data.trait_symbol != null) { - header = "<thead><tr><th style=\"text-align: center;\" colspan=\"100%\">Trait: " + js_data.trait_id + " - " + js_data.trait_symbol + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; + header = "<thead><tr><th style=\"color: white; background-color: #369; text-align: center;\" colspan=\"100%\">Trait " + js_data.trait_id + " - " + js_data.trait_symbol + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; } else { - header = "<thead><tr><th style=\"text-align: center;\" colspan=\"100%\">Trait: " + js_data.trait_id + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; + header = "<thead><tr><th style=\"color: white; background-color: #369; text-align: center;\" colspan=\"100%\">Trait " + js_data.trait_id + "</th></tr><tr><th style=\"text-align: right; padding-left: 5px;\">Statistic</th>"; } _ref = js_data.sample_group_types; for (key in _ref) { @@ -990,12 +990,13 @@ var hist_trace = { root.histogram_data = [hist_trace]; root.histogram_layout = { bargap: 0.05, - title: js_data.trait_id, + title: "<b>Trait " + js_data.trait_id + ": " + js_data.short_description + "</b>", xaxis: { autorange: true, - title: "Value", + title: "<b>Value</b>", titlefont: { - size: 16 + family: "arial", + size: 20 }, ticklen: 4, tickfont: { @@ -1004,23 +1005,25 @@ root.histogram_layout = { }, yaxis: { autorange: true, - title: "Count", + title: "<b>Count</b>", titlefont: { - size: 16 + family: "arial", + size: 20 }, showline: true, ticklen: 4, tickfont: { size: 16 - } + }, + automargin: true }, width: 500, height: 600, margin: { - l: 50, + l: 70, r: 30, t: 100, - b: 60 + b: 50 } }; @@ -1036,25 +1039,34 @@ $('.histogram_samples_group').change(function() { }); root.box_layout = { - title: js_data.trait_id, xaxis: { showline: true, + titlefont: { + family: "arial", + size: 20 + }, tickfont: { size: 16 }, }, yaxis: { - title: js_data.unit_type, + title: "<b>" + js_data.unit_type +"</b>", autorange: true, showline: true, + titlefont: { + family: "arial", + size: 20 + }, ticklen: 4, tickfont: { size: 16 }, - tickformat: tick_digits + tickformat: tick_digits, + zeroline: false, + automargin: true }, margin: { - l: 50, + l: 90, r: 30, t: 30, b: 80 @@ -1122,7 +1134,7 @@ if (full_sample_lists.length > 1) { { type: 'box', y: get_sample_vals(full_sample_lists[0]), - name: sample_group_list[0], + name: "<b>Trait " + js_data.trait_id + "</b>", boxpoints: 'Outliers', jitter: 0.5, whiskerwidth: 0.2, @@ -1150,28 +1162,36 @@ $('.box_plot_tab').click(function() { // Violin Plot root.violin_layout = { - title: js_data.trait_id, xaxis: { showline: true, + titlefont: { + family: "arial", + size: 20 + }, tickfont: { size: 16 } }, yaxis: { - title: js_data.unit_type, + title: "<b>"+js_data.unit_type+"</b>", autorange: true, showline: true, + titlefont: { + family: "arial", + size: 20 + }, ticklen: 4, tickfont: { size: 16 }, tickformat: tick_digits, - zeroline: false + zeroline: false, + automargin: true }, margin: { - l: 50, + l: 90, r: 30, - t: 80, + t: 30, b: 80 } }; @@ -1239,14 +1259,11 @@ if (full_sample_lists.length > 1) { box: { visible: true }, - line: { - color: 'green', - }, meanline: { visible: true }, - name: sample_group_list[0], - x0: sample_group_list[0] + name: "<b>Trait " + js_data.trait_id + "</b>", + x0: "<b>Trait " + js_data.trait_id + "</b>" } ] } diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js index 8001dfc9..8db9522c 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js +++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js @@ -156,7 +156,7 @@ 'score_type', 'suggestive', 'significant', 'num_perm', 'permCheck', 'perm_output', 'num_bootstrap', 'bootCheck', 'bootstrap_results', 'LRSCheck', 'covariates', 'maf', 'use_loco', 'manhattan_plot', 'control_marker', 'control_marker_db', 'do_control', 'genofile', 'pair_scan', 'startMb', 'endMb', 'graphWidth', 'lrsMax', 'additiveCheck', 'showSNP', 'showGenes', 'viewLegend', 'haplotypeAnalystCheck', - 'mapmethod_rqtl_geno', 'mapmodel_rqtl_geno', 'temp_trait', 'group', 'species', 'reaper_version'] + 'mapmethod_rqtl_geno', 'mapmodel_rqtl_geno', 'temp_trait', 'group', 'species', 'reaper_version', 'primary_samples'] $("#rqtl_geno_compute").on("click", (function(_this) { return function() { diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 80bbd7f5..2366bdec 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -94,7 +94,7 @@ <form method="get" action="/gsearch"> <div class="row" style="width: 100%; position: absolute; bottom: 0; top: 30px;"> - <select style="width: 170px; margin-top: 15px; margin-left: 10px;" name="type"> + <select style="width: 150px; margin-top: 15px; margin-left: 20px;" name="type"> <option value="gene">Genes / Molecules</option> <option value="phenotype" {% if type=="phenotype" %}selected{% endif %}>Phenotypes</option> </select> diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index 7e67ece2..34a15c6a 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -10,7 +10,7 @@ <div class="container" width="100%"> <h1>Correlation Matrix</h1> -<div style="width: 100%; max-width: 850px;">Lower left cells list Pearson product-moment correlations; upper right cells list Spearman rank order correlations. Each cell also contains the n of cases. Values ranging from 0.4 to 1.0 range from dark blue to white, while values ranging from -0.4 to -1.0 range from orange to white. Select any cell to generate a scatter plot. Select trait labels for more information.</div> +<div style="width: 100%; max-width: 850px;">Lower left cells list Pearson product-moment correlations; upper right cells list Spearman rank order correlations. Each cell also contains the n of cases. Values ranging from 0.4 to 1.0 range from orange to white, while values ranging from -0.4 to -1.0 range from dark blue to white. Select any cell to generate a scatter plot. Select trait labels for more information.</div> <hr style="height: 1px; background-color: #A9A9A9;"> {% if lowest_overlap < 8 %} <div style="margin-bottom: 10px;"><i><font style="color: red;">Caution</font>: This matrix of correlations contains some cells with small sample sizes of fewer than 8.</i></div> diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 286f6c1f..ed91a886 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -28,7 +28,7 @@ <div class="page-header"> <h1>Select and search</h1> </div> - <form method="get" action="/search" name="SEARCHFORM"> + <form method="get" action="/search" target="_blank" name="SEARCHFORM"> <fieldset> <div style="padding: 20px" class="form-horizontal"> @@ -199,9 +199,9 @@ <h1>Github</h1> <ul> <li><a href="https://github.com/genenetwork/genenetwork2">GN2 Source Code</a></li> - <li><a href="https://github.com/genenetwork/gn-docs/wiki">GN2 Document Wiki</a></li> - <li><a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a></li> <li><a href="https://github.com/genenetwork/genenetwork">GN1 Source Code</a></li> + <!--<li><a href="https://github.com/genenetwork/gn-docs/wiki">GN2 Document Wiki</a></li>--> + <li><a href="https://github.com/genenetwork/sysmaintenance">System Maintenance Code</a></li> </ul> </div> </section> @@ -241,7 +241,7 @@ <h3>GeneNetwork v2:</h3> <ul> <li><a href="http://gn2.genenetwork.org/">Main website</a> at UTHSC</li> - <li><a href="http://test-gn2.genenetwork.org/">Testing website</a> at UTHSC</li> + <!--<li><a href="http://test-gn2.genenetwork.org/">Testing website</a> at UTHSC</li>--> </ul> <h3>GeneNetwork v1:</h3> <ul> diff --git a/wqflask/wqflask/templates/loading.html b/wqflask/wqflask/templates/loading.html index 25560249..3eb061e5 100644 --- a/wqflask/wqflask/templates/loading.html +++ b/wqflask/wqflask/templates/loading.html @@ -7,10 +7,24 @@ <div class="container"> <div> <div style="min-height: 80vh; display: flex; align-items: center;"> - <div style="margin-bottom: 10px; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); position: absolute;"> + <div style="margin-bottom: 5px; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); position: absolute;"> + {% if start_vars.tool_used == "Mapping" %} + <h1>Computing the Map</h1> + <br> + <i>n</i> = {{ start_vars.num_vals }} + <br> + Method = {{ start_vars.method }} + <br> + {% if start_vars.transform != "" %} + transform = {{ start_vars.transform }} + <br> + {% endif %} + MAF = {{ start_vars.maf }} + {% else %} <h1>Loading {{ start_vars.tool_used }} Results...</h1> + {% endif %} </div> - <div class="progress center-block" style="margin-top: 5px; margin-left: 25%; margin-right: 25%; position: absolute; height:50px; width:50%; top:50%;"> + <div class="progress center-block" style="margin-left: 25%; margin-right: 25%; position: absolute; height:50px; width:50%; top:50%;"> <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%;"></div> </div> </div> @@ -22,5 +36,5 @@ <script type="text/javascript"> $("#loading_form").attr("action", "{{ start_vars.form_url }}"); -$("#loading_form").submit(); +setTimeout(function(){ $("#loading_form").submit()}, 350); </script>
\ No newline at end of file diff --git a/wqflask/wqflask/templates/new_security/login_user.html b/wqflask/wqflask/templates/new_security/login_user.html index 27b20ebf..c9aaf028 100644 --- a/wqflask/wqflask/templates/new_security/login_user.html +++ b/wqflask/wqflask/templates/new_security/login_user.html @@ -2,53 +2,11 @@ {% block title %}Register{% endblock %} {% block content %} - <div class="container"> + <div class="container" style="min-width: 1250px;"> {{ flash_me() }} - <div class="page-header"> - <h1> Login</h1> - </div> - - - <div class="security_box"> - - <h4>Don't have an account?</h4> - - {% if es_server: %} - <a href="/n/register" class="btn btn-primary modalize">Create a new account</a> - {% else: %} - <div class="alert alert-warning"> - <p>You cannot create an account at this moment.<br /> - Please try again later.</p> - </div> - {% endif %} - - <hr /> - <h4>Login with external services</h4> - - {% if external_login: %} - <div> - {% if external_login["github"]: %} - <a href="{{external_login['github']}}" title="Login with GitHub" class="btn btn-info btn-group">Login with Github</a> - {% else %} - <p>Github login is not available right now</p> - {% endif %} - - {% if external_login["orcid"]: %} - <a href="{{external_login['orcid']}}" title="Login with ORCID" class="btn btn-info btn-group">Login with ORCID</a> - {% else %} - <p>ORCID login is not available right now</p> - {% endif %} - </div> - {% else: %} - <div class="alert alert-warning"> - <p>Sorry, you cannot login with Github or ORCID at this time.</p> - </div> - {% endif %} - <hr /> - - <h4>Already have an account? Sign in here.</h4> + <h4>Already have an account? Sign in here.</h4> {% if es_server: %} <form class="form-horizontal" action="/n/login" method="POST" name="login_user_form" id="loginUserForm"> @@ -69,7 +27,6 @@ </div> </div> - <div class="form-group"> <label class="col-xs-1 control-label" for="remember"></label> <div style="margin-left:20px;" class="col-xs-4 controls"> @@ -87,6 +44,42 @@ </div> </fieldset> + <div class="security_box"> + + <h4>Don't have an account?</h4> + + {% if es_server: %} + <a href="/n/register" class="btn btn-primary modalize">Create a new account</a> + {% else: %} + <div class="alert alert-warning"> + <p>You cannot create an account at this moment.<br /> + Please try again later.</p> + </div> + {% endif %} + + <hr /> + <h4>Login with external services</h4> + + {% if external_login: %} + <div> + {% if external_login["github"]: %} + <a href="{{external_login['github']}}" title="Login with GitHub" class="btn btn-info btn-group">Login with Github</a> + {% else %} + <p>Github login is not available right now</p> + {% endif %} + + {% if external_login["orcid"]: %} + <a href="{{external_login['orcid']}}" title="Login with ORCID" class="btn btn-info btn-group">Login with ORCID</a> + {% else %} + <p>ORCID login is not available right now</p> + {% endif %} + </div> + {% else: %} + <div class="alert alert-warning"> + <p>Sorry, you cannot login with Github or ORCID at this time.</p> + </div> + {% endif %} + </form> {% else: %} <div class="alert alert-warning"> diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index f5978196..2dded69f 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -13,7 +13,7 @@ <div style="padding-top: 10px; padding-bottom: 10px; font-size: 16px;"> <!-- Need to customize text more for other types of searches --> - <p>We searched <a href="http://genenetwork.org/webqtl/main.py?FormID=sharinginfo&{% if dataset.accession_id != 'None' %}GN_AccessionId={{ dataset.accession_id }}{% else %}InfoPageName={{ dataset.name }}{% endif %}">{{ dataset.fullname }}</a> + <p><b>Search Results:</b> We searched <a href="http://genenetwork.org/webqtl/main.py?FormID=sharinginfo&{% if dataset.accession_id != 'None' %}GN_AccessionId={{ dataset.accession_id }}{% else %}InfoPageName={{ dataset.name }}{% endif %}">{{ dataset.fullname }}</a> to find all records {% for word in search_terms %} {% if word.key|lower == "rif" %} @@ -249,6 +249,7 @@ 'columns': [ { 'data': null, + 'width': "30px", 'orderDataType': "dom-checkbox", 'orderSequence': [ "desc", "asc"], 'render': function(data, type, row, meta) { @@ -258,12 +259,14 @@ { 'title': "Index", 'type': "natural", + 'width': "30px", 'data': "index" }, { 'title': "Record", 'type': "natural", 'data': null, + 'width': "60px", 'orderDataType': "dom-inner-text", 'render': function(data, type, row, meta) { return '<a href="/show_trait?trait_id=' + data.name + '&dataset=' + data.dataset + '">' + data.name + '</a>' @@ -277,7 +280,6 @@ { 'title': "Description", 'type': "natural", - 'width': "300px", 'data': null, 'render': function(data, type, row, meta) { try { @@ -290,12 +292,13 @@ { 'title': "Location", 'type': "natural", - 'width': "140px", + 'width': "120px", 'data': "location" }, { 'title': "Mean", 'type': "natural", + 'width': "40px", 'data': "mean", 'orderSequence': [ "desc", "asc"] }, @@ -308,7 +311,7 @@ { 'title': "Max LRS Location", 'type': "natural", - 'width': "140px", + 'width': "120px", 'data': "lrs_location" }, { diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index fe858d52..7b585b03 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -560,6 +560,7 @@ def loading_page(): logger.info(request.url) initial_start_vars = request.form start_vars_container = {} + num_vals = 0 #ZS: So it can be displayed on loading page if 'wanted_inputs' in initial_start_vars: wanted = initial_start_vars['wanted_inputs'].split(",") start_vars = {} @@ -567,6 +568,15 @@ def loading_page(): if key in wanted or key.startswith(('value:')): start_vars[key] = value + if 'primary_samples' in start_vars: + samples = start_vars['primary_samples'].split(",") + for sample in samples: + value = start_vars.get('value:' + sample) + if value != "x": + num_vals += 1 + + start_vars['num_vals'] = num_vals + start_vars_container['start_vars'] = start_vars else: start_vars_container['start_vars'] = initial_start_vars |