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

computeCommunProb Inconsistent Slot to createCellChat #131

Open
DarioS opened this issue Apr 15, 2024 · 2 comments
Open

computeCommunProb Inconsistent Slot to createCellChat #131

DarioS opened this issue Apr 15, 2024 · 2 comments

Comments

@DarioS
Copy link

DarioS commented Apr 15, 2024

computeCommunProb fails with aggregate error.

> cellChatData
An object of class CellChat created from a single dataset 
 21473 genes.
 101722 cells. 
CellChat analysis of single cell RNA-seq data! 
> cellChatData <- computeCommunProb(cellChatData)
triMean is used for calculating the average gene expression per cell group. 
Error in aggregate.data.frame(as.data.frame(x), ...) : 
  no rows to aggregate
In addition: Warning message:
In max(data) : no non-missing arguments to max; returning -Inf

The input data has no negative values.

> class(assay(allHuman, "merged"))
  "dgCMatrix"
> sum(assay(allHuman, "merged") < 0)
  0

It looks like it expects to find RNA abundance matrix in a different slot.

if (raw.use) {
        data <- as.matrix(object@data.signaling)
    }
    else {
        data <- object@data.project
    }

> str(cellChatData) # But it is in data slot.
Formal class 'CellChat' [package "CellChat"] with 15 slots
  ..@ data.raw      : num[0 , 0 ] 
  ..@ data          :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
  .. .. ..@ i       : int [1:1366909514] 1 7 8 11 12 13 14 15 16 17 ...
  .. .. ..@ p       : int [1:101723] 0 15202 28539 41479 54546 68718 83648 96258 112230 128208 ...
  .. .. ..@ Dim     : int [1:2] 21473 101722
  .. .. ..@ Dimnames:List of 2
  .. .. .. ..$ : chr [1:21473] "AL627309.1" "AL627309.5" "AP006222.2" "LINC01409" ...
  .. .. .. ..$ : chr [1:101722] "DANFRO_CUL1HNP3_AAACCTGAGGACAGAA-1" "DANFRO_CUL1HNP3_AAACCTGGTGCGAAAC-1" "DANFRO_CUL1HNP3_AAACCTGTCATTCACT-1" "DANFRO_CUL1HNP3_AAACGGGTCGTAGGTT-1" ...
  .. .. ..@ x       : num [1:1366909514] 0.01213 0.07797 0.00399 1.01789 0.01951 ...
  .. .. ..@ factors : list()
  ..@ data.signaling: num[0 , 0 ] 
  ..@ data.scale    : num[0 , 0 ] 
  ..@ data.project  : num[0 , 0 ] 
@sqjin
Copy link
Member

sqjin commented Apr 16, 2024

@DarioS You have to run the subsetData function even if no signaling genes are filtered.

@DarioS
Copy link
Author

DarioS commented Apr 17, 2024

Ah, I see now. Perhaps a more informative error message handling this user mistake would be beneficial to end-users.

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

2 participants