JiaLiVUMC / scMRMA

13 stars 4 forks source link

all entries of 'x' must be nonnegative and finite #4

Open nbahti opened 1 year ago

nbahti commented 1 year ago

Hi,

I am getting this "all entries of 'x' must be nonnegative and finite" error when running the tool using preprocessed seurat object containing the cluster information already. I am setting selfclusters = Idents(mySeuratObj), normalizedData = T when running, but no success so far. Detailed error message is the following:

Pre-defined cell type database panglaodb will be used. Multi Resolution Annotation Started. Level 1 annotation started. Error in fisher.test(cont.table, alternative = "greater") : all entries of 'x' must be nonnegative and finite

Another confusion I have is that when checked quickly, the code of scMRMA shows that it picks up "count" slot data from seurat object's active assay (e.g. RNA) even though normalizedData = T is set (which I assumed should make "data" normalized slot to be used). Can you also comment on this too?

Thank you.

JiaLiVUMC commented 1 year ago

Thanks for your interest.

When the input of scMRMA is seurat object, it will use the code GetAssayData(input,slot="counts") to extract count matrix and then do normalization. If the error is 'all entries of 'x' must be nonnegative and finite', it is possible that it is not 'real count' matrix in your seurat object. There are nonnegative values in the input. You can try set defaultAssay as 'RNA' if it is integrated object or check the count matrix by yourself.

Actually the normalization method in scMRMA is the same as the default seurat method 'LogNormalize'. If your input is seurat object, there is no need to change the normalizedData parameter. But if user provided normalized data using other methed, it could be a seurat object with normalized data in 'count' slot.

Hope it works.