Skip to contents

Rgemini (Our GEMINI) is a custom R package that provides a variety of functions to perform data analyses with GEMINI data.

All functions have been developed by the GEMINI team and were tested on the current version of the GEMINI database.

Installation

Rgemini is currently not yet available on CRAN. Please follow the installation instructions below, depending on the environment you work in (HPC4Health, NORA, other).

HPC4Health

The Rgemini package is automatically installed for all HPC4Health users working with GEMINI data. If you run into any issues using Rgemini functions or require a specific package version, please submit a ticket on HPC4Health.

GEMINI team members

For users within the GEMINI team, please git clone the Rgemini repository to your home directory on NORA, then run devtools::install("/path/to/repo", repos = NULL, type="source").

Other users

All other users can install the package from GitHub using the following:

remotes::install_github("GEMINI-Medicine/Rgemini", build_vignettes = TRUE)

If the installation method above does not work, please try one of the following:

  1. Install using pak::pkg_install("GEMINI-Medicine/Rgemini").
  2. Download the latest source tarball from the package releases to some directory such as /path/to/tarball and run install.packages("/path/to/tarball", repos = NULL, type="source").
  3. Try configuring secure downloads as described in this blog post.

If none of the above methods work, please create a post on our discussion board.

Example

Some functions require access to the GEMINI database. With access, the functions can be used as follows:

library(Rgemini)

# establish DB connection
drv <- DBI::dbDriver("PostgreSQL")
db <- DBI::dbConnect(
  drv,
  dbname = "db_name",
  host = "domain_name.ca",
  port = 1234,
  user = getPass::getPass("Enter Username"),
  password = getPass::getPass("Enter Password")
)

# For HPC4Health users: For newer datacuts (H4H >= v4.0.0) set the schema according to the datacut name
dbSendQuery(db, "Set schema 'datacut_name'");

# query data
admdad <- DBI::dbGetQuery(
  db,
  "SELECT * FROM admdad LIMIT 200;"
)

# run Rgemini function
readm <- readmission(
  db = db
)

Please review the extensive package documentation and vignettes for detailed examples and sample code.

Contributing

Currently, only GEMINI team members can directly contribute to this package. However, we invite all users to share their feedback and suggestions with us so we can continue to improve Rgemini.

If you identify any package bugs or would like to request enhancements, please open a GitHub issue. We have also activated the GitHub discussion forum for you to submit any questions about package functionality or discuss applications of Rgemini functions to your research question. Note that the repository is public, so please do not share any sensitive information and/or GEMINI data on the GitHub site!

For GEMINI team members: Please carefully review the CONTRIBUTING.md file for guidelines on how to contribute and review code.

Package versions

Different versions of Rgemini are released with X.Y.Z. increments following these conventions:

  • Z: Patch version, bug fixes, documentation, tests, changing argument defaults, optimizing the internals of a function without affecting the external interface (argument names etc).
  • Y: Minor version, new function added, some large changes to existing functions (including even changes to the type and number of arguments).
  • X: Major version, change to the underlying DB the code was written for (e.g., table and variable names).

Usually we accumulate a series of changes on develop and release them all at once on main with a version increment.

Citation

If you find Rgemini useful, please cite it in your publications using citation("Rgemini"):

The GEMINI team (2023). Rgemini: R Functions for GEMINI Data. R package version . https://gemini-medicine.github.io/Rgemini/

Note that particular functions may require additional citations. Please consult the references in function-specific documentation whenever applicable.