iferres / pagoo

A comprehensive and intuitive encapsulated OO class system for analyzing bacterial pangenomes in R.
https://iferres.github.io/pagoo/
28 stars 4 forks source link

load_pangenomeRDS() fails with old third party objects #48

Closed iferres closed 3 years ago

iferres commented 3 years ago

load_pangenomeRDS() expects an attribute named parent_package, which may be missing in older objects. Pagoo should be capable to dealing with these cases going backwards and loading a simple pagoo, OR/AND giving the user the ability to supply the package at load: x <- load_pangenomeRDS("pangenome.rds", pkg = "pewit")

iferres commented 3 years ago

Workaround:

library(pagoo)
x <- readRDS("pangenome.rds")
attr(x, "parent_package") <- "pewit"
saveRDS(x, "pangenome.rds")
y <- load_pangenomeRDS("pangenome.rds")