I noticed some recent updates to the package and just couldn't wait to try it out. I used some old script I have with spatial data (not too old!) but got the following warning message which seemed new to me:
Warning message:
In createCellChat(object = mat, meta = meta, group.by = "ident", :
The 'meta' data does not have a column named `slices` for spatial transcriptomics data analysis.
We now add this column and all cells are assigned as `slice1`!
And later the whole thing failed when I ran computeCommunProb() because some matrices got fully filled with NaN.
I did some code reading myself and am pretty sure that the bug is located between R/CellChat_class.Rline 254 to line 266. You helped adding the column in meta but forgot to put it back to the object which is finally returned.
I've already figured out the way to make it work though, it would also be nice to add a line or two in the createCellChat() function to help check whether user customized metadata columns are factors or just character vectors. I also tried remaking my metadata with slice name properly set with meta$slices <- "name", but didn't factor it. And later I found in the code that the cluster wise distance is calculated on a per slice base and the for-loop for each slice is based on levels(meta$slices) which is obviously NULL for me and that's the story.
I noticed some recent updates to the package and just couldn't wait to try it out. I used some old script I have with spatial data (not too old!) but got the following warning message which seemed new to me:
And later the whole thing failed when I ran
computeCommunProb()
because some matrices got fully filled withNaN
.I did some code reading myself and am pretty sure that the bug is located between
R/CellChat_class.R
line 254 to line 266. You helped adding the column inmeta
but forgot to put it back to the object which is finally returned.I've already figured out the way to make it work though, it would also be nice to add a line or two in the
createCellChat()
function to help check whether user customized metadata columns are factors or just character vectors. I also tried remaking my metadata with slice name properly set withmeta$slices <- "name"
, but didn't factor it. And later I found in the code that the cluster wise distance is calculated on a per slice base and the for-loop for each slice is based onlevels(meta$slices)
which is obviouslyNULL
for me and that's the story.Thanks for the great tool!