Question: sc3_prepare function error
gravatar for Assa Yeroslaviz
2.7 years ago by
Assa Yeroslaviz1.4k
Munich, Germany
Assa Yeroslaviz1.4k wrote:


I am trying to follow the workflow from the hemberg lab about single-cell analysis. There is though a conflict in the versions.

I try to run the SC3 package. There is a function here called sc3_prepare, but under my R environment it doesn't seem to exist.

I keep getting the error message (running the script in the file 17-clustering.Rmd) 

Quitting from lines 94-95 (17-clustering.Rmd) 
Error in eval(expr, envir, enclos) : 
  could not find function "sc3_prepare"
Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval
In addition: Warning messages:
1: package 'mclust' was built under R version 3.3.2 
2: package 'ggplot2' was built under R version 3.3.2 
Execution halted

looking at my sc3 package i can't find this function at all. 

is there something i am doing wrong here?



> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] SC3_1.1.4            scater_1.0.4         ggplot2_2.2.1        Biobase_2.32.0       BiocGenerics_0.18.0 
[6] BiocInstaller_1.22.3

loaded via a namespace (and not attached):
 [1] bitops_1.0-6         matrixStats_0.51.0   doParallel_1.0.10    RColorBrewer_1.1-2   rprojroot_1.2       
 [6] tools_3.3.0          backports_1.0.5      doRNG_1.6            R6_2.2.0             KernSmooth_2.23-15  
[11] DBI_0.5-1            lazyeval_0.2.0       colorspace_1.3-2     gridExtra_2.2.1      pkgmaker_0.22       
[16] bookdown_0.3         caTools_1.17.1       scales_0.4.1         DEoptimR_1.0-8       mvtnorm_1.0-5       
[21] robustbase_0.92-7    stringr_1.1.0        digest_0.6.12        rmarkdown_1.3        wdman_0.2.2         
[26] rrcov_1.4-3          htmltools_0.3.5      WriteXLS_4.0.0       limma_3.28.21        RSQLite_1.1-2       
[31] shiny_1.0.0          gtools_3.5.0         dplyr_0.5.0          RCurl_1.95-4.8       magrittr_1.5        
[36] Rcpp_0.12.9          munsell_0.4.3        S4Vectors_0.10.3     viridis_0.3.4        stringi_1.1.2       
[41] yaml_2.1.14          edgeR_3.14.0         zlibbioc_1.18.0      rhdf5_2.16.0         gplots_3.0.1        
[46] Rtsne_0.11           plyr_1.8.4           grid_3.3.0           gdata_2.17.0         shinydashboard_0.5.3
[51] semver_0.2.0         lattice_0.20-34      knitr_1.15.1         rjson_0.2.15         rngtools_1.2.4      
[56] reshape2_1.4.2       codetools_0.2-15     biomaRt_2.28.0       stats4_3.3.0         XML_3.98-1.5        
[61] evaluate_0.10        data.table_1.10.4    httpuv_1.3.3         foreach_1.4.3        gtable_0.2.0        
[66] openssl_0.9.6        assertthat_0.1       binman_0.1.0         mime_0.5             xtable_1.8-2        
[71] e1071_1.6-8          rsconnect_0.7        class_7.3-14         pcaPP_1.9-61         tibble_1.2          
[76] pheatmap_1.0.8       iterators_1.0.8      RSelenium_1.7.1      AnnotationDbi_1.34.4 registry_0.3        
[81] memoise_1.0.0        IRanges_2.6.1        tximport_1.0.3       cluster_2.0.5        ROCR_1.0-7          
ADD COMMENTlink modified 2.7 years ago by Vladimir Kiselev150 • written 2.7 years ago by Assa Yeroslaviz1.4k

I have updated the SC3 package to 1.3.14.

Now I get a different error message, which is even before the sc3_prepare error.

when running this command 

patient.sceset <- sc3(patient.sceset, ks = 2:5, k_estimator = TRUE, biology = TRUE)

I get the following error 

Setting SC3 parameters...
Error in (function (cl, name, valueClass)  :
  ‘sc3’ is not a slot in class “SCESet”

​What is now wrong?

thanks  again



but at least I can now see the sc3_prepare function, so it probably exists, when I get there.

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Assa Yeroslaviz1.4k
Have you updated the scater package as well? You need the latest scater version (1.2.0) for SC3 to work.
ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Vladimir Kiselev150

thanks I have updated R to 3.3.2 and bio to 3.4. now it works. I do get a different error message, but this seems to be something else. 

when running the jackStraw function it throws back an error - 

> d <- jackStraw(
+     d,
+     num.replicate = 200,
+     do.print = FALSE,
+     num.pc = 25
+ )
Error in JackStraw(...) : Too few variable genes
> d
An object of class seurat in project NBT
 4260 genes across 51 samples.

I do need to take a closer look at Seurat though.

ADD REPLYlink written 2.7 years ago by Assa Yeroslaviz1.4k

Note that in the course we used an old version of Seurat (1.3). Now there is a new one available, where the clustering algorithm is completely different. We will try to update the course with this new version when we run it next time (middle of March 2017).

ADD REPLYlink written 2.7 years ago by Vladimir Kiselev150
Answer: sc3_prepare function error
gravatar for Vladimir Kiselev
2.7 years ago by
Sanger Institute, Cambridge, UK
Vladimir Kiselev150 wrote:


It looks like you have an old version of Bioconductor (both SC3 and scater versions are quite old). Could you please provide an output of this call?


If it offers you to upgrade, please do so and then update all the Bioconductor packages. This should solve your problem.



ADD COMMENTlink written 2.7 years ago by Vladimir Kiselev150
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 398 users visited in the last hour