aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/qtlreaper.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/computations/qtlreaper.py')
-rw-r--r--gn3/computations/qtlreaper.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py
index 30c7051..eff2a80 100644
--- a/gn3/computations/qtlreaper.py
+++ b/gn3/computations/qtlreaper.py
@@ -94,9 +94,15 @@ def parse_reaper_main_results(results_file):
with open(results_file, "r") as infile:
lines = infile.readlines()
+ def __parse_column_value(value):
+ try:
+ return float(value)
+ except:
+ return value
+
def __parse_line(line):
items = line.strip().split("\t")
- return items[0:2] + [float(item) for item in items[2:]]
+ return items[0:2] + [__parse_column_value(item) for item in items[2:]]
header = lines[0].strip().split("\t")
return [dict(zip(header, __parse_line(line))) for line in lines[1:]]