Skip to content

Commit

Permalink
allow to overwrite the existing temporary directory for sample
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyuma committed Oct 20, 2023
1 parent f3c462e commit 649fd61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions srcs/hypothesis_recovery_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,11 @@ def hypothesis_recovery(
sample_dir = os.path.dirname(sample_file)
sample_name = os.path.basename(sample_file).replace('.sig.zip', '')
path_to_sample_temp_dir = os.path.join(sample_dir, f'sample_{sample_name}_intermediate_files')
if not os.path.exists(path_to_sample_temp_dir):
os.makedirs(path_to_sample_temp_dir)
if os.path.exists(path_to_sample_temp_dir):
# if exists, remove it
logger.info(f"Removing existing temporary directory: {path_to_sample_temp_dir}")
os.system(f'rm -rf {path_to_sample_temp_dir}')
os.makedirs(path_to_sample_temp_dir)

# Find the organisms that have non-zero overlap with the sample
nontrivial_organism_names = get_organisms_with_nonzero_overlap(manifest, sample_file, scale, ksize, num_threads, path_to_genome_temp_dir, path_to_sample_temp_dir)
Expand Down

0 comments on commit 649fd61

Please sign in to comment.