Hello everyone,
Upon inputting my data using Scanpy and subsequently attempting to utilize scVI for batch effect removal, I encountered the following error:
ValueError: Making .obs["ID"] categorical failed. Expected categories: ['b10' 'b11' 'b12' 'b13' 'b14' 'b15' 'b16' 'b17' 'b18' 'b19' 'b20' 'b21' 'b23' 'b24' 'b25' 'b26' 'b27' 'b28' 'b29' 'b30' 'b31' 'b32' 'b33' 'b34' 'b35' 'b36' 'b37' 'b38' 'b39' 'b40' 'b41' 'b42' 'b43' 'b44' 'b7' 'b8' 'b9']. Received categories: Index(['b10', 'b11', 'b12', 'b13', 'b14', 'b15', 'b16', 'b17', 'b18', 'b19', 'b20', 'b21', 'b23', 'b24', 'b25', 'b26', 'b27', 'b28', 'b29', 'b30', 'b31', 'b32', 'b33', 'b34', 'b35', 'b36', 'b37', 'b38', 'b39', 'b40', 'b41', 'b42', 'b43', 'b44', 'b7', 'b8', 'b9'], dtype='object').
When I run:
scvi.model.SCVI.setup_anndata(adata, layer="counts", batch_key="ID",)
I input data use:
k16.obs['donor_id']='k16'
I am not sure where I made mistakes, and I hope you could offer me some thoughts on solving this problem.