Skip to content

Commit

Permalink
better the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Apr 11, 2024
1 parent beb3895 commit 7ec6a32
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bean/framework/ReporterScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def get_guide_edit_rate(
return_result=False,
count_layer="X_bcmatch",
edit_layer="edits",
condition_col = "condition",
condition_col="condition",
unsorted_condition_label=None,
):
"""
Expand All @@ -507,12 +507,14 @@ def get_guide_edit_rate(
)
if unsorted_condition_label is not None:
bulk_idx = np.where(
self.samples[condition_col].astype(str).map(
lambda s: unsorted_condition_label in s
)
self.samples[condition_col]
.astype(str)
.map(lambda s: unsorted_condition_label in s)
)[0]
if len(bulk_idx) == 0:
raise ValueError(f"{unsorted_condition_label} is not found in ReporterScreen.samples['{condition_col}]. Check your input.")
raise ValueError(
f"'{unsorted_condition_label}' is not found in ReporterScreen.samples['{condition_col}'] that has values {self.samples[condition_col].unique()}. Check your input."
)
else:
bulk_idx = np.arange(0, len(self.samples)).astype(int)

Expand Down

0 comments on commit 7ec6a32

Please sign in to comment.