Skip to content

Commit

Permalink
remove --not-save-genotype-data in --cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiwen-Owen-Jiang committed Jan 15, 2025
1 parent 6180985 commit fb90b6d
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions heig/wgs/cluster.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import time
import shutil
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -319,10 +318,6 @@ def run(args, log):
gprocessor.keep_remove_idvs(common_ids)
gprocessor.do_processing(mode="gwas")

temp_path = get_temp_path(args.out)
if not args.not_save_genotype_data:
gprocessor.save_interim_data(temp_path)

# extract common subjects and align data
snps_mt_ids = gprocessor.subject_id()
ldrs.to_single_index()
Expand Down Expand Up @@ -352,6 +347,7 @@ def run(args, log):
args.voxels = np.arange(bases.shape[0])

# wild bootstrap
temp_path = get_temp_path(args.out)
cluster = Cluster(
gprocessor,
resid_ldrs,
Expand All @@ -375,16 +371,6 @@ def run(args, log):

finally:
if "temp_path" in locals():
if os.path.exists(temp_path):
for _ in range(3):
try:
shutil.rmtree(temp_path)
break
except OSError as e:
if e.errno == 39: # Directory not empty
time.sleep(0.1)
else:
raise
if os.path.exists(f"{temp_path}_covar.txt"):
os.remove(f"{temp_path}_covar.txt")
if os.path.exists(f"{temp_path}_ldr.txt"):
Expand Down

0 comments on commit fb90b6d

Please sign in to comment.