aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/rqtl.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/computations/rqtl.py')
-rw-r--r--gn3/computations/rqtl.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py
index 22d9faf..7b1a35c 100644
--- a/gn3/computations/rqtl.py
+++ b/gn3/computations/rqtl.py
@@ -1,8 +1,7 @@
"""Procedures related rqtl computations"""
import os
import numpy as np
-from typing import Dict
-from typing import List
+from typing import Dict, List, Union
from flask import current_app
@@ -55,7 +54,7 @@ def process_rqtl_output(file_name: str) -> List:
marker_obs = []
# Later I should probably redo this using csv.read to avoid the
# awkwardness with removing quotes with [1:-1]
- with open(os.path.join(current_app.config.get("TMPDIR"), "output", file_name), "r") as the_file:
+ with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", file_name), "r") as the_file:
for line in the_file:
line_items = line.split(",")
if line_items[1][1:-1] == "chr" or not line_items:
@@ -63,6 +62,7 @@ def process_rqtl_output(file_name: str) -> List:
continue
else:
# Convert chr to int if possible
+ the_chr: Union[int, str]
try:
the_chr = int(line_items[1][1:-1])
except:
@@ -85,7 +85,7 @@ def process_perm_output(file_name: str):
"""
perm_results = []
- with open(os.path.join(current_app.config.get("TMPDIR"), "output", "PERM_" + file_name), "r") as the_file:
+ with open(os.path.join(current_app.config.get("TMPDIR", "/tmp"), "output", "PERM_" + file_name), "r") as the_file:
for i, line in enumerate(the_file):
if i == 0:
# Skip header line