Skip to content

Commit

Permalink
fix duplicate a0 subset error
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Dec 6, 2023
1 parent 7f7b4ab commit ea7365f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions bean/preprocessing/data_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def __getitem__(self, guide_idx):
ndata.X_masked = ndata.X_masked[:, :, guide_idx]
ndata.X_control = ndata.X_control[:, :, guide_idx]
ndata.repguide_mask = ndata.repguide_mask[:, guide_idx]
ndata.a0 = ndata.a0[guide_idx]
if hasattr(ndata, "a0") and self.a0 is not None:
ndata.a0 = ndata.a0[guide_idx]
return ndata

def transform_data(self, X, n_bins=None):
Expand Down Expand Up @@ -369,8 +370,6 @@ def __getitem__(self, guide_idx):
ndata.allele_counts = ndata.allele_counts[:, :, guide_idx, :]
if hasattr(ndata, "a0_allele"):
ndata.a0_allele = ndata.a0_allele[guide_idx, :]
if hasattr(ndata, "a0") and self.a0 is not None:
ndata.a0 = ndata.a0[guide_idx]
if hasattr(ndata, "pi_a0") and self.pi_a0 is not None:
ndata.pi_a0 = ndata.pi_a0[guide_idx]
if hasattr(ndata, "a0_bcmatch") and self.a0_bcmatch is not None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_run_tiling_with_wo_negctrl_noacc():

@pytest.mark.order(18)
def test_run_tiling_with_wo_negctrl_uniform():
cmd = "bean-run sorting tiling tests/data/tiling_mini_screen_annotated.h5ad -o tests/test_res/tiling/ --uniform-edit --allele-df-key allele_counts_spacer_0_19_A.G_translated_prop0.1_0.3 --control-guide-tag None --repguide-mask None"
cmd = "bean-run sorting tiling tests/data/tiling_mini_screen_annotated.h5ad -o tests/test_res/tiling/ --uniform-edit --allele-df-key allele_counts_spacer_0_19_A.G_translated_prop0.1_0.3 --control-guide-tag None --repguide-mask None"
try:
subprocess.check_output(
cmd,
Expand Down

0 comments on commit ea7365f

Please sign in to comment.