diff options
-rw-r--r-- | wqflask/base/trait.py | 3 | ||||
-rw-r--r-- | wqflask/wqflask/marker_regression/display_mapping_results.py | 6 | ||||
-rw-r--r-- | wqflask/wqflask/marker_regression/run_mapping.py | 10 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/get_traits_from_collection.js | 20 | ||||
-rw-r--r-- | wqflask/wqflask/templates/mapping_results.html | 8 | ||||
-rw-r--r-- | wqflask/wqflask/templates/search_result_page.html | 17 |
6 files changed, 27 insertions, 37 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index cfc02f8b..7763dbe8 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -265,11 +265,12 @@ def get_sample_data(): trait_dict['species'] = trait_ob.dataset.group.species trait_dict['url'] = url_for( 'show_trait_page', trait_id=trait, dataset=dataset) - trait_dict['description'] = trait_ob.description_display if trait_ob.dataset.type == "ProbeSet": trait_dict['symbol'] = trait_ob.symbol trait_dict['location'] = trait_ob.location_repr + trait_dict['description'] = trait_ob.description_display elif trait_ob.dataset.type == "Publish": + trait_dict['description'] = trait_ob.description_display if trait_ob.pubmed_id: trait_dict['pubmed_link'] = trait_ob.pubmed_link trait_dict['pubmed_text'] = trait_ob.pubmed_text diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 6d6572ff..3f6de2b2 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -2076,7 +2076,7 @@ class DisplayMappingResults(object): if self.lrsMax <= 0: #sliding scale if "lrs_value" in self.qtlresults[0]: LRS_LOD_Max = max([result['lrs_value'] for result in self.qtlresults]) - if self.LRS_LOD == "LOD" or self.LRS_LOD == "-log(p)": + if self.LRS_LOD == "LOD" or self.LRS_LOD == "-logP": LRS_LOD_Max = LRS_LOD_Max / self.LODFACTOR if self.permChecked and self.nperm > 0 and not self.multipleInterval: self.significant = min(self.significant / self.LODFACTOR, webqtlConfig.MAXLRS) @@ -2172,7 +2172,7 @@ class DisplayMappingResults(object): TEXT_X_DISPLACEMENT = -12 else: TEXT_X_DISPLACEMENT = -30 - if self.LRS_LOD == "-log(p)": + if self.LRS_LOD == "-logP": TEXT_Y_DISPLACEMENT = -242 else: TEXT_Y_DISPLACEMENT = -210 @@ -2397,7 +2397,7 @@ class DisplayMappingResults(object): if 'lrs_value' in qtlresult: - if self.LRS_LOD == "LOD" or self.LRS_LOD == "-log(p)": + if self.LRS_LOD == "LOD" or self.LRS_LOD == "-logP": if qtlresult['lrs_value'] > 460 or qtlresult['lrs_value']=='inf': #Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/(LRSAxisList[-1]*self.LODFACTOR) Yc = yZero - webqtlConfig.MAXLRS*LRSHeightThresh/(LRS_LOD_Max*self.LODFACTOR) diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index fa61272f..31d6a67c 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -228,7 +228,7 @@ class RunMapping(object): self.output_files = start_vars['output_files'] if 'first_run' in start_vars: #ZS: check if first run so existing result files can be used if it isn't (for example zooming on a chromosome, etc) self.first_run = False - self.score_type = "-log(p)" + self.score_type = "-logP" self.manhattan_plot = True with Bench("Running GEMMA"): if self.use_loco == "True": @@ -327,7 +327,7 @@ class RunMapping(object): self.control_marker, self.manhattan_plot) elif self.mapping_method == "plink": - self.score_type = "-log(p)" + self.score_type = "-logP" self.manhattan_plot = True results = plink_mapping.run_plink(self.this_trait, self.dataset, self.species, self.vals, self.maf) #results = self.run_plink() @@ -414,7 +414,7 @@ class RunMapping(object): highest_chr = marker['chr'] if ('lod_score' in marker.keys()) or ('lrs_value' in marker.keys()): if 'Mb' in marker.keys(): - marker['display_pos'] = "Chr" + str(marker['chr']) + ": " + "{:.3f}".format(marker['Mb']) + marker['display_pos'] = "Chr" + str(marker['chr']) + ": " + "{:.6f}".format(marker['Mb']) elif 'cM' in marker.keys(): marker['display_pos'] = "Chr" + str(marker['chr']) + ": " + "{:.3f}".format(marker['cM']) else: @@ -539,8 +539,8 @@ def export_mapping_results(dataset, trait, markers, results_path, mapping_scale, output_file.write("Location: " + str(trait.chr) + " @ " + str(trait.mb) + " Mb\n") output_file.write("\n") output_file.write("Name,Chr,") - if score_type.lower() == "-log(p)": - score_type = "-log(p)" + if score_type.lower() == "-logP": + score_type = "-logP" if 'Mb' in markers[0]: output_file.write("Mb," + score_type) if 'cM' in markers[0]: diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js index 4ec62157..a55ab356 100644 --- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js @@ -2,10 +2,6 @@ var add_trait_data, assemble_into_json, back_to_collections, collection_click, collection_list, color_by_trait, create_trait_data_csv, get_this_trait_vals, get_trait_data, process_traits, selected_traits, submit_click, this_trait_data, trait_click, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; -console.log("before get_traits_from_collection"); - -//collection_list = null; - this_trait_data = null; selected_traits = {}; @@ -69,7 +65,7 @@ if ( ! $.fn.DataTable.isDataTable( '#collection_table' ) ) { collection_click = function() { var this_collection_url; - //console.log("Clicking on:", $(this)); + this_collection_url = $(this).find('.collection_name').prop("href"); this_collection_url += "&json"; collection_list = $("#collections_holder").html(); @@ -87,9 +83,7 @@ submit_click = function() { $('#collections_holder').find('input[type=checkbox]:checked').each(function() { var this_dataset, this_trait, this_trait_url; this_trait = $(this).parents('tr').find('.trait').text(); - console.log("this_trait is:", this_trait); this_dataset = $(this).parents('tr').find('.dataset').text(); - console.log("this_dataset is:", this_dataset); this_trait_url = "/trait/get_sample_data?trait=" + this_trait + "&dataset=" + this_dataset; return $.ajax({ dataType: "json", @@ -147,7 +141,7 @@ create_trait_data_csv = function(selected_traits) { } all_vals.push(this_trait_vals); } - console.log("all_vals:", all_vals); + trait_vals_csv = trait_names.join(","); trait_vals_csv += "\n"; for (index = _k = 0, _len2 = samples.length; _k < _len2; index = ++_k) { @@ -168,7 +162,7 @@ create_trait_data_csv = function(selected_traits) { trait_click = function() { var dataset, this_trait_url, trait; - console.log("Clicking on:", $(this)); + trait = $(this).parent().find('.trait').text(); dataset = $(this).parent().find('.dataset').text(); this_trait_url = "/trait/get_sample_data?trait=" + trait + "&dataset=" + dataset; @@ -182,7 +176,6 @@ trait_click = function() { trait_row_click = function() { var dataset, this_trait_url, trait; - console.log("Clicking on:", $(this)); trait = $(this).find('.trait').text(); dataset = $(this).find('.dataset').data("dataset"); this_trait_url = "/trait/get_sample_data?trait=" + trait + "&dataset=" + dataset; @@ -256,7 +249,6 @@ populate_cofactor_info = function(trait_info) { get_trait_data = function(trait_data, textStatus, jqXHR) { var sample, samples, this_trait_vals, trait_sample_data, vals, _i, _len; trait_sample_data = trait_data[1]; - console.log("IN GET TRAIT DATA") if ( $('input[name=allsamples]').length ) { samples = $('input[name=allsamples]').val().split(" "); } else { @@ -362,13 +354,11 @@ assemble_into_json = function(this_trait_vals) { }; color_by_trait = function(trait_sample_data, textStatus, jqXHR) { - console.log('in color_by_trait:', trait_sample_data); return root.bar_chart.color_by_trait(trait_sample_data); }; process_traits = function(trait_data, textStatus, jqXHR) { var the_html, trait, _i, _len; - console.log('in process_traits with trait_data:', trait_data); the_html = "<button id='back_to_collections' class='btn btn-inverse btn-small'>"; the_html += "<i class='icon-white icon-arrow-left'></i> Back </button>"; the_html += " <button id='submit' class='btn btn-primary btn-small'> Submit </button>"; @@ -397,13 +387,11 @@ process_traits = function(trait_data, textStatus, jqXHR) { }; back_to_collections = function() { - collection_list_html = $('#collection_list_html').html() - $("#collections_holder").html(collection_list_html); + $("#collections_holder").html(collection_list); $(document).on("click", ".collection_line", collection_click); return $('#collections_holder').colorbox.resize(); }; -console.log("inside get_traits_from_collection"); $(".collection_line").on("click", collection_click); $("#submit").on("click", submit_click); if ($('#scatterplot2').length){ diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index e68a792a..28d93542 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -99,7 +99,7 @@ <input type="radio" name="LRSCheck" value="LRS" {% if LRS_LOD == "LRS" %}checked{% endif %}>LRS </label> <label class="radio-inline"> - <input type="radio" name="LRSCheck" value="{% if LRS_LOD == "-log(p)" %}-log(p){% else %}LOD{% endif %}" {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %}checked{% endif %}>{% if LRS_LOD == "-log(p)" %}-log(p){% else %}LOD{% endif %} + <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="http://genenetwork.org/glossary.html#LOD" target="_blank"> <sup style="color:#f00"> ?</sup> @@ -235,8 +235,8 @@ <th></th> <th>Row</th> <th>Marker</th> - {% if LRS_LOD == "-log(p)" %} - <th><div style="text-align: right;">–log(p)</div></th> + {% if LRS_LOD == "-logP" %} + <th><div style="text-align: right;">–logP</div></th> {% else %} <th><div style="text-align: right;">{{ LRS_LOD }}</div></th> {% endif %} @@ -259,7 +259,7 @@ </td> <td align="right">{{ loop.index }}</td> <td>{% if geno_db_exists == "True" %}<a href="/show_trait?trait_id={{ marker.name }}&dataset={{ dataset.group.name }}Geno">{{ marker.name }}</a>{% else %}{{ marker.name }}{% endif %}</td> - {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %} + {% if LRS_LOD == "LOD" or LRS_LOD == "-logP" %} {% if 'lod_score' in marker %} <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td> {% else %} diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 36f144c2..8e2b06a4 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -4,6 +4,7 @@ <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('js', filename='DataTablesExtensions/scroller/css/scroller.dataTables.min.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url_for('js', filename='DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css') }}"> + <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"> <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" /> <link rel="stylesheet" type="text/css" href="static/new/css/trait_list.css" /> {% endblock %} @@ -184,6 +185,7 @@ <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/buttons/js/dataTables.buttons.min.js') }}"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/buttons.colVis.min.js') }}"></script> + <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script> @@ -331,10 +333,10 @@ 'orderSequence': [ "desc", "asc"] }, { - 'title': "High P<a href=\"{{ url_for('glossary_blueprint.glossary') }}#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", + 'title': "High P<a href=\"{{ url_for('glossary_blueprint.glossary') }}#LRS\" target=\"_blank\" style=\"color: white;\"> <i class=\"fa fa-info-circle\" aria-hidden=\"true\"></i></a>", 'type': "natural-minus-na", 'data': "lrs_score", - 'width': "60px", + 'width': "65px", 'orderSequence': [ "desc", "asc"] }, { @@ -344,10 +346,10 @@ 'data': "lrs_location" }, { - 'title': "Effect Size<a href=\"{{ url_for('glossary_blueprint.glossary') }}#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", + 'title': "Effect Size<a href=\"{{ url_for('glossary_blueprint.glossary') }}#A\" target=\"_blank\" style=\"color: white;\"> <i class=\"fa fa-info-circle\" aria-hidden=\"true\"></i></a>", 'type': "natural-minus-na", 'data': "additive", - 'width': "85px", + 'width': "90px", 'orderSequence': [ "desc", "asc"] }{% elif dataset.type == 'Publish' %}, { @@ -400,7 +402,7 @@ 'orderSequence': [ "desc", "asc"] }, { - 'title': "High P<a href=\"{{ url_for('glossary_blueprint.glossary') }}#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", + 'title': "High P<a href=\"{{ url_for('glossary_blueprint.glossary') }}#LRS\" target=\"_blank\" style=\"color: white;\"> <i class=\"fa fa-info-circle\" aria-hidden=\"true\"></i></a>", 'type': "natural-minus-na", 'data': "lrs_score", 'width': "80px", @@ -413,7 +415,7 @@ 'data': "lrs_location" }, { - 'title': "Effect Size<a href=\"{{ url_for('glossary_blueprint.glossary') }}#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", + 'title': "Effect Size<a href=\"{{ url_for('glossary_blueprint.glossary') }}#A\" target=\"_blank\" style=\"color: white;\"> <i class=\"fa fa-info-circle\" aria-hidden=\"true\"></i></a>", 'type': "natural-minus-na", 'width': "120px", 'data': "additive", @@ -470,5 +472,4 @@ }); </script> -{% endblock %} - +{% endblock %}
\ No newline at end of file |