Closed joelmarkus closed 2 years ago
Just run filterdata with relaxed parameters (mintotal=1, minexp=0). This way you don't filter out any cells.
Hey, thanks for the response but when I use these parameters (or similar low values), I get the following error;
Error in if (coef(fit)[3] >= 0 | mm >= mthr) { : missing value where TRUE/FALSE needed
How do I solve this?
Hard to say. Do you have sample code and data to reproduce this?
I wish to calculate the entropy for the given set of genes (attached).
#read countmatrix here
entropy_cell <- as.data.frame(compentropy(Ltree(filterdata(SCseq(countmatrix), mintotal = 1, minexpr = 0)))@entropy)
filterdata gives me the "missing values" error.
Again, thanks for your help.
The max colSum in your data is 27. Are these scRNA-seq data? This would be quite unusual. The fit of the background model doesn't work, because there are only few genes wit few non-zero counts.
If you'd just like to compute the entropy, you can use this code:
probs <- t(t(countmatrix)/colSums(countmatrix)) entropy <- -apply(probs * log(probs + 1e-10)/log(nrow(countmatrix)), 2, sum)
It is scRNA-seq data-- I subsetted it to calculate the entropy of only a set of genes.
I shall only use the formula instead. Thank you so much.
I can't run Ltree if I don't run the function filterdata. Is there any way to sort this issue? All I wish to do is calculate the cell entropy. Thanks.