Calculate dilutions from predicted concentrations
Usage
qp_dilute(x, ...)
# S3 method for data.frame
qp_dilute(
x,
target_conc = NULL,
target_vol = 15,
remove_standards = FALSE,
pipette_vol_compat = TRUE,
...
)
# S3 method for list
qp_dilute(
x,
target_conc = NULL,
target_vol = 15,
remove_standards = FALSE,
...
)
Arguments
- x
A
data.frame
orlist
containing adata.frame
namedqp
with a column named.pred_conc
or.pred_conc_mean
. If both, will favor.pred_conc_mean
.- ...
Unused
- target_conc
Numeric vector. Target concentration in (mg/mL) protein. If length == 1, recycled.
- target_vol
Target volume in uL. If length == 1, recycled.
- remove_standards
Boolean. Should standards be removed from results?
- pipette_vol_compat
Boolean. Shold returned numbers be rounded to the typically precision of a pipette?
Examples
df <- data.frame(.pred_conc = 1)
qp_dilute(df, target_conc = 0.5, target_vol = 30)
#> .pred_conc sample_to_add add_to .target_conc .target_vol
#> 1 1 15 15 0.5 30
# Many sample and target concentrations
df2 <- data.frame(.pred_conc = 1:3)
qp_dilute(df2, target_conc = c(0.1, 0.4, 0.8), target_vol = 30)
#> .pred_conc sample_to_add add_to .target_conc .target_vol
#> 1 1 3 27 0.1 30
#> 2 2 6 24 0.4 30
#> 3 3 8 22 0.8 30
# Takes a list, so long as it has a data.frame named qp as one of the items:
ls <- list(qp = data.frame(.pred_conc = 3))
qp_dilute(ls, target_conc = 0.5, target_vol = 30)
#> $qp
#> .pred_conc sample_to_add add_to .target_conc .target_vol
#> 1 3 5 25 0.5 30
#>