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

[GDR-2497] Move define_matrix_grid_positions function to gDRutils package #150

Merged
merged 6 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 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.1.20
Date: 2024-05-08
Version: 1.1.21
Date: 2024-05-16
Authors@R: c(
person("Bartosz", "Czech", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-9908-3007")),
Expand All @@ -29,7 +29,7 @@ Imports:
BiocParallel,
checkmate,
futile.logger,
gDRutils (>= 1.1.12),
gDRutils (>= 1.1.14),
MultiAssayExperiment,
purrr,
stringr,
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.1.20 - 2024-05-16
* move `define_matrix_grid_positions` function to `gDRutils` package

## gDRcore 1.1.20 - 2024-05-08
* fix typo

Expand Down
40 changes: 1 addition & 39 deletions R/combinations-isobolograms.R
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
#' Define matrix grid positions
#'
#' @param conc1 drug_1 concentration
#' @param conc2 drug_2 concentration
#'
#' @details
#' \code{drug_1} is diluted along the rows as the y-axis and
#' \code{drug_2} is diluted along the columns and will be the x-axis.
#'
#' @keywords combinations
#' @return list with axis grid positions
#'
define_matrix_grid_positions <- function(conc1, conc2) {
.generate_gap_for_single_agent <- function(x) {
2 * x[2] - x[3] - log10(1.5)
}

conc_1 <- sort(unique(round_concentration(conc1)))
pos_y <- log10conc_1 <- log10(conc_1)
pos_y[1] <- .generate_gap_for_single_agent(log10conc_1)
axis_1 <- data.table::data.table(conc_1 = conc_1,
log10conc_1 = log10conc_1,
pos_y = pos_y,
marks_y = sprintf("%.2g", conc_1)
)

conc_2 <- sort(unique(round_concentration(conc2)))
pos_x <- log10conc_2 <- log10(conc_2)
pos_x[1] <- .generate_gap_for_single_agent(log10conc_2)
axis_2 <- data.table::data.table(conc_2 = conc_2,
log10conc_2 = log10conc_2,
pos_x = pos_x,
marks_x = sprintf("%.2g", conc_2)
)

list(axis_1 = axis_1, axis_2 = axis_2)
}

#' @keywords combinations
calculate_Loewe <- function(
df_mean,
Expand All @@ -62,7 +24,7 @@ calculate_Loewe <- function(
all_iso <- vector("list", length(iso_cutoffs))
names(all_iso) <- iso_cutoffs

axes <- define_matrix_grid_positions(
axes <- gDRutils::define_matrix_grid_positions(
df_mean[[series_identifiers[1]]],
df_mean[[series_identifiers[2]]]
)
Expand Down
24 changes: 0 additions & 24 deletions man/define_matrix_grid_positions.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion rplatform/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgs:
gDRutils:
ver: '>= 1.1.12'
ver: '>= 1.1.14'
url: gdrplatform/gDRutils
ref: main
subdir: ~
Expand Down
Loading