Are batch and categorical_covariates the same?

This seems like a straightforward thing, but I couldn’t find the answer.
Is batch_key treated the same as categorical_covariates or does it have a special handling?

I.e., is there a difference between calling setup_anndata(..., batch_key="batch", categorical_covariate_keys=["protocol"]) and setup_anndata(..., categorical_covariate_keys=["batch", "protocol"])

I apologize if I missed it somewhere in the docs, and would gladly follow any reference there : )

2 Likes

They are the same as it relates to learning a corrected latent space. The batch_key is uniquely used in the differential_expression methods, as a way to produce DE results that correct for that key. If you’re not using that then it’s the same.

1 Like