Skip to content

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

@Kalpi-ds

Description

@Kalpi-ds

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions