Open
Description
Hello,
I am trying to compute the AUC score for a custom gene set, on Xenium spatial transcriptomics, with omicverse 1.6.10
Running single.geneset_aucell with default parameters raises
"Assertion error: an AUC threshold of 1.00000 corresponds to 300 top ranked genes/region in the database. Please increase the rank threshold or decrease the AUC threshold".
Setting a custom AUC_threshold raises Key Error since the function derive_auc_threshold is returning hard-coded quantiles, and does not take as parameter AUC_threshold:
def derive_auc_threshold(ex_mtx: pd.DataFrame) -> pd.DataFrame:
return (
pd.Series(np.count_nonzero(ex_mtx, axis=1)).quantile(
[0.01, 0.05, 0.10, 0.50, 1]
)
/ ex_mtx.shape[1]
)
I think this function should be something like this:
def derive_auc_threshold(ex_mtx: pd.DataFrame, AUC_threshold: float = 0.01) -> pd.DataFrame:
quantiles = [0.01, 0.05, 0.10, 0.50, 1]
if not AUC_threshold in quantiles:
quantiles.append(AUC_threshold)
return pd.Series(np.count_nonzero(ex_mtx, axis=1)).quantile(quantiles)) / ex_mtx.shape[1]
By the way, if you have recommandations to compute AUCell for a custom geneset in Xenium spatial data this would help me !
Metadata
Metadata
Assignees
Labels
No labels