Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kalpi-ds opened this issue Apr 22, 2024 · 0 comments

Comments

@Kalpi-ds
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant