# HG changeset patch # User ebi-gxa # Date 1729869134 0 # Node ID 3c18dda2ea3f39eb13200b7a87f28b60edf87ab2 # Parent 617e5076721515cdbfbfbc32af8c3a52e75cc007 planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit f6c6b8e014c99101232dc75aa972a12fc640a4de diff -r 617e50767215 -r 3c18dda2ea3f decoupler_pseudobulk.py --- a/decoupler_pseudobulk.py Wed Oct 02 08:27:01 2024 +0000 +++ b/decoupler_pseudobulk.py Fri Oct 25 15:12:14 2024 +0000 @@ -503,6 +503,14 @@ for condition in conditions: # remove any starting or trailing whitespaces from condition condition = condition.strip() + if condition not in adata.obs[obs_field].unique(): + raise ValueError( + f"Condition '{condition}' from contrast {contrast}" + f" is not present in the " + f"obs_field '{obs_field}' from the AnnData object." + f"Possible values are: " + f"{', '.join(adata.obs[obs_field].unique())}." + ) # check the percentage of cells that express each gene # Filter the AnnData object based on the obs_field value adata_filtered = adata[adata.obs[obs_field] == condition]