Skip to content

error in cell chat when trying to identifyoverexpressedgenes #3

@teganmct

Description

@teganmct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions