Skip to content

Commit

Permalink
remove test as bbknn now works at these higher values
Browse files Browse the repository at this point in the history
  • Loading branch information
crichgriffin committed Apr 12, 2023
1 parent 0d0c6a6 commit 9e5f19f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion panpipes/funcs/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def batch_scatter_two_var(plot_df, method, batch, palette_choice=None):
colour=palette_choice[i],
title=str(method_choice) + "|" + str(group_choice))
idx+=1
logging.info(idx)
logging.debug(idx)
return fig, axs


Expand Down
14 changes: 0 additions & 14 deletions panpipes/python_scripts/batch_correct_bbknn.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,10 @@

# make sure that batch is a categorical
adata.obs["comb_columns"] = adata.obs["comb_columns"].astype("category")
# test the minimum number of neighbours needed for the function to not break,
# the safe point is 40 in my tests
nn_test = nnb * len(adata.obs["comb_columns"].unique())
if nn_test > 40:
nnb = nnb - 1
L.info("reducing the numbers within batch to %i as the number of batches is high, \
and bbknn will likely crash" % nnb)
if nnb < 1:
sys.exit("can't work with 0 neighbors_within_batch")
# run bbknn
adata = sc.external.pp.bbknn(adata, batch_key="comb_columns", copy=True, neighbors_within_batch=nnb)
else:
adata.obs[args.integration_col] = adata.obs[args.integration_col].astype("category")
nn_test = nnb * len(adata.obs[args.integration_col].unique())
if nn_test > 40:
nnb = nnb - 1
if nnb < 1:
sys.exit("can't work with 0 neighbors_within_batch")
# run bbknn
adata = sc.external.pp.bbknn(adata,
batch_key=args.integration_col,
Expand Down

0 comments on commit 9e5f19f

Please sign in to comment.