From 42e7643d6bd2e3b26ca35a91c73bfd65e95bb386 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 20 Jun 2022 10:20:53 +0300 Subject: Simplify partial correlation method choices - Have only `Pearson's r` and `Spearman's rho` as the available choices for the partial correlations. --- wqflask/wqflask/partial_correlations_views.py | 1 + .../partial_correlations/pcorrs_select_operations.html | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/wqflask/wqflask/partial_correlations_views.py b/wqflask/wqflask/partial_correlations_views.py index ce5e46e0..358a9d3b 100644 --- a/wqflask/wqflask/partial_correlations_views.py +++ b/wqflask/wqflask/partial_correlations_views.py @@ -139,6 +139,7 @@ def target_db_error(args, with_target_db: bool): def method_error(args): methods = ( + "pearson's r", "spearman's rho", "genetic correlation, pearson's r", "genetic correlation, spearman's rho", "sgo literature correlation", diff --git a/wqflask/wqflask/templates/partial_correlations/pcorrs_select_operations.html b/wqflask/wqflask/templates/partial_correlations/pcorrs_select_operations.html index fc60aa3e..375e792e 100644 --- a/wqflask/wqflask/templates/partial_correlations/pcorrs_select_operations.html +++ b/wqflask/wqflask/templates/partial_correlations/pcorrs_select_operations.html @@ -106,16 +106,8 @@ -- cgit v1.2.3 From c6d6b1b59531d44b514f97184160d4bb096b01b5 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 16 Jun 2022 13:55:39 +0300 Subject: wqflask: views: Delete noisy logging and dead code - Remove commented out code-blocks - Remove calls with this pattern: logger.info("Sending ...") logger.info(request.url) Should you want to inspect the local context of an environment when troubleshooting, set a breakpoint() and inspect the environment. To view everything in the local context, use "pp locals()"; and to view everything in the global context, use "pp globals()". --- wqflask/wqflask/views.py | 104 ----------------------------------------------- 1 file changed, 104 deletions(-) diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index a371d983..63f3b3bb 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -158,8 +158,6 @@ def handle_generic_exceptions(e): stack={formatted_lines}, error_image=animation, version=GN_VERSION)) - - # logger.error("Set cookie %s with %s" % (err_msg, animation)) resp.set_cookie(err_msg[:32], animation) return resp @@ -171,8 +169,6 @@ def no_access_page(): @app.route("/") def index_page(): - logger.info("Sending index_page") - logger.info(request.url) params = request.args if 'import_collections' in params: import_collections = params['import_collections'] @@ -184,11 +180,7 @@ def index_page(): @app.route("/tmp/") def tmp_page(img_path): - logger.info("In tmp_page") - logger.info("img_path:", img_path) - logger.info(request.url) initial_start_vars = request.form - logger.info("initial_start_vars:", initial_start_vars) imgfile = open(GENERATED_IMAGE_DIR + img_path, 'rb') imgdata = imgfile.read() imgB64 = base64.b64encode(imgdata) @@ -224,22 +216,14 @@ def twitter(filename): @app.route("/search", methods=('GET',)) def search_page(): - logger.info("in search_page") - logger.info(request.url) result = None if USE_REDIS: with Bench("Trying Redis cache"): key = "search_results:v1:" + \ json.dumps(request.args, sort_keys=True) - logger.debug("key is:", pf(key)) result = Redis.get(key) if result: - logger.info("Redis cache hit on search results!") result = pickle.loads(result) - else: - logger.info("Skipping Redis cache (USE_REDIS=False)") - - logger.info("request.args is", request.args) the_search = SearchResultPage(request.args) result = the_search.__dict__ valid_search = result['search_term_exists'] @@ -256,15 +240,7 @@ def search_page(): @app.route("/search_table", methods=('GET',)) def search_page_table(): - logger.info("in search_page table") - logger.info(request.url) - - logger.info("request.args is", request.args) the_search = search_results.SearchResultPage(request.args) - - logger.info(type(the_search.trait_list)) - logger.info(the_search.trait_list) - current_page = server_side.ServerSideTable( len(the_search.trait_list), the_search.trait_list, @@ -277,7 +253,6 @@ def search_page_table(): @app.route("/gsearch", methods=('GET',)) def gsearchact(): - logger.info(request.url) result = GSearch(request.args).__dict__ type = request.args['type'] if type == "gene": @@ -288,8 +263,6 @@ def gsearchact(): @app.route("/gsearch_table", methods=('GET',)) def gsearchtable(): - logger.info(request.url) - gsearch_table_data = GSearch(request.args) current_page = server_side.ServerSideTable( gsearch_table_data.trait_count, @@ -303,15 +276,12 @@ def gsearchtable(): @app.route("/gsearch_updating", methods=('POST',)) def gsearch_updating(): - logger.info("REQUEST ARGS:", request.values) - logger.info(request.url) result = UpdateGSearch(request.args).__dict__ return result['results'] @app.route("/docedit") def docedit(): - logger.info(request.url) try: if g.user_session.record['user_email_address'] == "zachary.a.sloan@gmail.com" or g.user_session.record['user_email_address'] == "labwilliams@gmail.com": doc = Docs(request.args['entry'], request.args) @@ -324,13 +294,11 @@ def docedit(): @app.route('/generated/') def generated_file(filename): - logger.info(request.url) return send_from_directory(GENERATED_IMAGE_DIR, filename) @app.route("/help") def help(): - logger.info(request.url) doc = Docs("help", request.args) return render_template("docs.html", **doc.__dict__) @@ -338,8 +306,6 @@ def help(): @app.route("/wgcna_setup", methods=('POST',)) def wcgna_setup(): # We are going to get additional user input for the analysis - logger.info("In wgcna, request.form is:", request.form) - logger.info(request.url) # Display them using the template return render_template("wgcna_setup.html", **request.form) @@ -353,8 +319,6 @@ def wcgna_results(): @app.route("/ctl_setup", methods=('POST',)) def ctl_setup(): # We are going to get additional user input for the analysis - logger.info("In ctl, request.form is:", request.form) - logger.info(request.url) # Display them using the template return render_template("ctl_setup.html", **request.form) @@ -362,7 +326,6 @@ def ctl_setup(): @app.route("/ctl_results", methods=["POST"]) def ctl_results(): - ctl_results = run_ctl(request.form) return render_template("gn3_ctl_results.html", **ctl_results) @@ -400,7 +363,6 @@ def update_page(): @app.route("/submit_trait") def submit_trait_form(): - logger.info(request.url) species_and_groups = get_species_groups() return render_template( "submit_trait.html", @@ -411,7 +373,6 @@ def submit_trait_form(): @app.route("/create_temp_trait", methods=('POST',)) def create_temp_trait(): - logger.info(request.url) doc = Docs("links") return render_template("links.html", **doc.__dict__) @@ -422,9 +383,6 @@ def export_trait_excel(): trait_name, sample_data = export_trait_data.export_sample_table( request.form) app.logger.info(request.url) - logger.info("sample_data - type: %s -- size: %s" % - (type(sample_data), len(sample_data))) - buff = io.BytesIO() workbook = xlsxwriter.Workbook(buff, {'in_memory': True}) worksheet = workbook.add_worksheet() @@ -443,15 +401,9 @@ def export_trait_excel(): @app.route('/export_trait_csv', methods=('POST',)) def export_trait_csv(): """CSV file consisting of the sample data from the trait data and analysis page""" - logger.info("In export_trait_csv") - logger.info("request.form:", request.form) - logger.info(request.url) trait_name, sample_data = export_trait_data.export_sample_table( request.form) - logger.info("sample_data - type: %s -- size: %s" % - (type(sample_data), len(sample_data))) - buff = io.StringIO() writer = csv.writer(buff) for row in sample_data: @@ -467,9 +419,6 @@ def export_trait_csv(): @app.route('/export_traits_csv', methods=('POST',)) def export_traits_csv(): """CSV file consisting of the traits from the search result page""" - logger.info("In export_traits_csv") - logger.info("request.form:", request.form) - logger.info(request.url) file_list = export_traits(request.form, "metadata") if len(file_list) > 1: @@ -501,7 +450,6 @@ def export_collection_csv(): @app.route('/export_perm_data', methods=('POST',)) def export_perm_data(): """CSV file consisting of the permutation data for the mapping results""" - logger.info(request.url) perm_info = json.loads(request.form['perm_info']) now = datetime.datetime.now() @@ -572,9 +520,6 @@ def show_trait_page(): @app.route("/heatmap", methods=('POST',)) def heatmap_page(): - logger.info("In heatmap, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form temp_uuid = uuid.uuid4() @@ -583,18 +528,14 @@ def heatmap_page(): version = "v5" key = "heatmap:{}:".format( version) + json.dumps(start_vars, sort_keys=True) - logger.info("key is:", pf(key)) with Bench("Loading cache"): result = Redis.get(key) if result: - logger.info("Cache hit!!!") with Bench("Loading results"): result = pickle.loads(result) else: - logger.info("Cache miss!!!") - template_vars = heatmap.Heatmap(request.form, temp_uuid) template_vars.js_data = json.dumps(template_vars.js_data, default=json_default_handler, @@ -602,12 +543,7 @@ def heatmap_page(): result = template_vars.__dict__ - for item in list(template_vars.__dict__.keys()): - logger.info( - " ---**--- {}: {}".format(type(template_vars.__dict__[item]), item)) - pickled_result = pickle.dumps(result, pickle.HIGHEST_PROTOCOL) - logger.info("pickled result length:", len(pickled_result)) Redis.set(key, pickled_result) Redis.expire(key, 60 * 60) @@ -623,9 +559,6 @@ def heatmap_page(): @app.route("/bnw_page", methods=('POST',)) def bnw_page(): - logger.info("In run BNW, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] @@ -643,9 +576,6 @@ def bnw_page(): @app.route("/webgestalt_page", methods=('POST',)) def webgestalt_page(): - logger.info("In run WebGestalt, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] @@ -663,9 +593,6 @@ def webgestalt_page(): @app.route("/geneweaver_page", methods=('POST',)) def geneweaver_page(): - logger.info("In run WebGestalt, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] @@ -683,9 +610,6 @@ def geneweaver_page(): @app.route("/comparison_bar_chart", methods=('POST',)) def comp_bar_chart_page(): - logger.info("In comp bar chart, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] @@ -712,7 +636,6 @@ def mapping_results_container_page(): @app.route("/loading", methods=('POST',)) def loading_page(): - # logger.info(request.url) initial_start_vars = request.form start_vars_container = {} n_samples = 0 # ZS: So it can be displayed on loading page @@ -769,7 +692,6 @@ def loading_page(): @app.route("/run_mapping", methods=('POST',)) def mapping_results_page(): initial_start_vars = request.form - logger.info(request.url) temp_uuid = initial_start_vars['temp_uuid'] wanted = ( 'trait_id', @@ -838,18 +760,11 @@ def mapping_results_page(): version) + json.dumps(start_vars, sort_keys=True) with Bench("Loading cache"): result = None # Just for testing - #result = Redis.get(key) - - #logger.info("************************ Starting result *****************") - #logger.info("result is [{}]: {}".format(type(result), result)) - #logger.info("************************ Ending result ********************") if result: - logger.info("Cache hit!!!") with Bench("Loading results"): result = pickle.loads(result) else: - logger.info("Cache miss!!!") with Bench("Total time in RunMapping"): try: template_vars = run_mapping.RunMapping(start_vars, temp_uuid) @@ -883,8 +798,6 @@ def mapping_results_page(): @app.route("/export_mapping_results", methods=('POST',)) def export_mapping_results(): - logger.info("request.form:", request.form) - logger.info(request.url) file_path = request.form.get("results_path") results_csv = open(file_path, "r").read() response = Response(results_csv, @@ -908,8 +821,6 @@ def export_corr_matrix(): @app.route("/export", methods=('POST',)) def export(): - logger.info("request.form:", request.form) - logger.info(request.url) svg_xml = request.form.get("data", "Invalid data") filename = request.form.get("filename", "manhattan_plot_snp") response = Response(svg_xml, mimetype="image/svg+xml") @@ -920,10 +831,7 @@ def export(): @app.route("/export_pdf", methods=('POST',)) def export_pdf(): import cairosvg - logger.info("request.form:", request.form) - logger.info(request.url) svg_xml = request.form.get("data", "Invalid data") - logger.info("svg_xml:", svg_xml) filename = request.form.get("filename", "interval_map_pdf") pdf_file = cairosvg.svg2pdf(bytestring=svg_xml) response = Response(pdf_file, mimetype="application/pdf") @@ -933,8 +841,6 @@ def export_pdf(): @app.route("/network_graph", methods=('POST',)) def network_graph_page(): - logger.info("In network_graph, request.form is:", pf(request.form)) - logger.info(request.url) start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] if traits[0] != "": @@ -963,9 +869,6 @@ def test_corr_compute_page(): @app.route("/corr_matrix", methods=('POST',)) def corr_matrix_page(): - logger.info("In corr_matrix, request.form is:", pf(request.form)) - logger.info(request.url) - start_vars = request.form traits = [trait.strip() for trait in start_vars['trait_list'].split(',')] if len(traits) > 1: @@ -981,7 +884,6 @@ def corr_matrix_page(): @app.route("/corr_scatter_plot") def corr_scatter_plot_page(): - logger.info(request.url) template_vars = corr_scatter_plot.CorrScatterPlot(request.args) template_vars.js_data = json.dumps(template_vars.js_data, default=json_default_handler, @@ -991,7 +893,6 @@ def corr_scatter_plot_page(): @app.route("/snp_browser", methods=('GET',)) def snp_browser_page(): - logger.info(request.url) template_vars = snp_browser.SnpBrowser(request.args) return render_template("snp_browser.html", **template_vars.__dict__) @@ -1006,7 +907,6 @@ def db_info_page(): @app.route("/snp_browser_table", methods=('GET',)) def snp_browser_table(): - logger.info(request.url) snp_table_data = snp_browser.SnpBrowser(request.args) current_page = server_side.ServerSideTable( snp_table_data.rows_count, @@ -1021,20 +921,17 @@ def snp_browser_table(): @app.route("/tutorial/WebQTLTour", methods=('GET',)) def tutorial_page(): # ZS: Currently just links to GN1 - logger.info(request.url) return redirect("http://gn1.genenetwork.org/tutorial/WebQTLTour/") @app.route("/tutorial/security", methods=('GET',)) def security_tutorial_page(): # ZS: Currently just links to GN1 - logger.info(request.url) return render_template("admin/security_help.html") @app.route("/submit_bnw", methods=('POST',)) def submit_bnw(): - logger.info(request.url) return render_template("empty_collection.html", **{'tool': 'Correlation Matrix'}) # Take this out or secure it before putting into production @@ -1042,7 +939,6 @@ def submit_bnw(): @app.route("/get_temp_data") def get_temp_data(): - logger.info(request.url) temp_uuid = request.args['key'] return flask.jsonify(temp_data.TempData(temp_uuid).get_all()) -- cgit v1.2.3 From c1c5ab5ba940e2b48c9568a6c1d34ccae4d17d7a Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 4 Jul 2022 15:10:14 +0300 Subject: wqflask: Use a map over a tuple when fetching case-attributes * wqflask/wqflask/metadata_edits.py (update_phenotype): Replace old "get_case_attributes" function call which returned a dict with the new updated version that returns a tuple. --- wqflask/wqflask/metadata_edits.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index 5a5ee4ac..5468fe9b 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -227,8 +227,7 @@ def update_phenotype(dataset_id: str, name: str): diff_data = {} with database_connection() as conn: headers = ["Strain Name", "Value", "SE", "Count"] + list( - get_case_attributes(conn).keys() - ) + map(lambda x: x[1], get_case_attributes(conn))) diff_data = remove_insignificant_edits( diff_data=csv_diff( base_csv=( -- cgit v1.2.3 From 4fd21d4c55e064c8d98b0ba6577f156cc669c852 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 4 Jul 2022 15:22:54 +0300 Subject: wqflask: use the raw user string if value is non-existent in redis * wqflask/wqflask/metadata_edits.py (_get_diffs): If a user---whose value is extracted from Redis and encoded in the file name---doesn't exist in Redis, use the raw string extracted from the file. --- wqflask/wqflask/metadata_edits.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index 5468fe9b..4b960072 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -62,13 +62,16 @@ def _get_diffs( ): def __get_file_metadata(file_name: str) -> Dict: author, resource_id, time_stamp, *_ = file_name.split(".") - + try: + author = json.loads(redis_conn.hget("users", author)).get( + "full_name" + ) + except (AttributeError, TypeError): + author = author return { "resource_id": resource_id, "file_name": file_name, - "author": json.loads(redis_conn.hget("users", author)).get( - "full_name" - ), + "author": author, "time_stamp": time_stamp, "roles": get_highest_user_access_role( resource_id=resource_id, -- cgit v1.2.3 From 28ca511f846eb08ed5a7a86ba36d3282df9bdd24 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 4 Jul 2022 15:25:42 +0300 Subject: wqflask: Remove DebugToolbarExtension This functionality, at least how we use it, is already provided natively in python's pdb. Should someone need this, they can add it manually. * wqflask/runserver.py (app_config): Remove "flask_debugtoolbar" import and instantiation. * wqflask/utility/startup_config.py (app_config): Ditto. --- wqflask/runserver.py | 2 -- wqflask/utility/startup_config.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 8198b921..fee29be1 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -23,9 +23,7 @@ app_config() werkzeug_logger = logging.getLogger('werkzeug') if WEBSERVER_MODE == 'DEBUG': - from flask_debugtoolbar import DebugToolbarExtension app.debug = True - toolbar = DebugToolbarExtension(app) app.run(host='0.0.0.0', port=SERVER_PORT, debug=True, diff --git a/wqflask/utility/startup_config.py b/wqflask/utility/startup_config.py index 778fb64d..59923fa1 100644 --- a/wqflask/utility/startup_config.py +++ b/wqflask/utility/startup_config.py @@ -23,12 +23,9 @@ def app_config(): if mode in ["DEV", "DEBUG"]: app.config['TEMPLATES_AUTO_RELOAD'] = True if mode == "DEBUG": - from flask_debugtoolbar import DebugToolbarExtension app.debug = True - toolbar = DebugToolbarExtension(app) print("==========================================") - show_settings() port = get_setting_int("SERVER_PORT") -- cgit v1.2.3 From 105db86b4d1f738b23aa6164302e71d93fe61aa7 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 8 Jul 2022 20:33:26 +0000 Subject: Add JS for exporting case attributes (sample metadata) --- .../wqflask/static/new/javascript/show_trait.js | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 6b81b47e..687cf85d 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -1113,7 +1113,7 @@ switch_qnorm_data = function() { }; $('#qnorm').click(switch_qnorm_data); -get_sample_table_data = function(table_name) { +get_sample_table_data = function(table_name, attributes_as_list) { var samples; samples = []; @@ -1123,20 +1123,29 @@ get_sample_table_data = function(table_name) { if ($('#' + table_name).length){ table_api = $('#' + table_name).DataTable(); sample_vals = []; + attr_col = 4 name_nodes = table_api.column(2).nodes().to$(); val_nodes = table_api.column(3).nodes().to$(); if (js_data.se_exists){ var_nodes = table_api.column(5).nodes().to$(); + attr_col = 6 if (js_data.has_num_cases) { n_nodes = table_api.column(6).nodes().to$(); + attr_col = 7 } } else { if (js_data.has_num_cases){ n_nodes = table_api.column(4).nodes().to$(); + attr_col = 5 } } + attribute_nodes = [] + for (_i = 0; _i < attributes_as_list.length; _i++){ + attribute_nodes.push(table_api.column(attr_col + _i).nodes().to$()) + } + for (_j = 0; _j < val_nodes.length; _j++){ sample_val = val_nodes[_j].childNodes[0].value sample_name = $.trim(name_nodes[_j].childNodes[0].textContent) @@ -1164,12 +1173,18 @@ get_sample_table_data = function(table_name) { sample_n = null; } } + row_dict = { name: sample_name, value: sample_val, se: sample_var, num_cases: sample_n } + + for (_k = 0; _k < attribute_nodes.length; _k++){ + row_dict[attributes_as_list[_k]] = attribute_nodes[_k][_j].textContent; + } + samples.push(row_dict) } } @@ -1179,9 +1194,15 @@ get_sample_table_data = function(table_name) { }; export_sample_table_data = function() { var format, json_sample_data, sample_data; + + var attributes_as_list = Object.keys(js_data.attributes).map(function(key) { + return js_data.attributes[key].name; + }); + sample_data = {}; - sample_data.primary_samples = get_sample_table_data('samples_primary'); - sample_data.other_samples = get_sample_table_data('samples_other'); + sample_data.primary_samples = get_sample_table_data('samples_primary', attributes_as_list); + sample_data.other_samples = get_sample_table_data('samples_other', attributes_as_list); + sample_data.attributes = attributes_as_list; json_sample_data = JSON.stringify(sample_data); $('input[name=export_data]').val(json_sample_data); format = $('input[name=export_format]').val(); -- cgit v1.2.3 From 7660c3bf93cc156aa63292a925c996bf7f0dee6c Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 8 Jul 2022 20:34:19 +0000 Subject: Add python for exporting case attributes --- wqflask/wqflask/show_trait/export_trait_data.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/show_trait/export_trait_data.py b/wqflask/wqflask/show_trait/export_trait_data.py index 7fabc3f6..4b328a4a 100644 --- a/wqflask/wqflask/show_trait/export_trait_data.py +++ b/wqflask/wqflask/show_trait/export_trait_data.py @@ -16,15 +16,24 @@ def export_sample_table(targs): final_sample_data = meta_data column_headers = ["Name", "Value"] + attr_pos = 2 if any(sample["se"] for sample in sample_data['primary_samples']): column_headers.append("SE") + attr_pos = 3 if any(sample["num_cases"] for sample in sample_data['primary_samples']): column_headers.append("N") + attr_pos = 4 + + for key in sample_data["primary_samples"][0].keys(): + if key not in ["name", "value", "se", "num_cases"]: + column_headers.append(key) final_sample_data.append(column_headers) for sample_group in ['primary_samples', 'other_samples']: for row in sample_data[sample_group]: - sorted_row = dict_to_sorted_list(row) + sorted_row = dict_to_sorted_list(row)[:attr_pos] + for attr in sample_data['attributes']: + sorted_row.append(row[attr]) final_sample_data.append(sorted_row) return trait_name, final_sample_data -- cgit v1.2.3 From 81f5855a2e7b671bff41ee4b05cbdaeba5ea2792 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 11 Jul 2022 20:02:47 +0000 Subject: Increase min-width for div containing tool buttons on search page --- wqflask/wqflask/templates/search_result_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 8eaf5f91..2df10990 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -69,7 +69,7 @@ {% if too_many_results %}

