Closed pabodha closed 5 years ago
Hi @pabodha,
Could you send me a small reproducible example to help me debug? Also, are you able to run compareARI
with a subset of the cluster sizes, e.g. compareARI(runLogit, K = c(3,4,5))
?
Based on the output, it looks to me like the ICL selected 3 clusters, but after using assigning observations to clusters using the maximum conditional probability for that model, only 2 clusters have observations assigned to them. To double check that, could you also send the output for table(clusters(runLogit))
?
Thanks Andrea
Hello @andreamrau,
Really appreciate your help.
When I restarted the R session, compareARI() with and without K parameter works fine for my original data set. But the dummy data set I have attached here still produce the same set of errors.
compareARI(runLogit, K=3:5)
Error in matrix(0, nrow = ncol(full_labels), ncol = ncol(full_labels)) :
non-numeric matrix extent
compareARI(runLogit)
Error in corrplot(ARI, is.corr = FALSE, method = "color", type = "upper", :
cl.lim[1] == 0 && cl.lim[2] == 0 is not TRUE
Here is the output from my original dataset for table(clusters())
table(clusters(runL))
Error in names(labels) <- rownames(pp) :
'names' attribute [633] must be the same length as the vector [0]
with Arcsin transformation the output looks like this
table(clusters(runA))
1 2 3
184 220 229
Thank you
Pabodha
Hello Andrea,
I also get an error while creating cluster profile line plots. Boxplots for the profiles generate fine. I checked whether the graphical device has some issues in my end. But seems its working fine.
plot(runA, graphs="profiles")
$profiles
Warning message:
In grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow) :
semi-transparency is not supported on this device: reported only once per page
Really appreciate your help.
Pabodha
Hello Pabodha,
Thanks for your patience -- I finally got around to fixing this. The issue was related to the fact that several of the Gaussian mixture models that were fit for the logit-transformed data in your dummy data had singular covariance matrices, which led to conditional probabilities of cluster membership equal to NaN
for all genes (and all of the downstream problems you saw). The solution in a situation like this is to try a more restrictive form of covariance matrix for the Gaussian mixture model. To make this clearer, an informative error message is now printed:
runLogit <- coseq(dummyCounts, K=2:30, model="Normal", transformation="logit")
****************************************
coseq analysis: Normal approach & logit transformation
K = 2 to 30
Use set.seed() prior to running coseq for reproducible results.
****************************************
Running K = 2 ...
[...]
Running K = 30 ...
Error in NormMixClus(y_profiles = tcounts$tcounts, K = K, subset = NULL, :
The selected model, which is of the form Gaussian_pk_Lk_Ck, resulted in estimation errors.
This is likely due to singular covariance matrices when this form of Gaussian mixture is used.
Try rerunning coseq with either a spherical (pk_Lk_Bk) or diagonal (pk_Lk_I)
covariance matrix form instead:
coseq(..., GaussianModel = "Gaussian_pk_Lk_Bk")
coseq(..., GaussianModel = "Gaussian_pk_Lk_I")
Following up on that, when the following code is run, there is no error:
runLogit <- coseq(dummyCounts, K=2:30, model="Normal", transformation="logit",
GaussianModel = "Gaussian_pk_Lk_Bk")
And you should be able to use all of the helper functions as usual:
summary(runLogit)
compareARI(runLogit)
clusters(runLogit)
Finally, I also fixed the issue with the plot
function for the coseqResults
class, it should be working now.
All of these changes have been made to coseq
version 1.7.2. They should be live as part of Bioconductor Devel in the next couple of days, but in the meantime you can install it using the devtools
package:
library(devtools)
install_github("andreamrau/coseq")
Thanks very much for the bug reports. Don't hesitate to get in touch if you find other issues!
Hello,
I am trying to create compareARI() plot for my coseq result object using logit transformation. I used following command to create the object.
runLogit <- coseq(counts, K=2:30, model="Normal", transformation="logit")
But the compareARI() passes following error.
Error in corrplot(ARI, is.corr = FALSE, method = "color", type = "upper", : cl.lim[1] == 0 && cl.lim[2] == 0 is not TRUE
The summary of the object looks like this
CompareARI() works fine with arcsin transformation.
Could you please help me with solving this issue
Thanks
Pabodha