YosefLab / scone

53 stars 12 forks source link

Error in get_normalized due to no imputation / return_norm = "no" #101

Open diyadas opened 5 years ago

diyadas commented 5 years ago

The help for get_normalized indicates that

If ‘scone’ was run with ‘return_norm="no"’, this function will compute the normalized matrix on the fly.

Unfortunately, doesn't seem to work for me because of some error in computing the imputation:

> tmp <- get_normalized(scone_obj, "none,fq,ruv_k=3,no_bio,batch")
Error in x@imputation_fn[[params[1]]](assay(x), impute_args) :
  attempt to apply non-function
> traceback()
3: .local(x, method, ...)
2: get_normalized(scone_obj, "none,fq,ruv_k=3,no_bio,batch")
1: get_normalized(scone_obj, "none,fq,ruv_k=3,no_bio,batch")
> package.version("scone")
[1] "1.4.0"

The issue derives from: https://github.com/YosefLab/scone/blob/e2436a33f6121ec36c1a6ba13906379dbf894559/R/get_normalized.R#L41 as impute_args has been set to NULL by L38.

mbcole commented 5 years ago

Hey @diyadas - thanks for reporting this! What does scone_obj@imputation_fn look like for this object?

diyadas commented 5 years ago

Hi!

> scone_obj@imputation_fn
list()
mbcole commented 5 years ago

That's interesting because the default is list(none=impute_null). Maybe this was overwritten at some point?