Skip to content

Commit

Permalink
Merge pull request #136 from gdrplatform/GDR-2718
Browse files Browse the repository at this point in the history
feat: add notification helpers
  • Loading branch information
gladkia authored Nov 7, 2024
2 parents 9fffa4c + cdcbff1 commit b87d525
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: gDRutils
Type: Package
Title: A package with helper functions for processing drug response data
Version: 1.5.1
Version: 1.5.2
Date: 2024-11-05
Authors@R: c(person("Bartosz", "Czech", role=c("aut"),
comment = c(ORCID = "0000-0002-9908-3007")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export(get_default_identifiers)
export(get_duplicated_rows)
export(get_env_assay_names)
export(get_env_identifiers)
export(get_env_var)
export(get_expect_one_identifiers)
export(get_experiment_groups)
export(get_header)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## gDRutils 1.5.2 - 2024-11-05
* add `get_env_var` helper

## gDRutils 1.5.1 - 2024-11-05
* synchronize Bioconductor and GitHub versioning

Expand Down
1 change: 1 addition & 0 deletions R/duplicates.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,4 @@ throw_msg_if_duplicates <- function(dt, assay_name = "unknown", msg_f = stop, pr
msg_f(paste0(msg, msg2, msg3))
}
}

20 changes: 20 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -761,3 +761,23 @@ calc_sd <- function(x) {
}
}



#' safe wrapper of Sys.getenv()
#'
#' So far the helper is needed to handle env vars containing `:`
#' for which the backslash is automatically added in some contexts
#' and R could not get the original value for these env vars.
#'
#' @param x string with the name of the environemntal variable
#' @param ... additional params for Sys.getenev
#' @keywords package_utils
#'
#' @examples
#' get_env_var("HOME")
#
#' @export
#' @return sanitized value of the env variable
get_env_var <- function(x, ...) {
gsub("\\\\", "", Sys.getenv(x, ...))
}
25 changes: 25 additions & 0 deletions man/get_env_var.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b87d525

Please sign in to comment.