diff options
| author | Alexander_Kabui | 2024-12-17 22:23:04 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2024-12-17 22:23:04 +0300 |
| commit | 90a39a513da56612da1b2d5e3268b04922568db8 (patch) | |
| tree | 37f8ee71c38302281254c3bc15c72927a05a3f5e /gn3/computations/rqtl.py | |
| parent | 0c9885d22ff89b5529757b30f83143396ca43e5e (diff) | |
| download | genenetwork3-90a39a513da56612da1b2d5e3268b04922568db8.tar.gz | |
feat: Init integrate streaming functionality to rqtl1.
Diffstat (limited to 'gn3/computations/rqtl.py')
| -rw-r--r-- | gn3/computations/rqtl.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py index 9e39c3f..eaf5df5 100644 --- a/gn3/computations/rqtl.py +++ b/gn3/computations/rqtl.py @@ -67,8 +67,7 @@ def process_rqtl_mapping(file_name: str) -> List: # Later I should probably redo this using csv.read to avoid the # awkwardness with removing quotes with [1:-1] 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 line in the_file: line_items = line.split(",") if line_items[1][1:-1] == "chr" or not line_items: @@ -316,15 +315,13 @@ def process_perm_output(file_name: str) -> Tuple[List, float, float]: 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 - _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) - return perm_results, suggestive, significant |
