hemberg-lab / SC3

A tool for the unsupervised clustering of cells from single cell RNA-Seq experiments
http://bioconductor.org/packages/SC3
GNU General Public License v3.0
118 stars 55 forks source link

k_estimator output not passed to sc3 wrapper function #67

Closed leonfodoulian closed 6 years ago

leonfodoulian commented 6 years ago

Hi,

This might be a very specific issue related to the SC3::sc3 wrapper function. If I run SC3::sc3_estimate_k on my raw sce object, before running SC3::sc3, I get a given estimated optimal number of clusters. However, when I run SC3::sc3, and re-estimate k, I get a completely different number. This is due to the gene filtering that is performed during the SC3::sc3_prepare step.

Now if I set k_estimator = TRUE, and ks = NULL, so that the optimal number of clusters gets automatically estimated and passed to the downstream SC3::sc3_kmeans sub-function of SC3, I get the following error:

>sce <- SC3::sc3(object = sce, ks = NULL, k_estimator = TRUE)
...
Error in sc3_kmeans(object, ks) : 
  Please provide a range of the number of clusters `ks` to be used by SC3!

It would be nice in the future to make this work (i.e. automatically pass the estimated optimal number of clusters as value for ks, even if ks is set to NULL), as setting a value to ks renders the number estimated by the SC3::sc3_estimate_k sub-function obsolete.

Best, Leon

pati-ni commented 6 years ago

Hi @leonfodoulian , thanks for reporting the issue. It is fixed now. Feel free to install the package via the devtools method directly from github.