report generation after new setup of repo; linearity XL report improved
Build and deploy Roxygen2|pkgdown documentation site / build-and-deploy-documentation (push) Successful in 48s
run tests / build-and-deploy-documentation (push) Successful in 9s

This commit is contained in:
2026-06-01 19:35:00 +02:00
parent cf1ce314e1
commit c480111552
7 changed files with 185 additions and 59 deletions
+16 -24
View File
@@ -280,14 +280,14 @@ plot_f <- function(dat, TransFlag = F) { # sigmoid,det_sig,
s_mr <- MODLS[[1]]
a <- s_mr$coefficients["a", 1]
b <- s_mr$coefficients["b", 1]
cs <- s_mr$coefficients["cs", 1]
c <- s_mr$coefficients["cs", 1]
d <- s_mr$coefficients["d", 1]
r <- s_mr$coefficients["r", 1]
log_dose <- unique(all_l$log_dose)
seq_x <- seq(min(log_dose), max(log_dose), 0.1)
SAMPLE <- a + (d - a) / (1 + exp(b * ((cs - r) - seq_x)))
REF <- a + (d - a) / (1 + exp(b * ((cs) - seq_x)))
SAMPLE <- a + (d - a) / (1 + exp(b * ((c - r) - seq_x)))
REF <- a + (d - a) / (1 + exp(b * (c - seq_x)))
s_mu <- MODLS[[2]]
@@ -310,16 +310,16 @@ plot_f <- function(dat, TransFlag = F) { # sigmoid,det_sig,
all_l2$readout[all_l2$readout < 0] <- 0.01
all_l2$readouttrans <- log(all_l2$readout)
slopeEC50 <- b * (d - a) / 4
Intercept <- a + (d - a) / 2 - b * (d - a) / 4 * cs
Intercept <- a + (d - a) / 2 - b * (d - a) / 4 * c
# browser()
Xbendl3 <- cs - (1.5434 / b)
Xbendu3 <- cs + (1.5434 / b)
XbendlT <- cs - r - (1.5434 / b)
XbenduT <- cs - r + (1.5434 / b)
XasymplS <- cs - (3 / b)
XasympuS <- cs + (3 / b)
XasymplT <- cs - r - (3 / b)
XasympuT <- cs - r + (3 / b)
Xbendl3 <- c - (1.5434 / b)
Xbendu3 <- c + (1.5434 / b)
XbendlT <- c - r - (1.5434 / b)
XbenduT <- c - r + (1.5434 / b)
XasymplS <- c - (3 / b)
XasympuS <- c + (3 / b)
XasymplT <- c - r - (3 / b)
XasympuT <- c - r + (3 / b)
bendpoints <- c(
bendREF_lower = round(Xbendl3, 3), bendREF_upper = round(Xbendu3, 3),
bendSAMPLE_lower = round(XbendlT, 3), bendSAMPLE_upper = round(XbenduT, 3),
@@ -362,7 +362,7 @@ plot_f <- function(dat, TransFlag = F) { # sigmoid,det_sig,
geom_vline(xintercept = c(XbendlT, XbenduT), col = "#C2173F", linetype = 2) +
geom_vline(xintercept = c(XasymplS, XasympuS), col = "#4545BABB", linetype = 3) +
geom_vline(xintercept = c(XasymplT, XasympuT), col = "#C2173FBB", linetype = 3) +
annotate("text", x = cs, y = a + (d - a) / 2, label = "0", size = 5) +
annotate("text", x = c, y = a + (d - a) / 2, label = "0", size = 5) +
geom_abline(slope = slopeEC50, intercept = Intercept) +
theme(legend.position = "none")
Dat$p2 <- p2
@@ -419,16 +419,8 @@ plot_f <- function(dat, TransFlag = F) { # sigmoid,det_sig,
cte <- Sum_u$coefficients["cs", 1] - Sum_u$coefficients["r", 1]
dst <- Sum_u$coefficients["ds", 1]
dte <- Sum_u$coefficients["dt", 1]
# } else {
# ast <- det_sig[5]
# ate <- det_sig[6]
# bst <- det_sig[1]
# bte <- det_sig[2]
# cst <- det_sig[7]
# cte <- det_sig[8]
# dst <- det_sig[3]
# dte <- det_sig[4]
# }
REFu <- ast + (dst - ast) / (1 + exp(bst * (cst - seq_x)))
SAMPLEu <- ate + (dte - ate) / (1 + exp(bte * (cte - seq_x)))
pl_df2 <- cbind(seq_x, SAMPLEu, REFu)
@@ -877,7 +869,7 @@ ANOVAlintests <- function(ro_new, circles, Lim, PureErrFlag) {
#'
#' PlotLinPLA_FUNC(circle, sigmoid, all_l2, pl_df, indS, indT)
PlotLinPLA_FUNC <- function(circle, sigmoid, all_l2, pl_df, indS, indT) {
# browser()
#browser()
mLin <- gsl_nls(readout ~ (intS + r) * isSample + intS * isRef + k * log_dose,
data = circle,
start = list(intS = 0, k = 1, r = 0),