diff --git a/DESCRIPTION b/DESCRIPTION index d16cf302..fb334305 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: gDRutils Type: Package Title: A package with helper functions for processing drug response data -Version: 1.9.7 -Date: 2026-04-14 +Version: 1.9.8 +Date: 2026-04-18 Authors@R: c(person("Bartosz", "Czech", role=c("aut"), comment = c(ORCID = "0000-0002-9908-3007")), person("Arkadiusz", "Gladki", role=c("cre", "aut"), email="gladki.arkadiusz@gmail.com", @@ -38,7 +38,7 @@ Imports: stats, stringr, SummarizedExperiment, - qs, + qs2, utils Suggests: BiocManager, diff --git a/Dockerfile b/Dockerfile index 77041aa5..ed35bc13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ARG GITHUB_TOKEN RUN mkdir -p /mnt/vol COPY rplatform/dependencies.yaml rplatform/.github_access_token.txt* /mnt/vol RUN echo "$GITHUB_TOKEN" >> /mnt/vol/.github_access_token.txt -RUN Rscript -e 'BiocManager::install(c("BiocStyle", "qs"))' +RUN Rscript -e 'BiocManager::install(c("BiocStyle", "qs2"))' RUN Rscript -e "gDRstyle::installAllDeps()" #================= Check & build package diff --git a/NEWS.md b/NEWS.md index a579b6cc..fc625dbe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +## gDRutils 1.9.8 - 2026-04-18 +* migrate from `qs` to `qs2` package (`qs::qread` → `qs2::qs_read`, `qs::qsave` → `qs2::qs_save`) +* update batch file extension from `.qs` to `.qs2` + ## gDRutils 1.9.7 - 2026-04-14 * add support for metadata in `merge_MAE` diff --git a/R/combo.R b/R/combo.R index 845a5537..74183aac 100644 --- a/R/combo.R +++ b/R/combo.R @@ -11,7 +11,7 @@ #' @return list of data.table(s) with combo data #' #' @examples -#' mae <- get_synthetic_data("finalMAE_combo_matrix_small.qs") +#' mae <- get_synthetic_data("finalMAE_combo_matrix_small.qs2") #' convert_combo_data_to_dt(mae[[1]]) #' #' @export diff --git a/R/concatentate_SEs.R b/R/concatentate_SEs.R index 3468dcf6..0f115a5f 100644 --- a/R/concatentate_SEs.R +++ b/R/concatentate_SEs.R @@ -33,7 +33,7 @@ has_nested_field <- function(asy, nested_field) { #' @details Revert this operation using \code{promote_fields}. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' se <- promote_fields(se, "ReadoutValue", 2) #' demote_fields(se, "ReadoutValue") @@ -96,7 +96,7 @@ demote_fields <- function(se, fields) { #' @seealso demote_fields #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' se <- promote_fields(se, "ReadoutValue", 2) #' @@ -218,7 +218,7 @@ promote_fields <- function(se, fields, MARGIN = c(1, 2)) { #' @return A \code{BumpyMatrix} object aggregated by \code{FUN}. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' assay <- SummarizedExperiment::assay(se) #' aggregate_assay(assay, FUN = mean, by = c("Barcode")) diff --git a/R/convert_mae_se_assay_to_dt.R b/R/convert_mae_se_assay_to_dt.R index af80c085..a294ec7e 100644 --- a/R/convert_mae_se_assay_to_dt.R +++ b/R/convert_mae_se_assay_to_dt.R @@ -28,7 +28,7 @@ #' @return data.table representation of the data in \code{assay_name}. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' convert_se_assay_to_dt(se, "Metrics") #' @@ -230,7 +230,7 @@ convert_se_assay_to_dt <- function(se, #' @seealso flatten convert_se_assay_to_dt #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' convert_mae_assay_to_dt(mae, "Metrics") #' #' @export @@ -306,7 +306,7 @@ convert_mae_assay_to_dt <- function(mae, #' @return data.table representation of the data in \code{assay_name} with added information from \code{colData}. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' convert_se_assay_to_custom_dt(se, "Metrics") #' convert_se_assay_to_custom_dt(se, "Metrics", output_table = "Metrics_raw") @@ -349,8 +349,8 @@ convert_se_assay_to_custom_dt <- function(se, } if (output_table %in% c("Metrics", "Metrics_raw")) { - # SE*.qs files contain 'c50' column instead of the 'ec50' in the metrics - # this is a temporary fix that should be removed once data (qs files) is reprocessed + # SE*.qs2 files contain 'c50' column instead of the 'ec50' in the metrics + # this is a temporary fix that should be removed once data (qs2 files) is reprocessed data.table::setnames(dt, "c50", "ec50", skip_absent = TRUE) groups <- c("normalization_type", "fit_source") diff --git a/R/duplicates.R b/R/duplicates.R index 45a89be4..d16a3771 100644 --- a/R/duplicates.R +++ b/R/duplicates.R @@ -31,7 +31,7 @@ has_dt_duplicated_rows <- function(dt, col_names = NULL) { #' #' @param dt data.table with assay data #' @examples -#' sdata <- get_synthetic_data("finalMAE_small") +#' sdata <- get_synthetic_data("finalMAE_small.qs2") #' smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") #' get_assay_req_uniq_cols(smetrics_data) #' @return charvec with columns required to have unique data @@ -80,7 +80,7 @@ get_assay_req_uniq_cols <- function(dt) { #' @return logical flag indicating if a dt contains duplicated rows or not #' @keywords duplicates #' @examples -#' sdata <- get_synthetic_data("finalMAE_small") +#' sdata <- get_synthetic_data("finalMAE_small.qs2") #' smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") #' has_assay_dt_duplicated_rows(smetrics_data) #' @export @@ -142,7 +142,7 @@ get_duplicated_rows <- function(x, #' @param output string with the output format to be returned #' @return integer vector or data.table with duplicated rows #' @examples -#' sdata <- get_synthetic_data("finalMAE_small") +#' sdata <- get_synthetic_data("finalMAE_small.qs2") #' smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") #' get_assay_dt_duplicated_rows(smetrics_data, output = "data") #' get_assay_dt_duplicated_rows(smetrics_data) @@ -169,7 +169,7 @@ get_assay_dt_duplicated_rows <- function(dt, output = "index") { #' @param msg_f function to be used to throw the message #' @param preview_max_numb number of rows to preview if duplicates found #' @examples -#' sdata <- get_synthetic_data("finalMAE_small") +#' sdata <- get_synthetic_data("finalMAE_small.qs2") #' smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") #' throw_msg_if_duplicates(smetrics_data, assay_name = "Metrics", msg_f = futile.logger::flog.info) #' @return NULL diff --git a/R/experiment_validators.R b/R/experiment_validators.R index 27603182..ba83be94 100644 --- a/R/experiment_validators.R +++ b/R/experiment_validators.R @@ -38,7 +38,7 @@ validate_dimnames <- function(obj, obj2, skip_empty = TRUE) { #' @export #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' validate_se_assay_name(se, "RawTreated") #' @@ -71,7 +71,7 @@ validate_se_assay_name <- function(se, name) { #' @export #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' validate_SE(se) #' @@ -142,7 +142,7 @@ validate_SE <- function(se, #' @export #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' validate_MAE(mae) #' #' @author Bartosz Czech diff --git a/R/fit_curves.R b/R/fit_curves.R index 87c7b51e..5624bb97 100644 --- a/R/fit_curves.R +++ b/R/fit_curves.R @@ -444,7 +444,7 @@ predict_efficacy_from_conc <- function(c, x_inf, x_0, ec50, h) { #' @return A single numeric value for the predicted 'smooth' response. #' #' @examples -#' mae <- gDRutils::get_synthetic_data("combo_matrix") +#' mae <- get_synthetic_data("combo_matrix") #' se <- mae[[gDRutils::get_supported_experiments("combo")]] #' dt_metrics <- gDRutils::convert_se_assay_to_dt(se[1, 1], "Metrics")[normalization_type == "RV"] #' predict_smooth_from_combo(conc_1 = 1.2, conc_2 = 9.8, metrics_merged = dt_metrics) diff --git a/R/helpers-tests.R b/R/helpers-tests.R index 6f4a02c3..d091c2eb 100644 --- a/R/helpers-tests.R +++ b/R/helpers-tests.R @@ -11,7 +11,7 @@ #' @export get_testdata <- function() { - mae <- get_synthetic_data("finalMAE_small") + mae <- get_synthetic_data("finalMAE_small.qs2") raw_data <- convert_mae_assay_to_dt(mae, "Metrics") drug_names <- unique(raw_data$DrugName) cell_line_names <- unique(raw_data$CellLineName) @@ -51,7 +51,7 @@ get_testdata <- function() { #' @export get_testdata_combo <- function() { - mae <- get_synthetic_data("finalMAE_combo_matrix") + mae <- get_synthetic_data("finalMAE_combo_matrix.qs2") raw_data <- convert_mae_assay_to_dt(mae, "Metrics") drug_names <- unique(raw_data$DrugName) cell_line_names <- unique(raw_data$CellLineName) @@ -91,7 +91,7 @@ get_testdata_combo <- function() { #' @export get_testdata_codilution <- function() { - mae <- get_synthetic_data("finalMAE_combo_codilution_small") + mae <- get_synthetic_data("finalMAE_combo_codilution_small.qs2") raw_data <- convert_mae_assay_to_dt(mae, "Metrics") drug_names <- unique(raw_data$DrugName) cell_line_names <- unique(raw_data$CellLineName) diff --git a/R/json_convert.R b/R/json_convert.R index 69826665..a4b4a11f 100644 --- a/R/json_convert.R +++ b/R/json_convert.R @@ -9,7 +9,7 @@ #' @return String representation of a JSON document. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' convert_mae_to_json(mae) #' convert_mae_to_json(mae, with_experiments = FALSE) #' diff --git a/R/json_validate.R b/R/json_validate.R index fc7a065d..c61fb728 100644 --- a/R/json_validate.R +++ b/R/json_validate.R @@ -69,7 +69,7 @@ validate_json <- function(json, schema_path) { #' @return Boolean of whether or not mae is valid #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' validate_mae_with_schema(mae) #' #' @export diff --git a/R/merge_SE.R b/R/merge_SE.R index 87ff2ef7..01b03093 100644 --- a/R/merge_SE.R +++ b/R/merge_SE.R @@ -13,8 +13,8 @@ #' @keywords SE_operators #' #' @examples -#' mae1 <- get_synthetic_data("finalMAE_combo_2dose_nonoise") -#' mae2 <- get_synthetic_data("finalMAE_combo_2dose_nonoise") +#' mae1 <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") +#' mae2 <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") #' merge_MAE(list(mae1 = mae1, mae2 = mae2), title = "Test", description = "Test MAE") #' #' @return Merged MultiAssayExperiment object. @@ -149,7 +149,7 @@ merge_MAE <- function(MAElist, #' @keywords SE_operators #' #' @examples -#' se1 <- get_synthetic_data("finalMAE_small")[[1]] +#' se1 <- get_synthetic_data("finalMAE_small.qs2")[[1]] #' merge_SE(list(se1 = se1, se2 = se1)) #' #' @return merged SummarizedExperiment object @@ -248,7 +248,7 @@ merge_SE <- function(SElist, #' @return BumpyMatrix or list with data.table + BumpyMatrix #' #' @examples -#' mae <- get_synthetic_data("finalMAE_combo_2dose_nonoise") +#' mae <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") #' #' listSE <- list( #' combo1 = mae[[1]], @@ -303,7 +303,7 @@ merge_assay <- function(SElist, #' @return character vector of unique names of metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' SElist <- list( #' se, @@ -329,7 +329,7 @@ identify_unique_se_metadata_fields <- function(SElist) { #' @return list of merged metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' listSE <- list( #' se, diff --git a/R/se_metadata.R b/R/se_metadata.R index 91302174..5a16d733 100644 --- a/R/se_metadata.R +++ b/R/se_metadata.R @@ -76,7 +76,7 @@ set_SE_experiment_raw_data <- function(se, value) { #' @rdname SE_metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' get_SE_fit_parameters(se) #' @@ -90,7 +90,7 @@ get_SE_fit_parameters <- function(se) { #' @rdname SE_metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' meta <- get_SE_processing_metadata(se) #' @@ -103,7 +103,7 @@ get_SE_processing_metadata <- function(se) { #' @rdname SE_metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' get_SE_experiment_raw_data(se) #' @@ -116,7 +116,7 @@ get_SE_experiment_raw_data <- function(se) { #' @rdname SE_metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' get_SE_experiment_metadata(se) #' @@ -142,7 +142,7 @@ get_SE_keys <- function(se, key_type = NULL) { #' @rdname SE_metadata #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' get_SE_identifiers(se) #' @@ -175,7 +175,7 @@ get_SE_identifiers <- function(se, id_type = NULL, simplify = TRUE) { #' @return named list with identifiers for each SE #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' get_MAE_identifiers(mae) #' #' @keywords SE_operators diff --git a/R/standardize_MAE.R b/R/standardize_MAE.R index d1c25ad3..818dbf7d 100644 --- a/R/standardize_MAE.R +++ b/R/standardize_MAE.R @@ -8,7 +8,7 @@ #' @return mae a MultiAssayExperiment with default gDR identifiers #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' S4Vectors::metadata(mae[[1]])$identifiers$drug <- "druug" #' standardize_mae(mae) #' @@ -32,7 +32,7 @@ standardize_mae <- function(mae, use_default = TRUE) { #' @return se a SummarizedExperiment with default gDR identifiers #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' S4Vectors::metadata(se)$identifiers$drug <- "druug" #' standardize_se(se) @@ -142,7 +142,7 @@ standardize_se <- function(se, use_default = TRUE) { #' @return a renamed DFrame object #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' rename_DFrame(SummarizedExperiment::rowData(mae[[1]]), c("Gnumber" = "Gnumber1")) #' #' @export @@ -165,7 +165,7 @@ rename_DFrame <- function(df, mapping_vector) { #' @return a renamed BumpyMatrix object #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' assay <- SummarizedExperiment::assay(se) #' rename_bumpy(assay, c("Concentration" = "conc")) @@ -231,7 +231,7 @@ get_optional_rowdata_fields <- function(se) { #' @return refined colData #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' refine_coldata(SummarizedExperiment::colData(mae[[1]]), mae[[1]]) #' #' @export @@ -263,7 +263,7 @@ refine_coldata <- function(cd, se, default_v = "Undefined") { #' @return refined rowData #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' refine_rowdata(SummarizedExperiment::colData(mae[[1]]), mae[[1]]) #' #' @export diff --git a/R/utils.R b/R/utils.R index 39f3b1c6..1720705a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -105,7 +105,7 @@ assert_choices <- function(x, choices, ...) { #' @return list or vector depends on unify param #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' MAEpply(mae, SummarizedExperiment::assayNames) #' #' @keywords package_utils @@ -207,7 +207,7 @@ loop <- function(x, paste0(fun_name, "_", unique_id, "_", start_index, "_of_", - total_iterations, "_batch.qs")) + total_iterations, "_batch.qs2")) file.exists(file_path) }, logical(1)) @@ -237,9 +237,9 @@ loop <- function(x, paste0(fun_name, "_", unique_id, "_", start_index, "_of_", - total_iterations, "_batch.qs")) + total_iterations, "_batch.qs2")) if (file.exists(file_path)) { - batch_results <- qs::qread(file_path) + batch_results <- qs2::qs_read(file_path) final_results <- c(final_results, batch_results) } } @@ -249,7 +249,7 @@ loop <- function(x, paste0(fun_name, "_", unique_id, "_", start_index, "_of_", - total_iterations, "_batch.qs")) + total_iterations, "_batch.qs2")) if (file.exists(file_path)) { file.remove(file_path) } @@ -276,10 +276,10 @@ loop <- function(x, #' @param FUN A user-defined function to apply to each element of the batch. #' @param ... Optional arguments passed to `FUN`. #' -#' @return This function does not return a value. It saves the processed batch results to disk as a `.qs` file. +#' @return This function does not return a value. It saves the processed batch results to disk as a `.qs2` file. #' #' @details The function applies `FUN` to each element in `batch`, saves the results to a file named -#' according to the format `___of__batch.qs`, and clears +#' according to the format `___of__batch.qs2`, and clears #' memory using `gc()` after saving. #' #' @examples @@ -310,8 +310,8 @@ process_batch <- function(batch, paste0(fun_name, "_", unique_id, "_", start_index, "_of_", - total_iterations, "_batch.qs")) - qs::qsave(results, file_path) + total_iterations, "_batch.qs2")) + qs2::qs_save(results, file_path) invisible(gc()) # clear memory after saving the batch } @@ -329,7 +329,7 @@ process_batch <- function(batch, #' @return The original \code{se} object with a new assay, \code{out_assay_name}. #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' FUN <- function(x) { #' data.table::data.table(Concentration = x$Concentration, CorrectedReadout = x$CorrectedReadout) @@ -398,7 +398,7 @@ apply_bumpy_function <- function(se, #' @return logical #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' is_mae_empty(mae) #' #' @keywords package_utils @@ -419,7 +419,7 @@ is_mae_empty <- function(mae) { #' @return logical #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' is_any_exp_empty(mae) #' #' @keywords package_utils @@ -440,7 +440,7 @@ is_any_exp_empty <- function(mae) { #' @return logical #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' se <- mae[[1]] #' is_exp_empty(se) #' @@ -472,7 +472,7 @@ is_exp_empty <- function(exp) { #' @return charvec with non-empty experiments #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' get_non_empty_assays(mae) #' #' @keywords package_utils @@ -492,7 +492,7 @@ get_non_empty_assays <- function(mae) { #' @author Arkadiusz Gladki #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' mcolData(mae) #' #' @return data.table with all-experiments colData @@ -515,7 +515,7 @@ mcolData <- function(mae) { #' @return data.table with all-experiments rowData #' #' @examples -#' mae <- get_synthetic_data("finalMAE_small.qs") +#' mae <- get_synthetic_data("finalMAE_small.qs2") #' mrowData(mae) #' #' @author Arkadiusz Gladki @@ -527,13 +527,13 @@ mrowData <- function(mae) { #' Get synthetic data from gDRtestData package #' -#' @param qs qs filename +#' @param qs dataset name or qs2 filename (e.g. \code{"small"} or \code{"finalMAE_small.qs2"}) #' #' @keywords package_utils #' @export #' -#' @examples -#' get_synthetic_data("finalMAE_small.qs") +#' @examples +#' get_synthetic_data("finalMAE_small.qs2") #' #' @return loaded data #' @@ -542,15 +542,13 @@ get_synthetic_data <- function(qs) { if (!grepl("finalMAE", qs)) { qs <- paste("finalMAE", qs, sep = "_") } - # check if extension exist and is supported -`qs`, if not add one or replace - if (!grepl(".qs$", qs)) { - if (grepl(".RDS$", qs)) { - qs <- gsub(".RDS", ".qs", qs) - } else { - qs <- paste0(qs, ".qs") - } + # normalize extension to .qs2 (handles .qs, .RDS, or no extension) + qs <- sub("\\.qs$", ".qs2", qs) + qs <- sub("\\.RDS$", ".qs2", qs) + if (!grepl("\\.qs2$", qs)) { + qs <- paste0(qs, ".qs2") } - qs::qread(system.file("testdata", qs, package = "gDRtestData")) + qs2::qs_read(system.file("testdata", qs, package = "gDRtestData")) } @@ -713,11 +711,11 @@ average_biological_replicates_dt <- function( #' @param se SummarizedExperiment #' #' @examples -#' se <- get_synthetic_data("combo_matrix")[[1]] +#' se <- get_synthetic_data("finalMAE_combo_matrix.qs2")[[1]] #' is_combo_data(se) -#' se <- get_synthetic_data("combo_matrix")[[2]] +#' se <- get_synthetic_data("finalMAE_combo_matrix.qs2")[[2]] #' is_combo_data(se) -#' se <- get_synthetic_data("small")[[1]] +#' se <- get_synthetic_data("finalMAE_small.qs2")[[1]] #' is_combo_data(se) #' #' @return logical @@ -1060,7 +1058,7 @@ remove_drug_batch <- function(drug_vec, #' #' @examples #' # single-agent data -#' sdata <- get_synthetic_data("finalMAE_small") +#' sdata <- get_synthetic_data("finalMAE_small.qs2") #' smetrics_data <- convert_se_assay_to_dt(sdata[[get_supported_experiments("sa")]], "Metrics") #' saveraged_data <- convert_se_assay_to_dt(sdata[[get_supported_experiments("sa")]], "Averaged") #' smetrics_data_capped <- cap_assay_infinities(saveraged_data, @@ -1068,7 +1066,7 @@ remove_drug_batch <- function(drug_vec, #' experiment_name = "single-agent") #' #' # combination data -#' cdata <- get_synthetic_data("finalMAE_combo_matrix_small") +#' cdata <- get_synthetic_data("finalMAE_combo_matrix_small.qs2") #' scaveraged_data <- convert_se_assay_to_dt(cdata[[get_supported_experiments("combo")]], "Averaged") #' scmetrics_data <- convert_se_assay_to_dt(cdata[[get_supported_experiments("combo")]], "Metrics") #' scmetrics_data_capped <- cap_assay_infinities(scaveraged_data, diff --git a/man/MAEpply.Rd b/man/MAEpply.Rd index b79b8da3..b2253e5d 100644 --- a/man/MAEpply.Rd +++ b/man/MAEpply.Rd @@ -23,7 +23,7 @@ list or vector depends on unify param Lapply through all the experiments in MultiAssayExperiment object } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") MAEpply(mae, SummarizedExperiment::assayNames) } diff --git a/man/SE_metadata.Rd b/man/SE_metadata.Rd index 5f6f8bf4..a6877935 100644 --- a/man/SE_metadata.Rd +++ b/man/SE_metadata.Rd @@ -66,23 +66,23 @@ For \code{*et_SE_fit_parameters}, get/set metadata for fit parameters used to construct the Metrics assay in a SummarizedExperiment object. } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] get_SE_fit_parameters(se) -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] meta <- get_SE_processing_metadata(se) -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] get_SE_experiment_raw_data(se) -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] get_SE_experiment_metadata(se) -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] get_SE_identifiers(se) diff --git a/man/aggregate_assay.Rd b/man/aggregate_assay.Rd index 74e701c5..0bd7c9a0 100644 --- a/man/aggregate_assay.Rd +++ b/man/aggregate_assay.Rd @@ -20,7 +20,7 @@ A \code{BumpyMatrix} object aggregated by \code{FUN}. Aggregation can only be performed on nested variables. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] assay <- SummarizedExperiment::assay(se) aggregate_assay(assay, FUN = mean, by = c("Barcode")) diff --git a/man/apply_bumpy_function.Rd b/man/apply_bumpy_function.Rd index a8c4fb73..7682aa9c 100644 --- a/man/apply_bumpy_function.Rd +++ b/man/apply_bumpy_function.Rd @@ -34,7 +34,7 @@ The original \code{se} object with a new assay, \code{out_assay_name}. Apply a user-specified function to every element of a bumpy matrix. } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] FUN <- function(x) { data.table::data.table(Concentration = x$Concentration, CorrectedReadout = x$CorrectedReadout) diff --git a/man/cap_assay_infinities.Rd b/man/cap_assay_infinities.Rd index baca5abe..091ea974 100644 --- a/man/cap_assay_infinities.Rd +++ b/man/cap_assay_infinities.Rd @@ -40,7 +40,7 @@ Cap infinity values (Inf, -Inf) in the assay data } \examples{ # single-agent data -sdata <- get_synthetic_data("finalMAE_small") +sdata <- get_synthetic_data("finalMAE_small.qs2") smetrics_data <- convert_se_assay_to_dt(sdata[[get_supported_experiments("sa")]], "Metrics") saveraged_data <- convert_se_assay_to_dt(sdata[[get_supported_experiments("sa")]], "Averaged") smetrics_data_capped <- cap_assay_infinities(saveraged_data, @@ -48,7 +48,7 @@ smetrics_data_capped <- cap_assay_infinities(saveraged_data, experiment_name = "single-agent") # combination data -cdata <- get_synthetic_data("finalMAE_combo_matrix_small") +cdata <- get_synthetic_data("finalMAE_combo_matrix_small.qs2") scaveraged_data <- convert_se_assay_to_dt(cdata[[get_supported_experiments("combo")]], "Averaged") scmetrics_data <- convert_se_assay_to_dt(cdata[[get_supported_experiments("combo")]], "Metrics") scmetrics_data_capped <- cap_assay_infinities(scaveraged_data, diff --git a/man/convert_combo_data_to_dt.Rd b/man/convert_combo_data_to_dt.Rd index 480bf02c..f127dd24 100644 --- a/man/convert_combo_data_to_dt.Rd +++ b/man/convert_combo_data_to_dt.Rd @@ -27,7 +27,7 @@ list of data.table(s) with combo data convert combo assays from SummarizedExperiments to the list of data.tables } \examples{ -mae <- get_synthetic_data("finalMAE_combo_matrix_small.qs") +mae <- get_synthetic_data("finalMAE_combo_matrix_small.qs2") convert_combo_data_to_dt(mae[[1]]) } diff --git a/man/convert_mae_assay_to_dt.Rd b/man/convert_mae_assay_to_dt.Rd index 9a3a8efc..9d9bbe67 100644 --- a/man/convert_mae_assay_to_dt.Rd +++ b/man/convert_mae_assay_to_dt.Rd @@ -55,7 +55,7 @@ NOTE: to extract information about 'Control' data, simply call the function with the name of the assay holding data on controls. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") convert_mae_assay_to_dt(mae, "Metrics") } diff --git a/man/convert_mae_to_json.Rd b/man/convert_mae_to_json.Rd index e146ba90..7a1a526c 100644 --- a/man/convert_mae_to_json.Rd +++ b/man/convert_mae_to_json.Rd @@ -18,7 +18,7 @@ String representation of a JSON document. Convert a MultiAssayExperiment object to a JSON document. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") convert_mae_to_json(mae) convert_mae_to_json(mae, with_experiments = FALSE) diff --git a/man/convert_se_assay_to_custom_dt.Rd b/man/convert_se_assay_to_custom_dt.Rd index 714b8aca..cabb10a9 100644 --- a/man/convert_se_assay_to_custom_dt.Rd +++ b/man/convert_se_assay_to_custom_dt.Rd @@ -56,7 +56,7 @@ function with the name of the assay holding data on controls. To extract the reference data in the same format as 'Averaged' use \code{convert_se_ref_assay_to_dt}. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] convert_se_assay_to_custom_dt(se, "Metrics") convert_se_assay_to_custom_dt(se, "Metrics", output_table = "Metrics_raw") diff --git a/man/convert_se_assay_to_dt.Rd b/man/convert_se_assay_to_dt.Rd index d19bc809..e1e61f0c 100644 --- a/man/convert_se_assay_to_dt.Rd +++ b/man/convert_se_assay_to_dt.Rd @@ -53,7 +53,7 @@ function with the name of the assay holding data on controls. To extract the reference data in to same format as 'Averaged' use \code{convert_se_ref_assay_to_dt}. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] convert_se_assay_to_dt(se, "Metrics") diff --git a/man/demote_fields.Rd b/man/demote_fields.Rd index 6ed2389d..cf24cc3f 100644 --- a/man/demote_fields.Rd +++ b/man/demote_fields.Rd @@ -24,7 +24,7 @@ to a nested field of a \code{BumpyMatrix} assay. Revert this operation using \code{promote_fields}. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] se <- promote_fields(se, "ReadoutValue", 2) demote_fields(se, "ReadoutValue") diff --git a/man/get_MAE_identifiers.Rd b/man/get_MAE_identifiers.Rd index a444d831..7110b2b9 100644 --- a/man/get_MAE_identifiers.Rd +++ b/man/get_MAE_identifiers.Rd @@ -16,7 +16,7 @@ named list with identifiers for each SE get the identifiers of all SE's in the MAE } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") get_MAE_identifiers(mae) } diff --git a/man/get_assay_dt_duplicated_rows.Rd b/man/get_assay_dt_duplicated_rows.Rd index 43111dc0..f985c7ef 100644 --- a/man/get_assay_dt_duplicated_rows.Rd +++ b/man/get_assay_dt_duplicated_rows.Rd @@ -18,7 +18,7 @@ integer vector or data.table with duplicated rows Helper function to find duplicated rows in assay data } \examples{ -sdata <- get_synthetic_data("finalMAE_small") +sdata <- get_synthetic_data("finalMAE_small.qs2") smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") get_assay_dt_duplicated_rows(smetrics_data, output = "data") get_assay_dt_duplicated_rows(smetrics_data) diff --git a/man/get_assay_req_uniq_cols.Rd b/man/get_assay_req_uniq_cols.Rd index 91ea6ff0..22a3bc62 100644 --- a/man/get_assay_req_uniq_cols.Rd +++ b/man/get_assay_req_uniq_cols.Rd @@ -16,7 +16,7 @@ charvec with columns required to have unique data get columns in the assay data required to have unique (non-duplicated) data } \examples{ -sdata <- get_synthetic_data("finalMAE_small") +sdata <- get_synthetic_data("finalMAE_small.qs2") smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") get_assay_req_uniq_cols(smetrics_data) } diff --git a/man/get_non_empty_assays.Rd b/man/get_non_empty_assays.Rd index c9685bf4..bca45d32 100644 --- a/man/get_non_empty_assays.Rd +++ b/man/get_non_empty_assays.Rd @@ -16,7 +16,7 @@ charvec with non-empty experiments get non empty assays } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") get_non_empty_assays(mae) } diff --git a/man/get_synthetic_data.Rd b/man/get_synthetic_data.Rd index 0289f98d..78f0cc39 100644 --- a/man/get_synthetic_data.Rd +++ b/man/get_synthetic_data.Rd @@ -7,7 +7,7 @@ get_synthetic_data(qs) } \arguments{ -\item{qs}{qs filename} +\item{qs}{dataset name or qs2 filename (e.g. \code{"small"} or \code{"finalMAE_small.qs2"})} } \value{ loaded data @@ -16,7 +16,7 @@ loaded data Get synthetic data from gDRtestData package } \examples{ -get_synthetic_data("finalMAE_small.qs") +get_synthetic_data("finalMAE_small.qs2") } \keyword{package_utils} diff --git a/man/has_assay_dt_duplicated_rows.Rd b/man/has_assay_dt_duplicated_rows.Rd index 0c67d6ab..1e6e2425 100644 --- a/man/has_assay_dt_duplicated_rows.Rd +++ b/man/has_assay_dt_duplicated_rows.Rd @@ -16,7 +16,7 @@ logical flag indicating if a dt contains duplicated rows or not An auxiliary function that checks for duplicates in the assay data } \examples{ -sdata <- get_synthetic_data("finalMAE_small") +sdata <- get_synthetic_data("finalMAE_small.qs2") smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") has_assay_dt_duplicated_rows(smetrics_data) } diff --git a/man/identify_unique_se_metadata_fields.Rd b/man/identify_unique_se_metadata_fields.Rd index b2ea2a59..465ee700 100644 --- a/man/identify_unique_se_metadata_fields.Rd +++ b/man/identify_unique_se_metadata_fields.Rd @@ -16,7 +16,7 @@ character vector of unique names of metadata Identify unique metadata fields from a list of \code{SummarizedExperiment}s } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] SElist <- list( se, diff --git a/man/is_any_exp_empty.Rd b/man/is_any_exp_empty.Rd index d6f10e1e..1e6da96c 100644 --- a/man/is_any_exp_empty.Rd +++ b/man/is_any_exp_empty.Rd @@ -16,7 +16,7 @@ logical check if any experiment is empty } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") is_any_exp_empty(mae) } diff --git a/man/is_combo_data.Rd b/man/is_combo_data.Rd index dab1df45..3644441f 100644 --- a/man/is_combo_data.Rd +++ b/man/is_combo_data.Rd @@ -16,11 +16,11 @@ logical Checks if \code{se} is combo dataset. } \examples{ -se <- get_synthetic_data("combo_matrix")[[1]] +se <- get_synthetic_data("finalMAE_combo_matrix.qs2")[[1]] is_combo_data(se) -se <- get_synthetic_data("combo_matrix")[[2]] +se <- get_synthetic_data("finalMAE_combo_matrix.qs2")[[2]] is_combo_data(se) -se <- get_synthetic_data("small")[[1]] +se <- get_synthetic_data("finalMAE_small.qs2")[[1]] is_combo_data(se) } diff --git a/man/is_exp_empty.Rd b/man/is_exp_empty.Rd index 100006c7..fb331179 100644 --- a/man/is_exp_empty.Rd +++ b/man/is_exp_empty.Rd @@ -16,7 +16,7 @@ logical check if experiment (SE) is empty } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] is_exp_empty(se) diff --git a/man/is_mae_empty.Rd b/man/is_mae_empty.Rd index ce7b9d79..12d4987f 100644 --- a/man/is_mae_empty.Rd +++ b/man/is_mae_empty.Rd @@ -16,7 +16,7 @@ logical check if all mae experiments are empty } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") is_mae_empty(mae) } diff --git a/man/mcolData.Rd b/man/mcolData.Rd index f8869684..ebd84d60 100644 --- a/man/mcolData.Rd +++ b/man/mcolData.Rd @@ -16,7 +16,7 @@ data.table with all-experiments colData get colData of all experiments } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") mcolData(mae) } diff --git a/man/merge_MAE.Rd b/man/merge_MAE.Rd index b0744b20..bc34a995 100644 --- a/man/merge_MAE.Rd +++ b/man/merge_MAE.Rd @@ -40,8 +40,8 @@ Merged MultiAssayExperiment object. Merge multiple MultiAssayExperiment objects } \examples{ -mae1 <- get_synthetic_data("finalMAE_combo_2dose_nonoise") -mae2 <- get_synthetic_data("finalMAE_combo_2dose_nonoise") +mae1 <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") +mae2 <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") merge_MAE(list(mae1 = mae1, mae2 = mae2), title = "Test", description = "Test MAE") } diff --git a/man/merge_SE.Rd b/man/merge_SE.Rd index bd203036..e7067524 100644 --- a/man/merge_SE.Rd +++ b/man/merge_SE.Rd @@ -28,7 +28,7 @@ merged SummarizedExperiment object Merge multiple Summarized Experiments } \examples{ -se1 <- get_synthetic_data("finalMAE_small")[[1]] +se1 <- get_synthetic_data("finalMAE_small.qs2")[[1]] merge_SE(list(se1 = se1, se2 = se1)) } diff --git a/man/merge_assay.Rd b/man/merge_assay.Rd index 5a68f1b5..c296dbe7 100644 --- a/man/merge_assay.Rd +++ b/man/merge_assay.Rd @@ -30,7 +30,7 @@ BumpyMatrix or list with data.table + BumpyMatrix Merge assay data } \examples{ -mae <- get_synthetic_data("finalMAE_combo_2dose_nonoise") +mae <- get_synthetic_data("finalMAE_combo_2dose_nonoise.qs2") listSE <- list( combo1 = mae[[1]], diff --git a/man/merge_metadata.Rd b/man/merge_metadata.Rd index 6ef777c7..38782eb9 100644 --- a/man/merge_metadata.Rd +++ b/man/merge_metadata.Rd @@ -18,7 +18,7 @@ list of merged metadata Merge metadata } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] listSE <- list( se, diff --git a/man/mrowData.Rd b/man/mrowData.Rd index ad27f758..1a90bae1 100644 --- a/man/mrowData.Rd +++ b/man/mrowData.Rd @@ -16,7 +16,7 @@ data.table with all-experiments rowData get rowData of all experiments } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") mrowData(mae) } diff --git a/man/predict_smooth_from_combo.Rd b/man/predict_smooth_from_combo.Rd index 4f04f407..dfba6236 100644 --- a/man/predict_smooth_from_combo.Rd +++ b/man/predict_smooth_from_combo.Rd @@ -24,7 +24,7 @@ their predictions. This is the combination equivalent of 'predict_efficacy_from_conc'. } \examples{ -mae <- gDRutils::get_synthetic_data("combo_matrix") +mae <- get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se[1, 1], "Metrics")[normalization_type == "RV"] predict_smooth_from_combo(conc_1 = 1.2, conc_2 = 9.8, metrics_merged = dt_metrics) diff --git a/man/process_batch.Rd b/man/process_batch.Rd index e2a4c60c..87541e83 100644 --- a/man/process_batch.Rd +++ b/man/process_batch.Rd @@ -33,14 +33,14 @@ process_batch( \item{...}{Optional arguments passed to \code{FUN}.} } \value{ -This function does not return a value. It saves the processed batch results to disk as a \code{.qs} file. +This function does not return a value. It saves the processed batch results to disk as a \code{.qs2} file. } \description{ Process and save a batch of results. } \details{ The function applies \code{FUN} to each element in \code{batch}, saves the results to a file named -according to the format \verb{___of__batch.qs}, and clears +according to the format \verb{___of__batch.qs2}, and clears memory using \code{gc()} after saving. } \examples{ diff --git a/man/promote_fields.Rd b/man/promote_fields.Rd index 8d504758..6ef9c745 100644 --- a/man/promote_fields.Rd +++ b/man/promote_fields.Rd @@ -27,7 +27,7 @@ as either the \code{rowData} or \code{colData}. Revert this operation using \code{demote_fields}. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] se <- promote_fields(se, "ReadoutValue", 2) diff --git a/man/refine_coldata.Rd b/man/refine_coldata.Rd index 97b61fb9..799b6d4a 100644 --- a/man/refine_coldata.Rd +++ b/man/refine_coldata.Rd @@ -23,7 +23,7 @@ current improvements done on the colData as a standardization step: } } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") refine_coldata(SummarizedExperiment::colData(mae[[1]]), mae[[1]]) } diff --git a/man/refine_rowdata.Rd b/man/refine_rowdata.Rd index ee47eb51..b1b2a91e 100644 --- a/man/refine_rowdata.Rd +++ b/man/refine_rowdata.Rd @@ -23,7 +23,7 @@ current improvements done on the rowData as a standardization step: } } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") refine_rowdata(SummarizedExperiment::colData(mae[[1]]), mae[[1]]) } diff --git a/man/rename_DFrame.Rd b/man/rename_DFrame.Rd index 64a39b99..84d401c2 100644 --- a/man/rename_DFrame.Rd +++ b/man/rename_DFrame.Rd @@ -20,7 +20,7 @@ a renamed DFrame object Rename DFrame } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") rename_DFrame(SummarizedExperiment::rowData(mae[[1]]), c("Gnumber" = "Gnumber1")) } diff --git a/man/rename_bumpy.Rd b/man/rename_bumpy.Rd index 0047316c..f49fb9b7 100644 --- a/man/rename_bumpy.Rd +++ b/man/rename_bumpy.Rd @@ -20,7 +20,7 @@ a renamed BumpyMatrix object Rename BumpyMatrix } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] assay <- SummarizedExperiment::assay(se) rename_bumpy(assay, c("Concentration" = "conc")) diff --git a/man/split_big_table_for_xlsx.Rd b/man/split_big_table_for_xlsx.Rd index 72cb79c6..a52b9b80 100644 --- a/man/split_big_table_for_xlsx.Rd +++ b/man/split_big_table_for_xlsx.Rd @@ -4,7 +4,7 @@ \alias{split_big_table_for_xlsx} \title{Split big table} \usage{ -split_big_table_for_xlsx(dt_list, max_row = 1000000, max_col = 16000) +split_big_table_for_xlsx(dt_list, max_row = 1e+06, max_col = 16000) } \arguments{ \item{dt_list}{list of data.tables. Each data.table will be checked and diff --git a/man/standardize_mae.Rd b/man/standardize_mae.Rd index 8f4c5780..e98a1c91 100644 --- a/man/standardize_mae.Rd +++ b/man/standardize_mae.Rd @@ -19,7 +19,7 @@ mae a MultiAssayExperiment with default gDR identifiers Standardize MAE by switching from custom identifiers into gDR-default } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") S4Vectors::metadata(mae[[1]])$identifiers$drug <- "druug" standardize_mae(mae) diff --git a/man/standardize_se.Rd b/man/standardize_se.Rd index 30084f08..ef9f558e 100644 --- a/man/standardize_se.Rd +++ b/man/standardize_se.Rd @@ -19,7 +19,7 @@ se a SummarizedExperiment with default gDR identifiers Standardize SE by switching from custom identifiers into gDR-default } \examples{ -mae <- get_synthetic_data("finalMAE_small.qs") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] S4Vectors::metadata(se)$identifiers$drug <- "druug" standardize_se(se) diff --git a/man/throw_msg_if_duplicates.Rd b/man/throw_msg_if_duplicates.Rd index ad80b3c5..0824efb9 100644 --- a/man/throw_msg_if_duplicates.Rd +++ b/man/throw_msg_if_duplicates.Rd @@ -26,7 +26,7 @@ In case of duplicates it throws a message. The messsage function is by default \ The message function can be customized with \code{msg_f} parameter } \examples{ -sdata <- get_synthetic_data("finalMAE_small") +sdata <- get_synthetic_data("finalMAE_small.qs2") smetrics_data <- convert_se_assay_to_dt(sdata[[1]], "Metrics") throw_msg_if_duplicates(smetrics_data, assay_name = "Metrics", msg_f = futile.logger::flog.info) } diff --git a/man/validate_MAE.Rd b/man/validate_MAE.Rd index f75701a9..0bcd1df5 100644 --- a/man/validate_MAE.Rd +++ b/man/validate_MAE.Rd @@ -25,7 +25,7 @@ Function validates correctness of SE included in MAE by checking multiple cases: } } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") validate_MAE(mae) } diff --git a/man/validate_SE.Rd b/man/validate_SE.Rd index 542b7cc2..f55a5be4 100644 --- a/man/validate_SE.Rd +++ b/man/validate_SE.Rd @@ -28,7 +28,7 @@ Function validates correctness of SE by checking multiple cases: } } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] validate_SE(se) diff --git a/man/validate_mae_with_schema.Rd b/man/validate_mae_with_schema.Rd index b71ea9f9..7e90cd22 100644 --- a/man/validate_mae_with_schema.Rd +++ b/man/validate_mae_with_schema.Rd @@ -29,7 +29,7 @@ Currently only SEs are validated TODO: add mae.json schema and validate full MAE object } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") validate_mae_with_schema(mae) } diff --git a/man/validate_se_assay_name.Rd b/man/validate_se_assay_name.Rd index d9ccb1be..b5fd96fc 100644 --- a/man/validate_se_assay_name.Rd +++ b/man/validate_se_assay_name.Rd @@ -19,7 +19,7 @@ Throws an error if the assay is not valid. Check for the presence of an assay in a SummarizedExperiment object. } \examples{ -mae <- get_synthetic_data("finalMAE_small") +mae <- get_synthetic_data("finalMAE_small.qs2") se <- mae[[1]] validate_se_assay_name(se, "RawTreated") diff --git a/tests/testthat/test-merge_SE.R b/tests/testthat/test-merge_SE.R index c7d7928b..25671de2 100644 --- a/tests/testthat/test-merge_SE.R +++ b/tests/testthat/test-merge_SE.R @@ -1,19 +1,19 @@ listMAE <- lapply(list.files(system.file(package = "gDRtestData", "testdata"), - "final", full.names = TRUE)[1:2], qs::qread) + "final.*\\.qs2$", full.names = TRUE)[1:2], qs2::qs_read) names(listMAE) <- c("MAE1", "MAE2") listSE <- lapply(listMAE, function(x) x[[2]]) names(listSE) <- c("combo1", "combo2") listMAE2 <- lapply(list.files(system.file(package = "gDRtestData", "testdata"), - "final", full.names = TRUE)[1:2], qs::qread) + "final.*\\.qs2$", full.names = TRUE)[1:2], qs2::qs_read) listSE2 <- lapply(listMAE, function(x) x[[1]]) names(listSE2) <- c("combo1", "combo2") listSE3 <- c(listSE[1], listSE2[2]) -listSE4 <- c(listSE[1], ligand = qs::qread( +listSE4 <- c(listSE[1], ligand = qs2::qs_read( list.files(system.file(package = "gDRtestData", "testdata"), - "Ligand", full.names = TRUE))[[1]]) + "Ligand.*\\.qs2$", full.names = TRUE)[1])[[1]]) test_that("merge_assay works as expected", { diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 04fa5aa2..691d39c4 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -187,10 +187,10 @@ test_that("process_batch works as expected", { process_batch(namedBatch, start_index = 1, fun_name = "test_fun", unique_id = "test_id", total_iterations = n, temp_dir = temp_dir, FUN = sum) - file_path <- file.path(temp_dir, "test_fun_test_id_1_of_50_batch.qs") + file_path <- file.path(temp_dir, "test_fun_test_id_1_of_50_batch.qs2") expect_true(file.exists(file_path)) - - saved_results <- qs::qread(file_path) + + saved_results <- qs2::qs_read(file_path) expect_true(is.list(saved_results)) expect_length(saved_results, n) expect_equal(names(saved_results), names(namedBatch)) @@ -200,12 +200,12 @@ test_that("process_batch works as expected", { process_batch(list(), start_index = 1, fun_name = "test_fun", unique_id = "test_id", total_iterations = 1, temp_dir = temp_dir, FUN = sum) - empty_file_path <- file.path(temp_dir, "test_fun_test_id_1_of_0_batch.qs") + empty_file_path <- file.path(temp_dir, "test_fun_test_id_1_of_0_batch.qs2") expect_false(file.exists(empty_file_path)) }) test_that("get_synthetic_data works as expected", { - expect_is(get_synthetic_data("finalMAE_small.qs"), + expect_is(get_synthetic_data("finalMAE_small.qs2"), "MultiAssayExperiment") expect_is(get_synthetic_data("finalMAE_small"), "MultiAssayExperiment")