Questions Arising from Using Scanpy for Data Input and scVI for Batch Effect Removal
0
0
Entering edit mode
16 months ago
Andy ▴ 120

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.

single scanpy cell scvi • 540 views
ADD COMMENT

Login before adding your answer.

Traffic: 1600 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6