From ef78c3b58497086521e113045e4c9edf8ed89bf6 Mon Sep 17 00:00:00 2001 From: Tony Wu Date: Sat, 25 Apr 2026 11:08:18 -0400 Subject: [PATCH 1/2] fix(dataProcessPlots): Change default of ylimDown to minimum of log2 intensity - 3 --- R/dataProcessPlotsPTM.R | 3 ++- R/utils_dataProcessPlots.R | 28 +++++++++++++++++----------- man/MSstatsPTM.Rd | 1 + man/dataProcessPlotsPTM.Rd | 3 ++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/R/dataProcessPlotsPTM.R b/R/dataProcessPlotsPTM.R index 2d54230..d506148 100644 --- a/R/dataProcessPlotsPTM.R +++ b/R/dataProcessPlotsPTM.R @@ -29,7 +29,8 @@ #' FALSE(Default) for Profile Plot and QC Plot uses the upper limit as rounded #' off maximum of log2(intensities) after normalization + 3.. #' @param ylimDown lower limit for y-axis in the log scale. FALSE(Default) for -#' Profile Plot and QC Plot uses 0.. +#' Profile Plot and QC Plot uses the lower limit as floor of minimum +#' log2(intensities) after normalization - 3, or 0 if that value is negative.. #' @param x.axis.size size of x-axis labeling for "Run" and "channel in Profile #' Plot and QC Plot. #' @param y.axis.size size of y-axis labels. Default is 10. diff --git a/R/utils_dataProcessPlots.R b/R/utils_dataProcessPlots.R index ac68357..1bb2a6e 100644 --- a/R/utils_dataProcessPlots.R +++ b/R/utils_dataProcessPlots.R @@ -553,11 +553,12 @@ if (is.numeric(ylimDown)) { y.limdown = ylimDown } else { - y.limdown = 0 + all_abund = if (plot_global) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE + y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0) } - + ## Apply pre-plot formatting - ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, + ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, y.limup, type) datafeature.ptm = ptm.list[[1]] datarun.ptm = ptm.list[[2]] @@ -871,13 +872,15 @@ y.limup = ylimUp } - y.limdown = 0 if (is.numeric(ylimDown)) { y.limdown = ylimDown + } else { + all_abund = if (length(data.table.list) == 4) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE + y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0) } - + ## Apply pre-plot formatting - ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, y.limup, + ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, y.limup, type) datafeature.ptm = ptm.list[[1]] datarun.ptm = ptm.list[[2]] @@ -1374,10 +1377,11 @@ if (is.numeric(ylimDown)) { y.limdown = ylimDown } else { - y.limdown = 0 + all_abund = if (plot_global) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE + y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0) } - - ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm, + + ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm, y.limup, type) datafeature.ptm = ptm.list[[1]] datarun.ptm = ptm.list[[2]] @@ -1667,11 +1671,13 @@ y.limup = ylimUp } - y.limdown = 0 if (is.numeric(ylimDown)) { y.limdown = ylimDown + } else { + all_abund = if (length(data.table.list) == 4) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE + y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0) } - + ## Apply pre-plot formatting ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm, y.limup, type) datafeature.ptm = ptm.list[[1]] diff --git a/man/MSstatsPTM.Rd b/man/MSstatsPTM.Rd index c3af091..96528ca 100644 --- a/man/MSstatsPTM.Rd +++ b/man/MSstatsPTM.Rd @@ -56,6 +56,7 @@ analysis and summarization \seealso{ Useful links: \itemize{ + \item \url{https://vitek-lab.github.io/MSstatsPTM/} \item Report bugs at \url{https://github.com/Vitek-Lab/MSstatsPTM/issues} } diff --git a/man/dataProcessPlotsPTM.Rd b/man/dataProcessPlotsPTM.Rd index c79f5e7..b689cce 100644 --- a/man/dataProcessPlotsPTM.Rd +++ b/man/dataProcessPlotsPTM.Rd @@ -43,7 +43,8 @@ FALSE(Default) for Profile Plot and QC Plot uses the upper limit as rounded off maximum of log2(intensities) after normalization + 3..} \item{ylimDown}{lower limit for y-axis in the log scale. FALSE(Default) for -Profile Plot and QC Plot uses 0..} +Profile Plot and QC Plot uses the lower limit as floor of minimum +log2(intensities) after normalization - 3, or 0 if that value is negative..} \item{x.axis.size}{size of x-axis labeling for "Run" and "channel in Profile Plot and QC Plot.} From 002a2d484420c28881ddd3058e100210280d123c Mon Sep 17 00:00:00 2001 From: Tony Wu Date: Sat, 25 Apr 2026 11:09:51 -0400 Subject: [PATCH 2/2] fix puncutation --- R/dataProcessPlotsPTM.R | 2 +- man/dataProcessPlotsPTM.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/dataProcessPlotsPTM.R b/R/dataProcessPlotsPTM.R index d506148..44fc09e 100644 --- a/R/dataProcessPlotsPTM.R +++ b/R/dataProcessPlotsPTM.R @@ -30,7 +30,7 @@ #' off maximum of log2(intensities) after normalization + 3.. #' @param ylimDown lower limit for y-axis in the log scale. FALSE(Default) for #' Profile Plot and QC Plot uses the lower limit as floor of minimum -#' log2(intensities) after normalization - 3, or 0 if that value is negative.. +#' log2(intensities) after normalization - 3, or 0 if that value is negative. #' @param x.axis.size size of x-axis labeling for "Run" and "channel in Profile #' Plot and QC Plot. #' @param y.axis.size size of y-axis labels. Default is 10. diff --git a/man/dataProcessPlotsPTM.Rd b/man/dataProcessPlotsPTM.Rd index b689cce..3a701cd 100644 --- a/man/dataProcessPlotsPTM.Rd +++ b/man/dataProcessPlotsPTM.Rd @@ -44,7 +44,7 @@ off maximum of log2(intensities) after normalization + 3..} \item{ylimDown}{lower limit for y-axis in the log scale. FALSE(Default) for Profile Plot and QC Plot uses the lower limit as floor of minimum -log2(intensities) after normalization - 3, or 0 if that value is negative..} +log2(intensities) after normalization - 3, or 0 if that value is negative.} \item{x.axis.size}{size of x-axis labeling for "Run" and "channel in Profile Plot and QC Plot.}