Skip to content
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.9.4
Date: 2026-02-02
Version: 1.9.5
Date: 2026-02-16
Authors@R: c(
person("Bartosz", "Czech", , "bartosz.czech@contractors.roche.com", 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.9.5 - 2026-02-16
* fix stack imbalance warnings during byte-compilation

## gDRcore 1.9.4 - 2026-02-02
* remove duplicated code from `map_references` in `map_untreated`

Expand Down
11 changes: 0 additions & 11 deletions R/constants.R

This file was deleted.

54 changes: 0 additions & 54 deletions R/packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,4 @@

# data.table awareness
.datatable.aware <- TRUE
patterns <- data.table:::patterns

#' onload function
#'
#' @param libname library name
#' @param pkgname package name
#' @noRd
.onLoad <- function(libname, pkgname) {
# scientific notation was disabled due to the problem with unit tests
options(scipen = 999)

cores <- Sys.getenv("NUM_CORES")
# based on https://github.com/Bioconductor/BiocParallel/issues/98
if (.Platform$OS.type != "windows" && cores != "") {
BiocParallel::register(
BiocParallel::MulticoreParam(workers = as.numeric(cores)),
default = TRUE
)
} else {
BiocParallel::register(
BiocParallel::SerialParam(),
default = TRUE
)
}
}

# Prevent R CMD check from complaining about the use of pipe expressions
# standard data.table variables
if (getRversion() >= "2.15.1") {
utils::globalVariables(
c(
"normalization_type",
".",
"rn",
"column",
"CorrectedReadout",
"cotrt_value",
"x",
"Duration",
"isDay0",
"record_id",
"ratio",
"smooth",
"priority1",
"priority2",
"x.N",
"..cotrt_var",
"..present_ref_cols",
"..y",
"LogFoldChange",
"ReadoutValue"
),
utils::packageName())
}

71 changes: 71 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

.drugNameRegex <- NULL
.untreated_tag_patterns <- NULL
.untreatedDrugNameRegex <- NULL
patterns <- NULL

#' onload function
#'
#' @param libname library name
#' @param pkgname package name
#' @noRd
.onLoad <- function(libname, pkgname) {
# scientific notation was disabled due to the problem with unit tests
options(scipen = 999)

cores <- Sys.getenv("NUM_CORES")
# based on https://github.com/Bioconductor/BiocParallel/issues/98
if (.Platform$OS.type != "windows" && cores != "") {
BiocParallel::register(
BiocParallel::MulticoreParam(workers = as.numeric(cores)),
default = TRUE
)
} else {
BiocParallel::register(
BiocParallel::SerialParam(),
default = TRUE
)
}
# CONS
drugs_id <- gDRutils::get_env_identifiers("drug_name")
utils::assignInNamespace(".drugNameRegex", sprintf("^%s$|^%s_[[:digit:]]+$", drugs_id, drugs_id), ns = pkgname)

untreated_tag_patterns <- vapply(
gDRutils::get_env_identifiers("untreated_tag"),
sprintf,
fmt = "^%s$",
character(1)
)
utils::assignInNamespace(".untreated_tag_patterns", untreated_tag_patterns, ns = pkgname)
utils::assignInNamespace(".untreatedDrugNameRegex", paste(untreated_tag_patterns, collapse = "|"), ns = pkgname)

# data.table compatible
utils::assignInNamespace("patterns", data.table:::patterns, ns = pkgname)
utils::globalVariables(
c(
".",
"..cotrt_var",
"..present_ref_cols",
"..y",
"bliss_score",
"column",
"CorrectedReadout",
"cotrt_value",
"Duration",
"hsa_score",
"isDay0",
"LogFoldChange",
"normalization_type",
"priority1",
"priority2",
"ratio",
"ReadoutValue",
"ReadoutValue_T0",
"record_id",
"rn",
"smooth",
"x",
"x.N"
),
pkgname)
}
10 changes: 5 additions & 5 deletions vignettes/gDR-annotation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
```{r knitr-setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
Expand Down Expand Up @@ -36,7 +36,7 @@ Alternatively, users can use other annotation files stored outside of this packa
- `GDR_CELLLINE_ANNOTATION`: Represents the path to the cell line annotation CSV file.
- `GDR_DRUG_ANNOTATION`: Represents the path to the drug annotation CSV file.

```{r, eval=FALSE}
```{r set-external-annotations, eval=FALSE}
Sys.setenv(GDR_CELLLINE_ANNOTATION = "some/path/to/cell_line_annotation.csv")
Sys.setenv(GDR_DRUG_ANNOTATION = "some/path/to/drug_annotation.csv")
```
Expand All @@ -45,7 +45,7 @@ Sys.setenv(GDR_DRUG_ANNOTATION = "some/path/to/drug_annotation.csv")

To turn off the usage of external paths for data annotation, please set these two environmental variables to empty.

```{r, eval=FALSE}
```{r unset-external-annotations, eval=FALSE}
Sys.setenv(GDR_CELLLINE_ANNOTATION = "")
Sys.setenv(GDR_DRUG_ANNOTATION = "")
```
Expand Down Expand Up @@ -76,7 +76,7 @@ If some information is not known for the cell line or drug, the corresponding fi

To annotate `SummarizedExperiment` and `MultiAssayExperiment` objects, use the functions `annotate_se_with_drug`, `annotate_mae_with_drug`, `annotate_se_with_cell_line`, and `annotate_mae_with_cell_line`. These functions take the experiment objects and the corresponding annotation tables as input and return the annotated objects.

```{r, eval=FALSE}
```{r annotate-experiment-objects, eval=FALSE}
# Example for SummarizedExperiment
se <- SummarizedExperiment::SummarizedExperiment(
rowData = data.table::data.table(Gnumber = c("D1", "D2", "D3"))
Expand Down Expand Up @@ -104,6 +104,6 @@ Proper annotation of drug and cell line data is crucial for running the gDR pipe

# SessionInfo {-}

```{r sessionInfo}
```{r session-info}
sessionInfo()
```
4 changes: 2 additions & 2 deletions vignettes/gDR-data-model.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ output:
abstract: |
This vignette comprehensively describes the data model used in the gDRsuite.
vignette: |
%\VignetteIndexEntry{Vignette Title}
%\VignetteIndexEntry{gDRcore}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -110,6 +110,6 @@ In gDR `r Biocpkg("BumpyMatrix")` objects can be easily transformed into the `r

# Session info {.unnumbered}

```{r sessionInfo, echo=FALSE}
```{r session-info, echo=FALSE}
sessionInfo()
```
16 changes: 8 additions & 8 deletions vignettes/gDRcore.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
```{r knitr-config, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup, echo = FALSE}
```{r load-gdr-libraries, echo = FALSE}
library(gDRtestData)
library(gDRcore)
log_level <- futile.logger::flog.threshold("ERROR")
Expand Down Expand Up @@ -87,13 +87,13 @@ Please familiarize yourself with the `gDRimport` package, which contains a varie

This example is based on the artificial dataset called `data1` available within the `gDRimport` package. `gDR` requires three types of data that should be used as the raw input: Template, Manifest, and RawData. More information about these three types of data can be found in our general documentation.

```{r}
```{r fetch-import-test-data}
td <- gDRimport::get_test_data()
```

The provided dataset needs to be merged into one `data.table` object to be able to run the gDR pipeline. This process can be done using two functions: `gDRimport::load_data()` and `gDRcore::merge_data()`.

```{r, include=FALSE}
```{r merge-manifest-templates-results, include=FALSE}
loaded_data <-
suppressMessages(
gDRimport::load_data(
Expand All @@ -110,16 +110,16 @@ head(input_df)

We provide an all-in-one function that splits data into appropriate data types, creates the SummarizedExperiment object for each data type, splits data into treatment and control assays, normalizes, averages, calculates gDR metrics, and finally, creates the MultiAssayExperiment object. This function is called `runDrugResponseProcessingPipeline`.

```{r, message = FALSE, results = FALSE, warning = FALSE}
```{r execute-processing-pipeline, message = FALSE, results = FALSE, warning = FALSE}
mae <- runDrugResponseProcessingPipeline(input_df)
```

```{r}
```{r inspect-mae-output}
mae
```
And we can subset the MultiAssayExperiment to receive the SummarizedExperiment specific to any data type, e.g.

```{r}
```{r subset-single-agent-experiment}
mae[["single-agent"]]
```

Expand All @@ -128,6 +128,6 @@ Extraction of the data from either `MultiAssayExperiment` or `SummarizedExperime

# SessionInfo {-}

```{r sessionInfo}
```{r session-info}
sessionInfo()
```
Loading