Skip to content

Commit 34354a2

Browse files
authored
fix(dataProcessPlots): Change default of ylimDown to minimum of log2 intensity - 3
1 parent f7cde3b commit 34354a2

4 files changed

Lines changed: 22 additions & 13 deletions

File tree

R/dataProcessPlotsPTM.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
#' FALSE(Default) for Profile Plot and QC Plot uses the upper limit as rounded
3030
#' off maximum of log2(intensities) after normalization + 3..
3131
#' @param ylimDown lower limit for y-axis in the log scale. FALSE(Default) for
32-
#' Profile Plot and QC Plot uses 0..
32+
#' Profile Plot and QC Plot uses the lower limit as floor of minimum
33+
#' log2(intensities) after normalization - 3, or 0 if that value is negative.
3334
#' @param x.axis.size size of x-axis labeling for "Run" and "channel in Profile
3435
#' Plot and QC Plot.
3536
#' @param y.axis.size size of y-axis labels. Default is 10.

R/utils_dataProcessPlots.R

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,12 @@
553553
if (is.numeric(ylimDown)) {
554554
y.limdown = ylimDown
555555
} else {
556-
y.limdown = 0
556+
all_abund = if (plot_global) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE
557+
y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0)
557558
}
558-
559+
559560
## Apply pre-plot formatting
560-
ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm,
561+
ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm,
561562
y.limup, type)
562563
datafeature.ptm = ptm.list[[1]]
563564
datarun.ptm = ptm.list[[2]]
@@ -871,13 +872,15 @@
871872
y.limup = ylimUp
872873
}
873874

874-
y.limdown = 0
875875
if (is.numeric(ylimDown)) {
876876
y.limdown = ylimDown
877+
} else {
878+
all_abund = if (length(data.table.list) == 4) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE
879+
y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0)
877880
}
878-
881+
879882
## Apply pre-plot formatting
880-
ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, y.limup,
883+
ptm.list = .preplot.format.tmt(datafeature.ptm, datarun.ptm, y.limup,
881884
type)
882885
datafeature.ptm = ptm.list[[1]]
883886
datarun.ptm = ptm.list[[2]]
@@ -1374,10 +1377,11 @@
13741377
if (is.numeric(ylimDown)) {
13751378
y.limdown = ylimDown
13761379
} else {
1377-
y.limdown = 0
1380+
all_abund = if (plot_global) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE
1381+
y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0)
13781382
}
1379-
1380-
ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm,
1383+
1384+
ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm,
13811385
y.limup, type)
13821386
datafeature.ptm = ptm.list[[1]]
13831387
datarun.ptm = ptm.list[[2]]
@@ -1667,11 +1671,13 @@
16671671
y.limup = ylimUp
16681672
}
16691673

1670-
y.limdown = 0
16711674
if (is.numeric(ylimDown)) {
16721675
y.limdown = ylimDown
1676+
} else {
1677+
all_abund = if (length(data.table.list) == 4) c(datafeature.ptm$ABUNDANCE, datafeature.protein$ABUNDANCE) else datafeature.ptm$ABUNDANCE
1678+
y.limdown = max(floor(min(all_abund, na.rm = TRUE) - 3), 0)
16731679
}
1674-
1680+
16751681
## Apply pre-plot formatting
16761682
ptm.list = .preplot.format.lf(datafeature.ptm, datarun.ptm, y.limup, type)
16771683
datafeature.ptm = ptm.list[[1]]

man/MSstatsPTM.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dataProcessPlotsPTM.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)