sqjin / CellChat

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

Error in UseMethod("select") : #312

Open rachel662 opened 2 years ago

rachel662 commented 2 years ago

Hi there, sorry to ask another question but when trying to do the Preprocessing the expression data for cell-cell communication analysis step in the tutorial with my data I get this error

Error in UseMethod("select") : no applicable method for 'select' applied to an object of class "NULL"

would anyone be able to help me with solving this error? Thanks so much in advance

Cheers Rachel

sqjin commented 2 years ago

@rachel662 Have you solved this error? If not, can you show me your input data and cell labels as well as codes?

sciencepeak commented 2 years ago

I have the same issue. My R version is 4.0.5. Now I figured it out. The order of the statements are very important.

my code:

CellChatDB <- CellChatDB.human
# showDatabaseCategory(CellChatDB)
CellChatDB.use <- CellChatDB

cellchat <- single_cellchat_object_list[[1]]
cellchat@DB <- CellChatDB.use

#Only take the genes in the database
cellchat <- subsetData(cellchat)
identifyOverExpressedGenes(cellchat)

my output:

  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s  
An object of class CellChat created from a single dataset 
 50513 genes.
 2725 cells.
ZebinWen commented 2 years ago

I have met the same issue. After I set the used database in the object by running "cellchat@DB <- CellChatDB.use", it worked.