From 6a47854a8e34b719e17929aab9abc87ccfce5f8d Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 17 Sep 2024 14:32:25 -0700 Subject: [PATCH] Add in condition column check --- screenpro/phenoscore/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/screenpro/phenoscore/__init__.py b/screenpro/phenoscore/__init__.py index a9ae7bc..f60427a 100644 --- a/screenpro/phenoscore/__init__.py +++ b/screenpro/phenoscore/__init__.py @@ -56,6 +56,9 @@ def runPhenoScore(adata, cond_ref, cond_test, score_level, var_names='target', t """ adat = adata.copy() + if 'condition' not in adat.obs.columns: + raise ValueError("The AnnData object must have a 'condition' column in its obs.") + # format result name result_name = f'{cond_test}_vs_{cond_ref}' print(f'\t{cond_test} vs {cond_ref}')