From de3ffeea12ad38222eab3e1f4a179b67025fffd0 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 22 Sep 2020 16:11:20 -0500 Subject: Replaced Chr and Mb/cM columns with a single position column in mapping results and also changes the -log(p) to use an endash instead * wqflask/wqflask/marker_regression/run_mapping.py - added "display_pos" to each marker object that is a combination of Chr and Mb/cM * wqflask/wqflask/templates/mapping_results.html - Included "display_pos" in results table and replaced -log(p) with using an endash --- wqflask/wqflask/marker_regression/run_mapping.py | 10 +- wqflask/wqflask/templates/mapping_results.html | 118 +++++++++++------------ 2 files changed, 61 insertions(+), 67 deletions(-) diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py index 9bde343c..8bc91b47 100644 --- a/wqflask/wqflask/marker_regression/run_mapping.py +++ b/wqflask/wqflask/marker_regression/run_mapping.py @@ -401,9 +401,7 @@ class RunMapping(object): rs = marker['name'], pos = this_ps ) - #if 'p_value' in marker: - # logger.debug("P EXISTS:", marker['p_value']) - #else: + if 'lrs_value' in marker and marker['lrs_value'] > 0: browser_marker['p_wald'] = 10**-(marker['lrs_value']/4.61) elif 'lod_score' in marker and marker['lod_score'] > 0: @@ -417,6 +415,12 @@ class RunMapping(object): if marker['chr'] > highest_chr or marker['chr'] == "X" or marker['chr'] == "X/Y": highest_chr = marker['chr'] if ('lod_score' in marker.keys()) or ('lrs_value' in marker.keys()): + if 'Mb' in marker.keys(): + marker['display_pos'] = str(marker['chr']) + "{.3f}".format(marker['Mb']) + elif 'cM' in marker.keys(): + marker['display_pos'] = str(marker['chr']) + "{.3f}".format(marker['Mb']) + else: + marker['display_pos'] = "N/A" self.qtl_results.append(marker) with Bench("Exporting Results"): diff --git a/wqflask/wqflask/templates/mapping_results.html b/wqflask/wqflask/templates/mapping_results.html index 4ea7fa07..657731b1 100644 --- a/wqflask/wqflask/templates/mapping_results.html +++ b/wqflask/wqflask/templates/mapping_results.html @@ -229,70 +229,60 @@

- - - - - - - - - {% if plotScale != "physic" %} - - {% else %} - - {% endif %} - {% if 'additive' in trimmed_markers[0] %} - - {% endif %} - {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %} - - {% endif %} - - - - {% for marker in trimmed_markers %} - - - - - {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %} - {% if 'lod_score' in marker %} - - {% else %} - - {% endif %} - {% else %} - {% if 'lod_score' in marker %} - - {% else %} - - {% endif %} - {% endif %} - - {% if plotScale != "physic" %} - {% if 'cM' in marker %} - - {% else %} - - {% endif %} - {% else %} - - {% endif %} - {% if 'additive' in marker %} - - {% endif %} - {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %} - - {% endif %} - - {% endfor %} - - + + + + + + + {% LRS_LOD == "-log(p)" %} + + {% else %} + + {% endif %} + + {% if 'additive' in trimmed_markers[0] %} + + {% endif %} + {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %} + + {% endif %} + + + + {% for marker in trimmed_markers %} + + + + + {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %} + {% if 'lod_score' in marker %} + + {% else %} + + {% endif %} + {% else %} + {% if 'lod_score' in marker %} + + {% else %} + + {% endif %} + {% endif %} + + {% endif %} + {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %} + + {% endif %} + + {% endfor %} + +
{% elif selectedChr != -1 and plotScale =="physic" and (dataset.group.species == 'mouse' or dataset.group.species == 'rat') %} -- cgit v1.2.3