sqjin / CellChat

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

error with identifyOverExpressedGenes(cellchat) #734

Open sanskritidey opened 7 months ago

sanskritidey commented 7 months ago

options(stringsAsFactors = FALSE)

Set the full human ligand-receptor interaction database

CellChatDB.use <- CellChatDB.human

Using a subset of CellChatDB for cell-cell communication analysis

CellChatDB.use <- subsetDB(CellChatDB.human, search = "Secreted Signaling")

Add the Secreted Signaling database in the CellChat object

cellchat@DB <- CellChatDB.use

3.Subset and pre-processing the expression data

subset the expression data to use less RAM

cellchat <- subsetData(cellchat)

Pre-processing the expression data

cellchat <- identifyOverExpressedGenes(cellchat) Error in (function (cond) : error in evaluating the argument 'x' in selecting a method for function 'rowSums': subscript out of bounds cellchat <- identifyOverExpressedInteractions(cellchat) |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s

Optional: project gene expression data onto protein-protein interaction (PPI)

str(cellchat) Formal class 'CellChat' [package "CellChat"] with 15 slots ..@ data.raw : num[0 , 0 ] ..@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. ..@ i : int(0) .. .. ..@ p : int 0 .. .. ..@ Dim : int [1:2] 30606 0 .. .. ..@ Dimnames:List of 2 .. .. .. ..$ : chr [1:30606] "RP11-34P13.7" "RP11-34P13.8" "FO538757.2" "AP006222.2" ... .. .. .. ..$ : NULL .. .. ..@ x : num(0) .. .. ..@ factors : list() ..@ data.signaling:Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. ..@ i : int(0) .. .. ..@ p : int 0 .. .. ..@ Dim : int [1:2] 689 0 .. .. ..@ Dimnames:List of 2 .. .. .. ..$ : chr [1:689] "TNFRSF18" "TNFRSF4" "TNFRSF14" "TNFRSF25" ... .. .. .. ..$ : NULL .. .. ..@ x : num(0) .. .. ..@ factors : list() ..@ data.scale : num[0 , 0 ] ..@ data.project : num[0 , 0 ] ..@ images : list() ..@ net : list() ..@ netP : list() ..@ meta :'data.frame': 0 obs. of 1 variable: .. ..$ labels: Factor w/ 8 levels "T cells","Tumor cells",..: ..@ idents :Formal class 'factor' [package "methods"] with 3 slots .. .. ..@ .Data : int(0) .. .. ..@ levels : chr(0) .. .. ..@ .S3Class: chr "factor" ..@ DB :List of 4 .. ..$ interaction:'data.frame': 1199 obs. of 11 variables: .. .. ..$ interaction_name : chr [1:1199] "TGFB1_TGFBR1_TGFBR2" "TGFB2_TGFBR1_TGFBR2" "TGFB3_TGFBR1_TGFBR2" "TGFB1_ACVR1B_TGFBR2" ... .. .. ..$ pathway_name : chr [1:1199] "TGFb" "TGFb" "TGFb" "TGFb" ... .. .. ..$ ligand : chr [1:1199] "TGFB1" "TGFB2" "TGFB3" "TGFB1" ... .. .. ..$ receptor : chr [1:1199] "TGFbR1_R2" "TGFbR1_R2" "TGFbR1_R2" "ACVR1B_TGFbR2" ... .. .. ..$ agonist : chr [1:1199] "TGFb agonist" "TGFb agonist" "TGFb agonist" "TGFb agonist" ... .. .. ..$ antagonist : chr [1:1199] "TGFb antagonist" "TGFb antagonist" "TGFb antagonist" "TGFb antagonist" ... .. .. ..$ co_A_receptor : chr [1:1199] "" "" "" "" ... .. .. ..$ co_I_receptor : chr [1:1199] "TGFb inhibition receptor" "TGFb inhibition receptor" "TGFb inhibition receptor" "TGFb inhibition receptor" ... .. .. ..$ evidence : chr [1:1199] "KEGG: hsa04350" "KEGG: hsa04350" "KEGG: hsa04350" "PMID: 27449815" ... .. .. ..$ annotation : chr [1:1199] "Secreted Signaling" "Secreted Signaling" "Secreted Signaling" "Secreted Signaling" ... .. .. ..$ interaction_name_2: chr [1:1199] "TGFB1 - (TGFBR1+TGFBR2)" "TGFB2 - (TGFBR1+TGFBR2)" "TGFB3 - (TGFBR1+TGFBR2)" "TGFB1 - (ACVR1B+TGFBR2)" ... .. ..$ complex :'data.frame': 157 obs. of 4 variables: .. .. ..$ subunit_1: chr [1:157] "INHBA" "INHA" "INHA" "IL12A" ... .. .. ..$ subunit_2: chr [1:157] "INHBB" "INHBA" "INHBB" "IL12B" ... .. .. ..$ subunit_3: chr [1:157] "" "" "" "" ... .. .. ..$ subunit_4: chr [1:157] "" "" "" "" ... .. ..$ cofactor :'data.frame': 31 obs. of 16 variables: .. .. ..$ cofactor1 : chr [1:31] "FST" "BAMBI" "TIE1" "PTPRB" ... .. .. ..$ cofactor2 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor3 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor4 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor5 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor6 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor7 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor8 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor9 : chr [1:31] "" "" "" "" ... .. .. ..$ cofactor10: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor11: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor12: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor13: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor14: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor15: chr [1:31] "" "" "" "" ... .. .. ..$ cofactor16: chr [1:31] "" "" "" "" ... .. ..$ geneInfo :'data.frame': 41787 obs. of 6 variables: .. .. ..$ Symbol : chr [1:41787] "A1BG" "A1BG-AS1" "A1CF" "A2M" ... .. .. ..$ Name : chr [1:41787] "alpha-1-B glycoprotein" "A1BG antisense RNA 1" "APOBEC1 complementation factor" "alpha-2-macroglobulin" ... .. .. ..$ EntrezGene.ID : int [1:41787] 1 503538 29974 2 144571 144568 NA NA 3 127550 ... .. .. ..$ Ensembl.Gene.ID: chr [1:41787] "ENSG00000121410" "ENSG00000268895" "ENSG00000148584" "ENSG00000175899" ... .. .. ..$ MGI.ID : chr [1:41787] "MGI:2152878" "" "MGI:1917115" "MGI:2449119" ... .. .. ..$ Gene.group.name: chr [1:41787] "Immunoglobulin like domain containing" "Antisense RNAs" "RNA binding motif containing" "C3 and PZP like, alpha-2-macroglobulin domain containing" ... ..@ LR :List of 1 .. ..$ LRsig:'data.frame': 0 obs. of 11 variables: .. .. ..$ interaction_name : chr(0) .. .. ..$ pathway_name : chr(0) .. .. ..$ ligand : chr(0) .. .. ..$ receptor : chr(0) .. .. ..$ agonist : chr(0) .. .. ..$ antagonist : chr(0) .. .. ..$ co_A_receptor : chr(0) .. .. ..$ co_I_receptor : chr(0) .. .. ..$ evidence : chr(0) .. .. ..$ annotation : chr(0) .. .. ..$ interaction_name_2: chr(0) ..@ var.features : list() ..@ dr : list() ..@ options :List of 2 .. ..$ mode : chr "single" .. ..$ datatype: chr "RNA" cellchat <- projectData(cellchat, PPI.human) Error in solve.default(AA, BB) : no right-hand side in 'b'

sqjin commented 7 months ago

@sanskritidey Can you show your object@data.signaling and unique(object@idents)?