aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorzsloan2021-09-23 22:33:31 +0000
committerzsloan2022-03-22 19:08:01 +0000
commitea15c3f0ed8fe6682af1ceb45e1fc962d09d2e7e (patch)
tree0f43ea6b1c96e5f490c5a23ad8a4690ff36317fc /gn3/computations
parenta4a2886c16b578dd4f91520bf3fa9a1e9d801edb (diff)
downloadgenenetwork3-ea15c3f0ed8fe6682af1ceb45e1fc962d09d2e7e.tar.gz
Add typing to some functions
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/rqtl.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py
index 51ac3c7..cfa58a8 100644
--- a/gn3/computations/rqtl.py
+++ b/gn3/computations/rqtl.py
@@ -1,7 +1,7 @@
"""Procedures related rqtl computations"""
import os
from bisect import bisect
-from typing import Dict, List, Union
+from typing import Dict, List, Tuple, Union
import numpy as np
@@ -150,7 +150,7 @@ def pairscan_for_table(file_name: str, geno_file: str) -> List:
marker_list.append(this_marker)
# Get the list of original markers from the .geno file
- original_markers = build_marker_pos_list(geno_file)
+ original_markers = build_marker_pos_dict(geno_file)
# Open the file with the actual results and write the results as
# they will be displayed in the results table
@@ -181,7 +181,7 @@ def pairscan_for_table(file_name: str, geno_file: str) -> List:
return sorted(table_data, key = lambda i: float(i['lod']), reverse=True)[:500]
-def build_marker_pos_list(genotype_file):
+def build_marker_pos_dict(genotype_file: str) -> Dict:
"""
Gets list of markers and their positions from .geno file
@@ -211,7 +211,7 @@ def build_marker_pos_list(genotype_file):
return the_markers
-def find_nearest_marker(the_chr, the_pos, marker_list):
+def find_nearest_marker(the_chr: str, the_pos: str, marker_list: Dict) -> Tuple[str, str]:
"""
Given a chromosome and position of a pseudomarker (from R/qtl pair-scan results),
return the nearest real marker
@@ -227,7 +227,7 @@ def find_nearest_marker(the_chr, the_pos, marker_list):
return proximal_marker, distal_marker
-def process_perm_output(file_name: str):
+def process_perm_output(file_name: str) -> Tuple[List, float, float]:
"""Given base filename, read in R/qtl permutation output and calculate
suggestive and significant thresholds