sqjin / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell data
GNU General Public License v3.0
634 stars 145 forks source link

Error in data.use[RsubunitsV, ] : subscript out of bounds error #307

Open Tomer9w opened 3 years ago

Tomer9w commented 3 years ago

Hi! Thanks for this awesome package I've seen this question asked before, but unfortunately, neither of recommendations helped me overcome this error.

I used RNA-seq normalzied counts as input for cellchat object. Here is the code I used:

`cellchat <- createCellChat(object = as.matrix(input.DLN), meta = coldata, group.by = "Type") cellchat <- setIdent(cellchat, ident.use = "Type") groupSize <- as.numeric(table(cellchat@idents)) CellChatDB <- CellChatDB.mouse # use CellChatDB.mouse if running on mouse data showDatabaseCategory(CellChatDB)

cellchat@DB <- CellChatDB cellchat <- subsetData(cellchat) # This step is necessary even if using the whole database future::plan("multisession", workers = 4) # do parallel

cellchat <- identifyOverExpressedGenes(cellchat) cellchat <- identifyOverExpressedInteractions(cellchat) cellchat <- projectData(cellchat, PPI.mouse)

cellchat <- computeCommunProb(cellchat, raw.use = TRUE) cellchat <- filterCommunication(cellchat, min.cells = 10) `

Here is a snip of the input.DLN data frame image

coldata Type CD8.DLN.1 CD8.DLN CD8.DLN.2 CD8.DLN CD8.DLN.3 CD8.DLN DCs.DLN.1 CD8.TUMOR DCs.DLN.2 CD8.TUMOR DCs.DLN.3 CD8.TUMOR

Hope you can help with this Thanks!

sqjin commented 3 years ago

@Tomer9w You should use the normalized data (i.e. log-transformed data) instead of the raw count data

Tomer9w commented 3 years ago

I switched to the normalized data, but still same error message.

A snip from the relevant input table: image

Thanks

chen-zhan commented 1 year ago

Hi, I meet the same problem. This error have occur in my a small portion of the sample. And it run successful in other with the same code. How can I find more detail error message to fix the error.

sqjin commented 1 year ago

@chen-zhan The best way is to run the source codes and see when this error happens.