Skip to content

Commit

Permalink
- added diagnostic legend to plot
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasko committed Oct 20, 2020
1 parent fa643f4 commit 02efaec
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions R/rawR.R
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ validate_rawRspectrum <- function(x){
#' @author Tobias Kockmann, 2020
#' @importFrom graphics legend
plot.rawRspectrum <- function(x, relative = TRUE, centroid = FALSE, SN = FALSE,
legend = TRUE, ...){
legend = TRUE, diagnostic = FALSE, ...){

stopifnot(is.rawRspectrum(x))

Expand Down Expand Up @@ -668,7 +668,7 @@ plot.rawRspectrum <- function(x, relative = TRUE, centroid = FALSE, SN = FALSE,

#basePeak <- paste("(", paste(format(x$basePeak, nsmall = 4),
# collapse = ", "), ")", sep='')
legend("topright",
legend("topleft",
paste(c("Scan#: ",
"Scan Type: ",
"RT [s]: ",
Expand All @@ -685,6 +685,18 @@ plot.rawRspectrum <- function(x, relative = TRUE, centroid = FALSE, SN = FALSE,

}

if (diagnostic) {
legend("left", legend = paste(c("Injection time [ms]: ",
"Max. Injection time [ms]",
"AGC target",
"Resolution: "),
c(x$`Ion Injection Time (ms)`,
x$`Max. Ion Time (ms)`,
x$`AGC Target`,
x$`FT Resolution`)),
bty = "n", cex = 0.75, text.col = "grey")
}

}

#' Basic print function faking the look and feel of freestyle's output
Expand Down

0 comments on commit 02efaec

Please sign in to comment.