From bf9a6444bc67354af013485a33a66a6596384e04 Mon Sep 17 00:00:00 2001 From: Ko Date: Tue, 25 Jul 2023 17:11:37 -0400 Subject: [PATCH 1/6] Updated method descriptions to reflect new descriptions now in invitrodb for the following *_mthds.R files: sc1, sc2, mc2, mc3, mc4, mc5, and mc6. Removed bmed.aeid.lowconc.twells, no.gnls.fit, and nmad.apid.null.zwells and unused commented out functions from from mc4_mthds.R to align with invitrodb. --- R/mc2_mthds.R | 32 ++-- R/mc3_mthds.R | 215 ++++++++++++++---------- R/mc4_mthds.R | 439 ++------------------------------------------------ R/mc5_mthds.R | 45 ++++-- R/mc6_mthds.R | 11 +- R/sc1_mthds.R | 75 +++++---- R/sc2_mthds.R | 42 +++-- 7 files changed, 282 insertions(+), 577 deletions(-) diff --git a/R/mc2_mthds.R b/R/mc2_mthds.R index c857381e..05badc5a 100644 --- a/R/mc2_mthds.R +++ b/R/mc2_mthds.R @@ -30,17 +30,27 @@ #' available in the package vignette, "Pipeline_Overview." #' #' \describe{ -#' \item{log2}{Take the logarithm of cval with the base 2.} -#' \item{log10}{Take the logarithm of cval with the base 10.} -#' \item{rmneg}{Remove entries where cval is less than 0.} -#' \item{rmzero}{Remove entries where cval is 0.} -#' \item{mult25}{Multiply cval by 25.} -#' \item{mult100}{Multiply cval by 100.} -#' \item{negshift}{Shift cval by subtracting out the minimum of cval and -#' adding 1, such that the new minimum of cval is 1.} -#' \item{mult25}{Multiply cval by 2.5.} -#' \item{mult3}{Multiply cval by 3.} -#' \item{mult6}{Multiply cval by 6.} +#' \item{log2}{Transform the corrected response value (cval) to log-scale (base 2).} +#' \item{log10}{Transform the corrected response value (cval) to log-scale (base 10).} +#' \item{rmneg}{Exclude wells with negative corrected response values (cval) and downgrading +#' their well quality (wllq); if cval < 0, wllq = 0.} +#' \item{rmzero}{Exclude wells with corrected response values (cval) equal to zero and +#' downgrading their well quality (wllq); if cval = 0, wllq = 0.} +#' \item{mult25}{Multiply corrected response value (cval) by 25; 25*cval.} +#' \item{mult100}{Multiply corrected response value (cval) by 100; 100*cval.} +#' \item{negshift}{Shift corrected response values (cval) by subtracting the minimum cval and +#' adding 1, such that the new minimum is 1; cval - min + 1.} +#' \item{mult2.5}{Multiply corrected response value (cval) by 2.5; 2.5*cval.} +#' \item{mult3}{Multiply corrected response value (cval) by 3; 3*cval.} +#' \item{mult6}{Multiply corrected response value (cval) by 6; 6*cval.} +#' \item{sub100}{Center data around zero by subtracting the corrected response value (cval) from +#' 100; 100 - cval. Typically used if data was pre-normalized around 100 with responses +#' decreasing to 0.} +#' \item{zscore.npwlls}{Convert the corrected response value (cval) to an absolute Z-Score based +#' on the neutral and positive control wells (wllts = n and p), by assay plate ID (apid); +#' cval = |(cval - (mean cval for wllt = n and p)) / (sd cval for wllt = n and p)|.} +#' \item{sub1}{Center data around zero by subtracting the corrected response value (cval) from 1; +#' 1 - cval. Typically used if data was pre-normalized around 1 with responses decreasing to 0.} #' } #' #' @note diff --git a/R/mc3_mthds.R b/R/mc3_mthds.R index 39a49291..d769b463 100644 --- a/R/mc3_mthds.R +++ b/R/mc3_mthds.R @@ -38,101 +38,148 @@ #' #' \subsection{bval Methods}{ #' \describe{ -#' \item{bval.apid.nwlls.med}{Calculate bval as the median of cval for -#' wells with wllt equal to "n," by apid.} -#' \item{bval.apid.lowconc.med}{Calculate bval as the median of cval for -#' wells with wllt equal to "t" and cndx equal to 1 or 2, by apid.} -#' \item{bval.apid.twlls.med}{Calculate bval as the median of cval for -#' wells with wllt equal to "t," by apid.} -#' \item{bval.apid.tn.med}{Calculate bval as the median of cval for wells -#' with wllt equal to "t" or "n," by apid.} -#' \item{bval.apid.nwllslowconc.med}{Calculate bval as the median of cval -#' for wells with wllt equal to "n" or wells with wllt equal to "t" and -#' cndx equal to 1 or 2, by apid.} -#' \item{bval.spid.lowconc.med}{Calculate bval as the median of cval for -#' wells with wllt equal to "t" and cndx equal to 1, 2, or 3, by spid.} -#' \item{bval.apid.nwllstcwllslowconc.med}{Calculate bval as the median of -#' cval for wells with wllt equal to "n" or cndx equal to 1 or 2 and -#' wllt equal to "t" or "c" by apid.} +#' \item{bval.apid.nwlls.med}{Calculate the baseline value (bval) as the plate-wise median, by +#' assay plate ID (apid), of the corrected values (cval) for neutral control wells (wllt = n).} +#' \item{bval.apid.lowconc.med}{Calculate the baseline value (bval) as the plate-wise median, +#' by assay plate ID (apid), of the corrected values (cval) for test compound wells (wllt = t) +#' with a concentration index (cndx) of 1 or 2.} +#' \item{bval.apid.twlls.med}{Calculate the baseline value (bval) as the plate-wise median, by +#' assay plate ID (apid), of the corrected values (cval) of test compound wells (wllt = t).} +#' \item{bval.apid.tn.med}{Calculate the baseline value (bval) as the plate-wise median, by +#' assay plate ID (apid), of the corrected values (cval) for test compound wells (wllt = t) and +#' neutral control wells (wllt = n).} +#' \item{bval.apid.nwllslowconc.med}{Calculate the baseline value (bval) as the plate-wise +#' median, by assay plate ID (apid), of the corrected values (cval) of test compound wells +#' (wllt = t) with a concentration index (cndx) of 1 or 2 or neutral control wells (wllt = n).} +#' \item{bval.spid.lowconc.med}{Calculate the baseline value (bval) as the sample-wise median, +#' by sample ID (spid), of the corrected values (cval) of the three lowest concentration test +#' compound wells (wllt = t and cndx = 1, 2, & 3).} +#' \item{bval.apid.nwllstcwllslowconc.med}{Calculate the baseline value (bval) as the +#' plate-wise median, by assay plate ID (apid), of the corrected values (cval) for neutral +#' control wells (wllt = n) or wells with a concentration index (cndx) of 1 or 2 and well +#' type of test compound (wllt = t) or gain-of-signal control in multiple concentrations +#' (wllt = c).} +#' \item{bval.aeid.nwlls.med}{Calculate the baseline value (bval) as the endpoint-wise median, +#' by assay component endpoint ID (aeid), corrected value (cval) for neutral control wells +#' (wllt = n).} #' #' } #' } #' #' \subsection{pval Methods}{ #' \describe{ -#' \item{pval.apid.pwlls.med}{Calculate pval as the median of cval for -#' wells with wllt equal to "p," by apid.} -#' \item{pval.apid.mwlls.med}{Calculate pval as the median of cval for -#' wells with wllt equal to "m," by apid.} -#' \item{pval.apid.medpcbyconc.max}{First calculate the median of cval for -#' wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then -#' calculate pval as the maximum of the calculated medians, by apid.} -#' \item{pval.apid.medpcbyconc.min}{First calculate the median of cval for -#' wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then -#' calculate pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.medncbyconc.min}{First calculate the median of cval for -#' wells with wllt equal to "m" or "o," by wllt, conc, and apid. Then -#' calculate pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.pmv.min}{First calculate the median of cval for -#' wells with wllt equal to "p," "m," or "v," by wllt, conc, and apid. Then -#' calculate pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.pmv.max}{First calculate the median of cval for -#' wells with wllt equal to "p," "m," or "v," by wllt, conc, and apid. Then -#' calculate pval as the maximum of the calculated medians, by apid.} -#' \item{pval.apid.f.max}{First calculate the median of cval for -#' wells with wllt equal to "f," by wllt, conc, and apid. Then calculate -#' pval as the maximum of the calculated medians, by apid.} -#' \item{pval.apid.f.min}{First calculate the median of cval for -#' wells with wllt equal to "f," by wllt, conc, and apid. Then calculate -#' pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.p.max}{First calculate the median of cval for -#' wells with wllt equal to "p," by wllt, conc, and apid. Then calculate -#' pval as the maximum of the calculated medians, by apid.} -#' \item{pval.apid.p.min}{First calculate the median of cval for -#' wells with wllt equal to "p," by wllt, conc, and apid. Then calculate -#' pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.v.min}{First calculate the median of cval for -#' wells with wllt equal to "v," by wllt, conc, and apid. Then calculate -#' pval as the minimum of the calculated medians, by apid.} -#' \item{pval.zero}{Define pval as 0.} +#' \item{pval.apid.pwlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the corrected values (cval) for single-concentration +#' gain-of-signal positive control wells (wllt = p).} +#' \item{pval.apid.mwlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the corrected values (cval) for multiple-concentration +#' loss-of-signal negative control wells (wllt = m).} +#' \item{pval.apid.medpcbyconc.max}{Calculate the positive control value (pval) as the +#' plate-wise maximum, by assay plate ID (apid), of the medians of the corrected values (cval) +#' for gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) +#' by apid, well type, and concentration.} +#' \item{pval.apid.medpcbyconc.min}{Calculate the positive control value (pval) as the +#' plate-wise minimum, by assay plate ID (apid), of the medians of corrected value (cval) of +#' gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by +#' apid, well type, and concentration.} +#' \item{pval.apid.medncbyconc.min}{Calculate the positive control value (pval) as the +#' plate-wise minimum, by assay plate ID (apid), of the medians of the corrected values (cval) +#' for gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) +#' by apid, well type, and concentration.} +#' \item{pval.apid.pmv.min}{Calculate the positive control value (pval) as the plate-wise +#' minimum, by assay plate ID (apid), of the medians of the corrected values (cval) for +#' single-concentration gain-of-signal, multiple-concentration loss-of-signal, or viability +#' control wells (wllt = p, m, or v) by apid, well type, and concentration.} +#' \item{pval.apid.pmv.max}{Calculate the positive control value (pval) as the plate-wise +#' maximum, by assay plate ID (apid), of the medians of the corrected values (cval) for +#' single-concentration gain-of-signal, multiple-concentration loss-of-signal, or viability +#' control wells (wllt = p, m, or v) by apid, well type, and concentration.} +#' \item{pval.apid.f.max}{Calculate the positive control value (pval) as the plate-wise +#' maximum, by assay plate ID (apid), of the medians of important reference wells (wllt = f) +#' values by apid and concentration.} +#' \item{pval.apid.f.min}{Calculate the positive control value (pval) as the plate-wise +#' minimum, by assay plate ID (apid), of the medians of important reference wells (wllt = f) +#' values by apid and concentration.} +#' \item{pval.apid.p.max}{Calculate the positive control value (pval) as the plate-wise +#' maximum, by assay plate ID (apid), of the medians of the corrected values (cval) for +#' single-concentration gain-of-signal control wells (wllt = p) by apid.} +#' \item{pval.apid.p.min}{Calculate the positive control value (pval) as the plate-wise +#' minimum, by assay plate ID (apid), of the medians of corrected values (cval) for +#' single-concentration gain-of-signal control wells (wllt = p) by apid.} +#' \item{pval.apid.v.min}{Calculate the positive control value (pval) as the plate-wise +#' minimum, by assay plate ID (apid), of the medians of the corrected values (cval) for +#' viability control wells (wllt = v) by apid and concentration.} +#' \item{pval.zero}{Set the positive control value (pval) to 0; pval = 0.} +#' \items{pval.apid.owlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the corrected values (cval) for single-concentration +#' negative control wells (wllt = o).} +#' \item{pval.2bval}{Calculate the positive control value (pval) as the plate-wise median, by +#' assay plate ID (apid), of the corrected values (cval) for neutral control wells (wllt = n) +#' multiplied by 2.} +#' \item{pval.maxp}{Calculate the positive control value (pval) as the endpoint-wise maximum, +#' by assay component ID (aeid), of the corrected values for single-concentration +#' gain-of-signal wells (wllt = p).} +#' \item{pval.apid.bwlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the corrected values (cval) for blank wells (wllt= b).} +#' \item{pval.twlls.99pct}{Calculate positive control value (pval) as the 99th percentile of +#' all corrected value (cvals) of the test compound wells (wllt = t).} +#' \item{pval.neg.100}{Calculate positive control value (pval) as -100 for endpoints in the +#' down direction; pval = -100.} #' } #' } #' #' \subsection{resp Methods}{ #' \describe{ -#' \item{resp.pc}{Calculate resp as \eqn{\frac{\mathit{cval} - -#' \mathit{bval}}{\mathit{pval} - \mathit{bval}}100}{(cval - bval)/(pval -#' - bval)*100}.} -#' \item{resp.pc.pval.cor}{Calculate resp as \eqn{\frac{\mathit{cval} - -#' \mathit{bval}}{\mathit{pval}}100}{(cval - bval)/(pval)*100}.} -#' \item{resp.fc}{Calculate resp as \eqn{\mathit{cval}/\mathit{bval}}{ -#' cval/bval}.} -#' \item{resp.logfc}{Calculate resp as \eqn{\mathit{cval} - \mathit{bval}}{ -#' cval - bval}.} -#' \item{resp.log2}{Take the logarithm of resp with base 2.} -#' \item{resp.mult25}{Multiply resp by 25.} -#' \item{resp.scale.mad.log2fc}{Multiply resp by the scale factor -#' \eqn{\frac{\log_2 \left( 1.2 \right)}{3\mathit{bmad}}}{ -#' log2(1.2)/(3*bmad)}.} -#' \item{resp.scale.quant.log2fc}{Determine the maximum response -#' \eqn{\mathit{md}}{md} where \eqn{\mathit{md}}{md} = abs(1st centile - -#' 50th centile) or abs(99th centile - 50th centile), whichever is greater. -#' Scale the response such that 20 percent of md equals -#' \eqn{\log_2 \left( 1.2 \right)}{log2(1.2)}.} -#' \item{resp.multneg1}{Multiply resp by -1.} -#' \item{resp.shiftneg.3bmad}{Shift all resp values less than -3*bmad to 0.} -#' \item{resp.shiftneg.6bmad}{Shift all resp values less than -6*bmad to 0.} -#' \item{resp.shiftneg.10bmad}{Shift all resp values less than -10*bmad to -#' 0.} -#' \item{resp.blineshift.3bmad.repi}{Shift resp values with the blineShift -#' function by repi, where the window (wndw) is 3*bmad.} -#' \item{resp.blineshift.50.repi}{Shift resp values with the blineShift -#' function by repi, where the window (wndw) is 50.} -#' \item{resp.blineshift.3bmad.spid}{Shift resp values with the blineShift -#' function by spid, where the window (wndw) is 3*bmad.} -#' \item{resp.blineshift.50.spid}{Shift resp values with the blineShift -#' function by spid, where the window (wndw) is 50.} -#' \item{none}{Do no normalization; make resp equal to cval.} +#' \item{resp.pc}{Calculate the normalized response (resp) as a percent of control, i.e. the +#' ratio of the difference between the corrected (cval) and baseline (bval) values divided the +#' difference between the positive control (pval) and baseline (bval) values multiplied by 100; +#' resp = (cval-bval)/(pval-bval)*100.} +#' \item{resp.pc.pval.cor}{Calculate the normalized response (resp) as a percent of control, +#' i.e. the ratio of the difference between the corrected (cval) and baseline (bval) values +#' divided the positive control (pval) value multiplied by 100; resp = (cval-bval)/pval*100.} +#' \item{resp.fc}{Calculate the normalized response (resp) as the fold change, i.e. the ratio +#' of the corrected (cval) and baseline (bval) values; resp = cval/bal.} +#' \item{resp.logfc}{Calculate the normalized response (resp) as the fold change of logged, +#' i.e. the difference between corrected (cval) and baseline (bval) log-scale values.} +#' \item{resp.log2}{Transform the response values to log-scale (base 2).} +#' \item{resp.mult25}{Multiply the normalized response value (resp) by 25; 25*resp.} +#' \item{resp.scale.mad.log2fc}{Scale the normalized response value (resp) by the ratio of +#' log2(1.2) and 3 multiplied by the baseline median absolute deviation (bmad) of the unscaled +#' normalized response values (resp); log2(1.2) / 3(bmad)*resp.} +#' \item{resp.scale.quant.log2fc}{Scale the normalized response value (resp). First, determine +#' the maximum difference (md) by finding the maximum between the absolute difference of the +#' 1st percentile minus the 50th percentile and the absolute difference of the 99th percentile +#' minus the 50th percentile. Then multiply resp by log2(1.2) divided by 20 percent of md; +#' log2(1.2) / 0.2(md)*resp.} +#' \item{resp.multneg1}{Multiply the normalized response value (resp) by -1; -1*resp.} +#' \item{resp.shiftneg.3bmad}{Shift all the normalized response values (resp) less than -3 +#' multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -3*bmad, +#' resp = 0.} +#' \item{resp.shiftneg.6bmad}{Shift all the normalized response values (resp) less than -6 +#' multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -6*bmad, +#' resp = 0.} +#' \item{resp.shiftneg.10bmad}{Shift all the normalized response values (resp) less than 10 +#' multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -10*bmad, +#' resp = 0.} +#' \item{resp.blineshift.3bmad.repi}{Shift the normalized response value (resp) with a baseline +#' correction, by replicate index (repi), with a window of 3 multiplied by the baseline median +#' absolute deviation (bmad).} +#' \item{resp.blineshift.50.repi}{Shift the normalized response value (resp) with a baseline +#' correction, by replicate index (repi), with a window of 50.} +#' \item{resp.blineshift.3bmad.spid}{Shift the normalized response value (resp) with a baseline +#' correction, by sample ID (spid), with a window of 3 multiplied by the baseline median +#' absolute deviation (bmad).} +#' \item{resp.blineshift.50.spid}{Shift the normalized response value (resp) with a baseline +#' correction, by sample ID (spid), with a window of 50.} +#' \item{none}{Set the corrected response value (cval) as the normalized response value (resp); +#' cval = resp. No additional mc3 methods needed for endpoint-specific normalization.} +#' \item{resp.zerocenter.fc}{Calculate the normalized response (resp) as a zero center fold +#' change, i.e. 1 minus the ratio of corrected (cval) and baseline (bval) values; +#' resp = 1 - (cval/bval). Typically used for increasing responses.} +#' \item{resp.incr.zerocenter.fc}{Calculate the normalized response (resp) as a zero center +#' fold change, i.e. the ratio of the the corrected (cval) and baseline (bval) values minus 1; +#' resp = cval/bval - 1. Typically used for increasing responses.} +#' \item{resp.mult100}{Multiply the normalized response value (resp) by 100; 100*resp.} #' } #' } #' diff --git a/R/mc4_mthds.R b/R/mc4_mthds.R index cc54777d..b74bc7b0 100644 --- a/R/mc4_mthds.R +++ b/R/mc4_mthds.R @@ -29,13 +29,23 @@ #' #' Although it does not say so specifically in each description, all methods #' are applied by aeid. -#' +#' #' More information about the level 4 multiple-concentration processing is #' available in the package vignette, "Pipeline_Overview." #' #' \describe{ -#' \item{bmad.aeid.lowconc.twells}{bmad based on two lowest concentration of treatment wells} -#' \item{bmad.aeid.lowconc.nwells}{bmad based on two lowest concentration of nwells} +#' \item{bmad.aeid.lowconc.twells}{Calculate the baseline median absolute value (bmad) as the +#' median absolute deviation of normalized response values (rep) for test compound wells +#' (wllt = t) with concentration index (cndx) equal to 1 or 2.} +#' \item{bmad.aeid.lowconc.nwells}{Calculate the baseline median absolute value (bmad) as the +#' median absolute deviation of normalized response values (resp) for neutral control wells +#' (wllt = n).} +#' \item{onesd.aeid.lowconc.twells}{Calculate one standard deviation of the normalized response +#' for test compound wells (wllt = t) with a concentration index (cndx) of 1 or 2; +#' onesd = sqrt(sum((resp - mean resp)^2)/sample size - 1). Used to establish BMR and therefore +#' required for tcplfit2 processing.} +#' \item{bidirectional.false}{Limits bidirectional fitting and processes data in positive +#' analysis direction only. Use for gain-of-signal or inverted data.} #' } #' #' @note @@ -70,428 +80,7 @@ mc4_mthds <- function() { e1 <- bquote(dat[ ,bidirectional := FALSE]) list(e1) - }, - bmed.aeid.lowconc.twells = function() { - - e1 <- bquote(dat[ , bmed := median(resp[cndx %in% 1:2 & wllt == "t"], na.rm = TRUE)]) - list(e1) - - }, - no.gnls.fit = function() { - - e1 <- bquote(dat[ ,fitmodels := list(c("cnst", "hill", "poly1", "poly2", "pow", "exp2", "exp3","exp4", "exp5"))]) - list(e1) - - }, - nmad.apid.null.zwells = function() { - - e1 <- bquote(dat[, - bmad := mad(resp[wllt == "z"], constant=1.4826, - na.rm = TRUE), - by = list(aeid, apid)]) - list(e1) - } - + ) } - -# mc4_mthds <- function() { -# -# -# -# list( -# -# bval.apid.nwlls.med = function(aeids) { -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[wllt == "n"], na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# bval.apid.lowconc.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# bval.apid.twlls.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[wllt == "t"], na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# bval.apid.tn.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[wllt %in% c("t", "n")], -# na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# bval.apid.nwllslowconc.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[(cndx %in% 1:2 & wllt == "t") | -# wllt == "n"], -# na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# bval.spid.lowconc.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[cndx %in% 1:3 & wllt == "t"], -# na.rm = TRUE), -# by = list(aeid, spid, repi)]) -# list(e1) -# -# }, -# -# pval.apid.pwlls.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# pval := median(cval[wllt == "p"], na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# pval.apid.mwlls.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# pval := median(cval[wllt == "m"], na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# -# }, -# -# pval.apid.medpcbyconc.max = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt %in% c("c", "p")], -# na.rm = TRUE), -# by = list(aeid, apid, wllt, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := max(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.medpcbyconc.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt %in% c("c", "p")], -# na.rm = TRUE), -# by = list(aeid, apid, wllt, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.medncbyconc.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt %in% c("m","o")], -# na.rm = TRUE), -# by = list(aeid, apid, wllt, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.pmv.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt %in% c("p", "m", "v")], -# na.rm = TRUE), -# by = list(aeid, apid, wllt, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.pmv.max = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt %in% c("p", "m", "v")], -# na.rm = TRUE), -# by = list(aeid, apid, wllt, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := max(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.f.max = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt == "f"], na.rm = TRUE), -# by = list(aeid, apid, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := max(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.f.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt == "f"], na.rm = TRUE), -# by = list(aeid, apid, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.p.max = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt == "p"], na.rm = TRUE), -# by = list(aeid, apid, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := max(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.p.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt == "p"], na.rm = TRUE), -# by = list(aeid, apid, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.apid.v.min = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# temp := median(cval[wllt == "v"], na.rm = TRUE), -# by = list(aeid, apid, conc)]) -# e2 <- bquote(dat[J(.(aeids)), -# pval := min(temp, na.rm = TRUE), -# by = list(aeid, apid)]) -# e3 <- bquote(dat[ , temp := NULL]) -# list(e1, e2, e3) -# -# }, -# -# pval.zero = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), pval := 0]) -# list(e1) -# -# }, -# -# resp.pc = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# resp := (cval - bval)/(pval - bval)*100]) -# list(e1) -# -# }, -# -# resp.fc = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := cval/bval]) -# list(e1) -# -# }, -# -# resp.logfc = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := cval - bval]) -# list(e1) -# -# }, -# -# resp.log2 = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := log2(resp)]) -# list(e1) -# -# }, -# -# resp.mult25 = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := resp * 25]) -# list(e1) -# -# }, -# -# resp.scale.mad.log2fc = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bmad := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE), -# by = aeid]) -# e2 <- bquote(dat[J(.(aeids)), resp := log2(1.2)/(3*bmad)*resp]) -# e3 <- bquote(dat[ , bmad := NULL]) -# -# list(e1, e2, e3) -# -# }, -# -# resp.scale.quant.log2fc = function(aeids) { -# -# qv <- c(0.01, 0.5, 0.99) -# e1 <- bquote(dat[J(.(aeids)), -# c("q1", "q2", "q3") := as.list(quantile(resp, .(qv))), -# by = aeid]) -# e2 <- bquote(dat[J(.(aeids)), -# md := max(abs(c(diff(c(q1, q2)), diff(c(q2, q3))))), -# by = aeid]) -# e3 <- bquote(dat[J(.(aeids)), resp := log2(1.2)/(0.2*md)*resp]) -# e4 <- bquote(dat[ , .(c("q1", "q2", "q3", "md")) := NULL, with = FALSE]) -# list(e1, e2, e3, e4) -# -# }, -# -# resp.multneg1 = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := resp * -1]) -# list(e1) -# -# }, -# -# resp.shiftneg.3bmad = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bmad := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE), -# by = aeid]) -# e2 <- bquote(dat[aeid %in% .(aeids) & resp < -3 * bmad, resp := 0]) -# e3 <- bquote(dat[ , bmad := NULL]) -# list(e1, e2, e3) -# -# }, -# -# resp.shiftneg.6bmad = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bmad := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE), -# by = aeid]) -# e2 <- bquote(dat[aeid %in% .(aeids) & resp < -6 * bmad, resp := 0]) -# e3 <- bquote(dat[ , bmad := NULL]) -# list(e1, e2, e3) -# -# }, -# -# resp.shiftneg.10bmad = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bmad := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE), -# by = aeid]) -# e2 <- bquote(dat[aeid %in% .(aeids) & resp < -10 * bmad, resp := 0]) -# e3 <- bquote(dat[ , bmad := NULL]) -# list(e1, e2, e3) -# -# }, -# -# resp.blineshift.3bmad.repi = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# wndw := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE) * 3, -# by = aeid]) -# e2 <- bquote(dat[aeid %in% .(aeids) & wllt %in% c("t", "c", "o"), -# resp := blineShift(resp, logc, wndw), -# by = list(aeid, spid, repi)]) -# e3 <- bquote(dat[ , wndw := NULL]) -# list(e1, e2, e3) -# -# }, -# -# resp.blineshift.50.repi = function(aeids) { -# -# e1 <- bquote(dat[aeid %in% .(aeids) & wllt %in% c("t", "c", "o"), -# resp := blineShift(resp, logc, wndw = 50), -# by = list(aeid, spid, repi)]) -# list(e1) -# -# }, -# -# resp.blineshift.3bmad.spid = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# wndw := mad(resp[cndx %in% 1:2 & wllt == "t"], -# na.rm = TRUE) * 3, -# by = aeid]) -# e2 <- bquote(dat[aeid %in% .(aeids) & wllt %in% c("t", "c", "o"), -# resp := blineShift(resp, logc, wndw), -# by = list(aeid, spid)]) -# e3 <- bquote(dat[ , wndw := NULL]) -# list(e1, e2, e3) -# -# }, -# -# resp.blineshift.50.spid = function(aeids) { -# -# e1 <- bquote(dat[aeid %in% .(aeids) & wllt %in% c("t", "c", "o"), -# resp := blineShift(resp, logc, wndw = 50), -# by = list(aeid, spid)]) -# list(e1) -# -# }, -# -# none = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), resp := cval]) -# list(e1) -# -# }, -# -# bval.apid.nwllstcwllslowconc.med = function(aeids) { -# -# e1 <- bquote(dat[J(.(aeids)), -# bval := median(cval[(cndx %in% 1:2 & wllt %in% c("t","c")) | -# wllt == "n"], -# na.rm = TRUE), -# by = list(aeid, apid)]) -# list(e1) -# } -# -# ) -# -# } -# -# #------------------------------------------------------------------------------- diff --git a/R/mc5_mthds.R b/R/mc5_mthds.R index daf04a89..4a645c72 100644 --- a/R/mc5_mthds.R +++ b/R/mc5_mthds.R @@ -22,18 +22,41 @@ #' available in the package vignette, "Pipeline_Overview." #' #' \describe{ -#' \item{bmad3}{Add a cutoff value of 3*bmad.} -#' \item{pc20}{Add a cutoff value of 20.} -#' \item{log2_1.2}{Add a cutoff value of log2(1.2).} -#' \item{log10_1.2}{Add a cutoff value of log10(1.2).} -#' \item{bmad5}{Add a cutoff value of 5*bmad.} -#' \item{bmad6}{Add a cutoff value of 6*bmad.} -#' \item{bmad10}{Add a cutoff value of 10*bmad.} -#' \item{log2_2}{Add a cutoff value of log2(2).} -#' \item{log10_2}{Add a cutoff value of log10(2).} -#' \item{neglog2_0.88}{Add a cutoff value of -1*log2(0.88).} +#' \item{bmad3}{Add a cutoff value of 3 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{pc20}{Add a cutoff value of 20. Typically for percent of control data.} +#' \item{log2_1.2}{Add a cutoff value of log2(1.2). Typically for fold change data.} +#' \item{log10_1.2}{Add a cutoff value of log10(1.2). Typically for fold change data.} +#' \item{bmad5}{Add a cutoff value of 5 multiplied the baseline median absolute deviation (bmad). +#' By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad6}{Add a cutoff value of 6 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad10}{Add a cutoff value of 10 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{maxmed20pct}{Add a cutoff value of 20 percent of the maximum of all endpoint maximal +#' average response values (max_med).} +#' \item{pc70}{Add a cutoff value of 70. Typically for percent of control data.} +#' \item{pc50}{Add a cutoff value of 50. Typically for percent of control data.} +#' \item{log2_2}{Add a cutoff value log2(2). Typically for fold change data.} +#' \item{log10_2}{Add a cutoff value of log10(2). Typically for fold change data.} +#' \item{neglog2_0.88}{Add a cutoff value of -1 times log2(0.88).} #' \item{coff_2.32}{Add a cutoff value of 2.32.} -#' +#' \item{loec.coff}{Method not yet updated for tcpl implementation. Identify the lowest observed +#' effective concentration (loec) compared to baseline.} +#' \item{fc0.2}{Add a cutoff value of 0.2. Typically for zero centered fold change data.} +#' \item{fc0.3}{Add a cutoff value of 0.3. Typically for zero centered fold change data.} +#' \item{pc25}{Add a cutoff value of 25. Typically for percent of control data.} +#' \item{pc30}{Add a cutoff value of 30. Typically for percent of control data.} +#' \item{bmad1}{Add a cutoff value of 1 multiplied by baseline median absolute value (bmad). By +#' default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad2}{Add a cutoff value of 2 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{pc10}{Add a cutoff value of 10. Typically for percent of control data.} +#' \item{pc05}{Add a cutoff value of 5. Typically for percent of control data.} +#' \item{pc95}{Add a cutoff value of 95. Typically for percent of control data.} +#' \item{bmad4}{Add a cutoff value of 4 multiplied the baseline median absolute deviation (bmad). +#' By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{fc0.5}{Add a cutoff value of 0.5. Typically for zero centered fold change data.} #' } diff --git a/R/mc6_mthds.R b/R/mc6_mthds.R index b5baffa4..f454941e 100644 --- a/R/mc6_mthds.R +++ b/R/mc6_mthds.R @@ -4,7 +4,7 @@ #' @name MC6_Methods #' @title Load list of level 6 multiple-concentration flag methods -#' +#' #' @description #' \code{mc6_mthds} returns a list of flag methods to be used #' during level 6 multiple-concentration processing. @@ -61,9 +61,9 @@ #' series which have borderline activity, i.e., series where the top #' parameter of the winning model was greater than or equal to 0.8*cutoff #' and less than or equal to 1.2*cutoff.} -#' \item{overfit.hit}{The overfit.hit flag recalculates the model winner -#' after applying a small sample correction factor to the AIC values. If the -#' hit-call would be changed after applying the small sample correction +#' \item{overfit.hit}{Method not yet updated for tcpl implementation. The overfit.hit flag +#' recalculates the model winner after applying a small sample correction factor to the AIC +#' values. If the hit-call would be changed after applying the small sample correction #' factor the series is flagged. Series with less than 5 concentrations where #' the hill model won and series with less than 7 concentrations where the #' gain-loss model won are automatically flagged.} @@ -76,6 +76,9 @@ #' \item{viability.gnls}{The viability.gnls flag identifies concentration series #' of cell viability assays which were fit with gain-loss as the winning #' model and the series had an active hit-call.} +#' \item{medresp.3bmad}{Flag series where no median response values are greater than baseline as +#' defined by 3 times the baseline median absolute deviation (bmad); nmed_gtbl = 0, where +#' nmed_gtbl is the number of medians greater than 3*bmad.} #' } mc6_mthds <- function() { diff --git a/R/sc1_mthds.R b/R/sc1_mthds.R index 5a1b9350..1f64102f 100644 --- a/R/sc1_mthds.R +++ b/R/sc1_mthds.R @@ -38,46 +38,61 @@ #' #' \subsection{bval Methods}{ #' \describe{ -#' \item{bval.apid.nwlls.med}{Calculate bval as the median of rval for -#' wells with wllt equal to "n," by apid.} -#' \item{bval.apid.twlls.med}{Calculate bval as the median of rval for -#' wells with wllt equal to "t," by apid.} -#' \item{bval.apid.tn.med}{Calculate bval as the median of rval for wells -#' with wllt equal to "t" or "n," by apid.} +#' \item{bval.apid.nwlls.med}{Calculate the baseline value (bval) as the plate-wise median, +#' by assay plate ID (apid), of the raw values (rval) for neutral control wells (wllt = n).} +#' \item{bval.apid.twlls.med}{Calculate the baseline value (bval) as the plate-wise median, +#' by assay plate ID (apid), of the raw values (rval) for test compound wells (wllt = t).} +#' \item{bval.apid.tn.med}{Calculate the baseline value (bval) as the plate-wise median, +#' by assay plate ID (apid), of the raw values (rval) for test compound wells (wllt = t) +#' and neutral control wells (wllt = n).} #' } #' } #' #' \subsection{pval Methods}{ #' \describe{ -#' \item{pval.apid.pwlls.med}{Calculate pval as the median of rval for -#' wells with wllt equal to "p," by apid.} -#' \item{pval.apid.mwlls.med}{Calculate pval as the median of rval for -#' wells with wllt equal to "m," by apid.} -#' \item{pval.apid.medpcbyconc.max}{First calculate the median of rval for -#' wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then -#' calculate pval as the maximum of the calculated medians, by apid.} -#' \item{pval.apid.medpcbyconc.min}{First calculate the median of rval for -#' wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then -#' calculate pval as the minimum of the calculated medians, by apid.} -#' \item{pval.apid.medncbyconc.min}{First calculate the median of rval for -#' wells with wllt equal to "m" or "o," by wllt, conc, and apid. Then -#' calculate pval as the minimum of the calculated medians, by apid.} -#' \item{pval.zero}{Define pval as 0.} +#' \item{pval.apid.pwlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the raw values (rval) for single-concentration +#' gain-of-signal positive control wells (wllt = p).} +#' \item{pval.apid.mwlls.med}{Calculate the positive control value (pval) as the plate-wise +#' median, by assay plate ID (apid), of the raw values (rval) for multiple-concentration +#' loss-of-signal negative control wells (wllt = m).} +#' \item{pval.apid.medpcbyconc.max}{Calculate the positive control value (pval) as the +#' plate-wise maximum, by assay plate ID (apid), of the medians of the raw values (rval) for +#' gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by +#' apid, well type, and concentration.} +#' \item{pval.apid.medpcbyconc.min}{Calculate the positive control value (pval) as the +#' plate-wise minimum, by assay plate ID (apid), of the medians of the raw values (rval) for +#' gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by +#' apid, well type, and concentration.} +#' \item{pval.apid.medncbyconc.min}{Calculate the positive control value (pval) as the +#' plate-wise minimum, by assay plate ID (apid), of the medians of the raw values (rval) for +#' gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) by +#' apid, well type, and concentration.} +#' \item{pval.zero}{Set the positive control value (pval) to 0; pval = 0.} +#' \item{pval.apid.or.aeid.pwlls.med}{Calculate the positive control value (pval) as the +#' plate-wise median, by assay plate ID (apid), of the raw values (rval) for +#' single-concentration gain-of-signal positive control wells (wllt = p). For plates without p +#' wells, set the pval as the median pval calculated from all plates.} #' } #' } #' #' \subsection{resp Methods}{ #' \describe{ -#' \item{resp.pc}{Calculate resp as \eqn{\frac{\mathit{rval} - -#' \mathit{bval}}{\mathit{pval} - \mathit{bval}}100}{(rval - bval)/(pval -#' - bval)*100}.} -#' \item{resp.fc}{Calculate resp as \eqn{\mathit{rval}/\mathit{bval}}{ -#' rval/bval}.} -#' \item{resp.logfc}{Calculate resp as \eqn{\mathit{rval} - \mathit{bval}}{ -#' rval - bval}.} -#' \item{resp.log2}{Take the logarithm of resp with base 2.} -#' \item{resp.multneg1}{Multiply resp by -1.} -#' \item{none}{Do no normalization; make resp equal to rval.} +#' \item{resp.pc}{Calculate the normalized response (resp) as a percent of control, i.e. the +#' ratio of the difference between the raw (rval) and baseline (bval) values divided by the +#' difference between positive control (pval) and baseline (bval) values multiplied by 100; +#' resp = (rval-bval)/(pval-bval)*100.} +#' \item{resp.fc}{Calculate the normalized response (resp) as fold change, i.e. the ratio of +#' the raw (rval) and baseline (bval) values; resp = rval/bval.} +#' \item{resp.logfc}{Calculate the normalized response (resp) as the fold change of logged, +#' i.e. the difference between raw (rval) and baseline (bval) log-scale values.} +#' \item{resp.log2}{Transform the response values to log-scale (base 2).} +#' \item{resp.multneg1}{Multiply the normalized response value (resp) by -1; -1*resp.} +#' \item{none}{Use raw value (rval) as is. This may be necessary for additional +#' endpoint-specific adjustments, or where no additional sc1 methods are needed.} +#' \item{resp.incr.zerocenter.fc}{Calculate the normalized response (resp) as a zero center +#' fold change, i.e. the ratio of the raw (rval) and baseline (bval) values minus 1; +#' resp = rval/bval - 1. Typically used for increasing responses.} #' } #' } #' diff --git a/R/sc2_mthds.R b/R/sc2_mthds.R index 36250e1e..3b10106f 100644 --- a/R/sc2_mthds.R +++ b/R/sc2_mthds.R @@ -30,18 +30,36 @@ #' available in the package vignette, "Pipeline_Overview." #' #' \describe{ -#' \item{bmad3}{Add a cutoff value of 3*bmad.} -#' \item{pc20}{Add a cutoff value of 20.} -#' \item{log2_1.2}{Add a cutoff value of log2(1.2).} -#' \item{log10_1.2}{Add a cutoff value of log10(1.2).} -#' \item{bmad5}{Add a cutoff value of 5*bmad.} -#' \item{bmad6}{Add a cutoff value of 6*bmad.} -#' \item{bmad10}{Add a cutoff value of 10*bmad.} -#' \item{pc30orbmad3}{Add a cutoff value of either 30 or 3*bmad, whichever -#' is less.} -#' \item{ow_bmad_nwells}{Overwrite method to calculate bmad based on nwells for aeid.} -#' \item{bmad2}{Add a cutoff value of 2*bmad.} -#' \item{bmad1}{Add a cutoff value of 1*bmad.} +#' \item{bmad3}{Add a cutoff value of 3 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{pc20}{Add a cutoff value of 20. Typically for percent of control data.} +#' \item{log2_1.2}{Add a cutoff value of log2(1.2). Typically for fold change data.} +#' \item{log10_1.2}{Add a cutoff value of log10(1.2). Typically for fold change data.} +#' \item{bmad5}{Add a cutoff value of 5 multiplied the baseline median absolute deviation (bmad). +#' By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad6}{Add a cutoff value of 6 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad10}{Add a cutoff value of 10 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{pc30orbmad3}{Add a cutoff value of either 30 or 3 multiplied by the baseline median +#' absolute deviation (bmad), whichever is less. By default, bmad is calculated using test +#' compound wells (wllt = t) for the endpoint.} +#' \item{pc0.88}{Add a cutoff value of 0.88. Typically for percent of control data.} +#' \item{log2_1.5}{Add a cutoff value of log2(1.5). Typically for fold change data.} +#' \item{pc25}{Add a cutoff value of 25. Typically for percent of control data.} +#' \item{ow_bmad_nwells}{Overwrite the default baseline median absolute value (bmad) with a bmad +#' calculated using neutral control wells (wllt = n).} +#' \item{bmad2}{Add a cutoff value of 2 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{bmad1}{Add a cutoff value of 1 multiplied by baseline median absolute deviation (bmad). +#' By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{log2_0.76}{Add a cutoff value of 0.76 for log2-transformed data. This was a custom +#' threshold value set for endpoint id 1690 (formerly aeid 1691).} +#' \item{pc30}{Add a cutoff value of 30. Typically for percent of control data.} +#' \item{bmad1.5}{Add a cutoff value of 1.5 multiplied by the baseline median absolute deviation +#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' \item{ow_bidirectional_false}{Overwrite the max_med and max_tmp values, which were calculated +#' using absolute value, to a calculation not using absolute value for non-bidirectional data.} #' } #' #' @note From 1c6f635a6962cec416ac9c4b805cc98a1149bc4e Mon Sep 17 00:00:00 2001 From: Ko Date: Wed, 26 Jul 2023 14:44:50 -0400 Subject: [PATCH 2/6] Re-wrote the method bmad3 from mc5_mths.R based reviewer on feedback. Updated descriptions for level 6 flags in mc6_mthds.R to reflect new descriptions in invitrodb. Added self to contributor list in "DESCRIPTION" --- DESCRIPTION | 1 + R/mc5_mthds.R | 2 +- R/mc6_mthds.R | 96 ++++++++++++++++++++++----------------------------- 3 files changed, 43 insertions(+), 56 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 29c22b0a..ec366879 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,6 +10,7 @@ Authors@R: c( person("Lori","Kolaczkowski",role = "ctb",email = "kolaczkowski.lori@epa.gov"), person("Kurt", "Dunham", role = "ctb", email = "dunham.kurt@epa.gov"), person("Carter", "Thunes", role = "ctb", email = "thunes.carter@epa.gov"), + person("Ashley", "Ko", role = "ctb", email = "ko.ashley@epa.gov"), person("Todd", "Zurlinden", role="ctb"), person("Parth", "Kothiya", role = "ctb"), person("Woodrow R", "Setzer", role = "ctb"), diff --git a/R/mc5_mthds.R b/R/mc5_mthds.R index 4a645c72..33c0f2f1 100644 --- a/R/mc5_mthds.R +++ b/R/mc5_mthds.R @@ -23,7 +23,7 @@ #' #' \describe{ #' \item{bmad3}{Add a cutoff value of 3 multiplied by the baseline median absolute deviation -#' (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} +#' (bmad) as defined at Level 4.} #' \item{pc20}{Add a cutoff value of 20. Typically for percent of control data.} #' \item{log2_1.2}{Add a cutoff value of log2(1.2). Typically for fold change data.} #' \item{log10_1.2}{Add a cutoff value of log10(1.2). Typically for fold change data.} diff --git a/R/mc6_mthds.R b/R/mc6_mthds.R index f454941e..88634d27 100644 --- a/R/mc6_mthds.R +++ b/R/mc6_mthds.R @@ -20,62 +20,48 @@ #' available in the package vignette, "Pipeline_Overview." #' #' \describe{ -#' \item{modl.directionality.fail}{The modl.directionality.fail flag -#' identifies concentration series where, had the model direction been -#' opposite, more responses would have exceeded the cutoff, i.e., series -#' where the number of responses in absolute value which are greater than the -#' absolute value of the cutoff exceeds twice the number of responses which -#' are more extreme than the cutoff (< cutoff when cutoff is negative, -#' > cutoff when cutoff is positive).} -#' \item{low.nrep}{The low.nrep flag identifies concentration series where -#' the average number of replicates per concentration tested is less than 2.} -#' \item{low.nconc}{The low.nconc flag identifies concentration series where -#' the number of concentrations tested is greater or equal to 4.} -#' \item{bmd.highconc}{The bmd.highconc flag identifies concentration series -#' with a steep curve, i.e., series where the bmd is greater than 50% of the -#' range of concentrations tested.} -#' \item{bmd.lowconc}{The bmd.lowconc flag identifies concentration series -#' with a shallow curve, i.e., series where the bmd is less than 50% of the -#' range of concentrations tested.} -#' \item{bmd.high}{The bmd.high flag attempts to identify noisy concentration -#' series by flagging series where the bmd is greater than the ac50.} -#' \item{singlept.hit.high}{The singlept.hit.high flag identifies -#' concentration series where the median response was greater than 3*bmad -#' only at the highest tested concentration and the series had an active -#' hit-call.} -#' \item{singlept.hit.mid}{The singlept.hit.mid flag identifies concentration -#' series where the median response was greater than 3*bmad at only one -#' concentration (not the highest tested concentration) and the series had -#' an active hit-call.} -#' \item{multipoint.neg}{The multipoint.neg flag identifies concentration -#' series with response medians greater than 3*bmad at multiple -#' concentrations and an inactive hit-call.} -#' \item{gnls.lowconc}{The gnls.lowconc flag identifies concentration series -#' where the gain-loss model won, the gain AC50 is less than the minimum -#' tested concentration, and the loss AC50 is less than the mean tested +#' \item{modl.directionality.fail}{Flag series if model directionality is questionable, i.e. if +#' the winning model direction was opposite, more responses (resp) would have exceeded the cutoff +#' (coff). If loss was winning directionality (top < 0), flag if +#' count(resp < -1(coff)) < 2(count(resp > coff)). If gain was winning directionality (top > 0), +#' flag if count(resp > coff) < 2(count(resp < -1*coff)).} +#' \item{low.nrep}{Flag series if the average number of replicates per concentration is less than +#' 2; nrep < 2.} +#' \item{low.nconc}{Flag series if 4 concentrations or less were tested; nconc <= 4.} +#' \item{bmd.highconc}{Flag series if modeled benchmark dose (BMD) is greater than AC50 +#' (concentration at 50 percent maximal response). This is indicates high variability in baseline +#' response in excess of more than half of the maximal response.} +#' \item{bmd.lowconc}{} +#' \item{bmd.high}{Flag series if modeled benchmark dose (BMD) is greater than AC50 +#' (concentration at 50 percent maximal response). This is indicates high variability in baseline +#' response in excess of more than half of the maximal response.} +#' \item{singlept.hit.high}{Flag single-point hit that's only at the highest conc tested, where +#' series is an active hit call (hitc >= 0.9) with the median response observed above baseline +#' occurring only at the highest tested concentration tested. } +#' \item{singlept.hit.mid}{Flag single-point hit that's not at the highest conc tested, where +#' series is an active hit call (hitc >= 0.9) with the median response observed above baseline +#' occurring only at one concentration and not the highest concentration tested.} +#' \item{multipoint.neg}{Flag multi-point miss, where series is an inactive hit call (hitc < 0.9) +#' with multiple median responses observed above baseline.} +#' \item{gnls.lowconc}{Flag series where winning model is gain-loss (gnls) and the gain AC50 is +#' less than the minimum tested concentration, and the loss AC50 is less than the mean tested #' concentration.} -#' \item{noise}{The noise flag attempts to identify noisy concentration -#' series by flagging series where the root mean square error for the series -#' is greater than the cutoff for the assay endpoint.} -#' \item{border}{The border flag identifies concentration -#' series which have borderline activity, i.e., series where the top -#' parameter of the winning model was greater than or equal to 0.8*cutoff -#' and less than or equal to 1.2*cutoff.} -#' \item{overfit.hit}{Method not yet updated for tcpl implementation. The overfit.hit flag -#' recalculates the model winner after applying a small sample correction factor to the AIC -#' values. If the hit-call would be changed after applying the small sample correction -#' factor the series is flagged. Series with less than 5 concentrations where -#' the hill model won and series with less than 7 concentrations where the -#' gain-loss model won are automatically flagged.} -#' \item{efficacy.50}{The efficacy.50 flag identifies concentration series -#' with efficacy values (either the modeled top parameter for the winning -#' model or the maximum median response) less than 50 for percent activity -#' data or log2(1.5) for fold induction data} -#' \item{ac50.lowconc}{The ac50.lowconc flag identifies concentration series -#' with ac50 values less than the minimum tested concentration.} -#' \item{viability.gnls}{The viability.gnls flag identifies concentration series -#' of cell viability assays which were fit with gain-loss as the winning -#' model and the series had an active hit-call.} +#' \item{noise}{Flag series as noisy if the quality of fit as calculated by the root mean square +#' error (rmse) for the series is greater than the cutoff (coff); rmse > coff.} +#' \item{border}{Flag series if borderline activity is suspected based on modeled top parameter +#' (top) relative to cutoff (coff); |top| <= 1.2(coff) or |top| >= 0.8(coff).} +#' \item{overfit.hit}{Method not yet updated for tcpl implementation. Flag hit-calls that would +#' get changed after doing the small N correction to the aic values.} +#' \item{efficacy.50}{Flag low efficacy hits if series has an active hit call (hitc >= 0.9) and +#' efficacy values (e.g. top and maximum median response) less than 50 percent; intended for +#' biochemical assays. If hitc >= 0.9 and coff >= 5, then flag when top < 50 or max_med < 50. +#' If hitc >= 0.9 and coff < 5, then flag when top < log2(1.5) or max_med < log2(1.5).} +#' \item{ac50.lowconc}{Flag series with an active hit call (hitc >= 0.9) if AC50 (concentration +#' at 50 percent maximal response) is less than the lowest concentration tested;if hitc >= 0.9 +#' and ac50 < 10^logc_min, then flag.} +#' \item{viability.gnls}{Flag series with an active hit call (hitc >= 0.9) if denoted as cell +#' viability assay with winning model is gain-loss (gnls); if hitc >= 0.9, modl=="gnls" and +#' cell_viability_assay == 1, then flag.} #' \item{medresp.3bmad}{Flag series where no median response values are greater than baseline as #' defined by 3 times the baseline median absolute deviation (bmad); nmed_gtbl = 0, where #' nmed_gtbl is the number of medians greater than 3*bmad.} From 20f9358e6554d919a2ed7d64f33d6cb7c04fe9d1 Mon Sep 17 00:00:00 2001 From: Ko Date: Wed, 26 Jul 2023 15:18:59 -0400 Subject: [PATCH 3/6] Removed unused functions bmd.highconc and bmd.lowconc. --- R/mc6_mthds.R | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/R/mc6_mthds.R b/R/mc6_mthds.R index 88634d27..e681bd33 100644 --- a/R/mc6_mthds.R +++ b/R/mc6_mthds.R @@ -28,10 +28,6 @@ #' \item{low.nrep}{Flag series if the average number of replicates per concentration is less than #' 2; nrep < 2.} #' \item{low.nconc}{Flag series if 4 concentrations or less were tested; nconc <= 4.} -#' \item{bmd.highconc}{Flag series if modeled benchmark dose (BMD) is greater than AC50 -#' (concentration at 50 percent maximal response). This is indicates high variability in baseline -#' response in excess of more than half of the maximal response.} -#' \item{bmd.lowconc}{} #' \item{bmd.high}{Flag series if modeled benchmark dose (BMD) is greater than AC50 #' (concentration at 50 percent maximal response). This is indicates high variability in baseline #' response in excess of more than half of the maximal response.} @@ -123,38 +119,6 @@ mc6_mthds <- function() { }, - #bmd.highconc = function(mthd) { - - #flag <- "Bmd falling > 50% conc range tested, indicative of a steep curve" - #out <- c("m5id", "m4id", "aeid", "mc6_mthd_id", - #"flag", "fval", "fval_unit") - #init <- bquote(list(.(mthd), .(flag), NA_real_, NA_character_, FALSE)) - #e1 <- bquote(ft[ , .(c(out[4:7], "test")) := .(init)]) - #e2 <- bquote(ft[ , crng := 10^logc_max - 10^logc_min]) - #e3 <- bquote(ft[ , test := bmd > 0.5*crng & hitc >= 0.9]) - #e4 <- bquote(f[[.(mthd)]] <- ft[which(test), .SD, .SDcols = .(out)]) - #cr <- c("mc6_mthd_id", "flag", "fval", "fval_unit", "test", "crng") - #e5 <- bquote(ft[ , .(cr) := NULL]) - #list(e1, e2, e3, e4, e5) - - #}, - - #bmd.lowconc = function(mthd) { - - #flag <- "Bmd falling < 50% conc range tested, indicative of a shallow curve" - #out <- c("m5id", "m4id", "aeid", "mc6_mthd_id", - #"flag", "fval", "fval_unit") - #init <- bquote(list(.(mthd), .(flag), NA_real_, NA_character_, FALSE)) - #e1 <- bquote(ft[ , .(c(out[4:7], "test")) := .(init)]) - #e2 <- bquote(ft[ , crng := 10^logc_max - 10^logc_min]) - #e3 <- bquote(ft[ , test := bmd < 0.5*crng & hitc >= 0.9]) - #e4 <- bquote(f[[.(mthd)]] <- ft[which(test), .SD, .SDcols = .(out)]) - #cr <- c("mc6_mthd_id", "flag", "fval", "fval_unit", "test", "crng") - #e5 <- bquote(ft[ , .(cr) := NULL]) - #list(e1, e2, e3, e4, e5) - - #}, - bmd.high = function(mthd) { flag <- "Bmd > ac50, indication of high baseline variability" From a7d027683a6b45835818eab198219ae8726156ed Mon Sep 17 00:00:00 2001 From: Ko Date: Thu, 27 Jul 2023 14:44:18 -0400 Subject: [PATCH 4/6] Corrected mc3_mthds.R line 113 to now read \item Rendered documents using devtools::document() to update the manual. --- R/mc3_mthds.R | 2 +- man/MC2_Methods.Rd | 32 ++++--- man/MC3_Methods.Rd | 215 +++++++++++++++++++++++++++------------------ man/MC4_Methods.Rd | 14 ++- man/MC5_Methods.Rd | 45 +++++++--- man/MC6_Methods.Rd | 95 +++++++++----------- man/SC1_Methods.Rd | 75 +++++++++------- man/SC2_Methods.Rd | 42 ++++++--- 8 files changed, 314 insertions(+), 206 deletions(-) diff --git a/R/mc3_mthds.R b/R/mc3_mthds.R index d769b463..232fd73b 100644 --- a/R/mc3_mthds.R +++ b/R/mc3_mthds.R @@ -110,7 +110,7 @@ #' minimum, by assay plate ID (apid), of the medians of the corrected values (cval) for #' viability control wells (wllt = v) by apid and concentration.} #' \item{pval.zero}{Set the positive control value (pval) to 0; pval = 0.} -#' \items{pval.apid.owlls.med}{Calculate the positive control value (pval) as the plate-wise +#' \item{pval.apid.owlls.med}{Calculate the positive control value (pval) as the plate-wise #' median, by assay plate ID (apid), of the corrected values (cval) for single-concentration #' negative control wells (wllt = o).} #' \item{pval.2bval}{Calculate the positive control value (pval) as the plate-wise median, by diff --git a/man/MC2_Methods.Rd b/man/MC2_Methods.Rd index 30b52b07..57aa02fd 100644 --- a/man/MC2_Methods.Rd +++ b/man/MC2_Methods.Rd @@ -34,17 +34,27 @@ More information about the level 2 multiple-concentration processing is available in the package vignette, "Pipeline_Overview." \describe{ - \item{log2}{Take the logarithm of cval with the base 2.} - \item{log10}{Take the logarithm of cval with the base 10.} - \item{rmneg}{Remove entries where cval is less than 0.} - \item{rmzero}{Remove entries where cval is 0.} - \item{mult25}{Multiply cval by 25.} - \item{mult100}{Multiply cval by 100.} - \item{negshift}{Shift cval by subtracting out the minimum of cval and - adding 1, such that the new minimum of cval is 1.} - \item{mult25}{Multiply cval by 2.5.} - \item{mult3}{Multiply cval by 3.} - \item{mult6}{Multiply cval by 6.} + \item{log2}{Transform the corrected response value (cval) to log-scale (base 2).} + \item{log10}{Transform the corrected response value (cval) to log-scale (base 10).} + \item{rmneg}{Exclude wells with negative corrected response values (cval) and downgrading + their well quality (wllq); if cval < 0, wllq = 0.} + \item{rmzero}{Exclude wells with corrected response values (cval) equal to zero and + downgrading their well quality (wllq); if cval = 0, wllq = 0.} + \item{mult25}{Multiply corrected response value (cval) by 25; 25*cval.} + \item{mult100}{Multiply corrected response value (cval) by 100; 100*cval.} + \item{negshift}{Shift corrected response values (cval) by subtracting the minimum cval and + adding 1, such that the new minimum is 1; cval - min + 1.} + \item{mult2.5}{Multiply corrected response value (cval) by 2.5; 2.5*cval.} + \item{mult3}{Multiply corrected response value (cval) by 3; 3*cval.} + \item{mult6}{Multiply corrected response value (cval) by 6; 6*cval.} + \item{sub100}{Center data around zero by subtracting the corrected response value (cval) from + 100; 100 - cval. Typically used if data was pre-normalized around 100 with responses + decreasing to 0.} + \item{zscore.npwlls}{Convert the corrected response value (cval) to an absolute Z-Score based + on the neutral and positive control wells (wllts = n and p), by assay plate ID (apid); + cval = |(cval - (mean cval for wllt = n and p)) / (sd cval for wllt = n and p)|.} + \item{sub1}{Center data around zero by subtracting the corrected response value (cval) from 1; + 1 - cval. Typically used if data was pre-normalized around 1 with responses decreasing to 0.} } } diff --git a/man/MC3_Methods.Rd b/man/MC3_Methods.Rd index f14ba589..9b2f6c26 100644 --- a/man/MC3_Methods.Rd +++ b/man/MC3_Methods.Rd @@ -42,101 +42,148 @@ available in the package vignette, "Pipeline_Overview." \subsection{bval Methods}{ \describe{ - \item{bval.apid.nwlls.med}{Calculate bval as the median of cval for - wells with wllt equal to "n," by apid.} - \item{bval.apid.lowconc.med}{Calculate bval as the median of cval for - wells with wllt equal to "t" and cndx equal to 1 or 2, by apid.} - \item{bval.apid.twlls.med}{Calculate bval as the median of cval for - wells with wllt equal to "t," by apid.} - \item{bval.apid.tn.med}{Calculate bval as the median of cval for wells - with wllt equal to "t" or "n," by apid.} - \item{bval.apid.nwllslowconc.med}{Calculate bval as the median of cval - for wells with wllt equal to "n" or wells with wllt equal to "t" and - cndx equal to 1 or 2, by apid.} - \item{bval.spid.lowconc.med}{Calculate bval as the median of cval for - wells with wllt equal to "t" and cndx equal to 1, 2, or 3, by spid.} - \item{bval.apid.nwllstcwllslowconc.med}{Calculate bval as the median of - cval for wells with wllt equal to "n" or cndx equal to 1 or 2 and - wllt equal to "t" or "c" by apid.} + \item{bval.apid.nwlls.med}{Calculate the baseline value (bval) as the plate-wise median, by + assay plate ID (apid), of the corrected values (cval) for neutral control wells (wllt = n).} + \item{bval.apid.lowconc.med}{Calculate the baseline value (bval) as the plate-wise median, + by assay plate ID (apid), of the corrected values (cval) for test compound wells (wllt = t) + with a concentration index (cndx) of 1 or 2.} + \item{bval.apid.twlls.med}{Calculate the baseline value (bval) as the plate-wise median, by + assay plate ID (apid), of the corrected values (cval) of test compound wells (wllt = t).} + \item{bval.apid.tn.med}{Calculate the baseline value (bval) as the plate-wise median, by + assay plate ID (apid), of the corrected values (cval) for test compound wells (wllt = t) and + neutral control wells (wllt = n).} + \item{bval.apid.nwllslowconc.med}{Calculate the baseline value (bval) as the plate-wise + median, by assay plate ID (apid), of the corrected values (cval) of test compound wells + (wllt = t) with a concentration index (cndx) of 1 or 2 or neutral control wells (wllt = n).} + \item{bval.spid.lowconc.med}{Calculate the baseline value (bval) as the sample-wise median, + by sample ID (spid), of the corrected values (cval) of the three lowest concentration test + compound wells (wllt = t and cndx = 1, 2, & 3).} + \item{bval.apid.nwllstcwllslowconc.med}{Calculate the baseline value (bval) as the + plate-wise median, by assay plate ID (apid), of the corrected values (cval) for neutral + control wells (wllt = n) or wells with a concentration index (cndx) of 1 or 2 and well + type of test compound (wllt = t) or gain-of-signal control in multiple concentrations + (wllt = c).} + \item{bval.aeid.nwlls.med}{Calculate the baseline value (bval) as the endpoint-wise median, + by assay component endpoint ID (aeid), corrected value (cval) for neutral control wells + (wllt = n).} } } \subsection{pval Methods}{ \describe{ - \item{pval.apid.pwlls.med}{Calculate pval as the median of cval for - wells with wllt equal to "p," by apid.} - \item{pval.apid.mwlls.med}{Calculate pval as the median of cval for - wells with wllt equal to "m," by apid.} - \item{pval.apid.medpcbyconc.max}{First calculate the median of cval for - wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then - calculate pval as the maximum of the calculated medians, by apid.} - \item{pval.apid.medpcbyconc.min}{First calculate the median of cval for - wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then - calculate pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.medncbyconc.min}{First calculate the median of cval for - wells with wllt equal to "m" or "o," by wllt, conc, and apid. Then - calculate pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.pmv.min}{First calculate the median of cval for - wells with wllt equal to "p," "m," or "v," by wllt, conc, and apid. Then - calculate pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.pmv.max}{First calculate the median of cval for - wells with wllt equal to "p," "m," or "v," by wllt, conc, and apid. Then - calculate pval as the maximum of the calculated medians, by apid.} - \item{pval.apid.f.max}{First calculate the median of cval for - wells with wllt equal to "f," by wllt, conc, and apid. Then calculate - pval as the maximum of the calculated medians, by apid.} - \item{pval.apid.f.min}{First calculate the median of cval for - wells with wllt equal to "f," by wllt, conc, and apid. Then calculate - pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.p.max}{First calculate the median of cval for - wells with wllt equal to "p," by wllt, conc, and apid. Then calculate - pval as the maximum of the calculated medians, by apid.} - \item{pval.apid.p.min}{First calculate the median of cval for - wells with wllt equal to "p," by wllt, conc, and apid. Then calculate - pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.v.min}{First calculate the median of cval for - wells with wllt equal to "v," by wllt, conc, and apid. Then calculate - pval as the minimum of the calculated medians, by apid.} - \item{pval.zero}{Define pval as 0.} + \item{pval.apid.pwlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the corrected values (cval) for single-concentration + gain-of-signal positive control wells (wllt = p).} + \item{pval.apid.mwlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the corrected values (cval) for multiple-concentration + loss-of-signal negative control wells (wllt = m).} + \item{pval.apid.medpcbyconc.max}{Calculate the positive control value (pval) as the + plate-wise maximum, by assay plate ID (apid), of the medians of the corrected values (cval) + for gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) + by apid, well type, and concentration.} + \item{pval.apid.medpcbyconc.min}{Calculate the positive control value (pval) as the + plate-wise minimum, by assay plate ID (apid), of the medians of corrected value (cval) of + gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by + apid, well type, and concentration.} + \item{pval.apid.medncbyconc.min}{Calculate the positive control value (pval) as the + plate-wise minimum, by assay plate ID (apid), of the medians of the corrected values (cval) + for gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) + by apid, well type, and concentration.} + \item{pval.apid.pmv.min}{Calculate the positive control value (pval) as the plate-wise + minimum, by assay plate ID (apid), of the medians of the corrected values (cval) for + single-concentration gain-of-signal, multiple-concentration loss-of-signal, or viability + control wells (wllt = p, m, or v) by apid, well type, and concentration.} + \item{pval.apid.pmv.max}{Calculate the positive control value (pval) as the plate-wise + maximum, by assay plate ID (apid), of the medians of the corrected values (cval) for + single-concentration gain-of-signal, multiple-concentration loss-of-signal, or viability + control wells (wllt = p, m, or v) by apid, well type, and concentration.} + \item{pval.apid.f.max}{Calculate the positive control value (pval) as the plate-wise + maximum, by assay plate ID (apid), of the medians of important reference wells (wllt = f) + values by apid and concentration.} + \item{pval.apid.f.min}{Calculate the positive control value (pval) as the plate-wise + minimum, by assay plate ID (apid), of the medians of important reference wells (wllt = f) + values by apid and concentration.} + \item{pval.apid.p.max}{Calculate the positive control value (pval) as the plate-wise + maximum, by assay plate ID (apid), of the medians of the corrected values (cval) for + single-concentration gain-of-signal control wells (wllt = p) by apid.} + \item{pval.apid.p.min}{Calculate the positive control value (pval) as the plate-wise + minimum, by assay plate ID (apid), of the medians of corrected values (cval) for + single-concentration gain-of-signal control wells (wllt = p) by apid.} + \item{pval.apid.v.min}{Calculate the positive control value (pval) as the plate-wise + minimum, by assay plate ID (apid), of the medians of the corrected values (cval) for + viability control wells (wllt = v) by apid and concentration.} + \item{pval.zero}{Set the positive control value (pval) to 0; pval = 0.} + \item{pval.apid.owlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the corrected values (cval) for single-concentration + negative control wells (wllt = o).} + \item{pval.2bval}{Calculate the positive control value (pval) as the plate-wise median, by + assay plate ID (apid), of the corrected values (cval) for neutral control wells (wllt = n) + multiplied by 2.} + \item{pval.maxp}{Calculate the positive control value (pval) as the endpoint-wise maximum, + by assay component ID (aeid), of the corrected values for single-concentration + gain-of-signal wells (wllt = p).} + \item{pval.apid.bwlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the corrected values (cval) for blank wells (wllt= b).} + \item{pval.twlls.99pct}{Calculate positive control value (pval) as the 99th percentile of + all corrected value (cvals) of the test compound wells (wllt = t).} + \item{pval.neg.100}{Calculate positive control value (pval) as -100 for endpoints in the + down direction; pval = -100.} } } \subsection{resp Methods}{ \describe{ - \item{resp.pc}{Calculate resp as \eqn{\frac{\mathit{cval} - - \mathit{bval}}{\mathit{pval} - \mathit{bval}}100}{(cval - bval)/(pval - - bval)*100}.} - \item{resp.pc.pval.cor}{Calculate resp as \eqn{\frac{\mathit{cval} - - \mathit{bval}}{\mathit{pval}}100}{(cval - bval)/(pval)*100}.} - \item{resp.fc}{Calculate resp as \eqn{\mathit{cval}/\mathit{bval}}{ - cval/bval}.} - \item{resp.logfc}{Calculate resp as \eqn{\mathit{cval} - \mathit{bval}}{ - cval - bval}.} - \item{resp.log2}{Take the logarithm of resp with base 2.} - \item{resp.mult25}{Multiply resp by 25.} - \item{resp.scale.mad.log2fc}{Multiply resp by the scale factor - \eqn{\frac{\log_2 \left( 1.2 \right)}{3\mathit{bmad}}}{ - log2(1.2)/(3*bmad)}.} - \item{resp.scale.quant.log2fc}{Determine the maximum response - \eqn{\mathit{md}}{md} where \eqn{\mathit{md}}{md} = abs(1st centile - - 50th centile) or abs(99th centile - 50th centile), whichever is greater. - Scale the response such that 20 percent of md equals - \eqn{\log_2 \left( 1.2 \right)}{log2(1.2)}.} - \item{resp.multneg1}{Multiply resp by -1.} - \item{resp.shiftneg.3bmad}{Shift all resp values less than -3*bmad to 0.} - \item{resp.shiftneg.6bmad}{Shift all resp values less than -6*bmad to 0.} - \item{resp.shiftneg.10bmad}{Shift all resp values less than -10*bmad to - 0.} - \item{resp.blineshift.3bmad.repi}{Shift resp values with the blineShift - function by repi, where the window (wndw) is 3*bmad.} - \item{resp.blineshift.50.repi}{Shift resp values with the blineShift - function by repi, where the window (wndw) is 50.} - \item{resp.blineshift.3bmad.spid}{Shift resp values with the blineShift - function by spid, where the window (wndw) is 3*bmad.} - \item{resp.blineshift.50.spid}{Shift resp values with the blineShift - function by spid, where the window (wndw) is 50.} - \item{none}{Do no normalization; make resp equal to cval.} + \item{resp.pc}{Calculate the normalized response (resp) as a percent of control, i.e. the + ratio of the difference between the corrected (cval) and baseline (bval) values divided the + difference between the positive control (pval) and baseline (bval) values multiplied by 100; + resp = (cval-bval)/(pval-bval)*100.} + \item{resp.pc.pval.cor}{Calculate the normalized response (resp) as a percent of control, + i.e. the ratio of the difference between the corrected (cval) and baseline (bval) values + divided the positive control (pval) value multiplied by 100; resp = (cval-bval)/pval*100.} + \item{resp.fc}{Calculate the normalized response (resp) as the fold change, i.e. the ratio + of the corrected (cval) and baseline (bval) values; resp = cval/bal.} + \item{resp.logfc}{Calculate the normalized response (resp) as the fold change of logged, + i.e. the difference between corrected (cval) and baseline (bval) log-scale values.} + \item{resp.log2}{Transform the response values to log-scale (base 2).} + \item{resp.mult25}{Multiply the normalized response value (resp) by 25; 25*resp.} + \item{resp.scale.mad.log2fc}{Scale the normalized response value (resp) by the ratio of + log2(1.2) and 3 multiplied by the baseline median absolute deviation (bmad) of the unscaled + normalized response values (resp); log2(1.2) / 3(bmad)*resp.} + \item{resp.scale.quant.log2fc}{Scale the normalized response value (resp). First, determine + the maximum difference (md) by finding the maximum between the absolute difference of the + 1st percentile minus the 50th percentile and the absolute difference of the 99th percentile + minus the 50th percentile. Then multiply resp by log2(1.2) divided by 20 percent of md; + log2(1.2) / 0.2(md)*resp.} + \item{resp.multneg1}{Multiply the normalized response value (resp) by -1; -1*resp.} + \item{resp.shiftneg.3bmad}{Shift all the normalized response values (resp) less than -3 + multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -3*bmad, + resp = 0.} + \item{resp.shiftneg.6bmad}{Shift all the normalized response values (resp) less than -6 + multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -6*bmad, + resp = 0.} + \item{resp.shiftneg.10bmad}{Shift all the normalized response values (resp) less than 10 + multiplied by the baseline median absolute deviation (bmad) to 0; if resp < -10*bmad, + resp = 0.} + \item{resp.blineshift.3bmad.repi}{Shift the normalized response value (resp) with a baseline + correction, by replicate index (repi), with a window of 3 multiplied by the baseline median + absolute deviation (bmad).} + \item{resp.blineshift.50.repi}{Shift the normalized response value (resp) with a baseline + correction, by replicate index (repi), with a window of 50.} + \item{resp.blineshift.3bmad.spid}{Shift the normalized response value (resp) with a baseline + correction, by sample ID (spid), with a window of 3 multiplied by the baseline median + absolute deviation (bmad).} + \item{resp.blineshift.50.spid}{Shift the normalized response value (resp) with a baseline + correction, by sample ID (spid), with a window of 50.} + \item{none}{Set the corrected response value (cval) as the normalized response value (resp); + cval = resp. No additional mc3 methods needed for endpoint-specific normalization.} + \item{resp.zerocenter.fc}{Calculate the normalized response (resp) as a zero center fold + change, i.e. 1 minus the ratio of corrected (cval) and baseline (bval) values; + resp = 1 - (cval/bval). Typically used for increasing responses.} + \item{resp.incr.zerocenter.fc}{Calculate the normalized response (resp) as a zero center + fold change, i.e. the ratio of the the corrected (cval) and baseline (bval) values minus 1; + resp = cval/bval - 1. Typically used for increasing responses.} + \item{resp.mult100}{Multiply the normalized response value (resp) by 100; 100*resp.} } } } diff --git a/man/MC4_Methods.Rd b/man/MC4_Methods.Rd index aecac88d..5e9a1f4a 100644 --- a/man/MC4_Methods.Rd +++ b/man/MC4_Methods.Rd @@ -38,8 +38,18 @@ More information about the level 4 multiple-concentration processing is available in the package vignette, "Pipeline_Overview." \describe{ - \item{bmad.aeid.lowconc.twells}{bmad based on two lowest concentration of treatment wells} - \item{bmad.aeid.lowconc.nwells}{bmad based on two lowest concentration of nwells} + \item{bmad.aeid.lowconc.twells}{Calculate the baseline median absolute value (bmad) as the + median absolute deviation of normalized response values (rep) for test compound wells + (wllt = t) with concentration index (cndx) equal to 1 or 2.} + \item{bmad.aeid.lowconc.nwells}{Calculate the baseline median absolute value (bmad) as the + median absolute deviation of normalized response values (resp) for neutral control wells + (wllt = n).} + \item{onesd.aeid.lowconc.twells}{Calculate one standard deviation of the normalized response + for test compound wells (wllt = t) with a concentration index (cndx) of 1 or 2; + onesd = sqrt(sum((resp - mean resp)^2)/sample size - 1). Used to establish BMR and therefore + required for tcplfit2 processing.} + \item{bidirectional.false}{Limits bidirectional fitting and processes data in positive + analysis direction only. Use for gain-of-signal or inverted data.} } } diff --git a/man/MC5_Methods.Rd b/man/MC5_Methods.Rd index 16e6b2d8..476f38b4 100644 --- a/man/MC5_Methods.Rd +++ b/man/MC5_Methods.Rd @@ -24,18 +24,41 @@ More information about the level 5 multiple-concentration processing is available in the package vignette, "Pipeline_Overview." \describe{ - \item{bmad3}{Add a cutoff value of 3*bmad.} - \item{pc20}{Add a cutoff value of 20.} - \item{log2_1.2}{Add a cutoff value of log2(1.2).} - \item{log10_1.2}{Add a cutoff value of log10(1.2).} - \item{bmad5}{Add a cutoff value of 5*bmad.} - \item{bmad6}{Add a cutoff value of 6*bmad.} - \item{bmad10}{Add a cutoff value of 10*bmad.} - \item{log2_2}{Add a cutoff value of log2(2).} - \item{log10_2}{Add a cutoff value of log10(2).} - \item{neglog2_0.88}{Add a cutoff value of -1*log2(0.88).} + \item{bmad3}{Add a cutoff value of 3 multiplied by the baseline median absolute deviation + (bmad) as defined at Level 4.} + \item{pc20}{Add a cutoff value of 20. Typically for percent of control data.} + \item{log2_1.2}{Add a cutoff value of log2(1.2). Typically for fold change data.} + \item{log10_1.2}{Add a cutoff value of log10(1.2). Typically for fold change data.} + \item{bmad5}{Add a cutoff value of 5 multiplied the baseline median absolute deviation (bmad). + By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad6}{Add a cutoff value of 6 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad10}{Add a cutoff value of 10 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{maxmed20pct}{Add a cutoff value of 20 percent of the maximum of all endpoint maximal + average response values (max_med).} + \item{pc70}{Add a cutoff value of 70. Typically for percent of control data.} + \item{pc50}{Add a cutoff value of 50. Typically for percent of control data.} + \item{log2_2}{Add a cutoff value log2(2). Typically for fold change data.} + \item{log10_2}{Add a cutoff value of log10(2). Typically for fold change data.} + \item{neglog2_0.88}{Add a cutoff value of -1 times log2(0.88).} \item{coff_2.32}{Add a cutoff value of 2.32.} - + \item{loec.coff}{Method not yet updated for tcpl implementation. Identify the lowest observed + effective concentration (loec) compared to baseline.} + \item{fc0.2}{Add a cutoff value of 0.2. Typically for zero centered fold change data.} + \item{fc0.3}{Add a cutoff value of 0.3. Typically for zero centered fold change data.} + \item{pc25}{Add a cutoff value of 25. Typically for percent of control data.} + \item{pc30}{Add a cutoff value of 30. Typically for percent of control data.} + \item{bmad1}{Add a cutoff value of 1 multiplied by baseline median absolute value (bmad). By + default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad2}{Add a cutoff value of 2 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{pc10}{Add a cutoff value of 10. Typically for percent of control data.} + \item{pc05}{Add a cutoff value of 5. Typically for percent of control data.} + \item{pc95}{Add a cutoff value of 95. Typically for percent of control data.} + \item{bmad4}{Add a cutoff value of 4 multiplied the baseline median absolute deviation (bmad). + By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{fc0.5}{Add a cutoff value of 0.5. Typically for zero centered fold change data.} } } diff --git a/man/MC6_Methods.Rd b/man/MC6_Methods.Rd index 340526c4..f7774224 100644 --- a/man/MC6_Methods.Rd +++ b/man/MC6_Methods.Rd @@ -21,62 +21,47 @@ More information about the level 6 multiple-concentration processing is available in the package vignette, "Pipeline_Overview." \describe{ - \item{modl.directionality.fail}{The modl.directionality.fail flag - identifies concentration series where, had the model direction been - opposite, more responses would have exceeded the cutoff, i.e., series - where the number of responses in absolute value which are greater than the - absolute value of the cutoff exceeds twice the number of responses which - are more extreme than the cutoff (< cutoff when cutoff is negative, - > cutoff when cutoff is positive).} - \item{low.nrep}{The low.nrep flag identifies concentration series where - the average number of replicates per concentration tested is less than 2.} - \item{low.nconc}{The low.nconc flag identifies concentration series where - the number of concentrations tested is greater or equal to 4.} - \item{bmd.highconc}{The bmd.highconc flag identifies concentration series - with a steep curve, i.e., series where the bmd is greater than 50% of the - range of concentrations tested.} - \item{bmd.lowconc}{The bmd.lowconc flag identifies concentration series - with a shallow curve, i.e., series where the bmd is less than 50% of the - range of concentrations tested.} - \item{bmd.high}{The bmd.high flag attempts to identify noisy concentration - series by flagging series where the bmd is greater than the ac50.} - \item{singlept.hit.high}{The singlept.hit.high flag identifies - concentration series where the median response was greater than 3*bmad - only at the highest tested concentration and the series had an active - hit-call.} - \item{singlept.hit.mid}{The singlept.hit.mid flag identifies concentration - series where the median response was greater than 3*bmad at only one - concentration (not the highest tested concentration) and the series had - an active hit-call.} - \item{multipoint.neg}{The multipoint.neg flag identifies concentration - series with response medians greater than 3*bmad at multiple - concentrations and an inactive hit-call.} - \item{gnls.lowconc}{The gnls.lowconc flag identifies concentration series - where the gain-loss model won, the gain AC50 is less than the minimum - tested concentration, and the loss AC50 is less than the mean tested + \item{modl.directionality.fail}{Flag series if model directionality is questionable, i.e. if + the winning model direction was opposite, more responses (resp) would have exceeded the cutoff + (coff). If loss was winning directionality (top < 0), flag if + count(resp < -1(coff)) < 2(count(resp > coff)). If gain was winning directionality (top > 0), + flag if count(resp > coff) < 2(count(resp < -1*coff)).} + \item{low.nrep}{Flag series if the average number of replicates per concentration is less than + 2; nrep < 2.} + \item{low.nconc}{Flag series if 4 concentrations or less were tested; nconc <= 4.} + \item{bmd.high}{Flag series if modeled benchmark dose (BMD) is greater than AC50 + (concentration at 50 percent maximal response). This is indicates high variability in baseline + response in excess of more than half of the maximal response.} + \item{singlept.hit.high}{Flag single-point hit that's only at the highest conc tested, where + series is an active hit call (hitc >= 0.9) with the median response observed above baseline + occurring only at the highest tested concentration tested. } + \item{singlept.hit.mid}{Flag single-point hit that's not at the highest conc tested, where + series is an active hit call (hitc >= 0.9) with the median response observed above baseline + occurring only at one concentration and not the highest concentration tested.} + \item{multipoint.neg}{Flag multi-point miss, where series is an inactive hit call (hitc < 0.9) + with multiple median responses observed above baseline.} + \item{gnls.lowconc}{Flag series where winning model is gain-loss (gnls) and the gain AC50 is + less than the minimum tested concentration, and the loss AC50 is less than the mean tested concentration.} - \item{noise}{The noise flag attempts to identify noisy concentration - series by flagging series where the root mean square error for the series - is greater than the cutoff for the assay endpoint.} - \item{border}{The border flag identifies concentration - series which have borderline activity, i.e., series where the top - parameter of the winning model was greater than or equal to 0.8*cutoff - and less than or equal to 1.2*cutoff.} - \item{overfit.hit}{The overfit.hit flag recalculates the model winner - after applying a small sample correction factor to the AIC values. If the - hit-call would be changed after applying the small sample correction - factor the series is flagged. Series with less than 5 concentrations where - the hill model won and series with less than 7 concentrations where the - gain-loss model won are automatically flagged.} - \item{efficacy.50}{The efficacy.50 flag identifies concentration series - with efficacy values (either the modeled top parameter for the winning - model or the maximum median response) less than 50 for percent activity - data or log2(1.5) for fold induction data} - \item{ac50.lowconc}{The ac50.lowconc flag identifies concentration series - with ac50 values less than the minimum tested concentration.} - \item{viability.gnls}{The viability.gnls flag identifies concentration series - of cell viability assays which were fit with gain-loss as the winning - model and the series had an active hit-call.} + \item{noise}{Flag series as noisy if the quality of fit as calculated by the root mean square + error (rmse) for the series is greater than the cutoff (coff); rmse > coff.} + \item{border}{Flag series if borderline activity is suspected based on modeled top parameter + (top) relative to cutoff (coff); |top| <= 1.2(coff) or |top| >= 0.8(coff).} + \item{overfit.hit}{Method not yet updated for tcpl implementation. Flag hit-calls that would + get changed after doing the small N correction to the aic values.} + \item{efficacy.50}{Flag low efficacy hits if series has an active hit call (hitc >= 0.9) and + efficacy values (e.g. top and maximum median response) less than 50 percent; intended for + biochemical assays. If hitc >= 0.9 and coff >= 5, then flag when top < 50 or max_med < 50. + If hitc >= 0.9 and coff < 5, then flag when top < log2(1.5) or max_med < log2(1.5).} + \item{ac50.lowconc}{Flag series with an active hit call (hitc >= 0.9) if AC50 (concentration + at 50 percent maximal response) is less than the lowest concentration tested;if hitc >= 0.9 + and ac50 < 10^logc_min, then flag.} + \item{viability.gnls}{Flag series with an active hit call (hitc >= 0.9) if denoted as cell + viability assay with winning model is gain-loss (gnls); if hitc >= 0.9, modl=="gnls" and + cell_viability_assay == 1, then flag.} + \item{medresp.3bmad}{Flag series where no median response values are greater than baseline as + defined by 3 times the baseline median absolute deviation (bmad); nmed_gtbl = 0, where + nmed_gtbl is the number of medians greater than 3*bmad.} } } diff --git a/man/SC1_Methods.Rd b/man/SC1_Methods.Rd index 13f6476c..9866fd90 100644 --- a/man/SC1_Methods.Rd +++ b/man/SC1_Methods.Rd @@ -42,46 +42,61 @@ available in the package vignette, "Pipeline_Overview." \subsection{bval Methods}{ \describe{ - \item{bval.apid.nwlls.med}{Calculate bval as the median of rval for - wells with wllt equal to "n," by apid.} - \item{bval.apid.twlls.med}{Calculate bval as the median of rval for - wells with wllt equal to "t," by apid.} - \item{bval.apid.tn.med}{Calculate bval as the median of rval for wells - with wllt equal to "t" or "n," by apid.} + \item{bval.apid.nwlls.med}{Calculate the baseline value (bval) as the plate-wise median, + by assay plate ID (apid), of the raw values (rval) for neutral control wells (wllt = n).} + \item{bval.apid.twlls.med}{Calculate the baseline value (bval) as the plate-wise median, + by assay plate ID (apid), of the raw values (rval) for test compound wells (wllt = t).} + \item{bval.apid.tn.med}{Calculate the baseline value (bval) as the plate-wise median, + by assay plate ID (apid), of the raw values (rval) for test compound wells (wllt = t) + and neutral control wells (wllt = n).} } } \subsection{pval Methods}{ \describe{ - \item{pval.apid.pwlls.med}{Calculate pval as the median of rval for - wells with wllt equal to "p," by apid.} - \item{pval.apid.mwlls.med}{Calculate pval as the median of rval for - wells with wllt equal to "m," by apid.} - \item{pval.apid.medpcbyconc.max}{First calculate the median of rval for - wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then - calculate pval as the maximum of the calculated medians, by apid.} - \item{pval.apid.medpcbyconc.min}{First calculate the median of rval for - wells with wllt equal to "p" or "c," by wllt, conc, and apid. Then - calculate pval as the minimum of the calculated medians, by apid.} - \item{pval.apid.medncbyconc.min}{First calculate the median of rval for - wells with wllt equal to "m" or "o," by wllt, conc, and apid. Then - calculate pval as the minimum of the calculated medians, by apid.} - \item{pval.zero}{Define pval as 0.} + \item{pval.apid.pwlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the raw values (rval) for single-concentration + gain-of-signal positive control wells (wllt = p).} + \item{pval.apid.mwlls.med}{Calculate the positive control value (pval) as the plate-wise + median, by assay plate ID (apid), of the raw values (rval) for multiple-concentration + loss-of-signal negative control wells (wllt = m).} + \item{pval.apid.medpcbyconc.max}{Calculate the positive control value (pval) as the + plate-wise maximum, by assay plate ID (apid), of the medians of the raw values (rval) for + gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by + apid, well type, and concentration.} + \item{pval.apid.medpcbyconc.min}{Calculate the positive control value (pval) as the + plate-wise minimum, by assay plate ID (apid), of the medians of the raw values (rval) for + gain-of-signal single- or multiple-concentration positive control wells (wllt = p or c) by + apid, well type, and concentration.} + \item{pval.apid.medncbyconc.min}{Calculate the positive control value (pval) as the + plate-wise minimum, by assay plate ID (apid), of the medians of the raw values (rval) for + gain-of-signal single- or multiple-concentration negative control wells (wllt = m or o) by + apid, well type, and concentration.} + \item{pval.zero}{Set the positive control value (pval) to 0; pval = 0.} + \item{pval.apid.or.aeid.pwlls.med}{Calculate the positive control value (pval) as the + plate-wise median, by assay plate ID (apid), of the raw values (rval) for + single-concentration gain-of-signal positive control wells (wllt = p). For plates without p + wells, set the pval as the median pval calculated from all plates.} } } \subsection{resp Methods}{ \describe{ - \item{resp.pc}{Calculate resp as \eqn{\frac{\mathit{rval} - - \mathit{bval}}{\mathit{pval} - \mathit{bval}}100}{(rval - bval)/(pval - - bval)*100}.} - \item{resp.fc}{Calculate resp as \eqn{\mathit{rval}/\mathit{bval}}{ - rval/bval}.} - \item{resp.logfc}{Calculate resp as \eqn{\mathit{rval} - \mathit{bval}}{ - rval - bval}.} - \item{resp.log2}{Take the logarithm of resp with base 2.} - \item{resp.multneg1}{Multiply resp by -1.} - \item{none}{Do no normalization; make resp equal to rval.} + \item{resp.pc}{Calculate the normalized response (resp) as a percent of control, i.e. the + ratio of the difference between the raw (rval) and baseline (bval) values divided by the + difference between positive control (pval) and baseline (bval) values multiplied by 100; + resp = (rval-bval)/(pval-bval)*100.} + \item{resp.fc}{Calculate the normalized response (resp) as fold change, i.e. the ratio of + the raw (rval) and baseline (bval) values; resp = rval/bval.} + \item{resp.logfc}{Calculate the normalized response (resp) as the fold change of logged, + i.e. the difference between raw (rval) and baseline (bval) log-scale values.} + \item{resp.log2}{Transform the response values to log-scale (base 2).} + \item{resp.multneg1}{Multiply the normalized response value (resp) by -1; -1*resp.} + \item{none}{Use raw value (rval) as is. This may be necessary for additional + endpoint-specific adjustments, or where no additional sc1 methods are needed.} + \item{resp.incr.zerocenter.fc}{Calculate the normalized response (resp) as a zero center + fold change, i.e. the ratio of the raw (rval) and baseline (bval) values minus 1; + resp = rval/bval - 1. Typically used for increasing responses.} } } } diff --git a/man/SC2_Methods.Rd b/man/SC2_Methods.Rd index 4f1a1447..babb1cc4 100644 --- a/man/SC2_Methods.Rd +++ b/man/SC2_Methods.Rd @@ -34,18 +34,36 @@ More information about the level 2 single-concentration processing is available in the package vignette, "Pipeline_Overview." \describe{ - \item{bmad3}{Add a cutoff value of 3*bmad.} - \item{pc20}{Add a cutoff value of 20.} - \item{log2_1.2}{Add a cutoff value of log2(1.2).} - \item{log10_1.2}{Add a cutoff value of log10(1.2).} - \item{bmad5}{Add a cutoff value of 5*bmad.} - \item{bmad6}{Add a cutoff value of 6*bmad.} - \item{bmad10}{Add a cutoff value of 10*bmad.} - \item{pc30orbmad3}{Add a cutoff value of either 30 or 3*bmad, whichever - is less.} - \item{ow_bmad_nwells}{Overwrite method to calculate bmad based on nwells for aeid.} - \item{bmad2}{Add a cutoff value of 2*bmad.} - \item{bmad1}{Add a cutoff value of 1*bmad.} + \item{bmad3}{Add a cutoff value of 3 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{pc20}{Add a cutoff value of 20. Typically for percent of control data.} + \item{log2_1.2}{Add a cutoff value of log2(1.2). Typically for fold change data.} + \item{log10_1.2}{Add a cutoff value of log10(1.2). Typically for fold change data.} + \item{bmad5}{Add a cutoff value of 5 multiplied the baseline median absolute deviation (bmad). + By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad6}{Add a cutoff value of 6 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad10}{Add a cutoff value of 10 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{pc30orbmad3}{Add a cutoff value of either 30 or 3 multiplied by the baseline median + absolute deviation (bmad), whichever is less. By default, bmad is calculated using test + compound wells (wllt = t) for the endpoint.} + \item{pc0.88}{Add a cutoff value of 0.88. Typically for percent of control data.} + \item{log2_1.5}{Add a cutoff value of log2(1.5). Typically for fold change data.} + \item{pc25}{Add a cutoff value of 25. Typically for percent of control data.} + \item{ow_bmad_nwells}{Overwrite the default baseline median absolute value (bmad) with a bmad + calculated using neutral control wells (wllt = n).} + \item{bmad2}{Add a cutoff value of 2 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{bmad1}{Add a cutoff value of 1 multiplied by baseline median absolute deviation (bmad). + By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{log2_0.76}{Add a cutoff value of 0.76 for log2-transformed data. This was a custom + threshold value set for endpoint id 1690 (formerly aeid 1691).} + \item{pc30}{Add a cutoff value of 30. Typically for percent of control data.} + \item{bmad1.5}{Add a cutoff value of 1.5 multiplied by the baseline median absolute deviation + (bmad). By default, bmad is calculated using test compound wells (wllt = t) for the endpoint.} + \item{ow_bidirectional_false}{Overwrite the max_med and max_tmp values, which were calculated + using absolute value, to a calculation not using absolute value for non-bidirectional data.} } } From c6e9072914e71a220a18184b555d0ecdb018e2ca Mon Sep 17 00:00:00 2001 From: Ko Date: Thu, 27 Jul 2023 15:57:59 -0400 Subject: [PATCH 5/6] Changed name mc6_mthds.R method medresp.3bmad to no.med.gt.3bmad and corresponding rendered manual. --- R/mc6_mthds.R | 2 +- man/MC6_Methods.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/mc6_mthds.R b/R/mc6_mthds.R index e681bd33..e63f99c6 100644 --- a/R/mc6_mthds.R +++ b/R/mc6_mthds.R @@ -58,7 +58,7 @@ #' \item{viability.gnls}{Flag series with an active hit call (hitc >= 0.9) if denoted as cell #' viability assay with winning model is gain-loss (gnls); if hitc >= 0.9, modl=="gnls" and #' cell_viability_assay == 1, then flag.} -#' \item{medresp.3bmad}{Flag series where no median response values are greater than baseline as +#' \item{no.med.gt.3bmad}{Flag series where no median response values are greater than baseline as #' defined by 3 times the baseline median absolute deviation (bmad); nmed_gtbl = 0, where #' nmed_gtbl is the number of medians greater than 3*bmad.} #' } diff --git a/man/MC6_Methods.Rd b/man/MC6_Methods.Rd index f7774224..98f76100 100644 --- a/man/MC6_Methods.Rd +++ b/man/MC6_Methods.Rd @@ -59,7 +59,7 @@ available in the package vignette, "Pipeline_Overview." \item{viability.gnls}{Flag series with an active hit call (hitc >= 0.9) if denoted as cell viability assay with winning model is gain-loss (gnls); if hitc >= 0.9, modl=="gnls" and cell_viability_assay == 1, then flag.} - \item{medresp.3bmad}{Flag series where no median response values are greater than baseline as + \item{no.med.gt.3bmad}{Flag series where no median response values are greater than baseline as defined by 3 times the baseline median absolute deviation (bmad); nmed_gtbl = 0, where nmed_gtbl is the number of medians greater than 3*bmad.} } From 98ef4b1f6125ca6a19fe2239b62173ce762c88a5 Mon Sep 17 00:00:00 2001 From: Ko Date: Mon, 31 Jul 2023 10:10:57 -0400 Subject: [PATCH 6/6] Added small change to see if conflict resolves. # added to line 261 --- R/mc6_mthds.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mc6_mthds.R b/R/mc6_mthds.R index e63f99c6..f5ed2a4f 100644 --- a/R/mc6_mthds.R +++ b/R/mc6_mthds.R @@ -258,7 +258,7 @@ mc6_mthds <- function() { #e16 <- bquote(ft[ , .(cr) := NULL]) #list(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, #e11, e12, e13, e14, e15, e16) - + # #}, efficacy.50 = function(mthd) {