Title: | Support Compatibility Between 'Maelstrom' R Packages and 'Opal' Environment |
---|---|
Description: | Functions to support compatibility between 'Maelstrom' R packages and 'Opal' environment. 'Opal' is the 'OBiBa' core database application for biobanks. It is used to build data repositories that integrates data collected from multiple sources. 'Opal Maelstrom' is a specific implementation of this software. This 'Opal' client is specifically designed to interact with 'Opal Maelstrom' distributions to perform operations on the R server side. The user must have adequate credentials. Please see <https://opaldoc.obiba.org/> for complete documentation. |
Authors: | Guillaume Fabre [aut, cre] |
Maintainer: | Guillaume Fabre <[email protected]> |
License: | GPL-3 |
Version: | 1.0.3 |
Built: | 2025-02-26 04:01:01 UTC |
Source: | https://github.com/maelstrom-research/mlstropalr |
Transforms a data dictionary from 'opalr' format to Opal format. A data dictionary imported using the 'opalr' package has a different structure and will be transformed to the structure used in Maelstrom packages.
data_dict_opalr_fix(data_dict)
data_dict_opalr_fix(data_dict)
data_dict |
A list of tibble(s) representing metadata to be transformed. Automatically generated if not provided. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
A list of tibble(s) identifying a data dictionary.
Please see Opal documentation for
complete documentation.
madshapR::as_data_dict_mlstr()
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use DEMO_files provided by the package library(madshapR) library(stringr) library(dplyr) dossier <- DEMO_files[str_detect(names(DEMO_files),"dataset_MELBOURNE")] tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) try( opal_tables_push( opal, dossier,project_name = tempdir, .force = TRUE, .overwrite = TRUE)) # get the data dictionary and reshape it. data_dict <- try( opal.table_dictionary_get( opal,project = tempdir,table = "dataset_MELBOURNE")) data_dict <- try(data_dict_opalr_fix(data_dict)) glimpse(data_dict) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use DEMO_files provided by the package library(madshapR) library(stringr) library(dplyr) dossier <- DEMO_files[str_detect(names(DEMO_files),"dataset_MELBOURNE")] tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) try( opal_tables_push( opal, dossier,project_name = tempdir, .force = TRUE, .overwrite = TRUE)) # get the data dictionary and reshape it. data_dict <- try( opal.table_dictionary_get( opal,project = tempdir,table = "dataset_MELBOURNE")) data_dict <- try(data_dict_opalr_fix(data_dict)) glimpse(data_dict) ## End(Not run)
This function is a direct call to the documentation in the repository hosting the package. The user can access the description of the latest version of the package, the vignettes, and the list of functions.
mlstrOpalr_help()
mlstrOpalr_help()
Nothing to be returned. The function opens a web page.
{ mlstrOpalr_help() }
{ mlstrOpalr_help() }
Downloads files from an Opal environment to the local environment. This is a
wrapper function for opalr::opal.file_download()
.
opal_files_pull(opal, from, to)
opal_files_pull(opal, from, to)
opal |
Opal login attributes. |
from |
A character string of a path where the files will be taken from in R. |
to |
A character string of a path where the files will be placed to in Opal. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
Folder(s) containing files coming from Opal in user R environment.
Please see Opal documentation for complete documentation.
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- tempdir() invisible(dir.create(paste0(tempdir,"/a_file"))) invisible(file.create(paste0(tempdir,"/a_file","/file.txt"))) try(opal_files_push(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) try(opal_files_pull(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- tempdir() invisible(dir.create(paste0(tempdir,"/a_file"))) invisible(file.create(paste0(tempdir,"/a_file","/file.txt"))) try(opal_files_push(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) try(opal_files_pull(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) ## End(Not run)
Uploads files from the local environment to an Opal environment. This is a
wrapper function for opalr::opal.file_upload()
.
opal_files_push(opal, from, to)
opal_files_push(opal, from, to)
opal |
Opal login attributes. |
from |
A character string of a path where the files will be taken from in R. |
to |
A character string of a path where the files will be placed to in Opal. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
Folder(s) containing files coming from the user R environment in Opal. The path to Opal needs to be pasted with Opal absolute path.
Please see Opal documentation for complete documentation.
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- tempdir() invisible(dir.create(paste0(tempdir,"/a_file"))) invisible(file.create(paste0(tempdir,"/a_file","/file.txt"))) try(opal_files_push(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- tempdir() invisible(dir.create(paste0(tempdir,"/a_file"))) invisible(file.create(paste0(tempdir,"/a_file","/file.txt"))) try(opal_files_push(opal, from = paste0(tempdir,"/a_file"), to = tempdir)) ## End(Not run)
Creates an empty project in an Opal environment. This is a wrapper function
for opalr::opal.project_create()
.
opal_project_create(opal, project, tag = NULL)
opal_project_create(opal, project, tag = NULL)
opal |
Opal login attributes. |
project |
A character string to name the project in Opal. |
tag |
A character string to provide a tag for the Opal project. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
A project in an Opal environment. If the project already exists, it will remain as it is, and no new project is created. The user must have adequate credentials to interact with their Opal environment.
Please see Opal documentation for complete documentation.
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) ## End(Not run)
Downloads a dossier or dataset from an Opal environment to the local
environment. This is a wrapper function foropalr::opal.table_get()
and
opalr::opal.table_dictionary_get()
.
opal_tables_pull( opal, project, table_list = NULL, content = c("dataset", "data_dict"), keep_as_dossier = TRUE, .remove_id = FALSE )
opal_tables_pull( opal, project, table_list = NULL, content = c("dataset", "data_dict"), keep_as_dossier = TRUE, .remove_id = FALSE )
opal |
Opal login attributes. |
project |
A character string specifying the Opal project name. |
table_list |
A vector character string specifying Opal tables name. |
content |
A vector of character string which indicates if the function returns a dataset, or data dictionary. Default is 'dataset'. |
keep_as_dossier |
whether to return a dossier or a dataset if there is only one table. TRUE by default, if FALSE returns dataset. |
.remove_id |
whether to return the id column created in Opal or not. TRUE by default. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
Objects (tibbles and list of tibbles) representing tables and their respective data dictionary.
Please see Opal documentation for
complete documentation.
madshapR::as_dossier()
madshapR::as_dataset()
madshapR::as_data_dict_mlstr()
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use DEMO_files provided by the package library(madshapR) library(stringr) library(dplyr) dossier <- DEMO_files[str_detect(names(DEMO_files),"dataset_MELBOURNE")] tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) try( opal_tables_push( opal, dossier,project_name = tempdir, .force = TRUE, .overwrite = TRUE)) ###### Example pull a table from a project. try( glimpse(opal_tables_pull( opal,project = tempdir,table_list = 'dataset_MELBOURNE_1'))) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use DEMO_files provided by the package library(madshapR) library(stringr) library(dplyr) dossier <- DEMO_files[str_detect(names(DEMO_files),"dataset_MELBOURNE")] tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) try( opal_tables_push( opal, dossier,project_name = tempdir, .force = TRUE, .overwrite = TRUE)) ###### Example pull a table from a project. try( glimpse(opal_tables_pull( opal,project = tempdir,table_list = 'dataset_MELBOURNE_1'))) ## End(Not run)
Uploads a dossier or dataset from the local environment to an Opal
environment. This is a wrapper function for opalr::opal.table_create()
,
opalr::opal.table_save()
and opalr::opal.table_dictionary_update()
.
opal_tables_push( opal, dossier = NULL, data_dict = NULL, dataset = NULL, table_name = NULL, project_name, .force = FALSE, .overwrite = FALSE )
opal_tables_push( opal, dossier = NULL, data_dict = NULL, dataset = NULL, table_name = NULL, project_name, .force = FALSE, .overwrite = FALSE )
opal |
Opal login attributes. |
dossier |
List of data frame, each of them being datasets. |
data_dict |
A list of tibble(s) representing metadata of an associated dataset. Automatically generated if not provided. |
dataset |
A tibble identifying the dataset observations associated to its data dictionary. |
table_name |
A character string specifying an Opal table name. |
project_name |
A character string specifying the Opal project name. |
.force |
If the destination already exists, stop with an informative message if this flag is FALSE (default). |
.overwrite |
If the destination table already exists, it will be replaced (deleted, re-created with associated permissions reinstated and then imported). Otherwise the table will be updated (data dictionaries merge may conflict). Default is FALSE.* |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
A table or table(s) in Opal.
Please see Opal documentation for
complete documentation.
madshapR::as_dossier()
madshapR::as_dataset()
madshapR::as_data_dict_mlstr()
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use madshapR_DEMO provided by the package library(madshapR) library(stringr) dataset <- madshapR_DEMO$dataset_MELBOURNE tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) # push a table in a project. try( opal_tables_push( opal, dataset = dataset, table_name = 'MELBOURNE', project_name = tempdir, .force = TRUE, .overwrite = TRUE)) ## End(Not run)
## Not run: library(opalr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') # use madshapR_DEMO provided by the package library(madshapR) library(stringr) dataset <- madshapR_DEMO$dataset_MELBOURNE tempdir <- basename(tempdir()) try(opal_project_create(opal, tempdir)) # push a table in a project. try( opal_tables_push( opal, dataset = dataset, table_name = 'MELBOURNE', project_name = tempdir, .force = TRUE, .overwrite = TRUE)) ## End(Not run)
Downloads all taxonomies from an Opal server in a specific tibble format used by Opal.
taxonomy_opal_get(opal)
taxonomy_opal_get(opal)
opal |
Opal login attributes. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
A tibble identifying a taxonomy (generally generated from Opal taxonomy).
Please see Opal documentation for
complete documentation.
madshapR::as_taxonomy()
## Not run: library(opalr) library(dplyr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') try(glimpse(taxonomy_opal_get(opal))) ## End(Not run)
## Not run: library(opalr) library(dplyr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') try(glimpse(taxonomy_opal_get(opal))) ## End(Not run)
Downloads all taxonomies from an Opal server in a specific tibble format used in the Maelstrom Research ecosystem.
taxonomy_opal_mlstr_get(opal)
taxonomy_opal_mlstr_get(opal)
opal |
Opal login attributes. |
Opal is the OBiBa application for data management, and Opal environments can
be integrated with RStudio environments using the package opalr
.
The user must have adequate credentials to interact with a specific Opal
environment. Some function errors produced may be associated with the
handler or Opal read/write permissions.
A tibble identifying a taxonomy (generally generated from Opal taxonomy.
Please see Opal documentation for
complete documentation.
madshapR::as_taxonomy()
## Not run: library(opalr) library(dplyr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') glimpse(try(taxonomy_opal_mlstr_get(opal))) ## End(Not run)
## Not run: library(opalr) library(dplyr) opal <- opal.login('administrator','password', url ='https://opal-demo.obiba.org/') glimpse(try(taxonomy_opal_mlstr_get(opal))) ## End(Not run)
Provides a built-in tibble showing the list of allowed Opal valueType values and their corresponding R data types. This tibble is mainly used for internal processes and programming.
valueType_list
valueType_list
tibble
A data frame with 12 rows and 6 columns:
data type as described in Opal
data type provided by base::typeof
data class provided by base::class
function to transpose object according base::do.call function
ensemble data type as described in Opal
ensemble data type provided by base::typeof
ensemble data type which valueType belongs
...
The valueType is a property of a variable and is required in certain
functions to determine the handling of the variables. The valueType refers
to the OBiBa-internal type of a variable. It is specified in a data
dictionary in a column valueType
and can be associated with variables as
attributes. Acceptable valueTypes include 'text', 'integer', 'decimal',
'boolean', datetime', 'date'). The full list of OBiBa valueType
possibilities and their correspondence with R data types are available using
valueType_list.
{ valueType_list }
{ valueType_list }