about summary refs log tree commit diff
path: root/gn3/computations/rqtl.py
diff options
context:
space:
mode:
authorAlexander_Kabui2024-12-13 15:14:58 +0300
committerBonfaceKilz2024-12-13 15:22:20 +0300
commit6af4f70055e088530b4cdbdc47b2589046d00984 (patch)
treee5f2dc10db67a1a37a6b5d2bb891ab27114e2da6 /gn3/computations/rqtl.py
parent0872774cdcacddb1bc59051e274e50256a1126d0 (diff)
downloadgenenetwork3-6af4f70055e088530b4cdbdc47b2589046d00984.tar.gz
fix: Fetch the correct value from rqtl output file for permutation.
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 21c863a..9c1c7cd 100644
--- a/gn3/computations/rqtl.py
+++ b/gn3/computations/rqtl.py
@@ -312,16 +312,16 @@ def process_perm_output(file_name: str) -> Tuple[List, float, float]:
     suggestive and significant thresholds"""
 
     perm_results = []
-    outdir = os.path.join(get_tmpdir(),"gn3")
+    outdir = os.path.join(get_tmpdir(), "gn3")
 
-    with open( os.path.join(outdir,file_name),"r",encoding="utf-8") as the_file:
+    with open(os.path.join(outdir, file_name), "r", encoding="utf-8") as the_file:
         for i, line in enumerate(the_file):
             if i == 0:
                 # Skip header line
                 continue
 
-            line_items = line.split(",")
-            perm_results.append(float(line_items[1].replace("\"", "")))
+            snp, chromosome, position, lod_score = line.split(",")
+            perm_results.append(float(lod_score))
 
     suggestive = np.percentile(np.array(perm_results), 67)
     significant = np.percentile(np.array(perm_results), 95)