Skip to content

Commit b95ba4a

Browse files
committed
allow calibration curves for single replicate experiments
1 parent 82daf18 commit b95ba4a

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: CalibraCurve
22
Title: Calibration curves for targeted proteomics, lipidomics and metabolomics data
3-
Version: 1.1.1
3+
Version: 1.1.2
44
Authors@R: c(
55
person("Karin", "Schork", , "karin.schork@rub.de", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-3756-4347")),

NEWS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@
22

33

44
# 0.99.0
5-
65
Initial submission to BioConductor.
6+
7+
8+
# 1.1.1
9+
Bugfixes
10+
11+
# 1.1.2
12+
Allow calculation of calibration curves with only one replicate per concentration level.
13+
14+
15+

R/02_preliminary_linear_range.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ calculate_PLR <- function(dataCleaned, cvThres = 20,
9797
#' @importFrom stats sd
9898
#'
9999
.calcCV <- function(x) {
100-
SD <- stats::sd(x$Measurement)
100+
if (nrow(x) == 1) { #only one raplicate
101+
SD <- 0
102+
} else {
103+
SD <- stats::sd(x$Measurement)
104+
}
101105
Mean <- mean(x$Measurement)
102106
CV <- SD / Mean * 100
103107
names(CV) <- NULL

R/03_final_linear_range.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ calculate_FLR <- function(dataPrelim, weightingMethod = "1/x^2",
155155
calculatedConc <- (x - coeff[1]) / coeff[2]
156156
perBias <- 100 * abs(calculatedConc - expConc) / expConc
157157
names(perBias) <- NULL
158+
158159
return(perBias)
159160
}
160161

@@ -174,6 +175,7 @@ calculate_FLR <- function(dataPrelim, weightingMethod = "1/x^2",
174175
concentrations <- as.numeric(names(x))
175176
perBiasValues <- mapply(FUN = .calcPerBias, x = x, expConc = concentrations,
176177
MoreArgs = list(LMfit = LMfit))
178+
if(!is.matrix(perBiasValues)) perBiasValues <- t(as.matrix(perBiasValues))
177179
return(perBiasValues)
178180
}
179181

@@ -191,6 +193,7 @@ calculate_FLR <- function(dataPrelim, weightingMethod = "1/x^2",
191193
#' @importFrom stats sd median
192194
#'
193195
.calcPerBiasAvgSDCV <- function(x, method = "mean") {
196+
194197
if (method == "mean") {
195198
avgPerBias <- colMeans(x)
196199
}

0 commit comments

Comments
 (0)