recipeLoad: recipeLoad

View source: R/recipeLoad.R

recipeLoadR Documentation

recipeLoad

Description

To load data recipe(s) into R environment.

Usage

recipeLoad(
  rcp = c(),
  cachePath = "ReUseDataRecipe",
  env = .GlobalEnv,
  return = TRUE
)

Arguments

rcp

The (vector of) character string of recipe name or file path (recipeNames() or mcols()$fpath column of the recipeHub object returned from recipeSearch).

cachePath

A character string for the recipe cache. Must match the one specified in recipeUpdate(). Default is "ReUseDataRecipe".

env

The R environment to export to. Default is .GlobalEnv.

return

Whether to return the recipe to a user-assigned R object. Default is TRUE, where user need to assign a variable name to the recipe. e.g., rcp1 <- recipeLoad(). If FALSE, it loads the recipe and uses its original name, and user doesn't need to assign a new name. e.g., recipeLoad(return=TRUE). If multiple recipes are to be loaded, return=FALSE must be used.

Value

A data recipe of cwlProcess S4 class, which is ready to be evaluated in R.

Examples

########################
## Load single recipe
########################

library(Rcwl)
recipeUpdate()
recipeSearch("liftover")
rcp <- recipeLoad("ensembl_liftover")
Rcwl::inputs(rcp)
rm(rcp)

gencode_annotation <- recipeLoad("gencode_annotation")
inputs(gencode_annotation)
rm(gencode_annotation)

#########################
## Load multiple recipes
#########################

rcphub <- recipeSearch("gencode")
recipeNames(rcphub)
recipeLoad(recipeNames(rcphub), return=FALSE)
inputs(gencode_transcripts)

rworkflow/ReUseData documentation built on Dec. 7, 2023, 11 p.m.