Conversation
- R/auciv.R, R/aucint.R, R/sparse.R had no real conflict, just adding content with new line
- R/pk.calc.urine.R (4 conflicts): Kept HEAD's version which had expanded depends = c("ae", "auclast") (adding the AUC dependency) plus formula=. The PKNCA.set.summary() blocks were outside the conflict markers (shared context).
- R/pk.calc.simple.R (26 conflicts): Kept both — the formula= argument from the branch AND the PKNCA.set.summary() blocks from main
Merge remote-tracking branch 'origin/main' into 507-parameters-formulas-website
# Conflicts:
# R/aucint.R
# R/auciv.R
# R/pk.calc.simple.R
# R/pk.calc.urine.R
# R/sparse.R
- removed summary definitions - typpo aumc_integrate instead of auc_integrate
test-001-add.interval.col.R — Added formula=NULL to 3 expected list comparisons. The add.interval.col() function now stores a formula field (10 elements), but the tests expected only 9. test-pk.calc.all.R — Added 8 sparse-dependent parameters to the exclusion list (sparse_aumclast, sparse_aumc_se, sparse_aumc_df, cl.sparse.last, mrt.sparse.last, vz.sparse.last, vss.sparse.last, kel.sparse.last). These parameters require sparse data which the test doesn't provide — same reason the existing sparse_auclast/sparse_auc_se/sparse_auc_df were already excluded.
billdenney
left a comment
There was a problem hiding this comment.
Thank you for this work!
This remains a bit complicated. Some of the formula are not easily represented as simple equations.
R/auc.R
Outdated
| pretty_name="AUClast", | ||
| desc="The area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification") | ||
| desc="The area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification", | ||
| formula="$AUC_{\\text{last}} = \\int_{0}^{T_{\\text{last}}} C(t) dt$") |
There was a problem hiding this comment.
The integral formulae are technically accurate, but they are not how the formula are actually calculated. The actual calculation is more complex as it depends on the integration method. It's hard to show this (and all AUC calculations) in a single formula as they are more easily described with algorithms. (This will probably take more thought.)
| desc="Correlation between time and log-concentration for lambda.z points", | ||
| depends="half.life") | ||
| depends="half.life", | ||
| formula="$\\text{cor}(t, \\log C)$") |
There was a problem hiding this comment.
Ideally, this would have an indicator that it is evaluated from lambda.z time first to lambda.z time last.
R/half.life.R
Outdated
| desc="The first time point used for the calculation of half-life", | ||
| depends="half.life") | ||
| depends="half.life", | ||
| formula="$t_{\\text{first}}$") |
There was a problem hiding this comment.
This doesn't seem like it needs a formula or if it does have one, perhaps something like:
$\lambda_z t_{first} = \min\left({time}_{\lambda_z}\right)$
R/half.life.R
Outdated
| desc="The last time point used for the calculation of half-life", | ||
| depends="half.life") | ||
| depends="half.life", | ||
| formula="$t_{\\text{last}}$") |
There was a problem hiding this comment.
Maybe
$\lambda_z t_{last} = \max\left({time}_{\lambda_z}\right)$
R/half.life.R
Outdated
| desc="The concentration at Tlast as predicted by the half-life", | ||
| depends="half.life") | ||
| depends="half.life", | ||
| formula="$C_{\\text{last,pred}} = e^{a + b t_{\\text{last}}}$") |
There was a problem hiding this comment.
This is a bit complicated because what is a (for clarity, I know what you mean, but it doesn't have a defined PK parameter)? b should be -\lambda_z.
R/sparse.R
Outdated
| pretty_name="Sparse AUClast", | ||
| desc="For sparse PK sampling, the area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification" | ||
| desc="For sparse PK sampling, the area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification", | ||
| formula="$AUC_{\\text{sparse}} = \\sum_k \\frac{\\bar{C}_k + \\bar{C}_{k+1}}{2} \\Delta t_k$" |
There was a problem hiding this comment.
This is more like the AUC calculation formula, but for non-sparse AUC, it has a different formula for log-down (or generally log-scale sub-intervals). Something to consider for how to best represent it elsewhere.
R/sparse.R
Outdated
| desc="For sparse PK sampling, the standard error degrees of freedom of the area under the concentration time curve from the beginning of the interval to the last concentration above the limit of quantification", | ||
| depends="sparse_auclast" | ||
| depends="sparse_auclast", | ||
| formula="$df(AUC_{\\text{sparse}})$" |
There was a problem hiding this comment.
This is accurate but not informative.
R/time.above.R
Outdated
| pretty_name="Time above Concentration", | ||
| desc="Time above a given concentration") | ||
| desc="Time above a given concentration", | ||
| formula="$T_{\\text{above}} = \\sum \\Delta t_{i: C_i > C_{\\text{ref}}}$") |
There was a problem hiding this comment.
This doesn't account for the fact that PKNCA interpolates the starting and ending times and accounts for times when it may go up and down.
|
Tried to address your comments the best I could! I also added a new column |
Closes #507
I needed to think a bit out of the box for this one and implement something semi-automatized.
add.interval.colwill optionally accept aformulaarg in LaTeXdata_raw/write_parameters-available_md.Rgenerates the website with the tablelet me know what you think. Also, you have more knowledge so it would be nice if you can do a quick review of the formulas I populated. Although I guess that they can always keep being corrected.
Feel also free to commit/push changes if easier