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

Error in computeCommunProb #263

Open
daxianghuibian opened this issue Aug 11, 2021 · 10 comments
Open

Error in computeCommunProb #263

daxianghuibian opened this issue Aug 11, 2021 · 10 comments

Comments

@daxianghuibian
Copy link

cellchat <- computeCommunProb(cellchat,raw.use = F,population.size = T)
Error in computeCommunProb(cellchat, raw.use = F, population.size = T) :
Please check your input data matrix and ensure that you use the normalized data instead of count data!

sorry, I had used normalized data, and other groups can run successful except this group. All groups data were from one seuratobject.

@sqjin
Copy link
Owner

sqjin commented Aug 14, 2021

@daxianghuibian Can you show me your data in object@data.project and object@data.signaling

@zpingfeng
Copy link

str(cellchat@data.signaling)
Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
..@ i : int [1:1197638] 0 23 30 43 47 53 72 77 81 85 ...
..@ p : int [1:2815] 0 329 721 1094 1512 1895 2439 2941 3309 3767 ...
..@ Dim : int [1:2] 3000 2814
..@ Dimnames:List of 2
.. ..$ : chr [1:3000] "Rb1cc1" "Mybl1" "Gsta3" "Gm28836" ...
.. ..$ : chr [1:2814] "AAACCTGAGCGCTCCA-1_1" "AAACCTGAGTATCGAA-1_1" "AAACCTGCAACGCACC-1_1" "AAACCTGCAGCATGAG-1_1" ...
..@ x : num [1:1197638] 1.79 2.3 1.1 1.79 1.1 ...
..@ factors : list()
str(cellchat@data.project)
num [1:3000, 1:2814] 1.79 0 0 0 0 ...

  • attr(*, "dimnames")=List of 2
    ..$ : chr [1:3000] "Rb1cc1" "Mybl1" "Gsta3" "Gm28836" ...
    ..$ : chr [1:2814] "AAACCTGAGCGCTCCA-1_1" "AAACCTGAGTATCGAA-1_1" "AAACCTGCAACGCACC-1_1" "AAACCTGCAGCATGAG-1_1" ...

cellchat <- computeCommunProb(cellchat)
Error in data.use[RsubunitsV, ] : subscript out of bounds

I have checked everything mentioned listed in issue #111, still got similar error message

@sqjin
Copy link
Owner

sqjin commented Aug 21, 2021

@zpingfeng It looks like the genes in the @data.signaling is not the signaling genes. e.g., "Rb1cc1" "Mybl1" "Gsta3" "Gm28836" ... You cannot use the HVGs

@zpingfeng
Copy link

Thanks for your beautiful work!
I can only have results of “Secreted Signalling” from one sample and “Cell-Cell Contact” from another sample. Is this an issue from my data or have I done something incorrectly?

@DRSEI
Copy link

DRSEI commented Dec 12, 2022

Hi,

I am having a bid diffrent problem please see below.

cellchat <- computeCommunProb(cellchat,raw.use = F,population.size = T)
triMean is used for calculating the average gene expression per cell group. 
Error in computeCommunProb(cellchat, raw.use = F, population.size = T) : 
  Please check `unique(object@idents)` and ensure that the factor levels are correct!
         You may need to drop unused levels using 'droplevels' function. e.g.,
         `meta$labels = droplevels(meta$labels, exclude = setdiff(levels(meta$labels),unique(meta$labels)))`
I am not sure why I have <NA> in my dataset. This was appeared right after i run the 
`
cellchat <- computeCommunProb(cellchat,raw.use = F,population.size = T)

`> unique(cellchat@idents)
 [1] Cd4 Treg           B cell             Nk cell            Myeloid           
 [5] CD4 T cell         CD8 T cell         RB_unknown         CD4 naive         
 [9] Macrophage         pDC                Mast cell          Fibroblasts       
[13] Epithelial         4T1 epithelial     <NA>               EMT6 myofibroblast
[17] Neutrophils       
16 Levels: 4T1 epithelial B cell CD4 T cell CD4 naive CD8 T cell Cd4 Treg ... pDC

Then I run this but still having error
meta$Cell_type = droplevels(meta$Cell_type, exclude = setdiff(levels(meta$Cell_type),unique(meta$Cell_type)))

Really appriciate your helps

@sqjin
Copy link
Owner

sqjin commented Dec 12, 2022

@DRSEI When you see in unique(cellchat@idents), you should check and correct your input cell label vector.

@DRSEI
Copy link

DRSEI commented Dec 12, 2022

@sqjin I checked and my cell labell was correct when i load my file Please see below

levels(cellchat@idents) # show factor levels of the cell labels [1] "4T1 epithelial" "B cell" "CD4 T cell" "CD4 naive" [5] "CD8 T cell" "Cd4 Treg" "EMT6 myofibroblast" "Epithelial" [9] "Fibroblasts" "Macrophage" "Mast cell" "Myeloid" [13] "Neutrophils" "Nk cell" "RB_unknown" "pDC"


 unique(meta$Cell_type)
 [1] Cd4 Treg           B cell             Nk cell            Myeloid           
 [5] CD4 T cell         CD8 T cell         RB_unknown         CD4 naive         
 [9] Macrophage         pDC                Mast cell          Fibroblasts       
[13] Epithelial         4T1 epithelial     <NA>               EMT6 myofibroblast
[17] Neutrophils       
16 Levels: 4T1 epithelial B cell CD4 T cell CD4 naive CD8 T cell Cd4 Treg ... pDC

But I still don't get why I am getting errors ?

@DRSEI
Copy link

DRSEI commented Dec 12, 2022

I forget to mention that This dataset converted from the scanpy .
based on this link
https://htmlpreview.github.io/?https://github.com/sqjin/CellChat/blob/master/tutorial/Interface_with_other_single-cell_analysis_toolkits.html

@sqjin
Copy link
Owner

sqjin commented Dec 12, 2022

@DRSEI You should correct your input data. unique(meta$Cell_type) still contains 'NA'.

@DRSEI
Copy link

DRSEI commented Dec 15, 2022

@sqjin I managed to removed "NA" but i have New issues which i posted in here #525

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

4 participants