Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add model saving capabilities to R implementation #8

Open
wmacnair opened this issue Apr 18, 2018 · 0 comments
Open

Suggestion: Add model saving capabilities to R implementation #8

wmacnair opened this issue Apr 18, 2018 · 0 comments

Comments

@wmacnair
Copy link

Hi

I tried saving a Rcpp_SlalomModel object in an RData file, and found out that C++ pointer problems mean that it doesn't work when you then try to reload it.

I appreciate that addResultsToSingleCellExperiment allows you to record some of the results, but (a) it doesn't save them all and (b) you can't use the updated sce object as an input to e.g. plotTerms.

My workaround was the following code:

cpp_names 		= ls( envir=slalom_model@.xData )
slalom_list 		= lapply(cpp_names, function(x) slalom_model[[x]])
names(slalom_list) 	= cpp_names

plus commenting out

if (!methods::is(object, "Rcpp_SlalomModel")) 
    stop("object must be of class Rcpp_SlalomModel")

in topTerms, plotTerms etc.

I would find it helpful to have some similar save capability, plus making the plotting/topterms functions work with either an Rcpp_SlalomModel object or a saved list / appropriate other data structure. Being able to save model outputs is especially important when you're dealing with large numbers of cells, and trying out lots of factors...

Thanks for all the work on the package!
Will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant