Closed fhausmann closed 4 years ago
I guess a possible fix could be to replace: https://github.com/theislab/scgen/blob/0ef7030ef593515bfe75be14e07c9efd444ad857/scgen/models/util.py#L313-L316 with:
corrected = all_corrected_data
corrected.X = network.reconstruct(all_corrected_data.X, use_data=True)
corrected.var_names = adata.var_names.tolist()
corrected = corrected[adata.obs_names]
This should preserve the input obs
and their ordering.
thanks @fhausmann it is now fixed https://github.com/theislab/scgen/commit/7758656cebecd102ed96cb60a1f3e5c51c579d5e
Description: When trying to run
batch_removal
metadata (anndata.obs) get shuffled and are not corresponding to the obs_names. It is probably related to/ a consequence of: https://github.com/theislab/scgen/issues/7Version: scgen: '1.1.4'
Code to reproduce:
Thanks in advance for your help.