diff options
author | zsloan | 2021-06-18 20:54:18 +0000 |
---|---|---|
committer | zsloan | 2021-06-18 22:08:04 +0000 |
commit | 476b146562070cee6a55c55c03c37ef3e19a1474 (patch) | |
tree | 438a295cef30a8822e0f87398bcf7a88e711ed63 /gn3 | |
parent | cd921a4778d141b6dbbf9f60c178a4f681d47860 (diff) | |
download | genenetwork3-476b146562070cee6a55c55c03c37ef3e19a1474.tar.gz |
Resolve mypy errors in computations/rqtl.py
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/computations/rqtl.py | 8 |
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 |