| Title: | Calibration curves for targeted proteomics, lipidomics and metabolomics data |
|---|---|
| Description: | CalibraCurve is a computational tool designed to generate calibration curves for targeted mass spectrometry-based quantitative data. It is applicable to various omics disciplines, including proteomics, lipidomics, and metabolomics. The package also offers functionalities for data and calibration curve visualization and concentration prediction from new datasets based on the established curves. |
| Authors: | Karin Schork [aut, cre] (ORCID: <https://orcid.org/0000-0003-3756-4347>), Robin Grugel [aut], Michael Kohl [aut], Markus Stepath [aut], Martin Eisenacher [aut, fnd] |
| Maintainer: | Karin Schork <[email protected]> |
| License: | BSD 3-clause License + file LICENSE |
| Version: | 1.3.0 |
| Built: | 2026-05-31 06:41:28 UTC |
| Source: | https://github.com/bioc/CalibraCurve |
PLR: Calculate key features for the existing continuous preliminary ranges
.calcContPrelimRanges(index).calcContPrelimRanges(index)
index |
integer |
Data.frame with one range in each row. Contains the columns "startPoints", "endPoints", and "extent".
PLR: calculate CV for one concentration level
.calcCV(x).calcCV(x)
x |
data.frame |
numeric(1)
Coefficient of variation (CV) for the given
concentration level.
FLR: calculate weighted or unweighted linear model
.calcLinearModel(x, weights = NULL).calcLinearModel(x, weights = NULL)
x |
list of data.frames |
weights |
numeric |
Fit of the linear model as an object of class "lm".
FLR: calculate percent bias for a specific concentration level
.calcPerBias(x, LMfit, expConc).calcPerBias(x, LMfit, expConc)
x |
data.frame |
LMfit |
lm object |
expConc |
numeric(1) |
Vector of percent bias values for each data point in this concentration level.
FLR: calculate average, SD and CV percent bias for each concentration level
.calcPerBiasAvgSDCV(x, method = "mean").calcPerBiasAvgSDCV(x, method = "mean")
x |
list |
method |
character(1) |
data frame with 3 columns: avgPerBias, stdDevPerBias, CV_PerBias
each row is one concentration level
FLR: calculate list of percent bias values for all concentration levels
.calcPerBiasLevels(x, LMfit).calcPerBiasLevels(x, LMfit)
x |
list of data.frames |
LMfit |
lm object |
List with percent bias values for each data point per concentration level
Function, which calculates a response factor for a single data point
.calcResponseFactors(x, intercept, expConc).calcResponseFactors(x, intercept, expConc)
x |
data.frame* |
intercept |
numeric(1) |
expConc |
numeric(1) |
Formula obtained from: Green, J. M., A practical guide to analytical method validation. Analytical Chemistry 1996, 68, 305A-309A.
vector of response factors for this specific concentration level
FLR: calculate weights for linear model for a specific concentration level
.calcWeights(x, weightingMethod = "1/x^2").calcWeights(x, weightingMethod = "1/x^2")
x |
data.frame |
weightingMethod |
character(1) |
Vector of a constant weights for each measurement in this concentration level.
FLR: checks if final linear range has been reached (compare average percent bias with threshold)
.checkFinalRange(perBiasInfo, perBiasThres = 20).checkFinalRange(perBiasInfo, perBiasThres = 20)
perBiasInfo |
data.frame Result of
|
perBiasThres |
numeric(1) numeric(1) |
TRUE if both lowest and highest concentration level passed the check (and the final linear range is reached), FALSE otherwise
Data preprocessing: Helper function to check for sufficient number of replicates for a specific concentration level
.checkNumberReplicates(x, data, minReplicates).checkNumberReplicates(x, data, minReplicates)
x |
numeric(1) |
data |
list of data.frames |
minReplicates |
integer(1) |
logical(1)
TRUE if there are enough replicates, else FALSE
Data preprocessing: Helper function to select all rows from a specific concentration level
.filterConcentrationLevel(x, data).filterConcentrationLevel(x, data)
x |
numeric(1) |
data |
data.frame |
data.frame
Prepare annotation data
.prepareAnnotationData(D_calib).prepareAnnotationData(D_calib)
D_calib |
data.frame |
Dataframe with annotation data for the plot.
Prepare calibration data
.prepareCalibData(CC_RES).prepareCalibData(CC_RES)
CC_RES |
list Result object of |
Dataframe with calibration data for plotting.
Prepare curve data
.prepareCurveData(CC_RES, D_calib).prepareCurveData(CC_RES, D_calib)
CC_RES |
list |
D_calib |
data.frame |
Dataframe with data points on a grid to plot the calibration curve.
Save results of CalibraCurve
.saveCCResult(CC_res, output_path, suffix = "").saveCCResult(CC_res, output_path, suffix = "")
CC_res |
list Result object of |
output_path |
character(1) |
suffix |
character(1) |
Returns nothing, but the function saves the results to the specified output path.
Save result tables and plots
.saveTablesAndPlots( RES, output_path, pl_CC_list, pl_RF_list, summary_tab, CC_plot_width, CC_plot_height, RF_plot_width, RF_plot_height, plot_type, plot_dpi, device ).saveTablesAndPlots( RES, output_path, pl_CC_list, pl_RF_list, summary_tab, CC_plot_width, CC_plot_height, RF_plot_width, RF_plot_height, plot_type, plot_dpi, device )
RES |
list |
output_path |
character(1) |
pl_CC_list |
list |
pl_RF_list |
list |
summary_tab |
data.frame |
CC_plot_width |
numeric(1) |
CC_plot_height |
numeric(1) |
RF_plot_width |
numeric(1) |
RF_plot_height |
numeric(1) |
plot_type |
character(1) |
plot_dpi |
numeric(1) |
device |
character(1) |
Invisible NULL. Plots and the summary table are saved to the hard drive.
FLR: selects the highest or lowest concentration level for removal
.selctConcLevel(x, perBiasT = 20, consPerBiasCV = TRUE, perBiasDistT = 10).selctConcLevel(x, perBiasT = 20, consPerBiasCV = TRUE, perBiasDistT = 10)
x |
data.frame Result of |
perBiasT |
numeric(1) |
consPerBiasCV |
consider CV? default is TRUE |
perBiasDistT |
numeric(1) |
TRUE, if lowest concentration will be removed, FALSE if highest will be removed
Assemble result tables
assemble_results( X, dataCleaned, PLR_res, resFacDataV, avgResFacDataV, FLR_res, mod, cvThres = 20, RfThresL = 80, RfThresU = 120, substance = "substance1" )assemble_results( X, dataCleaned, PLR_res, resFacDataV, avgResFacDataV, FLR_res, mod, cvThres = 20, RfThresL = 80, RfThresU = 120, substance = "substance1" )
X |
data.frame |
dataCleaned |
list of data.frames |
PLR_res |
list |
resFacDataV |
list |
avgResFacDataV |
numeric |
FLR_res |
list Result object of |
mod |
lm object |
cvThres |
numeric(1) |
RfThresL |
numeric(1) |
RfThresU |
numeric(1) |
substance |
character(1) |
List with the following elements:
result_table_conc_levels: Result table with one line for each
concentration level.
result_table_obs: Result table with one line per observation (e.g.
individual response factors for each data point).
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) RES_FLR <- calculate_FLR(RES_PLR$dataPrelim) RFs <- calcRF(data_cleaned, mod = RES_FLR$mod) assemble_results( X = D_list[[1]], dataCleaned = data_cleaned, PLR_res = RES_PLR, resFacDataV = RFs$RFs, avgResFacDataV = RFs$meanRFs, FLR_res = RES_FLR, mod = RES_FLR$mod )file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) RES_FLR <- calculate_FLR(RES_PLR$dataPrelim) RFs <- calcRF(data_cleaned, mod = RES_FLR$mod) assemble_results( X = D_list[[1]], dataCleaned = data_cleaned, PLR_res = RES_PLR, resFacDataV = RFs$RFs, avgResFacDataV = RFs$meanRFs, FLR_res = RES_FLR, mod = RES_FLR$mod )
Calculate all necessary steps for a single calibration curve
calc_single_curve( D, substance = "substance", minReplicates = 3, cvThres = 20, calcContinuousPrelimRanges = FALSE, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10, RfThresL = 80, RfThresU = 120 )calc_single_curve( D, substance = "substance", minReplicates = 3, cvThres = 20, calcContinuousPrelimRanges = FALSE, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10, RfThresL = 80, RfThresU = 120 )
D |
data.frame data set, e.g. result of |
substance |
character(1) |
minReplicates |
integer(1) |
cvThres |
numeric(1) |
calcContinuousPrelimRanges |
logical(1) |
weightingMethod |
character(1) |
centralTendencyMeasure |
character(1) |
perBiasThres |
numeric(1) |
considerPerBiasCV |
logical(1) |
perBiasDistThres |
numeric(1) |
RfThresL |
numeric(1) |
RfThresU |
numeric(1) |
List with the following elements:
mod: lm-object containing the final linear model.
final_linear_range: vector of concentration levels that are part of
the final linear range.
weightingMethod: weighting method used for the linear model.
result_table_conc_levels: Result table with one line for each
concentration level (generated by assemble_results).
result_table_obs: Result table with one line per observation (e.g.
individual response factors for each data point) (generated by
assemble_results).
data_path <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve") D <- readDataTable(dataPath = data_path, concCol = 16, measCol = 12, fileType = "xlsx") calc_single_curve(D = D)data_path <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve") D <- readDataTable(dataPath = data_path, concCol = 16, measCol = 12, fileType = "xlsx") calc_single_curve(D = D)
Final linear range: Function, which returns a list with response factor values for a data set (given as list)
calcRF(x, mod)calcRF(x, mod)
x |
list of data.frames |
mod |
lm object |
List with the following elements:
RFs: List with response factors for each concentration level.
meanRFs: Vector with mean response factors for each concentration
level.
response factor values for each concentration level.
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) RES_FLR <- calculate_FLR(RES_PLR$dataPrelim) calcRF(data_cleaned, mod = RES_FLR$mod)file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) RES_FLR <- calculate_FLR(RES_PLR$dataPrelim) calcRF(data_cleaned, mod = RES_FLR$mod)
Calculate the final linear range
calculate_FLR( dataPrelim, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10 )calculate_FLR( dataPrelim, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10 )
dataPrelim |
list of data.frames |
weightingMethod |
character(1) |
centralTendencyMeasure |
character(1) |
perBiasThres |
numeric(1) |
considerPerBiasCV |
logical(1) |
perBiasDistThres |
numeric(1) |
List with the following elements:
dataFinal: List of data.frames containing data only within the
final linear range.
mod: lm-object containing the final linear model (weighted or
unweighted, depending on weightingMethod).
perBias: result list of .calcPerBiasLevels.
perBiasAvgSDCV: result data.frame of
.calcPerBiasAvgSDCV.
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) calculate_FLR(RES_PLR$dataPrelim)file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) RES_PLR <- calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE) calculate_FLR(RES_PLR$dataPrelim)
Calculate preliminary linear range (PLR)
calculate_PLR(dataCleaned, cvThres = 20, calcContinuousPrelimRanges = TRUE)calculate_PLR(dataCleaned, cvThres = 20, calcContinuousPrelimRanges = TRUE)
dataCleaned |
data.frame |
cvThres |
numeric(1) |
calcContinuousPrelimRanges |
logical(1) |
List with the following elements:
dataPrelim: List of data.frames containing data only within the
preliminary linear range.
concLevelsCV: Vector with the calculated CV for each concentration
level.
prelimConcLevels: Vector with the concentration levels within the
preliminary linear range.
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE)file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) data_cleaned <- cleanData(D_list[[1]]) calculate_PLR(data_cleaned, calcContinuousPrelimRanges = FALSE)
CalibraCurve
CalibraCurve( D_list, output_path = NULL, substance = "substance", minReplicates = 3, cvThres = 20, calcContinuousPrelimRanges = FALSE, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10, RfThresL = 80, RfThresU = 120, plot_type = "single_plots", RF_colour_threshold = "orange", RF_colour_within = "#00BFC4", RF_colour_outside = "#F8766D", device = "png", CC_plot_width = 15, CC_plot_height = 10, RF_plot_width = 15, RF_plot_height = 10, base_size = 11, RF_legend = FALSE, plot_dpi = 300, verbose = TRUE, ... )CalibraCurve( D_list, output_path = NULL, substance = "substance", minReplicates = 3, cvThres = 20, calcContinuousPrelimRanges = FALSE, weightingMethod = "1/x^2", centralTendencyMeasure = "mean", perBiasThres = 20, considerPerBiasCV = TRUE, perBiasDistThres = 10, RfThresL = 80, RfThresU = 120, plot_type = "single_plots", RF_colour_threshold = "orange", RF_colour_within = "#00BFC4", RF_colour_outside = "#F8766D", device = "png", CC_plot_width = 15, CC_plot_height = 10, RF_plot_width = 15, RF_plot_height = 10, base_size = 11, RF_legend = FALSE, plot_dpi = 300, verbose = TRUE, ... )
D_list |
data.frame/list |
output_path |
character(1) |
substance |
character(1) |
minReplicates |
integer(1) |
cvThres |
numeric(1) |
calcContinuousPrelimRanges |
logical(1) |
weightingMethod |
character(1) |
centralTendencyMeasure |
character(1) |
perBiasThres |
numeric(1) |
considerPerBiasCV |
logical(1) |
perBiasDistThres |
numeric(1) |
RfThresL |
numeric(1) |
RfThresU |
numeric(1) |
plot_type |
character(1) |
RF_colour_threshold |
character(1) |
RF_colour_within |
character(1) |
RF_colour_outside |
character(1) |
device |
character(1) |
CC_plot_width |
numeric(1) |
CC_plot_height |
numeric(1) |
RF_plot_width |
numeric(1) |
RF_plot_height |
numeric(1) |
base_size |
numeric(1) |
RF_legend |
logical(1) |
plot_dpi |
numeric(1) |
verbose |
logical(1) |
... |
additional parameters for |
List with the following elements:
RES: List of CalibraCurve results (one item per substance, output
from calc_single_curve).
summary_tab: Data.frame with summary information about the
calibration curves, one row per substance.
plot_CC_list: List of ggplot2 objects of the calibration curves
(one per substance for "single_plots", otherwise only one item).
plot_RF_list: List of ggplot2 objects of the response factor plots
(one item).
### NOTE: as output_path is not specified here, no files will be saved. ### Set output_path to a folder of your choice to save the results. ### single xlsx file: data_path <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve") D <- readDataTable(dataPath = data_path, concCol = 16, measCol = 12, fileType = "xlsx") RES <- CalibraCurve(D_list = D) RES$plot_CC_list RES$plot_RF_list ### multiple xlsx files (in a folder) as multiplot: data_folder <- system.file("extdata", "MSQC1_xlsx", package = "CalibraCurve") D_list <- readMultipleTables(dataFolder = data_folder, fileType = "xlsx", concCol = 16, measCol = 12) RES <- CalibraCurve(D_list = D_list, plot_type = "multiplot") RES$plot_CC_list ### single rds file (SummarizedExperiment) as an all-in-one plot: file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(dataPath = file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) RES <- CalibraCurve(D_list, plot_type = "all_in_one") RES$plot_CC_list### NOTE: as output_path is not specified here, no files will be saved. ### Set output_path to a folder of your choice to save the results. ### single xlsx file: data_path <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve") D <- readDataTable(dataPath = data_path, concCol = 16, measCol = 12, fileType = "xlsx") RES <- CalibraCurve(D_list = D) RES$plot_CC_list RES$plot_RF_list ### multiple xlsx files (in a folder) as multiplot: data_folder <- system.file("extdata", "MSQC1_xlsx", package = "CalibraCurve") D_list <- readMultipleTables(dataFolder = data_folder, fileType = "xlsx", concCol = 16, measCol = 12) RES <- CalibraCurve(D_list = D_list, plot_type = "multiplot") RES$plot_CC_list ### single rds file (SummarizedExperiment) as an all-in-one plot: file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(dataPath = file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) RES <- CalibraCurve(D_list, plot_type = "all_in_one") RES$plot_CC_list
Clean data (remove 0s and NAs, remove concentration levels with insufficient number of replicates)
cleanData(rawData, minReplicates = 3)cleanData(rawData, minReplicates = 3)
rawData |
data.frame |
minReplicates |
integer(1) |
list of data.frames, each element contains data for a specific concentration level
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) cleanData(D_list[[1]])file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) cleanData(D_list[[1]])
Plot the calibration curve
plotCalibraCurve( CC_RES, ylab = "Intensity", xlab = "Concentration", show_regression_info = FALSE, show_linear_range = TRUE, show_data_points = TRUE, plot_type = "multiplot", point_colour = "black", curve_colour = "red", linear_range_colour = "black", multiplot_nrow = NULL, multiplot_ncol = NULL, multiplot_scales = "free", regression_info_size = 3, base_size = 11 )plotCalibraCurve( CC_RES, ylab = "Intensity", xlab = "Concentration", show_regression_info = FALSE, show_linear_range = TRUE, show_data_points = TRUE, plot_type = "multiplot", point_colour = "black", curve_colour = "red", linear_range_colour = "black", multiplot_nrow = NULL, multiplot_ncol = NULL, multiplot_scales = "free", regression_info_size = 3, base_size = 11 )
CC_RES |
list |
ylab |
character(1) |
xlab |
character(1) |
show_regression_info |
logical(1) |
show_linear_range |
logical(1) |
show_data_points |
logical(1) |
plot_type |
character(1) |
point_colour |
character(1) |
curve_colour |
character(1) |
linear_range_colour |
character(1) |
multiplot_nrow |
integer(1) |
multiplot_ncol |
integer(1) |
multiplot_scales |
character(1) |
regression_info_size |
numeric(1) |
base_size |
numeric(1) |
List of a ggplot2 object containing the calibration curve plot (CC_plot) and a data.frame containing summary data for annotations (annotation_dat).
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) CC_RES <- calc_single_curve(D_list[[1]], calcContinuousPrelimRanges = FALSE) plotCalibraCurve(list(substance = CC_RES))file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) CC_RES <- calc_single_curve(D_list[[1]], calcContinuousPrelimRanges = FALSE) plotCalibraCurve(list(substance = CC_RES))
Plot response factors
plotResponseFactors( RES, RfThresL = 80, RfThresU = 120, ylab = "Response Factor", xlab = "Concentration", colour_threshold = "orange", colour_within = "#00BFC4", colour_outside = "#F8766D", legend = FALSE, base_size = 11, substance = NULL )plotResponseFactors( RES, RfThresL = 80, RfThresU = 120, ylab = "Response Factor", xlab = "Concentration", colour_threshold = "orange", colour_within = "#00BFC4", colour_outside = "#F8766D", legend = FALSE, base_size = 11, substance = NULL )
RES |
list |
RfThresL |
numeric(1) |
RfThresU |
numeric(1) |
ylab |
character(1) |
xlab |
character(1) |
colour_threshold |
character(1) |
colour_within |
character(1) |
colour_outside |
character(1) |
legend |
logical(1) |
base_size |
numeric(1) |
substance |
character(1) |
A ggplot2 object containing the response factor plot.
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) CC_RES <- calc_single_curve(D_list[[1]], calcContinuousPrelimRanges = FALSE) plotResponseFactors(RES = CC_RES)file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve" ) D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 ) CC_RES <- calc_single_curve(D_list[[1]], calcContinuousPrelimRanges = FALSE) plotResponseFactors(RES = CC_RES)
Predict concentrations from intensity values based on a given calibration curve
predictConcentration(CC_res, newdata, verbose = TRUE)predictConcentration(CC_res, newdata, verbose = TRUE)
CC_res |
list |
newdata |
numeric |
verbose |
logical(1) |
The function will give a warning if any of the predicted concentrations are outside the final linear range. This is important to ensure that the predictions are reliable and within the linear range of the calibration curve.
A data frame with the following columns:
intensity: The input intensity values.
predicted_concentrations: The predicted concentrations based on the
calibration curve.
linear_range: A logical vector indicating whether the predicted
concentrations are within the final linear range.
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance") RES <- CalibraCurve(D) newdata <- c(1000000, 10000000, 100000000) # 1e6, 1e7, 1e8 predictConcentration(RES$RES[[4]], newdata = newdata)file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance") RES <- CalibraCurve(D) newdata <- c(1000000, 10000000, 100000000) # 1e6, 1e7, 1e8 predictConcentration(RES$RES[[4]], newdata = newdata)
Read data stored as an SummarizedExperiment object (directly or stored in an .rds file). Extracts the two relevant columns (concentration and measurement) and orders the data by increasing concentration level.
readDataSE( dataPath = NULL, rawDataSE = NULL, concColName, substColName, assayNumber = 1, rowNumbers = NULL )readDataSE( dataPath = NULL, rawDataSE = NULL, concColName, substColName, assayNumber = 1, rowNumbers = NULL )
dataPath |
character(1) |
rawDataSE |
SummarizedExperiment |
concColName |
character(1) |
substColName |
character(1) |
assayNumber |
integer(1) |
rowNumbers |
integer |
The SummarizedExperiments object may contain quantitative values from targeted proteomics, lipidomics or metabolomics experiments. The colData has to contain a column with the concentration levels (concColName). The rowData has to contain a column with the substance names (e.g. peptide sequence, name of lipid or metabolite etc).
List of data.frame, each with two numeric columns: Concentration and Measurement
file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) # Alternative: import SummarizedExperiment object directly rawDataSE <- readRDS(file) D_list2 <- readDataSE(rawDataSE = rawDataSE, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 )file <- system.file("extdata", "MSQC1", "msqc1_dil_GGPFSDSYR.rds", package = "CalibraCurve") D_list <- readDataSE(file, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1) # Alternative: import SummarizedExperiment object directly rawDataSE <- readRDS(file) D_list2 <- readDataSE(rawDataSE = rawDataSE, concColName = "amount_fmol", substColName = "Substance", assayNumber = 1 )
Read data in different table input formats (xlsx, csv or txt). Extracts the two relevant columns (concentration and measurement) and orders the data by increasing concentration.
readDataTable( dataPath, fileType, concCol, measCol, substCol = NULL, sep = ",", dec = ".", header = TRUE, naStrings = c("NA", "NaN", "Filtered", "#NV"), sheet = 1 )readDataTable( dataPath, fileType, concCol, measCol, substCol = NULL, sep = ",", dec = ".", header = TRUE, naStrings = c("NA", "NaN", "Filtered", "#NV"), sheet = 1 )
dataPath |
character(1) |
fileType |
character(1) |
concCol |
integer(1) |
measCol |
integer |
substCol |
integer |
sep |
character(1) |
dec |
character(1) |
header |
logical(1) |
naStrings |
character |
sheet |
integer(1) |
Data.frame with two numeric columns: Concentration and Measurement
### xlsx file: file <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve" ) D <- readDataTable(file, fileType = "xlsx", concCol = 16, measCol = 12)### xlsx file: file <- system.file("extdata", "MSQC1_xlsx", "GGPFSDSYR_QTRAP_y5.xlsx", package = "CalibraCurve" ) D <- readDataTable(file, fileType = "xlsx", concCol = 16, measCol = 12)
Read folder of files in different table input formats (xlsx, csv or txt).
readMultipleTables(dataFolder, fileType, concCol, measCol, ...)readMultipleTables(dataFolder, fileType, concCol, measCol, ...)
dataFolder |
character(1) |
fileType |
character(1) |
concCol |
integer(1) |
measCol |
integer |
... |
additional parameters to |
List of data.frame, each with two numeric columns: Concentration and Measurement
data_folder <- system.file("extdata", "MSQC1_xlsx", package = "CalibraCurve") D_list <- readMultipleTables( dataFolder = data_folder, fileType = "xlsx", concCol = 16, measCol = 12 )data_folder <- system.file("extdata", "MSQC1_xlsx", package = "CalibraCurve") D_list <- readMultipleTables( dataFolder = data_folder, fileType = "xlsx", concCol = 16, measCol = 12 )