#' Reads the pickle file produced by pySCA and returns a list of class pySCA_pickle.
#'
#' @param path Pat A character with the path file.
#'
#' @return pySCA_pickle
#' @export
#'
#' @examples
#' \dontrun{
#' pysca <- import_pySCA_module_using_reticulate( virtualenv = "r-pySCA", force_installing = FALSE)
#' path <- "inst/extdata/HBG2_HUMAN.ClustalW.db"
#' pySCA_HBG2_HUMAN <- read_pySCA_pickle(path)
#' }
read_pySCA_pickle <- function(path){
if(!exists("pysca"))
stop("'The pysca module could not be found. Please call the import_pySCA_module_using_reticulate function first.")
db <- reticulate::py_load_object(path, pickle = "pickle")
ics <- db$sector$ics %>%
purrr::map_dfr(~{
tibble::tibble(
items = .x$items,
vect = .x$vect ) %>%
dplyr::mutate(
col = .x$col,
name = .x$name)},
.id = "ics")
db$sector$ics_tidy_df <- ics
return(structure(db, class = "pySCA_pickle"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.