Your search generated over 50000 results. Please modify your search to generate 50000 or fewer matches.

{% else %} -
+
-- cgit v1.2.3 From 1e403623792daca83875b5fefd5193455facb88e Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 12 Jul 2022 19:06:07 +0000 Subject: Include genotypes for F1s/reference/non-reference strains when fetching sample data for genotype traits --- wqflask/base/data_set.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index a7811a30..211c6752 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -1022,6 +1022,14 @@ class GenotypeDataSet(DataSet): results = g.db.execute(query, (webqtlDatabaseFunction.retrieve_species_id(self.group.name), trait, self.name)).fetchall() + + if self.group.name in webqtlUtil.ParInfo: + f1_1, f1_2, ref, nonref = webqtlUtil.ParInfo[self.group.name] + results.append([f1_1, 0, None, "N/A", f1_1]) + results.append([f1_2, 0, None, "N/A", f1_2]) + results.append([ref, -1, None, "N/A", ref]) + results.append([nonref, 1, None, "N/A", nonref]) + return results -- cgit v1.2.3 From bf192a52da5091e2e8aac864092a89d4e106f898 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 14 Jul 2022 19:15:27 +0000 Subject: Call DataTable() on the table id instead of referring to the_table; not sure why this is necessary, but the search doesn't work otherwise --- wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js index e1026f8c..2e12ca26 100644 --- a/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js +++ b/wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js @@ -259,7 +259,7 @@ function loadDataTable(first_run=false, table_id, table_data){ } $('#' + table_type.toLowerCase() + '_searchbox').on( 'keyup', function () { - the_table.search($(this).val()).draw(); + $('#' + table_id).DataTable().search($(this).val()).draw(); } ); $('.toggle-vis').on('click', function (e) { -- cgit v1.2.3 From 62dbbc440029efff136489f3a2d6cd8103207c05 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 14 Jul 2022 19:17:28 +0000 Subject: Remove column toggle JS from show_trait.html since it's in initialize_show_trait_tables.js --- wqflask/wqflask/templates/show_trait.html | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html index f366d33f..460c7c62 100644 --- a/wqflask/wqflask/templates/show_trait.html +++ b/wqflask/wqflask/templates/show_trait.html @@ -213,32 +213,6 @@ } }); - $('.toggle-vis').on('click', function (e) { - e.preventDefault(); - - function toggle_column(column) { - //ZS: Toggle column visibility - column.visible( ! column.visible() ); - if (column.visible()){ - $(this).removeClass("active"); - } else { - $(this).addClass("active"); - } - } - - // Get the column API object - var target_cols = $(this).attr('data-column').split(",") - for (let i = 0; i < target_cols.length; i++){ - var column = primary_table.column( target_cols[i] ); - toggle_column(column); - - {% if sample_groups|length != 1 %} - var column2 = other_table.column( target_cols[i] ); - toggle_column(column2); - {% endif %} - } - } ); - $('#samples_primary, #samples_other').find("tr.outlier").css('background-color', 'orange') $('.edit_sample_checkbox:checkbox').change(function() { -- cgit v1.2.3 From 5fa3e187687a7be6edab3b850fcd62d3635e40d4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 25 Jul 2022 09:03:01 +0300 Subject: Return config in app.config or None Update the code to return the setting already set up in the app.config dictionary if it exists or None if it does not exist. --- wqflask/utility/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index db0b4320..19bf686b 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -50,7 +50,7 @@ def get_setting(command_id, guess=None): app_set(command_id, command) return command else: - return None + return app.config.get(command_id) # ---- Check whether environment exists # print("Looking for "+command_id+"\n") -- cgit v1.2.3 From 06515da73091bb08c570e063d43ff4b6efada049 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 21 Jul 2022 15:22:36 +0000 Subject: Change Interval Analyst genome browser link to use mm10 instead of mm9 --- wqflask/wqflask/marker_regression/display_mapping_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py index 8dffd21d..6a62b45c 100644 --- a/wqflask/wqflask/marker_regression/display_mapping_results.py +++ b/wqflask/wqflask/marker_regression/display_mapping_results.py @@ -3012,7 +3012,7 @@ class DisplayMappingResults: else: snpString = 0 - mouseStartString = "http://genome.ucsc.edu/cgi-bin/hgTracks?clade=vertebrate&org=Mouse&db=mm9&position=chr" + \ + mouseStartString = "http://genome.ucsc.edu/cgi-bin/hgTracks?clade=vertebrate&org=Mouse&db=mm10&position=chr" + \ theGO["Chromosome"] + "%3A" + str(int(theGO["TxStart"] * 1000000.0)) + "-" + str( int(theGO["TxEnd"] * 1000000.0)) + "&pix=620&Submit=submit" -- cgit v1.2.3 From 98f32da4cafd79014493638acabd5fbec559b399 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 25 Jul 2022 18:16:51 +0000 Subject: Remove Comparison Bar Chart button --- wqflask/wqflask/templates/tool_buttons.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/wqflask/wqflask/templates/tool_buttons.html b/wqflask/wqflask/templates/tool_buttons.html index c3927495..c6d1476c 100644 --- a/wqflask/wqflask/templates/tool_buttons.html +++ b/wqflask/wqflask/templates/tool_buttons.html @@ -30,10 +30,6 @@ MultiMap - -
-- cgit v1.2.3 From 9132ae308d1e4d3fbfc39e2fdf6c2e951b27c529 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Fri, 22 Jul 2022 12:58:53 +0300 Subject: add test route --- wqflask/wqflask/views.py | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 63f3b3bb..2e13451d 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -64,6 +64,7 @@ from wqflask.marker_regression import display_mapping_results from wqflask.network_graph import network_graph from wqflask.correlation.show_corr_results import set_template_vars from wqflask.correlation.correlation_gn3_api import compute_correlation +from wqflask.correlation.rust_correlation import compute_correlation_rust from wqflask.correlation_matrix import show_corr_matrix from wqflask.correlation import corr_scatter_plot # from wqflask.wgcna import wgcna_analysis @@ -316,6 +317,7 @@ def wcgna_results(): results = run_wgcna(dict(request.form)) return render_template("gn3_wgcna_results.html", **results) + @app.route("/ctl_setup", methods=('POST',)) def ctl_setup(): # We are going to get additional user input for the analysis @@ -323,7 +325,6 @@ def ctl_setup(): return render_template("ctl_setup.html", **request.form) - @app.route("/ctl_results", methods=["POST"]) def ctl_results(): ctl_results = run_ctl(request.form) @@ -334,10 +335,11 @@ def ctl_results(): def fetch_network_files(file_name, file_type): file_path = f"{file_name}.{file_type}" - file_path = os.path.join("/tmp/",file_path) + file_path = os.path.join("/tmp/", file_path) return send_file(file_path) + @app.route("/intro") def intro(): doc = Docs("intro", request.args) @@ -447,6 +449,7 @@ def export_collection_csv(): mimetype='text/csv', headers={"Content-Disposition": "attachment;filename=" + out_file[0] + ".csv"}) + @app.route('/export_perm_data', methods=('POST',)) def export_perm_data(): """CSV file consisting of the permutation data for the mapping results""" @@ -657,7 +660,8 @@ def loading_page(): dataset = create_dataset(start_vars['dataset']) start_vars['trait_name'] = start_vars['trait_id'] if dataset.type == "Publish": - start_vars['trait_name'] = dataset.group.code + "_" + start_vars['trait_name'] + start_vars['trait_name'] = dataset.group.code + \ + "_" + start_vars['trait_name'] samples = dataset.group.samplelist if 'genofile' in start_vars: if start_vars['genofile'] != "": @@ -674,9 +678,11 @@ def loading_page(): n_samples += 1 start_vars['n_samples'] = n_samples - start_vars['vals_hash'] = generate_hash_of_string(str(sample_vals_dict)) - if start_vars['dataset'] != "Temp": # Currently can't get diff for temp traits - start_vars['vals_diff'] = get_diff_of_vals(sample_vals_dict, str(start_vars['trait_id'] + ":" + str(start_vars['dataset']))) + start_vars['vals_hash'] = generate_hash_of_string( + str(sample_vals_dict)) + if start_vars['dataset'] != "Temp": # Currently can't get diff for temp traits + start_vars['vals_diff'] = get_diff_of_vals(sample_vals_dict, str( + start_vars['trait_id'] + ":" + str(start_vars['dataset']))) start_vars['wanted_inputs'] = initial_start_vars['wanted_inputs'] @@ -777,8 +783,8 @@ def mapping_results_page(): if not template_vars.pair_scan: template_vars.js_data = json.dumps(template_vars.js_data, - default=json_default_handler, - indent=" ") + default=json_default_handler, + indent=" ") result = template_vars.__dict__ @@ -857,14 +863,25 @@ def network_graph_page(): @app.route("/corr_compute", methods=('POST',)) def corr_compute_page(): correlation_results = compute_correlation(request.form, compute_all=True) + correlation_results = set_template_vars(request.form, correlation_results) return render_template("correlation_page.html", **correlation_results) @app.route("/test_corr_compute", methods=["POST"]) def test_corr_compute_page(): - correlation_data = compute_correlation(request.form, compute_all=True) - return render_template("test_correlation_page.html", **correlation_data) + + start_vars = request.form + + correlation_results = compute_correlation_rust(start_vars, + start_vars["corr_type"], + start_vars['corr_sample_method'], + int(start_vars.get("corr_return_results", 500))) + + correlation_results = set_template_vars(request.form, correlation_results) + + return render_template("correlation_page.html", **correlation_results) + # return render_template("test_correlation_page.html", **correlation_data) @app.route("/corr_matrix", methods=('POST',)) @@ -993,9 +1010,8 @@ def display_diffs_users(): author = g.user_session.record.get(b'user_name').decode("utf-8") if os.path.exists(DIFF_DIR): files = os.listdir(DIFF_DIR) - files = filter(lambda x: not(x.endswith((".approved", ".rejected"))) \ + files = filter(lambda x: not(x.endswith((".approved", ".rejected"))) and author in x, files) return render_template("display_files_user.html", files=files) - -- cgit v1.2.3 From 43c67d5eaa5aa8ad7117d70b0b097696c639f618 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Fri, 22 Jul 2022 13:00:25 +0300 Subject: new file module for preprocessing input --- wqflask/wqflask/correlation/rust_correlation.py | 57 +++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 wqflask/wqflask/correlation/rust_correlation.py diff --git a/wqflask/wqflask/correlation/rust_correlation.py b/wqflask/wqflask/correlation/rust_correlation.py new file mode 100644 index 00000000..ebb079fa --- /dev/null +++ b/wqflask/wqflask/correlation/rust_correlation.py @@ -0,0 +1,57 @@ +"""module contains integration code for rust-gn3""" +import json +from wqflask.correlation.correlation_functions import get_trait_symbol_and_tissue_values +from wqflask.correlation.correlation_gn3_api import create_target_this_trait +from gn3.computations.rust_correlation import run_correlation +from gn3.computations.rust_correlation import get_sample_corr_data +from gn3.computations.rust_correlation import parse_tissue_corr_data + + +def compute_correlation_rust(start_vars: dict, corr_type: str, + method: str = "pearson", n_top: int = 500): + """function to compute correlation""" + + (this_dataset, this_trait, target_dataset, + sample_data) = create_target_this_trait(start_vars) + + if corr_type == "sample": + + all_samples = json.loads(start_vars["sample_vals"]) + sample_data = get_sample_corr_data(sample_type=start_vars["corr_samples_group"], + all_samples=all_samples, + dataset_samples=this_dataset.group.all_samples_ordered()) + + target_dataset.get_trait_data(list(sample_data.keys())) + + target_data = [] + for (key, val) in target_dataset.trait_data.items(): + lts = [key] + [str(x) for x in val] + r = ",".join(lts) + target_data.append(r) + # breakpoint() + + results = run_correlation(target_data, ",".join( + [str(x) for x in list(sample_data.values())]), method, ",") + + + if corr_type == "tissue": + + trait_symbol_dict = this_dataset.retrieve_genes("Symbol") + corr_result_tissue_vals_dict = get_trait_symbol_and_tissue_values( + symbol_list=list(trait_symbol_dict.values())) + + data = parse_tissue_corr_data(symbol_name=this_trait.symbol, + symbol_dict=get_trait_symbol_and_tissue_values( + symbol_list=[this_trait.symbol]), + dataset_symbols=trait_symbol_dict, + dataset_vals=corr_result_tissue_vals_dict) + + if data: + results = run_correlation( + data[1], data[0], method, ",") + + return {"correlation_results": results[0:n_top], + "this_trait": this_trait.name, + "target_dataset": start_vars['corr_dataset'], + "return_results": n_top + } -- cgit v1.2.3 From 590ec9d2f26a6536fc65c5fb79d476ab517b4f2c Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 26 Jul 2022 16:27:55 +0000 Subject: Change formatting for search term + add line break in description text --- wqflask/wqflask/templates/search_result_page.html | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 2df10990..9e486217 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -11,49 +11,50 @@ {% endblock %} {% block content %} -
+
-

