Dilution simulator updated
Build and deploy Roxygen2|pkgdown documentation site / build-and-deploy-documentation (push) Successful in 47s
run tests / build-and-deploy-documentation (push) Successful in 8s

This commit is contained in:
2026-06-05 11:32:15 +02:00
parent f5575f8429
commit abf02ef4ec
3 changed files with 97 additions and 40 deletions
+11 -8
View File
@@ -177,7 +177,7 @@ Fitting_FUNC <- function(ro_new, TransFlag = FALSE) {
#' @export
#' @examples
#' suppressMessages(source("../../dev/setup.R"))
#' data.frame(
#' dat <- data.frame(
#' R_dil1 = c(
#' 10.0651024695491, 10.9844983291817, 10.7635586089293, 10.4597656321327, 10.3898668457823, 10.8171761349909,
#' 10.319758021908, 10.1304854046653
@@ -265,11 +265,11 @@ plotSingularity <- function(dat) { # sigmoid,det_sig,
#' TEST1 = c(1405, 1523, 1502, 1474, 2383, 3221, 3589, 3445), TEST2 = c(1420, 1516, 1544, 1512, 2226, 3219, 3327, 3591),
#' TEST3 = c(1399, 1376, 1588, 1475, 2148, 3083, 2942, 3466), log_dose = c(5.01, 3.401, 2.708, 2.015, 1.32176, 0.62861, -0.0645385, -1.6739764)
#' )
#' sigmoid <- c(0.7163324, 0.5636804, 10.6156340, 9.9784160, -0.7504673, -0.7108692, -3.5788141, -0.6662962)
#' det_sig <- FALSE
#' TransF <- FALSE
#'
#'
#' TransFlag <- FALSE
#' Dat <- list()
#' p <- plot_f(dat, sigmoid, det_sig, TransF)
#' p <- plot_f(dat, TransFlag)
#' print(p)
plot_f <- function(dat, TransFlag = FALSE) { # sigmoid,det_sig,
CORdat <- cor(dat[, 1], dat[, ncol(dat)])
@@ -490,7 +490,7 @@ plot_f <- function(dat, TransFlag = FALSE) { # sigmoid,det_sig,
#' @param heteroNoise Boolean if heteroscedstic noise should be added.
#' @param noDilSeries A number >1 indicating how many dilution series per product should be simulated.
#' @param noDils A number >7 indicating how many dilutions steps per product should be simulated.
#' @returns A data-frame with readouts and natural log of concentrations.
#' @returns A data-frame with readouts and natural log of concentrations. avs: means per concentration; sds: standard deviation per concentration;cvs: coefficients of variation
#' @export
#' @examples
#' suppressMessages(source("../../dev/setup.R"))
@@ -656,7 +656,8 @@ LinPotTab <- function(circles, Lim, PureErrFlag) {
#' PureErrF <- TRUE
#'
#'
#' ANOVAlintests(ro_new, circles, Lim, PureErrF)
#' ANOVAlintests(dat, circles, Lim, PureErrF)
#'
ANOVAlintests <- function(ro_new, circles, Lim, PureErrFlag) {
all_l <- melt(data.frame(ro_new), id.vars = "log_dose", variable.name = "replname", value.name = "readout")
isRef <- rep(c(1, 0), 1, each = nrow(all_l) / 2)
@@ -873,6 +874,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()
mLin <- gsl_nls(readout ~ (intS + r) * isSample + intS * isRef + k * log_dose,
@@ -1100,7 +1102,7 @@ pot4plFUNC <- function(ro_new, PureErrFlag) {
#' se_xt <- 0.34
#' se_xs <- 0.23
#' DFs <- 32 - 16
#'
#' CoVar <- 0
#'
#' ParamCI_F(xt, xs, se_xt, se_xs, CoVar, DFs, Conf = 0.975)
ParamCI_F <- function(xt, xs, se_xt, se_xs, CoVar, DFs, Conf = 0.975) {
@@ -1371,6 +1373,7 @@ tests_FUNC <- function(ro_new, Lim, PureErrFlag) {
#'
#'
#' ANOVA4plUnresfunc(ro_new)
#'
ANOVA4plUnresfunc <- function(ro_new) {
all_l <- melt(data.frame(ro_new), id.vars = "log_dose", variable.name = "replname", value.name = "readout")
all_len <- nrow(all_l)