Skip to content

Commit

Permalink
doc: update env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
bczech committed Apr 23, 2024
1 parent 4d4b29b commit cdb5220
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions R/add_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @param fill string indicating how unknown cell lines should be filled in the DB
#' @param annotationPackage string indication name of the package containing cellline annotation
#' @param externalSource string with path to external file with annotation data; by default it checks
#' 'gDR_cellline_annotation' env var. This file should contain columns such as gnumber, drug_name and drug_moa
#' 'GDR_CELLLINE_ANNOTATION' env var. This file should contain columns such as gnumber, drug_name and drug_moa
#' @keywords annotation
#' @details
#' The logic of adding celline annotation for dt_metadata based on
Expand Down Expand Up @@ -47,7 +47,7 @@ add_CellLine_annotation <- function(
} else {
"gDRtestData"
},
externalSource = Sys.getenv("gDR_cellline_annotation")
externalSource = Sys.getenv("GDR_CELLLINE_ANNOTATION")
) {

# Assertions:
Expand Down Expand Up @@ -126,7 +126,7 @@ add_CellLine_annotation <- function(
#' @param fill string indicating how unknown cell lines should be filled in the DB
#' @param annotationPackage string indication name of the package containing drug annotation
#' @param externalSource string with path to external file with annotation data; by default it checks
#' 'gDR_drug_annotation' env var. This file should contain columns such as cell_line_identifier,
#' 'GDR_DRUG_ANNOTATION' env var. This file should contain columns such as cell_line_identifier,
#' cell_line_name, primary_tissue, doubling_time, parental_identifier, and subtype
#' @keywords annotation
#' @details The logic of adding drug annotation for dt_metadata
Expand All @@ -149,7 +149,7 @@ add_Drug_annotation <- function(
} else {
"gDRtestData"
},
externalSource = Sys.getenv("gDR_drug_annotation")
externalSource = Sys.getenv("GDR_DRUG_ANNOTATION")
) {

# Assertions:
Expand Down
4 changes: 2 additions & 2 deletions man/add_CellLine_annotation.Rd

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

4 changes: 2 additions & 2 deletions man/add_Drug_annotation.Rd

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

8 changes: 4 additions & 4 deletions tests/testthat/test-add_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test_that("add_CellLine_annotation works with custom annotation in external file
subtype = "random")
data.table::fwrite(custom_annotation,
temp_path)
Sys.setenv(gDR_cellline_annotation = temp_path)
Sys.setenv(GDR_CELLLINE_ANNOTATION = temp_path)
dt_unknown_annotated <- purrr::quietly(add_CellLine_annotation)(dt_unknown)$result
expect_equal(unname(dt_unknown_annotated), unname(custom_annotation))

Expand All @@ -40,7 +40,7 @@ test_that("add_CellLine_annotation works with custom annotation in external file
dt_unknown_annotated)

# restore default
Sys.setenv(gDR_cellline_annotation = "")
Sys.setenv(GDR_CELLLINE_ANNOTATION = "")
dt_unknown_annotated <- purrr::quietly(add_CellLine_annotation)(dt_unknown)$result
expect_equal(dt_unknown_annotated$clid, custom_annotation$cell_line_identifier)

Expand Down Expand Up @@ -84,7 +84,7 @@ test_that("add_Drug_annotation works with custom annotation in external file", {
drug_moa = "custom_moa")
data.table::fwrite(custom_annotation,
temp_path)
Sys.setenv(gDR_drug_annotation = temp_path)
Sys.setenv(GDR_DRUG_ANNOTATION = temp_path)
dt_unknown_annotated <- purrr::quietly(add_Drug_annotation)(dt_unknown)$result
expect_equal(unname(dt_unknown_annotated), unname(custom_annotation))

Expand All @@ -93,7 +93,7 @@ test_that("add_Drug_annotation works with custom annotation in external file", {
dt_unknown_annotated)

# restore default
Sys.setenv(gDR_drug_annotation = "")
Sys.setenv(GDR_DRUG_ANNOTATION = "")
dt_unknown_annotated <- purrr::quietly(add_Drug_annotation)(dt_unknown)$result
expect_equal(dt_unknown_annotated$DrugName, custom_annotation$gnumber)

Expand Down

0 comments on commit cdb5220

Please sign in to comment.