Skip to content

Commit

Permalink
fix filtering in place
Browse files Browse the repository at this point in the history
  • Loading branch information
LKremer committed Jun 14, 2024
1 parent 64907f8 commit a9f6a1b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions methscan/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def _check_cell_number(n, n_before):
if n < 1:
raise Exception(
"Your filtering options would mean that "
"no cells are left after filtering. "
"This is not enough to continue. Aborting."
"no cells are left after filtering. Aborting."
)
elif n == n_before:
secho(
"Warning: No cells are discarded with your current filtering settings.",
fg="red",
)
elif n <= 30:
secho(
Expand Down Expand Up @@ -169,4 +173,5 @@ def filter_(
_copy_log(log_path, log_path_out, len(cell_idx), n_cells_prefilter)
if in_place:
shutil.rmtree(data_dir)
shutil.copytree(filtered_dir, data_dir)
echo(f"overwriting the original data directory {data_dir} with {filtered_dir}.")
shutil.move(filtered_dir, data_dir)

0 comments on commit a9f6a1b

Please sign in to comment.