SCA-IRCM / SingleCellSignalR

R package for Bioconductor submission
29 stars 12 forks source link

Error in `.rowNamesDF<-`(x, value = value) #4

Closed hemadelon closed 3 years ago

hemadelon commented 3 years ago

Thank you for this awesome package!

I'm performing analysis on a Seurat object, as you've described in the supplementary information. This is the code I'm using:

library(SingleCellSignalR)
cluster = as.numeric(Idents(myObject))
data = data.frame(myObject[['RNA']]@data)
signal = cell_signaling(data=data, genes=row.names(myObject), cluster=cluster)

I get the error: Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length

I'm not sure of the reason for this error. Hoping someone can help me out!

SCA-IRCM commented 3 years ago

Hi, The code you typed should work. Make sure length(row.names(myObject))==nrow(data) and length(cluster)==ncol(data). You can also check thattypeof(genes)=="character". If every test above give TRUE send me a message on this issue.

Thanks for using SingleCellSignalR!

SCA

hemadelon commented 3 years ago

I put

DefaultAssay(myObject) <- "RNA"

before the selecting of data step and it's actually working now! Thank you!