bioinfo-biols / SEVtras

sEV-containing droplet identification in scRNA-seq data (SEVtras)
GNU Affero General Public License v3.0
20 stars 6 forks source link

Length mismatch error - No matched cell sample in part 2 #29

Open giuliaelgarcia opened 3 weeks ago

giuliaelgarcia commented 3 weeks ago

Hi, has anyone had the length mismatch error in part 2? I have tried changing the OBSsample and OBScelltype and even the size of my adata_cell and I keep getting this error Value error: Length mismatch and say No matched cell sample for sEV deconvolution. My adata_cell dataset is based on the filtered cellranger output wich was QCed, batch corrected and clustering as per normal single cell workflow in scanpy. When I do an intersect of indexes between the two adata_cell and sevtras output from part 1 there is an intersect between the two.

See screenshotScreenshot 2024-11-01 at 17 59 45

What could be causing this and how can I fix it?

Thank you!

RuiqiaoHe commented 3 weeks ago

This may be because that SEVtras cannot find the correct cell sample information in your adata_cell object. By default, SEVtras searchs for the information in adata.obs['batch']. If the key 'batch' doesn't exist in your adata_cell, you can try following code to rename it: import scanpy as sc adata_cell = sc.read_h5ad(directory + 'adata_cell.h5ad') adata_cell.obs['batch'] = adata_cell.obs['orig.ident'] Hope this will fix the problem.

giuliaelgarcia commented 2 weeks ago

OBSsample

Thank you for your reply! That is part of the solution, as its not clear that the batch have to match exactly across the part 1 output and the adata_cell you're providing. So changing the batch, and celltype to match SEVtras part 1 solved the problem. However maybe this should be added to the documentation so its clear to all users?

RuiqiaoHe commented 2 weeks ago

Thanks for your patience and advice. I will add it to the documentation.