From bfdf121ccb4e07fa5723936a4980bdc0ceaad890 Mon Sep 17 00:00:00 2001 From: jykr Date: Mon, 25 Mar 2024 15:22:03 -0400 Subject: [PATCH] allow & test feeding no --allele-df-key for tiling run --- bean/model/run.py | 2 +- bean/preprocessing/data_class.py | 1 - tests/test_run.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bean/model/run.py b/bean/model/run.py index 9615d8a..e09dcd5 100644 --- a/bean/model/run.py +++ b/bean/model/run.py @@ -222,7 +222,7 @@ def parse_args(): parser.add_argument( "--allele-df-key", type=str, - default="allele_counts", + default=None, help="screen.uns[allele_df_key] will be used as the allele count.", ) parser.add_argument( diff --git a/bean/preprocessing/data_class.py b/bean/preprocessing/data_class.py index 4bfc862..ed4a2c3 100644 --- a/bean/preprocessing/data_class.py +++ b/bean/preprocessing/data_class.py @@ -567,7 +567,6 @@ def _post_init( else: allele_counts_selected = self.screen.uns[allele_df_key] if control_guide_tag is not None: - def _set_uid_to_row(row): if control_guide_tag in row.guide: row[allele_col].set_uid(row.guide) diff --git a/tests/test_run.py b/tests/test_run.py index 1455707..3c877b1 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -120,8 +120,8 @@ def test_run_tiling_with_wo_negctrl_uniform(): @pytest.mark.order(24) -def test_run_tiling_negctrl(): - cmd = "bean-run sorting tiling tests/data/tiling_mini_screen_annotated.h5ad --scale-by-acc --acc-bw-path tests/data/accessibility_signal.bw -o tests/test_res/tiling/ --allele-df-key allele_counts_spacer_0_19_A.G_translated_prop0.1_0.3 --fit-negctrl --negctrl-col strand --negctrl-col-value neg --control-guide-tag neg --repguide-mask None --n-iter 10" +def test_run_tiling_negctrl_allelekey(): + cmd = "bean-run sorting tiling tests/data/tiling_mini_screen_annotated.h5ad --scale-by-acc --acc-bw-path tests/data/accessibility_signal.bw -o tests/test_res/tiling/ --fit-negctrl --negctrl-col strand --negctrl-col-value neg --control-guide-tag neg --repguide-mask None --n-iter 10" try: subprocess.check_output( cmd,