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 2591 #133

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
@@ -1,8 +1,8 @@
Package: gDRutils
Type: Package
Title: A package with helper functions for processing drug response data
Version: 1.3.13
Date: 2024-09-16
Version: 1.3.14
Date: 2024-10-03
Authors@R: c(person("Bartosz", "Czech", role=c("aut"),
comment = c(ORCID = "0000-0002-9908-3007")),
person("Arkadiusz", "Gladki", role=c("cre", "aut"), email="[email protected]",
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.3.14 - 2024-10-03
* fixed issue in average_biological_replicated (fit_type)

## gDRutils 1.3.13 - 2024-09-16
* add functions set_unique_cl_names_dt and set_unique_drug_names_dt

Expand Down
16 changes: 14 additions & 2 deletions R/headers_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,20 @@
"GR50",
"GEC50",
"IC50",
"EC50"
)
"EC50",
"GR_xc50",
"RV_xc50",
"GR_ec50",
"RV_ec50"
),
fit_type = c(
"fit_type",
"Fit Type",
"Fit Type RV",
"Fit Type GR",
"RV_fit_type",
"GR_fit_type"
)
)
}

Expand Down
6 changes: 5 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ geometric_mean <- function(x, fixed = TRUE, maxlog10Concentration = 1) {
#' @param fixed Flag indicating whether to add a fix for -Inf in the geometric mean.
#' @param geometric_average_fields Character vector of column names in \code{dt}
#' to take the geometric average of.
#' @param fit_type_average_fields Character vector of column names in \code{dt}
#' that should be treated as a column with fit type data
#' @param add_sd Flag indicating whether to add standard deviation and count columns.
#'
#' @examples
Expand All @@ -449,6 +451,7 @@ average_biological_replicates_dt <- function(
prettified = FALSE,
fixed = TRUE,
geometric_average_fields = get_header("metric_average_fields")$geometric_mean,
fit_type_average_fields = get_header("metric_average_fields")$fit_type,
add_sd = FALSE) {

data <- data.table::copy(dt)
Expand All @@ -465,7 +468,8 @@ average_biological_replicates_dt <- function(

average_fields <- setdiff(names(Filter(is.numeric, data)), c(unlist(pidfs), var, iso_cols))
geometric_average_fields <- intersect(geometric_average_fields, names(dt))
group_by <- setdiff(names(data), c(average_fields, var, id_cols, "fit_type", "Fit Type"))
fit_type_average_fields <- intersect(fit_type_average_fields, names(dt))
gladkia marked this conversation as resolved.
Show resolved Hide resolved
gladkia marked this conversation as resolved.
Show resolved Hide resolved
group_by <- setdiff(names(data), c(average_fields, var, id_cols, fit_type_average_fields))

if (add_sd) {
# Calculate standard deviation for both average_fields and geometric_average_fields
Expand Down
4 changes: 4 additions & 0 deletions man/average_biological_replicates_dt.Rd

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

Loading