You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
I want to compare to cellchat object using netVisual_diffInteraction, but got this error:
Error in obj2 - obj1 : non-conformable arrays
After check source code, I found the reason is the two object have different length of types in group.by meta.
So I use subsetCellChat to subset object with shared types.
However, also get error below:
Error in i_set_edge_attr(x, attr(value, "name"), index = value, value = attr(value, :
Length of new attribute value must be 1 or x, the number of target edges, not x
So, I decide to fix source code, which solve my problom.
to only keep shared types, which can solve error mentioned in title
Also, R/visualization.R line 1738, I guess, may be the reason cause error above Length of new attribute value must be ....
Before this line, I give the same length as edge.start in advance to avoid errors caused by length mismatch when adding igraph::E (g)$loop.angle
if(sum(edge.start[,2]==edge.start[,1])!=0){
igraph::E(g)$loop.angle= rep(0, nrow(edge.start)) # add this new lineigraph::E(g)$loop.angle[which(edge.start[,2]==edge.start[,1])]<-loop.angle[edge.start[which(edge.start[,2]==edge.start[,1]),1]]
}
I want to compare to cellchat object using netVisual_diffInteraction, but got this error:
After check source code, I found the reason is the two object have different length of types in
group.by
meta.So I use
subsetCellChat
to subset object with shared types.However, also get error below:
So, I decide to fix source code, which solve my problom.
Below R/visualization.R line 1644, add:
to only keep shared types, which can solve error mentioned in title
Also, R/visualization.R line 1738, I guess, may be the reason cause error above
Length of new attribute value must be ...
.Before this line, I give the same length as
edge.start
in advance to avoid errors caused by length mismatch when addingigraph::E (g)$loop.angle
That's works, hurray!
Fixed code: https://github.com/JiahaoWongg/CellChat_fix/blob/main/visualization.R
The text was updated successfully, but these errors were encountered: