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

Error in obj2 - obj1 : non-conformable arrays #162

Open
smk5g5 opened this issue Jun 6, 2024 · 2 comments
Open

Error in obj2 - obj1 : non-conformable arrays #162

smk5g5 opened this issue Jun 6, 2024 · 2 comments

Comments

@smk5g5
Copy link

smk5g5 commented Jun 6, 2024

Hi,

I keep getting Error in obj2 - obj1 : non-conformable arrays this error when comparing 2 objects. I was wondering why is that and if you can let me know the cause of this error. Thank you!

@sqjin
Copy link
Member

sqjin commented Jun 9, 2024

@smk5g5 Sorry, I have no idea on this. The best way is to run the source codes line by line and figure out the reason.

@micosacak
Copy link

micosacak commented Jun 11, 2024

That means the 2 objects have different cell clusters or there are differences in their idents.

in that case you must first create a common idents and lift the sample that is missing it.

example:

group.new = unique(union(levels(cellchat.E14@idents), levels(cellchat.E13@idents)))
cellchat.E14@idents<- liftCellChat(cellchat.E14@idents, group.new)
object.list = list(cellchat.E14, cellchat.E13)
names(object.list) = c("cellchat.E14","cellchat.E13")
cellchat <- mergeCellChat(object.list, add.names = names(object.list), cell.prefix = TRUE)

in case cellchat.E13@idents has missing cluster then you must run

group.new = unique(union(levels(cellchat.E14@idents), levels(cellchat.E13@idents)))
cellchat.E14@idents<- liftCellChat(cellchat.E14@idents, group.new)
cellchat.E13@idents<- liftCellChat(cellchat.E13@idents, group.new)
object.list = list(cellchat.E14, cellchat.E13)
names(object.list) = c("cellchat.E14","cellchat.E13")
cellchat <- mergeCellChat(object.list, add.names = names(object.list), cell.prefix = TRUE)

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

3 participants