diff options
Diffstat (limited to 'gn2/wqflask/templates/show_trait.html')
-rw-r--r-- | gn2/wqflask/templates/show_trait.html | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/gn2/wqflask/templates/show_trait.html b/gn2/wqflask/templates/show_trait.html new file mode 100644 index 00000000..dd054ffc --- /dev/null +++ b/gn2/wqflask/templates/show_trait.html @@ -0,0 +1,276 @@ +{% extends "base.html" %} +{%from "oauth2/display_error.html" import display_error%} + +{% block title %}Trait Data and Analysis{% endblock %} + +{% block css %} + <link rel="stylesheet" type="text/css" href="/static/new/css/bar_chart.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/box_plot.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/prob_plot.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/scatter-matrix.css" /> + <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='d3-tip/d3-tip.css') }}" /> + <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" /> + <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='nouislider/nouislider.min.css') }}" /> + <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/trait_list.css" /> + <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" /> + +{% endblock %} + +{% block content %} <!-- Start of body --> + + {{flash_me()}} + {%if "group:resource:view-resource" in trait_privileges or "system:resource:public-read" in trait_privileges%} + <div class="container"> + <h2>Trait Data and Analysis for <b>{{ this_trait.display_name }}</b></h2> + {% if this_trait.dataset.type != 'Publish' %} + <h3> + {% set trait_description = this_trait.description_fmt[0]|upper + this_trait.description_fmt[1:]|safe %} + {% if trait_description|length < 100 %} + {{ trait_description }} + {% else %} + <span class="truncDesc" style="display: block;">{{ trait_description[:99] }}... (<a onclick="toggleDescription()" href="#">Show More</a>)</span><span class="fullDesc" style="display: none;">{{ trait_description }} (<a onclick="toggleDescription()" href="#">Show Less</a>)</span> + {% endif %} + </h3> + {% endif %} + + <form method="post" action="" target="_blank" name="trait_page" id="trait_data_form" class="form-horizontal"> + <div id="hidden_inputs"> + <input type="hidden" name="trait_hmac" value="{{ data_hmac('{}:{}'.format(this_trait.name, dataset.name)) }}"> + {% for key in hddn %} + <input type="hidden" name="{{ key }}" value="{{ hddn[key] }}"> + {% endfor %} + </div> + + <input type="hidden" name="temp_uuid" id="temp_uuid" value="{{ temp_uuid }}"> + <input type="hidden" name="tool_used" value=""> + <input type="hidden" name="form_url" value=""> + <input type="hidden" name="wanted_inputs" value=""> + <input type="hidden" name="genofile" value=""> + <input type="hidden" name="covariates" value=""> + <input type="hidden" name="transform" value=""> + <input type="hidden" name="sample_vals" value=""> + + <div class="container"> + <div class="panel-group" id="accordion"> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" aria-expanded="true"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Details and Links + </h3> + </div> + <div id="collapseOne" class="panel-collapse collapse" aria-expanded="true"> + <div class="panel-body"> + {% include 'show_trait_details.html' %} + </div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading stats_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Statistics + </h3> + </div> + <div id="collapseTwo" class="panel-collapse collapse in"> + <div class="panel-body"> + {% include 'show_trait_statistics.html' %} + </div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Transform and Filter Data + </h3> + </div> + <div id="collapseThree" class="panel-collapse collapse in"> + <div class="panel-body"> + {% include 'show_trait_transform_and_filter.html' %} + </div> + <div id="transform_alert_placeholder"><div id="transform_alert" style="display: none;"class="alert alert-success outlier-alert"><a href="#" class="close" data-dismiss="alert">�</a><span>Because there are some values between 0 and 1, log2 and log10 transforms will add 1 to each value.</span></div></div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFour"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Calculate Correlations + </h3> + </div> + <div id="collapseFour" class="panel-collapse collapse in"> + <div class="panel-body"> + {% include 'show_trait_calculate_correlations.html' %} + </div> + </div> + </div> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseFive"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-down"></span> Mapping Tools + </h3> + </div> + <div id="collapseFive" class="panel-collapse collapse in"> + <div class="panel-body"> + {% include 'show_trait_mapping_tools.html' %} + </div> + <div id="outlier_alert_placeholder"></div> + </div> + </div> + <div class="panel panel-default" {%if (trait_table_width|int > 1100)%}style="min-width: {{trait_table_width|int + 30}}px;"{% endif %}> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseSix" aria-expanded="true"> + <h3 class="panel-title"> + <span class="glyphicon glyphicon-chevron-up"></span> Review and Edit Data + </h3> + </div> + <div id="collapseSix" class="panel-collapse collapse" aria-expanded="true"> + <div class="panel-body"> + {% include 'show_trait_edit_data.html' %} + </div> + </div> + </div> + </div> + {% include 'show_trait_progress_bar.html' %} + </div> + </form> + </div> + {%else%} + {%if user.name == "Anonymous User"%} + {{display_error("Access Denied", {"error": "AuthorisationError", "error_description": "This trait is not accessible for the general public yet. Please log in."})}} + {%else%} + {{display_error("Access Denied", {"error": "AuthorisationError", "error_description": "The user '" + user.name + "', does not currently possess the appropriate privileges to view this trait. If you know the owner of this trait, please request that they grant you access, or wait until it is made public."})}} + {%endif%} + {%endif%} + + <!-- End of body --> + +{% endblock %} + +{% block js %} + <script> + js_data = {{ js_data | safe }} + $('.collapse').collapse() + </script> + + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='d3js/d3.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/underscore.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='underscore-string/underscore.string.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='d3-tip/d3-tip.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/jstat.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='shapiro-wilk/shapiro-wilk.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='plotly/plotly.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/colorbrewer.js"></script> + + <script language="javascript" type="text/javascript" src="/static/new/javascript/stats.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/scatter-matrix.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/plotly_probability_plot.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/compare_traits_scatterplot.js"></script> + + + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/scientific.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/scroller/js/dataTables.scroller.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='nouislider/nouislider.js') }}"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/table_functions.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/create_datatable.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/initialize_show_trait_tables.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/show_trait_mapping_tools.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/show_trait.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/validation.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/javascript/get_covariates_from_collection.js"></script> + + <script type="text/javascript" charset="utf-8"> + + $.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ) + { + return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) { + return $('input', td).prop('checked') ? '1' : '0'; + } ); + }; + + function getValue(x) { + if (x == 'x') { + return "x"; + } + else { + return parseFloat(x); + } + } + + $.fn.dataTable.ext.order['dom-input'] = function (settings, col) { + return this.api().column(col, { order: 'index' }).nodes().map(function (td, i) { + return $('input', td).val(); + }); + } + + $.fn.dataTableExt.oSort['cust-txt-asc'] = function (a, b) { + var x = getValue(a); + var y = getValue(b); + + if (x == 'x' || x === '') { + return 1; + } + else if (y == 'x' || y === '') { + return -1; + } + else { + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + } + }; + + $.fn.dataTableExt.oSort['cust-txt-desc'] = function (a, b) { + var x = getValue(a); + var y = getValue(b); + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + }; + + $(document).ready( function () { + $('.panel-heading').click(function () { + if ($(this).hasClass('collapsed')){ + $(this).find('.glyphicon-chevron-down').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); + } + else { + $(this).find('.glyphicon-chevron-up').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); + } + }); + + $('#samples_primary, #samples_other').find("tr.outlier").css('background-color', 'orange') + + $('.edit_sample_checkbox:checkbox').change(function() { + if ($(this).is(":checked")) { + if (!$(this).closest('tr').hasClass('selected')) { + $(this).closest('tr').addClass('selected') + } + } + else { + if ($(this).closest('tr').hasClass('selected')) { + $(this).closest('tr').removeClass('selected') + } + } + }); + + var slider = document.getElementById('p_range_slider'); + noUiSlider.create(slider, { + start: [-1.0, 1.0], + range: { + 'min': [-1.0], + 'max': [1.0] + } + }); + + var slider_display = [ + document.getElementById('p_range_lower'), + document.getElementById('p_range_upper') + ]; + var slider_values = [ + $('input[name=p_range_lower]'), + $('input[name=p_range_upper]') + ]; + + slider.noUiSlider.on('update', function( values, handle ) { + slider_display[handle].innerHTML = values[handle]; + slider_values[handle].val(values[handle]); + }); + }); + </script> + +{% endblock %} |