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

chore: bump version and update NEWS.md #158

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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.7
Date: 2024-08-05
Version: 1.3.8
Date: 2024-08-08
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.8 - 2024-08-08
* fix issue with mapping overrides untreated controls

## gDRcore 1.3.7 - 2024-08-05
* fix issue with non-avearaged concentration data

Expand Down
2 changes: 1 addition & 1 deletion R/map_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ map_df <- function(trt_md,

out <- lapply(seq_along(trt_rnames), function(i) {
bczech marked this conversation as resolved.
Show resolved Hide resolved
treatment <- trt_rnames[i]
if (is.na(exact_out[[treatment]]) || !is.null(override_untrt_controls)) {
if (all(is.na(exact_out[[treatment]])) || !is.null(override_untrt_controls)) {

refs <- lapply(present_ref_cols, function(y) {
unname(unlist(ref_md[, y, with = FALSE]) == unlist(trt_md[which(trt_md$rn == treatment),
Expand Down
42 changes: 42 additions & 0 deletions tests/testthat/test-map_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,48 @@ test_that("map_df works as expected", {

expect_equal(mapping, out)
expect_equal(sort(unique(unname(unlist(mapping)))), sort(rownames(ref_df)))

bczech marked this conversation as resolved.
Show resolved Hide resolved
trt_dt <- dt <- data.table(
bczech marked this conversation as resolved.
Show resolved Hide resolved
clid = c("Cell123456", "Cell123456", "Cell654321", "Cell654321"),
CellLineName = c("CellLineA", "CellLineA", "CellLineB", "CellLineB"),
Tissue = c("Liver", "Liver", "Liver", "Liver"),
parental_identifier = c("ParentA", "ParentA", "ParentB", "ParentB"),
subtype = c("type1", "type1", "type2", "type2"),
ReferenceDivisionTime = c(45, 45, 30, 30),
Gnumber = c("Drug12345678", "Drug12345678", "Drug87654321", "Drug87654321"),
DrugName = c("DrugX", "DrugX", "DrugY", "DrugY"),
drug_moa = c("MOA1", "MOA1", "MOA2", "MOA2"),
Duration = c(120, 120, 120, 120),
E2 = c("0", "0.0023", "0", "0.0023"),
rn = c("1", "2", "6", "7")
)

ref_dt <- data.table(
clid = c("Cell123456", "Cell123456", "Cell123456", "Cell654321", "Cell654321", "Cell654321"),
CellLineName = c("CellLineA", "CellLineA", "CellLineA", "CellLineB", "CellLineB", "CellLineB"),
Tissue = c("Liver", "Liver", "Liver", "Liver", "Liver", "Liver"),
parental_identifier = c("ParentA", "ParentA", "ParentA", "ParentB", "ParentB", "ParentB"),
subtype = c("type1", "type1", "type1", "type2", "type2", "type2"),
ReferenceDivisionTime = c(NA, NA, NA, 60, 60, 60),
Gnumber = c("Drug12345678", "Drug12345678", "Drug12345678", "Drug87654321", "Drug87654321", "Drug87654321"),
DrugName = c("DrugX", "DrugX", "DrugX", "DrugY", "DrugY", "DrugY"),
drug_moa = c("MOA1", "MOA1", "MOA1", "MOA2", "MOA2", "MOA2"),
Duration = c(0, 168, 168, 0, 168, 168),
E2 = c("0", "0", "0.0023", "0", "0", "0.0023"),
rn = c("3", "4", "5", "8", "9", "10")
)

ref_cols <- c("CellLineName", "Tissue", "parental_identifier", "subtype",
"Barcode", "clid")

ref_type <- "Day0"
map_override_untrt_controls <- map_df(trt_dt,
ref_dt,
ref_cols = ref_cols,
ref_type = ref_type,
override_untrt_controls = c(E2 = 0.0023))
expect_list(map_override_untrt_controls)
expect_length(map_override_untrt_controls, 4)
})
bczech marked this conversation as resolved.
Show resolved Hide resolved


Expand Down
Loading