CalibraCurve 0.99.2
library("CalibraCurve")
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds",
package = "CalibraCurve")
D <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance")
RES <- CalibraCurve(D)
If multiple analytes are present in the data, CalibraCurve
by default plots
each calibration curve separately and saves them in separate files.
There are, however, two possibilities to combine the calibration curves.
The multiplot option allows to arrange the different curves in a grid. This
functionality is based on the facet_wrap
function from ggplot2
.
RES <- CalibraCurve(D, plot_type = "multiplot")
RES$plot_CC_list
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
The single plots are arranged in a grid. The number of rows and columns is
chosen automatically by default, but can be changed by using the
multiplot_nrow
and multiplot_ncol
parameters:
RES <- CalibraCurve(D, plot_type = "multiplot", multiplot_nrow = 3,
multiplot_ncol = 4)
RES$plot_CC_list
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
By default, the x and y-axis ranges are individual per plot
multiplot_scales = "fixed"
.
Sometimes it makes sense to fix both axis or only one of them for better
comparability. For this, the multiplot_scales
parameter
can be set to fixed
, fixed_y
or fixed_x
:
RES <- CalibraCurve(D, plot_type = "multiplot", multiplot_scales = "fixed")
RES$plot_CC_list
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
Now, the x- and y-axes are scaled the same for each plot, so the intensity values can be directly compared between plots.
As a second option, the "all_in_one"
option allows to plot all curves into
the same graphic, so a more direct comparison is possible:
RES <- CalibraCurve(D, plot_type = "all_in_one")
RES$plot_CC_list
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
Each of the 9 calibration curves is presented in the same plot in different colours (see legend). Please note that for better visability, the linear ranges are not indicated by the grey background anymore. However, data points outside of the linear range are still plotted with a higher transparency (alpha-value).
Different colours can be changed in the plots. For the calibration curves, the
colour of the data points (point_colour
), the colour of the curve
(curve_colour
) and of the linear range (linear_range_colour
) can be
customized. The colours can be given as the colour name or the hexadecimal
colour code:
RES <- CalibraCurve(D, point_colour = "blue", curve_colour = "black",
linear_range_colour = "red")
RES$plot_CC_list[[1]]
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
For the response factor plots, the colour of data points and corresponding
connection lines within and outside of the thresholds (RF_colour_within
and
RF_colour_outside
) can be adapted. Furthermore, the colour of the threshold
lines can be changed (RF_colour_threshold
).
RES <- CalibraCurve(D, RF_colour_threshold = "grey",
RF_colour_within = "purple",
RF_colour_outside = "darkgreen")
RES$plot_RF_list[[1]]
The plotting of the data points can be omitted. This makes sense especially when multiple curves are plotted in the same plot. As a downside, information on the linear ranges is lost:
RES <- CalibraCurve(D, plot_type = "all_in_one", show_data_points = FALSE)
RES$plot_CC_list
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
It is also possible to remove the background that indicates the linear range. Also, it is possible to write the regression curve equation (upper left corner of the plot) and the R squared value into the plot, which is turned off by default:
RES <- CalibraCurve(D, show_linear_range = FALSE, show_regression_info = TRUE)
RES$plot_CC_list[[1]]
#> Warning in ggplot2::scale_x_continuous(trans = "log10", labels = scales::label_comma(drop0trailing = TRUE)): log-10
#> transformation introduced infinite values.
Furthermore, the axis labels can be changed, in this example we specify the labels to match the underlying data set:
RES <- CalibraCurve(D, xlab = "Amount (fmol)", ylab = "Area")
RES$plot_CC_list[[1]]
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
It has to be noted that the plots are returned as ggplot2 objects by the respective functions. Therefore, even more customizations can be done by using the ggplot2 functionality. For example, we can give the plot a title and use a different theme which does not contain a grid in the background:
RES <- CalibraCurve(D)
pl <- RES$plot_CC_list[[1]]
library(ggplot2)
pl <- pl + ggtitle("Calibration Curve") + theme_classic()
pl
#> Warning in ggplot2::scale_y_continuous(trans = "log10"): log-10 transformation introduced infinite values.
R
session information.
#> ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.5.1 Patched (2025-08-23 r88802)
#> os Ubuntu 24.04.3 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate C
#> ctype en_US.UTF-8
#> tz America/New_York
#> date 2025-10-16
#> pandoc 2.7.3 @ /usr/bin/ (via rmarkdown)
#> quarto 1.7.32 @ /usr/local/bin/quarto
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> abind 1.4-8 2024-09-12 [2] CRAN (R 4.5.1)
#> backports 1.5.0 2024-05-23 [2] CRAN (R 4.5.1)
#> bibtex 0.5.1 2023-01-26 [2] CRAN (R 4.5.1)
#> Biobase 2.69.1 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> BiocGenerics 0.55.3 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> BiocManager 1.30.26 2025-06-05 [2] CRAN (R 4.5.1)
#> BiocStyle * 2.37.1 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> bookdown 0.45 2025-10-03 [2] CRAN (R 4.5.1)
#> bslib 0.9.0 2025-01-30 [2] CRAN (R 4.5.1)
#> cachem 1.1.0 2024-05-16 [2] CRAN (R 4.5.1)
#> CalibraCurve * 0.99.2 2025-10-16 [1] Bioconductor 3.22 (R 4.5.1)
#> checkmate 2.3.3 2025-08-18 [2] CRAN (R 4.5.1)
#> cli 3.6.5 2025-04-23 [2] CRAN (R 4.5.1)
#> crayon 1.5.3 2024-06-20 [2] CRAN (R 4.5.1)
#> DelayedArray 0.35.3 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> dichromat 2.0-0.1 2022-05-02 [2] CRAN (R 4.5.1)
#> digest 0.6.37 2024-08-19 [2] CRAN (R 4.5.1)
#> dplyr 1.1.4 2023-11-17 [2] CRAN (R 4.5.1)
#> evaluate 1.0.5 2025-08-27 [2] CRAN (R 4.5.1)
#> farver 2.1.2 2024-05-13 [2] CRAN (R 4.5.1)
#> fastmap 1.2.0 2024-05-15 [2] CRAN (R 4.5.1)
#> generics 0.1.4 2025-05-09 [2] CRAN (R 4.5.1)
#> GenomicRanges 1.61.5 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> ggplot2 * 4.0.0 2025-09-11 [2] CRAN (R 4.5.1)
#> glue 1.8.0 2024-09-30 [2] CRAN (R 4.5.1)
#> gtable 0.3.6 2024-10-25 [2] CRAN (R 4.5.1)
#> htmltools 0.5.8.1 2024-04-04 [2] CRAN (R 4.5.1)
#> httr 1.4.7 2023-08-15 [2] CRAN (R 4.5.1)
#> IRanges 2.43.5 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> jquerylib 0.1.4 2021-04-26 [2] CRAN (R 4.5.1)
#> jsonlite 2.0.0 2025-03-27 [2] CRAN (R 4.5.1)
#> knitr 1.50 2025-03-16 [2] CRAN (R 4.5.1)
#> labeling 0.4.3 2023-08-29 [2] CRAN (R 4.5.1)
#> lattice 0.22-7 2025-04-02 [3] CRAN (R 4.5.1)
#> lifecycle 1.0.4 2023-11-07 [2] CRAN (R 4.5.1)
#> lubridate 1.9.4 2024-12-08 [2] CRAN (R 4.5.1)
#> magrittr 2.0.4 2025-09-12 [2] CRAN (R 4.5.1)
#> Matrix 1.7-4 2025-08-28 [3] CRAN (R 4.5.1)
#> MatrixGenerics 1.21.0 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> matrixStats 1.5.0 2025-01-07 [2] CRAN (R 4.5.1)
#> openxlsx 4.2.8 2025-01-25 [2] CRAN (R 4.5.1)
#> pillar 1.11.1 2025-09-17 [2] CRAN (R 4.5.1)
#> pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.5.1)
#> plyr 1.8.9 2023-10-02 [2] CRAN (R 4.5.1)
#> purrr 1.1.0 2025-07-10 [2] CRAN (R 4.5.1)
#> R6 2.6.1 2025-02-15 [2] CRAN (R 4.5.1)
#> RColorBrewer 1.1-3 2022-04-03 [2] CRAN (R 4.5.1)
#> Rcpp 1.1.0 2025-07-02 [2] CRAN (R 4.5.1)
#> RefManageR * 1.4.0 2022-09-30 [2] CRAN (R 4.5.1)
#> rlang 1.1.6 2025-04-11 [2] CRAN (R 4.5.1)
#> rmarkdown 2.30 2025-09-28 [2] CRAN (R 4.5.1)
#> S4Arrays 1.9.1 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> S4Vectors 0.47.4 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> S7 0.2.0 2024-11-07 [2] CRAN (R 4.5.1)
#> sass 0.4.10 2025-04-11 [2] CRAN (R 4.5.1)
#> scales 1.4.0 2025-04-24 [2] CRAN (R 4.5.1)
#> Seqinfo 0.99.2 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> sessioninfo * 1.2.3 2025-02-05 [2] CRAN (R 4.5.1)
#> SparseArray 1.9.1 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> stringi 1.8.7 2025-03-27 [2] CRAN (R 4.5.1)
#> stringr 1.5.2 2025-09-08 [2] CRAN (R 4.5.1)
#> SummarizedExperiment 1.39.2 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> tibble 3.3.0 2025-06-08 [2] CRAN (R 4.5.1)
#> tidyr 1.3.1 2024-01-24 [2] CRAN (R 4.5.1)
#> tidyselect 1.2.1 2024-03-11 [2] CRAN (R 4.5.1)
#> timechange 0.3.0 2024-01-18 [2] CRAN (R 4.5.1)
#> vctrs 0.6.5 2023-12-01 [2] CRAN (R 4.5.1)
#> withr 3.0.2 2024-10-28 [2] CRAN (R 4.5.1)
#> xfun 0.53 2025-08-19 [2] CRAN (R 4.5.1)
#> xml2 1.4.0 2025-08-20 [2] CRAN (R 4.5.1)
#> XVector 0.49.1 2025-10-16 [2] Bioconductor 3.22 (R 4.5.1)
#> yaml 2.3.10 2024-07-26 [2] CRAN (R 4.5.1)
#> zip 2.3.3 2025-05-13 [2] CRAN (R 4.5.1)
#>
#> [1] /tmp/Rtmptowtjq/Rinst3ca11811b3798
#> [2] /home/biocbuild/bbs-3.22-bioc/R/site-library
#> [3] /home/biocbuild/bbs-3.22-bioc/R/library
#> * ── Packages attached to the search path.
#>
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
This vignette was generated using BiocStyle (Oleś, 2025) with knitr (Xie, 2025) and rmarkdown (Allaire Xie et al., 2025) running behind the scenes.
Citations made with RefManageR (McLean, 2017).
Allaire, J., Y. Xie, et al. (2025). rmarkdown: Dynamic Documents for R. R package version 2.30. URL: https://github.com/rstudio/rmarkdown.
Kohl, M., M. Stepath, et al. (2020). “CalibraCurve: A Tool for Calibration of Targeted MS-Based Measurements”. In: Proteomics, p. 1900143. DOI: https://doi.org/10.1002/pmic.201900143. URL: https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/pmic.201900143.
McLean, M. W. (2017). “RefManageR: Import and Manage BibTeX and BibLaTeX References in R”. In: The Journal of Open Source Software. DOI: 10.21105/joss.00338.
Oleś, A. (2025). BiocStyle: Standard styles for vignettes and other Bioconductor documents. R package version 2.37.1. DOI: 10.18129/B9.bioc.BiocStyle. URL: https://bioconductor.org/packages/BiocStyle.
Xie, Y. (2025). knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.50. URL: https://yihui.org/knitr/.