diff --git a/bean/framework/ReporterScreen.py b/bean/framework/ReporterScreen.py index fff5a09..f8a4629 100755 --- a/bean/framework/ReporterScreen.py +++ b/bean/framework/ReporterScreen.py @@ -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, ): """ @@ -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)