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 @@
- | Row | -Marker | -{{ LRS_LOD }} | -Chr | - {% if plotScale != "physic" %} -cM | - {% else %} -Mb | - {% endif %} - {% if 'additive' in trimmed_markers[0] %} -Add Eff | - {% endif %} - {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %} -Dom Eff | - {% endif %} -||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
- - | -{{ loop.index }} | -{% if geno_db_exists == "True" %}{{ marker.name }}{% else %}{{ marker.name }}{% endif %} | - {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %} - {% if 'lod_score' in marker %} -{{ '%0.2f' | format(marker.lod_score|float) }} | - {% else %} -{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }} | - {% endif %} - {% else %} - {% if 'lod_score' in marker %} -{{ '%0.2f' | format(marker.lod_score|float * 4.61) }} | - {% else %} -{{ '%0.2f' | format(marker.lrs_value|float) }} | - {% endif %} - {% endif %} -{{marker.chr}} | - {% if plotScale != "physic" %} - {% if 'cM' in marker %} -{{ '%0.3f' | format(marker.cM|float) }} | - {% else %} -{{ '%0.3f' | format(marker.Mb|float) }} | - {% endif %} - {% else %} -{{ '%0.6f' | format(marker.Mb|float) }} | - {% endif %} - {% if 'additive' in marker %} -{{ '%0.3f' | format(marker.additive|float) }} | - {% endif %} - {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %} -{{ '%0.2f' | format(marker.dominance|float) }} | - {% endif %} -
+ | Row | +Marker | + {% LRS_LOD == "-log(p)" %} +–log(p) | + {% else %} +{{ LRS_LOD }} | + {% endif %} +Position | + {% if 'additive' in trimmed_markers[0] %} +Add Eff | + {% endif %} + {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %} +Dom Eff | + {% endif %} +||
---|---|---|---|---|---|---|---|---|---|
+ + | +{{ loop.index }} | +{% if geno_db_exists == "True" %}{{ marker.name }}{% else %}{{ marker.name }}{% endif %} | + {% if LRS_LOD == "LOD" or LRS_LOD == "-log(p)" %} + {% if 'lod_score' in marker %} +{{ '%0.2f' | format(marker.lod_score|float) }} | + {% else %} +{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }} | + {% endif %} + {% else %} + {% if 'lod_score' in marker %} +{{ '%0.2f' | format(marker.lod_score|float * 4.61) }} | + {% else %} +{{ '%0.2f' | format(marker.lrs_value|float) }} | + {% endif %} + {% endif %} +{{ marker.display_pos }}/td> + {% if 'additive' in marker %} + | {{ '%0.3f' | format(marker.additive|float) }} | + {% endif %} + {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %} +{{ '%0.2f' | format(marker.dominance|float) }} | + {% endif %} +