diff options
-rw-r--r-- | gn2/wqflask/__init__.py | 2 | ||||
-rw-r--r-- | gn2/wqflask/correlation/corr_scatter_plot.py | 3 | ||||
-rw-r--r-- | gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js | 69 | ||||
-rw-r--r-- | gn2/wqflask/static/new/javascript/get_traits_from_collection.js | 6 | ||||
-rw-r--r-- | gn2/wqflask/static/new/javascript/show_trait.js | 2 | ||||
-rw-r--r-- | gn2/wqflask/templates/corr_scatterplot.html | 177 | ||||
-rw-r--r-- | gn2/wqflask/templates/gn_editor.html | 7 | ||||
-rw-r--r-- | gn2/wqflask/templates/gn_editor_commit.html | 8 | ||||
-rw-r--r-- | gn2/wqflask/templates/gn_editor_results_page.html | 31 | ||||
-rw-r--r-- | gn2/wqflask/templates/gsearch_gene.html | 40 | ||||
-rw-r--r-- | gn2/wqflask/templates/mapping_results.html | 12 | ||||
-rw-r--r-- | gn2/wqflask/templates/show_trait_calculate_correlations.html | 2 | ||||
-rw-r--r-- | gn2/wqflask/templates/show_trait_statistics.html | 2 | ||||
-rw-r--r-- | gn2/wqflask/views.py | 4 |
14 files changed, 210 insertions, 155 deletions
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py index d959598d..af386317 100644 --- a/gn2/wqflask/__init__.py +++ b/gn2/wqflask/__init__.py @@ -110,7 +110,7 @@ app.jinja_env.globals.update( # Registering blueprints -app.register_blueprint(gn_docs_blueprint, url_prefix="/gn_docs") +app.register_blueprint(gn_docs_blueprint, url_prefix="/gn-docs") app.register_blueprint(glossary_blueprint, url_prefix="/glossary") app.register_blueprint(references_blueprint, url_prefix="/references") app.register_blueprint(links_blueprint, url_prefix="/links") diff --git a/gn2/wqflask/correlation/corr_scatter_plot.py b/gn2/wqflask/correlation/corr_scatter_plot.py index ab130cc5..79905cc2 100644 --- a/gn2/wqflask/correlation/corr_scatter_plot.py +++ b/gn2/wqflask/correlation/corr_scatter_plot.py @@ -45,6 +45,8 @@ class CorrScatterPlot: if self.dataset_1.group.f1list != None: primary_samples += self.dataset_1.group.f1list + self.effect_plot = True if 'effect' in params else False + if 'dataid' in params: trait_data_dict = json.loads(Redis.get(params['dataid'])) trait_data = {key:webqtlCaseData.webqtlCaseData(key, float(trait_data_dict[key])) for (key, value) in trait_data_dict.items() if trait_data_dict[key] != "x"} @@ -116,6 +118,7 @@ class CorrScatterPlot: self.js_data = dict( data=self.data, + effect_plot=self.effect_plot, rdata=self.rdata, indIDs=self.indIDs, trait_1=self.trait_1.dataset.name + ": " + str(self.trait_1.name), diff --git a/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js b/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js index f883c0d9..fa896621 100644 --- a/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js +++ b/gn2/wqflask/static/new/javascript/draw_corr_scatterplot.js @@ -24,8 +24,6 @@ if (y_val_range >= 2 && y_val_range < 8){ y_tick_digits = 'f' } -console.log("y_digits:", y_tick_digits) - var layout = { height: 700, width: 800, @@ -42,7 +40,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, - ticklen: 4, + ticklen: 6, tickformat: x_tick_digits }, yaxis: { @@ -52,7 +50,7 @@ var layout = { visible: true, linecolor: 'black', linewidth: 1, - ticklen: 4, + ticklen: 6, tickformat: y_tick_digits, automargin: true }, @@ -140,12 +138,8 @@ var modebar_options = { cofactor1_dict = {} ranked_cofactor1_dict = {} -//cofactor1_values = [] -//ranked_cofactor1_values = [] cofactor2_dict = {} ranked_cofactor2_dict = {} -//cofactor2_values = [] -//ranked_cofactor2_values = [] cofactor3_dict = {} ranked_cofactor3_dict = {} @@ -176,6 +170,13 @@ function drawg() { } } + // Change some plot settings if the plot is an Effect Size plot + if (js_data.effect_plot) { + layout['width'] = 500 + layout['xaxis']['nticks'] = 3 + layout['xaxis']['tickformat'] = '.0f' + } + Plotly.newPlot('scatterplot2', [trace2, trace1], layout, modebar_options) } @@ -634,8 +635,10 @@ function chartupdatewh() { Plotly.newPlot('scatterplot2', getdata(), layout, modebar_options) Plotly.relayout('scatterplot2', width_height_update) - Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) - Plotly.relayout('srscatterplot2', width_height_update) + if (!js_data.effect_plot) { + Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) + Plotly.relayout('srscatterplot2', width_height_update) + } } function colorer(d) { @@ -711,8 +714,10 @@ function chartupdatedata() { Plotly.newPlot('scatterplot2', getdata(), layout, modebar_options) Plotly.relayout('scatterplot2', pearson_title_update) - Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) - Plotly.relayout('srscatterplot2', spearman_title_update) + if (!js_data.effect_plot) { + Plotly.newPlot('srscatterplot2', srgetdata(), sr_layout, modebar_options) + Plotly.relayout('srscatterplot2', spearman_title_update) + } if ($('#cofactor1_type option:selected').val() == "color"){ $('#cofactor_color_selector').css("display", "inline") @@ -722,11 +727,13 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } else if ($('#cofactor2_type option:selected').val() == "color"){ $('#cofactor_color_selector').css("display", "inline") @@ -736,11 +743,13 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } else { $('#cofactor_color_selector').css("display", "inline") @@ -750,17 +759,21 @@ function chartupdatedata() { 'stroke': colorer, 'fill': colorer }); - d3.select('#srscatterplot2 svg').selectAll('.point') - .style({ - 'stroke': ranked_colorer, - 'fill': ranked_colorer - }); + if (!js_data.effect_plot) { + d3.select('#srscatterplot2 svg').selectAll('.point') + .style({ + 'stroke': ranked_colorer, + 'fill': ranked_colorer + }); + } } } } drawg(); -srdrawg(); +if (!js_data.effect_plot) { + srdrawg(); +} $(".chartupdatewh").change(function () { chartupdatewh(); diff --git a/gn2/wqflask/static/new/javascript/get_traits_from_collection.js b/gn2/wqflask/static/new/javascript/get_traits_from_collection.js index c115f3b0..6968a9d7 100644 --- a/gn2/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/gn2/wqflask/static/new/javascript/get_traits_from_collection.js @@ -389,7 +389,11 @@ process_traits = function(trait_data, textStatus, jqXHR) { the_html += "<td class='trait' data-display_name='" + trait.name + "'>" + trait.name + "</td>"; } the_html += "<td class='dataset' data-dataset='" + trait.dataset + "'>" + trait.dataset_name + "</td>"; - the_html += "<td class='description'>" + trait.description + "</td>"; + if (trait.dataset.includes('Geno')) { + the_html += "<td class='description'>" + trait.location + "</td>"; + } else { + the_html += "<td class='description'>" + trait.description + "</td>"; + } } the_html += "</tbody>"; the_html += "</table>"; diff --git a/gn2/wqflask/static/new/javascript/show_trait.js b/gn2/wqflask/static/new/javascript/show_trait.js index edb2cfab..6d77e130 100644 --- a/gn2/wqflask/static/new/javascript/show_trait.js +++ b/gn2/wqflask/static/new/javascript/show_trait.js @@ -68,7 +68,7 @@ statTableRows.push( }, { vn: "interquartile", pretty: "<font color='black'>Interquartile Range</font>", - url: "http://www.genenetwork.org/glossary.html#Interquartile", + url: "{{ url_for('gn_docs_blueprint.glossary') }}#Interquartile", digits: 3 }, { vn: "skewness", diff --git a/gn2/wqflask/templates/corr_scatterplot.html b/gn2/wqflask/templates/corr_scatterplot.html index 554471be..9532726c 100644 --- a/gn2/wqflask/templates/corr_scatterplot.html +++ b/gn2/wqflask/templates/corr_scatterplot.html @@ -126,18 +126,20 @@ <li {% if method == 'pearson' %}class="active"{% endif %}> <a href="#tp1" data-toggle="tab">Pearson</a> </li> + {% if effect_plot == false %} <li {% if method == 'spearman' %}class="active"{% endif %}> <a href="#tp2" data-toggle="tab">Spearman Rank</a> </li> + {% endif %} </ul> - <div class="tab-content" style="min-width: 800px;"> + <div class="tab-content" style="width: {% if effect_plot %}500{% else %}800{% endif %}px;"> <div class="tab-pane {% if method == 'pearson' %}active{% endif %}" id="tp1"> <br> <div id="scatterplot2"></div> <br> - <div style="min-width: 700px; overflow: hidden;"> + <div style="width: {% if effect_plot %}500{% else %}800{% endif %}px; overflow: hidden;"> <div style="margin-left: 50px; min-width: 300px;"> {% if trait_1.dataset.type == "ProbeSet" %} <div> @@ -248,101 +250,102 @@ </div> </div> + {% if effect_plot == false %} <div class="tab-pane {% if method == 'spearman' %}active{% endif %}" id="tp2"> <br> <div id="srscatterplot2"></div> <br> - <div class="row" style="min-width: 700px; overflow: hidden;"> - <div style="margin-left: 50px; min-width: 300px;"> - {% if trait_1.dataset.type == "ProbeSet" %} - <div> - X axis: - <a href="{{url_for('show_trait_page', trait_id = trait_1.name, dataset = trait_1.dataset.name)}}"> - {{trait_1.dataset.group.species + " " + trait_1.dataset.group.name + " " + trait_1.dataset.tissue + " " + trait_1.dataset.name + ": " + trait_1.name|string}} - </a> - </div> - <div> - [{{trait_1.symbol}} on {{trait_1.location_repr}} Mb] - {{trait_1.description_display}} - </div> - {% elif trait_1.dataset.type == "Publish" %} - <div> - X axis: - <a href="{{url_for('show_trait_page', trait_id = trait_1.name, dataset = trait_1.dataset.name)}}"> - {{trait_1.dataset.group.species + " " + trait_1.dataset.group.name + " " + trait_1.dataset.name + ": " + trait_1.name|string}} - </a> - </div> - <div> - <a href="{{trait_1.pubmed_link}}">PubMed: {{trait_1.pubmed_text}}</a> + <div class="row" style="width: 800px; overflow: hidden;"> + <div style="margin-left: 50px; min-width: 300px;"> + {% if trait_1.dataset.type == "ProbeSet" %} + <div> + X axis: + <a href="{{url_for('show_trait_page', trait_id = trait_1.name, dataset = trait_1.dataset.name)}}"> + {{trait_1.dataset.group.species + " " + trait_1.dataset.group.name + " " + trait_1.dataset.tissue + " " + trait_1.dataset.name + ": " + trait_1.name|string}} + </a> + </div> + <div> + [{{trait_1.symbol}} on {{trait_1.location_repr}} Mb] {{trait_1.description_display}} - </div> - {% endif %} + </div> + {% elif trait_1.dataset.type == "Publish" %} + <div> + X axis: + <a href="{{url_for('show_trait_page', trait_id = trait_1.name, dataset = trait_1.dataset.name)}}"> + {{trait_1.dataset.group.species + " " + trait_1.dataset.group.name + " " + trait_1.dataset.name + ": " + trait_1.name|string}} + </a> + </div> + <div> + <a href="{{trait_1.pubmed_link}}">PubMed: {{trait_1.pubmed_text}}</a> + {{trait_1.description_display}} + </div> + {% endif %} - <br/> + <br/> - {% if trait_2.dataset.type == "ProbeSet" %} - <div> - Y axis: - <a href="{{url_for('show_trait_page', trait_id = trait_2.name, dataset = trait_2.dataset.name)}}"> - {{trait_2.dataset.group.species + " " + trait_2.dataset.group.name + " " + trait_2.dataset.tissue + " " + trait_2.dataset.name + ": " + trait_2.name|string}} - </a> - </div> - <div> - [{{trait_2.symbol}} on {{trait_2.location_repr}} Mb] - {{trait_2.description_display}} - </div> - {% elif trait_2.dataset.type == "Publish" %} - <div> - Y axis: - <a href="{{url_for('show_trait_page', trait_id = trait_2.name, dataset = trait_2.dataset.name)}}"> - {{trait_2.dataset.group.species + " " + trait_2.dataset.group.name + " " + trait_2.dataset.name + ": " + trait_2.name|string}} - </a> - </div> - <div> - <a href="{{trait_2.pubmed_link}}">PubMed: {{trait_2.pubmed_text}}</a> + {% if trait_2.dataset.type == "ProbeSet" %} + <div> + Y axis: + <a href="{{url_for('show_trait_page', trait_id = trait_2.name, dataset = trait_2.dataset.name)}}"> + {{trait_2.dataset.group.species + " " + trait_2.dataset.group.name + " " + trait_2.dataset.tissue + " " + trait_2.dataset.name + ": " + trait_2.name|string}} + </a> + </div> + <div> + [{{trait_2.symbol}} on {{trait_2.location_repr}} Mb] {{trait_2.description_display}} + </div> + {% elif trait_2.dataset.type == "Publish" %} + <div> + Y axis: + <a href="{{url_for('show_trait_page', trait_id = trait_2.name, dataset = trait_2.dataset.name)}}"> + {{trait_2.dataset.group.species + " " + trait_2.dataset.group.name + " " + trait_2.dataset.name + ": " + trait_2.name|string}} + </a> + </div> + <div> + <a href="{{trait_2.pubmed_link}}">PubMed: {{trait_2.pubmed_text}}</a> + {{trait_2.description_display}} + </div> + {% endif %} + </div> + <div style="float: left; margin-top: 30px;"> + <table class="table table-hover table-striped table-bordered" style="width: 80%; margin-left: 60px; text-align: right;"> + <thead> + <tr><th style="text-align: right;">Statistic</th><th style="text-align: right;">Value</th></tr> + </thead> + <tbody> + <tr> + <td>Number</td> + <td>{{jsdata.num_overlap}}</td> + </tr> + <tr> + <td>Slope</td> + <td>{{ jsdata.srslope_string }}</td> + </tr> + <tr> + <td>Intercept</td> + <td>{{'%0.3f' % jsdata.srintercept}}</td> + </tr> + <tr> + <td>r value</td> + <td>{{'%0.3f' % jsdata.srr_value}}</td> + </tr> + <tr> + <td>P value</td> + <td>{% if jsdata.srp_value < 0.001 %}{{'%0.3e' % jsdata.srp_value}}{% else %}{{'%0.3f' % jsdata.srp_value}}{% endif %}</td> + </tr> + <tr> + <td style="text-align: left;" colspan="2"> + Regression Line + <br> + y = {{ jsdata.srslope_string }} * x {% if jsdata.srintercept < 0 %}- {{'%0.3f' % (jsdata.srintercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.srintercept}}{% endif %} + </td> + </tr> + </tbody> + </table> </div> - {% endif %} - </div> - <div style="float: left; margin-top: 30px;"> - <table class="table table-hover table-striped table-bordered" style="width: 80%; margin-left: 60px; text-align: right;"> - <thead> - <tr><th style="text-align: right;">Statistic</th><th style="text-align: right;">Value</th></tr> - </thead> - <tbody> - <tr> - <td>Number</td> - <td>{{jsdata.num_overlap}}</td> - </tr> - <tr> - <td>Slope</td> - <td>{{ jsdata.srslope_string }}</td> - </tr> - <tr> - <td>Intercept</td> - <td>{{'%0.3f' % jsdata.srintercept}}</td> - </tr> - <tr> - <td>r value</td> - <td>{{'%0.3f' % jsdata.srr_value}}</td> - </tr> - <tr> - <td>P value</td> - <td>{% if jsdata.srp_value < 0.001 %}{{'%0.3e' % jsdata.srp_value}}{% else %}{{'%0.3f' % jsdata.srp_value}}{% endif %}</td> - </tr> - <tr> - <td style="text-align: left;" colspan="2"> - Regression Line - <br> - y = {{ jsdata.srslope_string }} * x {% if jsdata.srintercept < 0 %}- {{'%0.3f' % (jsdata.srintercept * -1)}}{% else %}+ {{'%0.3f' % jsdata.srintercept}}{% endif %} - </td> - </tr> - </tbody> - </table> - </div> </div> - </div> - + </div> + {% endif %} </div> {% endblock %} diff --git a/gn2/wqflask/templates/gn_editor.html b/gn2/wqflask/templates/gn_editor.html index d89aaf0a..14a41caa 100644 --- a/gn2/wqflask/templates/gn_editor.html +++ b/gn2/wqflask/templates/gn_editor.html @@ -29,10 +29,10 @@ hx-get="/editor/commit" hx-target="#output" hx-trigger="click" - hx-swap="innerHTML">Commit</a> + hx-swap="innerHTML">Save</a> </li> <li> - <a hx-trigger="click" id="diffBtn" hx-swap="innerHTML">Diff</a> + <a hx-trigger="click" id="diffBtn" hx-swap="innerHTML">Show Diff</a> </li> <li> <a href="#" @@ -228,6 +228,9 @@ editor.container.style.resize = "horizontal"; editor.getSession().on("change", function(e){ updatePreview() + }) + editor.on("click", function(e){ + updatePreview() }) editor.setValue(data, -1); } diff --git a/gn2/wqflask/templates/gn_editor_commit.html b/gn2/wqflask/templates/gn_editor_commit.html index 2eb3e60c..6006f6d2 100644 --- a/gn2/wqflask/templates/gn_editor_commit.html +++ b/gn2/wqflask/templates/gn_editor_commit.html @@ -3,7 +3,7 @@ <div> <div> <h2> - <i>Commit your Changes</i> + <i>Save your Changes</i> </h2> </div> </div> @@ -11,7 +11,7 @@ <div> <div class="row"> <label class="col-sm-8" for="message"> - <i>*Commit Message*</i> + <i>*Describe edit*</i> </label> </div> <br> @@ -24,9 +24,9 @@ <br> <div class="row"> <button id="btn-commit" - class="btn btn-primary col-lg-3 col-lg-offset-1 col-sm-4 col-sm-offset-1">Commit</button> + class="btn btn-primary col-lg-3 col-lg-offset-1 col-sm-4 col-sm-offset-1">Save</button> <button id="btn-diff" - class="btn col-lg-3 col-lg-offset-1 col-sm-4 col-sm-offset-1">Show Diff</button> + class="btn col-lg-3 col-lg-offset-1 col-sm-4 col-sm-offset-1">Show Edit Diff</button> </div> <br> <div id="diff_page"></div> diff --git a/gn2/wqflask/templates/gn_editor_results_page.html b/gn2/wqflask/templates/gn_editor_results_page.html index 6eaeb941..4f169a66 100644 --- a/gn2/wqflask/templates/gn_editor_results_page.html +++ b/gn2/wqflask/templates/gn_editor_results_page.html @@ -1,13 +1,5 @@ <section classs="row commit-content" style="padding-top:25px"> <div class="col-sm-10 col-sm-offset-1"> - <div> - <div> - <h2> - <i>Results status - {{ status }}</i> - </h2> - </div> - </div> - <br> {% if error %} <h1> Error-type: <mark style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif"><b><i>{{ error }}</i></b></mark> @@ -18,18 +10,27 @@ </h3> {% else %} <div> + <div class="lead"> + <h3> + Save results message: + <mark style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif"><b> + {% if status == '200' %} + <i>Everything is up to date; No changes to Save</i> + {% elif status == '201' %} + <i> Saved your changes Successfully </i> + {% else %} + {{ message }} + {% endif %} + </b></mark> + </h3> + </div> + <br /> <h3> - New Commit Sha: <span class="lead"> + New Edit Sha: <span class="lead"> <mark style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif"><b><i>{{ commit_sha }}</i></b></mark> </span> </h3> <br /> - <div class="lead"> - <h3> - Commit Message: - <mark style="font-family: 'Linux Libertine','Georgia','Times','Source Serif Pro',serif"><b><i>{{ message }}</i></b></mark> - </h3> - </div> </div> {% endif %} <br> diff --git a/gn2/wqflask/templates/gsearch_gene.html b/gn2/wqflask/templates/gsearch_gene.html index f1ca998b..13b56b42 100644 --- a/gn2/wqflask/templates/gsearch_gene.html +++ b/gn2/wqflask/templates/gsearch_gene.html @@ -10,7 +10,7 @@ <div class="container"> - <div class="row"> + <div> <h3>GN searched for the term(s) <b>"{{ terms }}"</b> in 754 datasets and 39,765,944 traits across 10 species<br/> and found <b>{{ trait_count }}</b> results that match your query.<br/> </h3> @@ -18,7 +18,7 @@ {% if do_ai_search %} - <div class="row" id="ai_result"> + <div class="row" id="ai_result_info"> <div class="text-center" id="spinner"> <i class="fa fa-spinner fa-spin fa-3x"></i> </div> @@ -287,13 +287,29 @@ {% if do_ai_search %} <script type='text/javascript'> function ai_content_div(search_term, search_result, search_uri) { + let header_length = 40; + let max_header_length = 180; + while (header_length <= search_result.length) { + let next_dot = search_result.indexOf(".", header_length+1); + + if (next_dot > max_header_length) { + let next_comma = search_result.indexOf(",", header_length+1); + if (next_comma > max_header_length) { + break; + } + header_length = next_comma; + } else { + header_length = next_dot; + } + } + let header = search_result.slice(0, header_length+1); return ` <div class="col-sm-6"> <div class="panel panel-info"> <div class="panel-heading" role="tab" id="ai_heading"> <h4 class="panel-title"> - <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#ai_results" aria-expanded="false" aria-controls="ai_results"> - AI Search: ${search_term} (Click for more details) + <a id="panel-title-content" class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#ai_results" aria-expanded="false" aria-controls="ai_results"> + ${header} ... (Click for more details) </a> </h4> </div> @@ -308,6 +324,20 @@ ` } + $('#ai_result_info').on('hidden.bs.collapse', function () { + let original_text = $("#panel-title-content").text(); + let new_text = original_text.replace("(Click to fold)", "(Click for more details)"); + $("#panel-title-content").text(new_text); + }) + + $('#ai_result_info').on('shown.bs.collapse', function () { + let original_text = $("#panel-title-content").text(); + let new_text = original_text.replace("(Click for more details)", "(Click to fold)"); + $("#panel-title-content").text(new_text); + }) + + + $(document).ready( function () { $.ajax({url: "gnqna", contentType: "application/json", @@ -317,7 +347,7 @@ }, success: function(result) { let ai_div = ai_content_div(result.search_term, result.search_result, result.search_url) - $("#ai_result").append(ai_div); + $("#ai_result_info").append(ai_div); }, complete: function() { $("#spinner").hide(); diff --git a/gn2/wqflask/templates/mapping_results.html b/gn2/wqflask/templates/mapping_results.html index 2fed79c1..c27de85e 100644 --- a/gn2/wqflask/templates/mapping_results.html +++ b/gn2/wqflask/templates/mapping_results.html @@ -116,7 +116,7 @@ <label class="radio-inline"> <input type="radio" name="LRSCheck" value="{% if LRS_LOD == "-logP" %}-logP{% else %}LOD{% endif %}" {% if LRS_LOD == "LOD" or LRS_LOD == "-logP" %}checked{% endif %}>{% if LRS_LOD == "-logP" %}-logP{% else %}LOD{% endif %} </label> - <a href="https://genenetwork.org/glossary.html#LOD" target="_blank"> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#LOD" target="_blank"> <sup style="color:#f00"> ?</sup> </a> </td> @@ -158,27 +158,27 @@ <div class="col-xs-4" style="padding: 0px;"> {% if (mapping_method == "reaper" or mapping_method == "rqtl_geno") and nperm > 0 %} <input type="checkbox" name="permCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if permChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Permutation Test - <a href="http://genenetwork.org/glossary.html#Permutation" target="_blank"> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#Permutation" target="_blank"> <sup style="color:#f00"> ?</sup> </a> <br> {% endif %} {% if mapping_method == "reaper" and nboot > 0 %} <input type="checkbox" name="bootCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if bootChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Bootstrap Test - <a href="http://genenetwork.org/glossary.html#bootstrap" target="_blank"> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#bootstrap" target="_blank"> <sup style="color:#f00"> ?</sup> </a> <br> {% endif %} {% if mapping_method == "reaper" %} <input type="checkbox" name="additiveCheck" class="checkbox" style="display: inline; margin-top: 0px;" {% if additiveChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">Allele Effects - <a href="http://genenetwork.org/glossary.html#additive" target="_blank"> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#additive" target="_blank"> <sup style="color:#f00"> ?</sup> </a> <br> {% endif %} <input type="checkbox" name="showSNP" class="checkbox" style="display: inline; margin-top: 0px;" {% if SNPChecked|upper == "ON" %}value="ON" checked{% endif %}> <span style="font-size: 12px;">SNP Track </span> - <a href="http://genenetwork.org/glossary.html#snpSeismograph" target="_blank"> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#snpSeismograph" target="_blank"> <sup style="color:#f00"> ?</sup> </a> <span style="color:red;">*</span> @@ -416,7 +416,7 @@ 'data': null, 'render': function(data, type, row, meta) { {% if geno_db_exists == "True" %} - return '<a target"_blank" href="corr_scatter_plot?method=pearson&dataset_1={{ dataset.group.name }}Geno&dataset_2={{ dataset.name }}&trait_1=' + data.name + '&trait_2={{ this_trait.name }}&cached_trait=trait_2&dataid={{ dataid }}">' + String(parseFloat(data.additive).toFixed(3)) + '</a>' + return '<a target"_blank" href="corr_scatter_plot?method=pearson&dataset_1={{ dataset.group.name }}Geno&dataset_2={{ dataset.name }}&trait_1=' + data.name + '&trait_2={{ this_trait.name }}&cached_trait=trait_2&dataid={{ dataid }}&effect=True">' + String(parseFloat(data.additive).toFixed(3)) + '</a>' {% else %} return String(parseFloat(data.additive).toFixed(3)) {% endif %} diff --git a/gn2/wqflask/templates/show_trait_calculate_correlations.html b/gn2/wqflask/templates/show_trait_calculate_correlations.html index d2e6624e..2f78a095 100644 --- a/gn2/wqflask/templates/show_trait_calculate_correlations.html +++ b/gn2/wqflask/templates/show_trait_calculate_correlations.html @@ -148,7 +148,7 @@ Semantic Gene Organizer</span> and human, rat, and mouse data from PubMed. Values are ranked by Lit r, but Sample r and Tissue r are also displayed.<br> - <a href="http://genenetwork.org/glossary.html#Literature">More on using Lit r</a></dd> + <a href="{{ url_for('gn_docs_blueprint.glossary') }}#Literature">More on using Lit r</a></dd> <dt class="map-method-text">Tissue Correlation</dt> <dd>The <a href="http://genenetwork.org/webqtl/main.py?FormID=tissueCorrelation">Tissue Correlation</a> (Tissue r) diff --git a/gn2/wqflask/templates/show_trait_statistics.html b/gn2/wqflask/templates/show_trait_statistics.html index 9ee0de5c..d16835e7 100644 --- a/gn2/wqflask/templates/show_trait_statistics.html +++ b/gn2/wqflask/templates/show_trait_statistics.html @@ -87,7 +87,7 @@ <br> <div> More about <a href="http://en.wikipedia.org/wiki/Normal_probability_plot">Normal Probability Plots</a> and more - about interpreting these plots from the <a href="http://genenetwork.org/glossary.html#normal_probability">glossary</a> + about interpreting these plots from the <a href="{{ url_for('gn_docs_blueprint.glossary') }}#normal_probability">glossary</a> </div> </div> </div> diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index 29df7596..d9c35115 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -248,9 +248,7 @@ def gsearchact(): search_type = request.args["type"] is_user_logged_in = session_info().get("user", {}).get("logged_in", False) - do_ai_search = False - if current_app.config.get("AI_SEARCH_ENABLED") and is_user_logged_in: - do_ai_search = True + do_ai_search = current_app.config.get("AI_SEARCH_ENABLED") and is_user_logged_in if search_type == "gene": return render_template("gsearch_gene.html", **result, do_ai_search=do_ai_search, result=result) elif search_type == "phenotype": |