diff options
| author | Alexander Kabui | 2024-12-20 18:28:26 +0300 |
|---|---|---|
| committer | GitHub | 2024-12-20 18:28:26 +0300 |
| commit | 745ae64283f97101465457a0dd571d9097556dfe (patch) | |
| tree | 4076faa4e36716b3491bddc8d3eefdf0a154e6f7 /gn3/computations/rqtl.py | |
| parent | 0c9885d22ff89b5529757b30f83143396ca43e5e (diff) | |
| parent | 6ea74320bc92939d1c99e406623568a183cc75b9 (diff) | |
| download | genenetwork3-745ae64283f97101465457a0dd571d9097556dfe.tar.gz | |
Merge pull request #205 from genenetwork/feature/integrate-streaming-api-functionality
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 |
