Skip to content

Commit

Permalink
make it possible to adjust lts_quantile in Qc-QC-Workflow function
Browse files Browse the repository at this point in the history
  • Loading branch information
Karin Schork committed Aug 12, 2024
1 parent 1c33dac commit 5ff79e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/prepareData.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @param use_groups If \code{TRUE}, the data contains groups.
#' @param group_colours A character vector of hex codes for the group colors, if the data has groups. If \code{NULL}, a default color scale will be used.
#' @param normalization A character containing the method of normalization. The possible methods are no normalization "nonorm" or "median", "loess", "quantile" or "lts" normalization.
#' @param lts_quantile A numeric containing the quantile for the lts normalization if \code{normalization = "lts"}, default is 0.8.
#'
#' @return A list containing the prepared data and the ids of the data as data.frames as well as the groups, number of groups and group colors
#' @export
Expand All @@ -28,7 +29,7 @@ prepareData <- function (data_path,
zero_to_NA = TRUE,
do_log_transformation = TRUE, log_base = 2,
use_groups = FALSE, group_colours = NULL,
normalization = "loess"){
normalization = "loess", lts_quantile = 0.8){


#### read and prepare data file ####
Expand Down Expand Up @@ -67,7 +68,7 @@ prepareData <- function (data_path,

#### normalize the data ####

D <- automatedNormalization(DATA = D, method = normalization, is_log_transformed = do_log_transformation, log_base = log_base)
D <- automatedNormalization(DATA = D, method = normalization, is_log_transformed = do_log_transformation, log_base = log_base, lts.quantile = lts_quantile)

mess <- paste0(mess, D$message)
D <- D$data
Expand Down
4 changes: 3 additions & 1 deletion R/workflow_QC.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# mandatory parameters
#' @param intensity_columns An integer vector containing the intensity columns of the table.
#' @param normalization_method A character containing the method of normalization. The possible methods are no normalization "nonorm" or "median", "loess", "quantile" or "lts" normalization.
#' @param lts_quantile A numeric containing the quantile for the lts normalization if \code{normalization = "lts"}, default is 0.8.
#' @param use_groups If \code{TRUE}, group information encoded in the column names are used. Default is \code{TRUE}.
#'
# additional parameters
Expand Down Expand Up @@ -80,6 +81,7 @@ workflow_QC <- function(data_path,

intensity_columns,
normalization_method = "loess",
lts_quantile = 0.8,
use_groups = TRUE,

na_strings = c("NA", "NaN", "Filtered","#NV"),
Expand Down Expand Up @@ -128,7 +130,7 @@ workflow_QC <- function(data_path,
na_strings = na_strings, zero_to_NA = zero_to_NA,
do_log_transformation = do_log_transformation, log_base = log_base,
use_groups = use_groups, group_colours = group_colours,
normalization = normalization_method)
normalization = normalization_method, lts_quantile = lts_quantile)


mess <- paste0(mess, prepared_data[["message"]])#
Expand Down

0 comments on commit 5ff79e2

Please sign in to comment.