diff --git a/DESCRIPTION b/DESCRIPTION index 0278b1e..6830843 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,8 +12,8 @@ Authors@R: c( person("Leo", "Lahti", role=c("ctb"), email="leo.lahti@utu.fi", comment = c(ORCID = "0000-0001-5537-637X")), person("Tuomas", "Borman", role = c("ctb"), comment = c(ORCID = "0000-0002-8563-8884")) ) -Version: 1.35.1 -Date: 2025-01-31 +Version: 1.35.2 +Date: 2025-02-11 License: GPL-3 Title: Single-Cell Analysis Toolkit for Gene Expression Data in R Description: A collection of tools for doing various analyses of diff --git a/R/plotReducedDim.R b/R/plotReducedDim.R index 6eb3c98..8245d7d 100644 --- a/R/plotReducedDim.R +++ b/R/plotReducedDim.R @@ -322,9 +322,12 @@ paired_reddim_plot <- function(df_to_plot, to_plot, dimred, percentVar = NULL, } .handle_truncval <- function(col, truncval) { - if (is.character(truncval)) { + if (is.character(truncval) || is.factor(truncval)) { + if (!is.na(as.character(as.numeric(truncval)))) { + return (as.character(as.numeric(truncval))) + } stopifnot(grepl("q\\d+", truncval)) - return (quantile(col, as.numeric(sub("q", "", truncval)) / 100)) + return (quantile(col, as.numeric(sub("q", "", as.character(truncval))) / 100)) } if (is.numeric(truncval)) { # do nothing? diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index da17899..f58653c 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -1,7 +1,14 @@ \name{NEWS} \title{News for Package \pkg{scater}} -\section{Changes in version 1.28.0, Bioconductor 3.17 Release}{ +\section{Changes in version 1.36.0, Bioconductor 3.21 Release}{ + \itemize{ + \item Add \code{min.value,max.value} arguments to \code{plotReducedDim} + to enable truncating colour scales using a numeric value or a quantile (eg \code{"q10"}). + } +} + +\section{Changes in version 1.28.0, Bioconductor 3.18 Release}{ \itemize{ \item Change \code{exprs_values} (and similar) to \code{assay.type}. \item Tweak colouring of violin plots.