aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2020-09-22 16:11:20 -0500
committerzsloan2020-09-22 16:11:20 -0500
commitde3ffeea12ad38222eab3e1f4a179b67025fffd0 (patch)
treef5e2b63000f738e34e5ca199fae2f82e397e3694
parent6de9a14d1a98b26fc8996c0220131e222a1482a8 (diff)
downloadgenenetwork2-de3ffeea12ad38222eab3e1f4a179b67025fffd0.tar.gz
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
-rw-r--r--wqflask/wqflask/marker_regression/run_mapping.py10
-rw-r--r--wqflask/wqflask/templates/mapping_results.html118
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 @@
<br />
<br />
<div id="table_container" style="width:{% if 'additive' in trimmed_markers[0] %}500{% else %}470{% endif %}px;">
- <table id="trait_table" class="table-hover table-striped cell-border dataTable no-footer">
- <thead>
- <tr>
- <th></th>
- <th>Row</th>
- <th>Marker</th>
- <th>{{ LRS_LOD }}</th>
- <th>Chr</th>
- {% if plotScale != "physic" %}
- <th>cM</th>
- {% else %}
- <th align="right">Mb</th>
- {% endif %}
- {% if 'additive' in trimmed_markers[0] %}
- <th>Add Eff</th>
- {% endif %}
- {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
- <th>Dom Eff</th>
- {% endif %}
- </tr>
- </thead>
- <tbody>
- {% for marker in trimmed_markers %}
- <tr>
- <td align="center" style="padding: 1px 0px 1px 0px;">
- <input type="checkbox" name="selectCheck"
- class="checkbox trait_checkbox"
- value="{{ data_hmac('{}:{}Geno'.format(marker.name, dataset.group.name)) }}">
- </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 'lod_score' in marker %}
- <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td>
- {% else %}
- <td align="right">{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }}</td>
- {% endif %}
- {% else %}
- {% if 'lod_score' in marker %}
- <td align="right">{{ '%0.2f' | format(marker.lod_score|float * 4.61) }}</td>
- {% else %}
- <td align="right">{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
- {% endif %}
- {% endif %}
- <td align="right">{{marker.chr}}</td>
- {% if plotScale != "physic" %}
- {% if 'cM' in marker %}
- <td align="right">{{ '%0.3f' | format(marker.cM|float) }}</td>
- {% else %}
- <td align="right">{{ '%0.3f' | format(marker.Mb|float) }}</td>
- {% endif %}
- {% else %}
- <td align="right">{{ '%0.6f' | format(marker.Mb|float) }}</td>
- {% endif %}
- {% if 'additive' in marker %}
- <td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
- {% endif %}
- {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
- <td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ <table id="trait_table" class="table-hover table-striped cell-border dataTable no-footer">
+ <thead>
+ <tr>
+ <th></th>
+ <th>Row</th>
+ <th>Marker</th>
+ {% LRS_LOD == "-log(p)" %}
+ <th>–log(p)</th>
+ {% else %}
+ <th>{{ LRS_LOD }}</th>
+ {% endif %}
+ <th>Position</th>
+ {% if 'additive' in trimmed_markers[0] %}
+ <th>Add Eff</th>
+ {% endif %}
+ {% if 'dominance' in trimmed_markers[0] and dataset.group.genetic_type != "riset" %}
+ <th>Dom Eff</th>
+ {% endif %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for marker in trimmed_markers %}
+ <tr>
+ <td align="center" style="padding: 1px 0px 1px 0px;">
+ <input type="checkbox" name="selectCheck"
+ class="checkbox trait_checkbox"
+ value="{{ data_hmac('{}:{}Geno'.format(marker.name, dataset.group.name)) }}">
+ </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 'lod_score' in marker %}
+ <td align="right">{{ '%0.2f' | format(marker.lod_score|float) }}</td>
+ {% else %}
+ <td align="right">{{ '%0.2f' | format(marker.lrs_value|float / 4.61) }}</td>
+ {% endif %}
+ {% else %}
+ {% if 'lod_score' in marker %}
+ <td align="right">{{ '%0.2f' | format(marker.lod_score|float * 4.61) }}</td>
+ {% else %}
+ <td align="right">{{ '%0.2f' | format(marker.lrs_value|float) }}</td>
+ {% endif %}
+ {% endif %}
+ <td align="right">{{ marker.display_pos }}/td>
+ {% if 'additive' in marker %}
+ <td align="right">{{ '%0.3f' | format(marker.additive|float) }}</td>
+ {% endif %}
+ {% if 'dominance' in marker and dataset.group.genetic_type != "riset" %}
+ <td align="right">{{ '%0.2f' | format(marker.dominance|float) }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
</div>
</div>
{% elif selectedChr != -1 and plotScale =="physic" and (dataset.group.species == 'mouse' or dataset.group.species == 'rat') %}