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 cell chat when trying to identifyoverexpressedgenes #3

Open
teganmct opened this issue Apr 3, 2024 · 0 comments
Open

error in cell chat when trying to identifyoverexpressedgenes #3

teganmct opened this issue Apr 3, 2024 · 0 comments

Comments

@teganmct
Copy link

teganmct commented Apr 3, 2024

Dear Professor Jin,

An amazing package! I have a query regarding cellchat. i am coming across an error when I try to run the function identifyoverexpressedgenes in cellchat and I would be hugely grateful for your help trying to resolve this. > cellchatPSA <- identifyOverExpressedGenes(cellchatPSA)
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
Error in (function (cl, name, valueClass) :
assignment of an object of class "character" is not valid for @'var.features' in an object of class "CellChat"; is(value, "list") is not TRUE
3.
stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, "%s") is not TRUE",
dQuote(valueClass), sQuote(name), dQuote(cl), slotClass),
domain = NA)
2.
(function (cl, name, valueClass)
{
ClassDef <- getClass(cl)
slotClass <- ClassDef@slots[[name]] ...
1.
identifyOverExpressedGenes(cellchatPSA)

below is my code:#part 1 create a cell chta object from a seurat object ####
Idents(noabseq) <- "Sample_Name"
seurat_objectHC <- subset(noabseq, idents = "HC")
seurat_objectPSA <- subset(noabseq, idents = "PSA")

Idents(seurat_objectHC) <- "celltypes"
data.inputHC <- GetAssayData(JoinLayers(seurat_objectHC, assay ="RNA", slot = "data"))
labelsHC <- Idents(seurat_objectHC)
metaHC <- data.frame(group = labelsHC, row.names = names(labelsHC))
cellchatHC <- createCellChat(object = data.inputHC, meta = metaHC, group.by = "group")

Idents(seurat_objectPSA) <- "celltypes"
data.inputPSA <- GetAssayData(JoinLayers(seurat_objectPSA, assay ="RNA", slot = "data"))
labelsPSA <- Idents(seurat_objectPSA)
metaPSA <- data.frame(group = labelsPSA, row.names = names(labelsPSA))
cellchatPSA <- createCellChat(object = data.inputPSA, meta = metaPSA, group.by = "group")

#part 2 cell chat databases cellchatdb ####
CellChatDB <- CellChatDB.human
showDatabaseCategory(CellChatDB.human)
#show structure of databases
dplyr::glimpse(CellChatDB$interaction)

#set all cellchat db for cell-cell communications
CellChatDB.use <- CellChatDB.human

#set a subset of cellchat db for cell-cell communication analysis if required
#CellChatDB.use <- subsetDB(CellChatDB.human, search = "secreted Signaling")
#CellChatDB.use <- subsetDB(CellChatDB.human, search = "ECM-Receptor")
#CellChatDB.use <- subsetDB(CellChatDB.human, search = "Cell-Cell Contact")

tutorial showing how to download complex, cofactor, gene info and interaction a

not shown here on youtube

#PART 3 inference of cell-cell communication network analysis
library(CellChat)
library(patchwork)
library(circlize)
options(stringsAsFactors = FALSE)

cellchatHC@DB <- CellChatDB.use
cellchatPSA@DB <- CellChatDB.use

#set the full human ligand-receptor interaction database
cellchatHC<-subsetData(cellchatHC)
cellchatPSA<-subsetData(cellchatPSA)

#not working coming up with an error
cellchatHC <- identifyOverExpressedGenes(cellchatHC)
cellchatHC <- identifyOverExpressedInteractions(cellchatHC)

cellchatPSA <- identifyOverExpressedGenes(cellchatPSA)
cellchatPSA <- identifyOverExpressedInteractions(cellchatPSA)

Hopefully your expert insight will be able to help solve this. Thankyou in advance.

Tegan

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

1 participant