Search Results: We searched {{ dataset.fullname }} - to find all records +

We searched {{ dataset.fullname }} +
+ to find all records {% if go_term is not none %} - with Gene Ontology ID GO:{{ go_term }}. + with Gene Ontology ID GO:{{ go_term }}. {% else %} {% for word in search_terms %} {% if word.key|lower == "rif" %} - with GeneRIF containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with GeneRIF containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "go" %} - with Gene Ontology ID {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with Gene Ontology ID {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "wiki" %} - with GeneWiki containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with GeneWiki containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "mean" %} - with MEAN between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with mean between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "range" %} - with RANGE between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with RANGE between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.key|lower == "lrs" or word.key|lower == "lod" or word.key|lower == "translrs" or word.key|lower == "cislrs" or word.key|lower == "translod" or word.key|lower == "cislod" %} {% if word.search_term|length == 1 %} with {% if word.key|lower == "translrs" %}trans{% elif word.key|lower == "cislrs" %}cis{% endif %}LRS {% if word.separator == ">" %} greater than {% elif word.separator == "<" %} less than {% elif word.separator == ">=" %} greater than or equal to {% elif word.separator == "<=" %} less than or equal to {% endif %} {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 2 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 3 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }}{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }}{% if loop.last %}.{% else %} and {% endif %} {% elif word.search_term|length == 4 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[3] }} with an exclusion zone of {{ word.search_term[2] }} Mb + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[3] }} with an exclusion zone of {{ word.search_term[2] }} Mb {% elif word.search_term|length == 5 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }} between {{ word.search_term[3] }} and {{ word.search_term[4] }} Mb{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }} between {{ word.search_term[3] }} and {{ word.search_term[4] }} Mb{% if loop.last %}.{% else %} and {% endif %} {% endif %} {% elif word.key|lower == "position" or word.key|lower == "mb" %} with target genes on chromosome {% if (word.search_term[0]|lower).split('chr')|length > 1 %}{{ (word.search_term[0]|lower).split('chr')[1] }}{% else %}{{ word.search_term[0] }}{% endif %} between {{ word.search_term[1] }} and {{ word.search_term[2] }} Mb{% if loop.last %}.{% else %} and {% endif %} {% else %} - {% if word.search_term[0] == "*" %} in the dataset.{% else %}{% if loop.first %}that match:
{% endif %}{{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %}{% endif %} + {% if word.search_term[0] == "*" %} in the dataset.{% else %}{% if loop.first %}that match: {% endif %}{{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %}{% endif %} {% endif %} {% endfor %} {% endif %}
- A total of {{ results|count }} records were found. + {{ results|count }} records were found.

{% if results|count > 0 %} -- cgit v1.2.3 From e412d0dd01e47e9594afdfa25f8fd7540e0068dc Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 26 Jul 2022 16:51:57 +0000 Subject: Change search result text/formatting --- wqflask/wqflask/templates/search_result_page.html | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 9e486217..e7743f98 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -25,36 +25,40 @@ {% else %} {% for word in search_terms %} {% if word.key|lower == "rif" %} - with GeneRIF containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with GeneRIF containing {{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.key|lower == "go" %} - with Gene Ontology ID {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with Gene Ontology ID {{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.key|lower == "wiki" %} - with GeneWiki containing {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with GeneWiki containing {{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.key|lower == "mean" %} - with mean between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with mean between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.key|lower == "range" %} - with RANGE between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with RANGE between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.key|lower == "lrs" or word.key|lower == "lod" or word.key|lower == "translrs" or word.key|lower == "cislrs" or word.key|lower == "translod" or word.key|lower == "cislod" %} {% if word.search_term|length == 1 %} - with {% if word.key|lower == "translrs" %}trans{% elif word.key|lower == "cislrs" %}cis{% endif %}LRS {% if word.separator == ">" %} greater than {% elif word.separator == "<" %} less than {% elif word.separator == ">=" %} greater than or equal to {% elif word.separator == "<=" %} less than or equal to {% endif %} {{ word.search_term[0] }}{% if loop.last %}.{% else %} and {% endif %} + with {% if word.key|lower == "translrs" %}trans{% elif word.key|lower == "cislrs" %}cis{% endif %}LRS {% if word.separator == ">" %} greater than {% elif word.separator == "<" %} less than {% elif word.separator == ">=" %} greater than or equal to {% elif word.separator == "<=" %} less than or equal to {% endif %} {{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.search_term|length == 2 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.search_term|length == 3 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }}{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }}{% if loop.last %}{% else %} and {% endif %} {% elif word.search_term|length == 4 %} with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[3] }} with an exclusion zone of {{ word.search_term[2] }} Mb {% elif word.search_term|length == 5 %} - with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }} between {{ word.search_term[3] }} and {{ word.search_term[4] }} Mb{% if loop.last %}.{% else %} and {% endif %} + with {{ word.key|upper }} between {{ word.search_term[0] }} and {{ word.search_term[1] }} on chromosome {{ word.search_term[2] }} between {{ word.search_term[3] }} and {{ word.search_term[4] }} Mb{% if loop.last %}{% else %} and {% endif %} {% endif %} {% elif word.key|lower == "position" or word.key|lower == "mb" %} - with target genes on chromosome {% if (word.search_term[0]|lower).split('chr')|length > 1 %}{{ (word.search_term[0]|lower).split('chr')[1] }}{% else %}{{ word.search_term[0] }}{% endif %} between {{ word.search_term[1] }} and {{ word.search_term[2] }} Mb{% if loop.last %}.{% else %} and {% endif %} + with target genes on chromosome {% if (word.search_term[0]|lower).split('chr')|length > 1 %}{{ (word.search_term[0]|lower).split('chr')[1] }}{% else %}{{ word.search_term[0] }}{% endif %} between {{ word.search_term[1] }} and {{ word.search_term[2] }} Mb{% if loop.last %}{% else %} and {% endif %} {% else %} {% if word.search_term[0] == "*" %} in the dataset.{% else %}{% if loop.first %}that match: {% endif %}{{ word.search_term[0] }}{% if loop.last %}{% else %} and {% endif %}{% endif %} {% endif %} {% endfor %} {% endif %}
- {{ results|count }} records were found. + {% if results|count > 0 %} + {{ results|count }} record{% if results|count > 1 %}s{% else %}{% endif %} found + {% else %} + No (0) records found for this search. Modify your search, check target dataset, or use Search All above. + {% endif %}

{% if results|count > 0 %} @@ -143,7 +147,7 @@ {% endif %} {% else %}
- + {% endif %}
-- cgit v1.2.3 From b07cd9d9321c93da7c4fdbefa1e6c6ebd121cb65 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 27 Jul 2022 18:11:35 +0000 Subject: Change some text/formatting for the Scree Plot --- wqflask/wqflask/templates/pca_scree_plot.html | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/wqflask/wqflask/templates/pca_scree_plot.html b/wqflask/wqflask/templates/pca_scree_plot.html index a9a6e761..74eb2c15 100644 --- a/wqflask/wqflask/templates/pca_scree_plot.html +++ b/wqflask/wqflask/templates/pca_scree_plot.html @@ -9,7 +9,8 @@
- +

Scree Plot

+
Review more on scree plots.
@@ -21,19 +22,9 @@ let { x_coord, y_coord } = js_data["scree_data"] const layout = { - - title: { - text: "PCA Scree Plot", - font: { - "size": 24, - "family": "Arial", - "color": "#000000" - } - }, - yaxis: { title: { - text: "Percent of total variance %", + text: "% of Variance", font: { "size": 18, "color": "" @@ -44,7 +35,7 @@ const layout = { xaxis: { title: { - text: "PCA components", + text: "Principal Components", font: { "size": 18, "color": "" -- cgit v1.2.3 From cd532637f3acd9257127d57f43fbb1a84cfee0d4 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 27 Jul 2022 18:11:48 +0000 Subject: Change capitalization on index page --- wqflask/wqflask/templates/index_page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html index af0e2fa2..3d76503c 100755 --- a/wqflask/wqflask/templates/index_page.html +++ b/wqflask/wqflask/templates/index_page.html @@ -59,7 +59,7 @@

You can also use advanced commands. Copy these simple examples into the Get Any field for single term searches and Combined for searches with multiple terms:

-- cgit v1.2.3 From 93f866cb6b3ad0011c7fb8f6a26901f5b732e2a3 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 27 Jul 2022 18:12:06 +0000 Subject: Change some text/formatting on Correlation Matrix page --- wqflask/wqflask/templates/correlation_matrix.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html index e90accf2..d392be34 100644 --- a/wqflask/wqflask/templates/correlation_matrix.html +++ b/wqflask/wqflask/templates/correlation_matrix.html @@ -11,7 +11,7 @@

Correlation Matrix

-
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.
+
Select any cell in the matrix to generate a scatter plot.
Lower left cells list Pearson product-moment correlations; upper right cells list Spearman rank order correlations. Each cell also contains the n of cases in parenthesis. 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.

{% if lowest_overlap < 8 %}
Caution: This matrix of correlations contains some cells with small sample sizes of fewer than 8.
@@ -37,7 +37,7 @@ - Trait {{ loop.index }}: {{ trait.dataset.name }}  {{ trait.name }} + {{ loop.index }}: {{ trait.dataset.name }}  {{ trait.name }}
{% if trait.dataset.type == "ProbeSet" %}Gene Symbol: {{ trait.symbol }}{% elif trait.dataset.type == "Publish" %}Trait Symbol: {{ trait.post_publication_abbreviation }}{% elif trait.dataset.type == "Geno" %}Genotype{% endif %}