Skip to content

Commit

Permalink
Disable prettifification in log check
Browse files Browse the repository at this point in the history
  • Loading branch information
pinin4fjords committed May 2, 2024
1 parent 3266cc7 commit 3b00f4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/accessory.R
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,12 @@ validate_indices <- function(assay_data, index_string, prettify_names = TRUE) {
#' If empty: no log2 transformation will be applied.
#' If non-empty: log2 transformation will be applied unconditionally to specified assays.
#' @param threshold A numeric threshold to determine if an assay should be log-transformed.
#' @param prettify_names Boolean. Prettify element names? Passed to validate_indices().
#'
#' @return A modified assay_data list.
#' @export

cond_log2_transform_assays <- function(assay_data, log2_assays, threshold = 20) {
cond_log2_transform_assays <- function(assay_data, log2_assays, threshold = 20, prettify_names = TRUE) {

indices_to_log = c()
should_log = FALSE
Expand All @@ -1308,7 +1309,7 @@ cond_log2_transform_assays <- function(assay_data, log2_assays, threshold = 20)
should_log <- NULL
} else if (log2_assays != "") {
# Determine which assays to log based on log2_assays
indices_to_log <- validate_indices(assay_data = assay_data, index_string = log2_assays)
indices_to_log <- validate_indices(assay_data = assay_data, index_string = log2_assays, prettify_names = prettify_names)
should_log <- TRUE
}

Expand Down
2 changes: 1 addition & 1 deletion exec/exploratory_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ if (is.null(opt$final_assay)){
}

# Apply a log2 transform to assays where appropriate
assay_data <- cond_log2_transform_assays(assay_data, log2_assays = opt$log2_assays, threshold = opt$log2_guessing_threshold)
assay_data <- cond_log2_transform_assays(assay_data, log2_assays = opt$log2_assays, threshold = opt$log2_guessing_threshold, prettify_names = FALSE)

# Prettify assay names
names(assay_data) <- prettifyVariablename(names(assay_data))
Expand Down

0 comments on commit 3b00f4b

Please sign in to comment.