Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: annotation #165

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Type: Package
Package: gDRcore
Title: Processing functions and interface to process and analyze drug
dose-response data
Version: 1.3.14
Date: 2024-10-24
Version: 1.3.15
Date: 2024-10-30
Authors@R: c(
person("Bartosz", "Czech", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-9908-3007")),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## gDRcore 1.3.15 - 2024-10-30
* hot fix for annotation colnames of cell lines

## gDRcore 1.3.14 - 2024-10-24
* split and refactor annotation functions

Expand Down
4 changes: 2 additions & 2 deletions R/add_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ annotate_dt_with_cell_line <- function(
cellline <- gDRutils::get_env_identifiers("cellline")
add_clid <- gDRutils::get_header("add_clid")

checkmate::assert_names(names(cell_line_annotation), must.include = c(cellline, unlist(add_clid)))

# Remove existing annotations if any
existing_cols <- intersect(unlist(add_clid), names(data))
if (length(existing_cols) > 0) {
data[, (existing_cols) := NULL]
}

colnames(cell_line_annotation) <- c(cellline, unlist(add_clid))
data <- cell_line_annotation[data, on = cellline]
(data)
}
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-add_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test_that("annotate_dt_with_cell_line works correctly", {
subtype = c("Subtype 1", "Subtype 2")
)
result <- annotate_dt_with_cell_line(data, cell_line_annotation, fill = "unknown")
expect_true(all(c(24, 48) %in% result$ReferenceDivisionTime))
expect_true("data.table" %in% class(result))
expect_equal(ncol(result), ncol(data) + ncol(cell_line_annotation) - 1)
expect_equal(result$CellLineName, c("Cell Line 1", "Cell Line 2", NA))
Expand Down
Loading