YosefLab / scone

53 stars 12 forks source link

Calling scone with run=TRUE Error #102

Open e-arslan opened 5 years ago

e-arslan commented 5 years ago

Maybe I'm missing some obvious point but whenever I try to run sample code:

 my_scone <- scone(my_scone,
                    scaling=scaling,
                    run=TRUE,
                    eval_kclust = 2:6,stratified_pam = TRUE,
                    return_norm = "in_memory",
                    zero = "postadjust")

I get the following error:

Error in imputation[[im_params[i]]](assay(x), impute_args) : 
   attempt to apply non-function
ibishof commented 3 years ago

I had the same issue. I resolved it by using the code at: https://bioconductor.org/packages/release/bioc/vignettes/scone/inst/doc/sconeTutorial.R

oppose to the code at: https://bioconductor.org/packages/release/bioc/vignettes/scone/inst/doc/sconeTutorial.html

The main difference I see is that the imputation is largely commented out in the Tutorial.R version (works) and is still present in the Tutorial.html (broken).

-----More specifically------ fnr_out = estimate_ziber(x = expr, bulk_model = TRUE, pos_controls = rownames(expr) %in% hk, maxiter = 10000)

imputation=list(none=impute_null, # No imputation expect=impute_expectation) # Replace zeroes

impute_args = list(p_nodrop = fnr_out$p_nodrop, mu = exp(fnr_out$Alpha[1,]))

my_scone <- scone(my_scone, imputation = imputation, impute_args = impute_args, scaling=scaling, k_qc=3, k_ruv = 3, adjust_bio="no", run=FALSE)

-----Should be replaced with------ my_scone <- scone(my_scone, scaling=scaling, k_qc=3, k_ruv = 3, adjust_bio="no", run=FALSE)

head(get_params(my_scone))