-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: rawrr | ||
Type: Package | ||
Title: Direct Access to Orbitrap Data and Beyond | ||
Version: 1.11.5 | ||
Version: 1.11.6 | ||
Authors@R: c(person("Christian", "Panse", | ||
email = "[email protected]", | ||
role = c("aut", "cre"), | ||
|
@@ -12,7 +12,7 @@ Authors@R: c(person("Christian", "Panse", | |
comment = c(ORCID = "0000-0002-1847-885X"))) | ||
Depends: R (>= 4.1) | ||
Imports: | ||
grDevices, graphics, stats, utils | ||
grDevices, graphics, stats, utils, ggplot2 | ||
Suggests: | ||
BiocStyle (>= 2.5), | ||
ExperimentHub, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#R | ||
# contains selected rawDiag plot methods | ||
# | ||
#' lock mass correction plot | ||
#' @inheritParams readFileHeader | ||
#' @return a ggplot object | ||
#' @author Christian Trachsel (2017), Christian Panse (2023) | ||
#' @references rawDiag \doi{10.1021/acs.jproteome.8b00173} | ||
#' @examples | ||
#' rawrr::sampleFilePath() |> rawrr:::.plotLockMassCorrection() | ||
#' @importFrom ggplot2 ggplot aes_string geom_hline geom_line labs scale_x_continuous facet_wrap theme_light | ||
.plotLockMassCorrection <- function(rawfile){ | ||
stopifnot("LM m/z-Correction (ppm):" %in% rawrr::readTrailer(rawfile)) | ||
|
||
message("Plotting lock mass correction for ", basename(rawfile)) | ||
message("reading index for ", basename(rawfile), "...") | ||
|
||
rawfile |> | ||
rawrr::readIndex() -> rawrrIndex | ||
|
||
message("reading LM m/z-Correction (ppm) ...") | ||
rawfile |> | ||
rawrr::readTrailer("LM m/z-Correction (ppm):") |> | ||
as.numeric() -> | ||
LMCorrection | ||
|
||
rawrrIndex$LMCorrection <- LMCorrection | ||
rawrrIndex$rawfile <- basename(rawfile) | ||
|
||
rawrrIndex |> | ||
base::subset(rawrrIndex$MSOrder == "Ms") |> | ||
ggplot2::ggplot(ggplot2::aes_string(x = "StartTime" , y = "LMCorrection")) + | ||
ggplot2::geom_hline(yintercept = c(-5, 5), colour = "red3", linetype = "longdash") + | ||
ggplot2::geom_line(size = 0.3) + | ||
ggplot2::geom_line(stat = "smooth", | ||
method= "gam", | ||
formula = y ~ s(x, bs ="cs"), | ||
colour = "deepskyblue3", se = FALSE) + | ||
ggplot2::labs(title = "Lock mass correction plot") + | ||
ggplot2::labs(subtitle = "Plotting lock mass correction value versus retention time") + | ||
ggplot2::labs(x = "Retention Time [min]", y = "Lock Mass Correction [ppm]") + | ||
ggplot2::scale_x_continuous(breaks = base::pretty(8)) + | ||
# scale_y_continuous(breaks = scales::pretty_breaks(8), limits = c(-10, 10)) + | ||
ggplot2::facet_wrap(~ rawfile) + | ||
ggplot2::theme_light() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.