Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

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

Open
Tomer9w opened this issue Oct 18, 2021 · 4 comments
Open

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

Tomer9w opened this issue Oct 18, 2021 · 4 comments

Comments

@Tomer9w
Copy link

Tomer9w commented Oct 18, 2021

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
Copy link
Owner

sqjin commented Oct 18, 2021

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

@Tomer9w
Copy link
Author

Tomer9w commented Oct 19, 2021

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

A snip from the relevant input table:
image

Thanks

@chen-zhan
Copy link

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
Copy link
Owner

sqjin commented Dec 12, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants