aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-03-24 15:34:17 -0500
committerGitHub2022-03-24 15:34:17 -0500
commit155c392984daaa1f43712063c097a1936cf7e4c4 (patch)
treef0263e098d4e59602550eac02c2a572f50543efc
parentde546b4fb148bf9f51e4262d6cabf169b504ba3c (diff)
parent1964871492efdb09b0c85861fb4d9018acdfb7e6 (diff)
downloadgenenetwork2-155c392984daaa1f43712063c097a1936cf7e4c4.tar.gz
Merge pull request #691 from zsloan/bug/fix_qtlreaper_snp_order
Bug/fix qtlreaper snp order
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py2
-rw-r--r--wqflask/wqflask/marker_regression/qtlreaper_mapping.py11
2 files changed, 11 insertions, 2 deletions
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index 920a8d30..034c352b 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -2637,7 +2637,7 @@ class DisplayMappingResults:
break
m += 1
- if self.manhattan_plot != True:
+ if self.manhattan_plot != True and len(LRSCoordXY) > 1:
draw_open_polygon(canvas, xy=LRSCoordXY, outline=thisLRSColor,
width=lrsEdgeWidth)
diff --git a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
index 801674e1..c4b495d7 100644
--- a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
+++ b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py
@@ -183,7 +183,16 @@ def natural_sort(marker_list):
Function to naturally sort numbers + strings, adopted from user Mark Byers here: https://stackoverflow.com/questions/4836710/does-python-have-a-built-in-function-for-string-natural-sort
Changed to return indices instead of values, though, since the same reordering needs to be applied to bootstrap results
"""
- convert = lambda text: int(text) if text.isdigit() else text.lower()
+
+ def convert(text):
+ if text.isdigit():
+ return int(text)
+ else:
+ if text != "M":
+ return text.lower()
+ else:
+ return "z"
+
alphanum_key = lambda key: [convert(c) for c in re.split(
'([0-9]+)', str(marker_list[key]['chr']))]
return sorted(list(range(len(marker_list))), key=alphanum_key)