Seurat-to-RNA-Velocity icon indicating copy to clipboard operation
Seurat-to-RNA-Velocity copied to clipboard

ValueError: Value passed for key 'X_umap' is of incorrect shape. Values of obsm must match dimensions (0,) of parent.

Open Kalpi-ds opened this issue 10 months ago • 0 comments

Hi @basilkhuder Thank you for the tutorial. I am trying to get RNA velocity for two samples (I have 30 samples, I am using only 2 for testing) Following is my code. NDN = C19_P1_NDN.concatenate(C19_P2_NDN) #concatenate the two filtered loom files in an annData object NDN.obs.index NDN_index = pd.DataFrame(NDN.obs.index) NDN_index = NDN_index.rename(columns = {0:'Cell_ID'}) #change the column name from 0 to Cell_ID) umap_cord.insert(0, 'Cell_ID', cellID_obs ['x']) #adding Cell_ID column into umap coordinates csv file umap_ordered = NDN_index.merge(umap_cord, on = "Cell_ID") #merge based on Cell_ID umap_ordered = umap_ordered.iloc[:,1:] NDN.obsm['X_umap'] = umap_ordered.values

ValueError: Value passed for key 'X_umap' is of incorrect shape. Values of obsm must match dimensions (0,) of parent. Value had shape (0, 2) while it should have had (14872,).

I think the error is at merge step because. I am merging the data frame NDN_index with umap_cord based on Cell_ID but not the actual annData object NDN. It is not clear for me what to do at this point in tutorial. I really appreciate your help here.

Kalpi-ds avatar Apr 22 '24 23:04 Kalpi-ds