aet21 / EpiSCORE

Epigenetic cell-type deconvolution from Single-Cell Omic Reference profiles
28 stars 10 forks source link

Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length #12

Open Yuanxiao369 opened 1 year ago

Yuanxiao369 commented 1 year ago

Hello, I get an error when I use the function 'ConstExpRef'. The error is

Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length In addition: Warning message: In data.frame(..., check.names = FALSE) : row names were found from a short variable and have been discarded

It occurs at this step "Now compute marker specificity scores and filter markers".

I prepare the three file this function needs. The first one is exp.m matrix, I used the data matrix of seurat object; and celltype.idx file in 'named num' class; and a chr vector of namesCellT.v.

Below is the running result of this function:

> expref <- ConstExpRef(exp.m = exp.m, celltype.idx = mycell.idx,
                       namesCellT.v = namescell)
[1] "Finding marker genes"
$Astrocyte
[1] 17071
$B_cell
[1] 12450
$Endothelial
[1] 9661
$Fibroblasts
[1] 19259
$Myeloid
[1] 20702
$NK_cell
[1] 16420
$T_cell
[1] 19082
$Tumor
[1] 22852
[1] "Now compute marker specificity scores and filter markers"
Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length
In addition: Warning message:
In data.frame(..., check.names = FALSE) :
  row names were found from a short variable and have been discarded

I don't know why I get this error. Looking forward to your answer. Thanks!

Yuanxiao369 commented 1 year ago

I have just solved this problem. The error occurred because I didn't set the value of markspecTH.v, so that one celltype of my data could not be detected very well. The default threshold of markspecTH.v is too high for my data. And this error doesn't mean the fault of data rownames.