# HG changeset patch # User ebi-gxa # Date 1729869139 0 # Node ID 1d140c4a5875be058e5925e0ea816f0b8acbbeb8 # Parent 87f1eaa410cc164560c6adc7466351cd4308e75b planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit f6c6b8e014c99101232dc75aa972a12fc640a4de diff -r 87f1eaa410cc -r 1d140c4a5875 decoupler_pseudobulk.py --- a/decoupler_pseudobulk.py Wed Oct 02 08:27:06 2024 +0000 +++ b/decoupler_pseudobulk.py Fri Oct 25 15:12:19 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]