Endpoint Reference

All endpoint functions listed below are computed by run_nca when applicable to the input data. They can also be specified individually in the endpoints argument to run_nca.

Concentration Endpoints

Maximum, minimum, and other concentration metrics.

NCA.cmax — Function

Maximum observed concentration of a plasma profile. Predose measurements are ignored. For steady state profiles, measurements after the dosing interval are ignored. If multiple timepoints share the maximum concentration, the first (earliest) one is returned. If no measurements remain after these exclusions, for example when all observations are missing, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cmax])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cmax
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing     1.15
   2 │     2        2    100.0  ev       missing  missing      missing     1.14
NCA.cmax_dn — Function

Dose normalized version of cmax.

NCA.cmaxss — Function

Maximum concentration of a non-steady state plasma profile, extrapolated to steady state. Calculated as cmax * accumulation_index, where the calculations assume that the profile has a dosing interval of assumed_tau. If no maximum is present, missing is returned. Returns missing (rather than erroring) if assumed_tau is not provided.

Example

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/ev_sd_example");

julia> df.assumed_tau .= 24;

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cmaxss])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cmaxss
     │ Int64  Int64    Float64  String  Missing   Missing  Float64      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing         24.0  1.15497
   2 │     2        2    100.0  ev       missing  missing         24.0  1.14905
NCA.cmax_interval — Function

Version of cmax that only considers timepoints inside a closed interval. The interval is a tuple (tstart, tend). Both tstart and tend should be relative to dosing time.

Other restrictions, already mentioned in cmax, such as exclusions of predose measurements, are also excluded in this version, even if these points are part of interval.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(
           df_r,
           [
               :cmax_interval => (; interval = (2, 4)) => :cmax_2_4,
               :cmax_interval => (; interval = (5, 8)) => :cmax_5_8,
           ],
       )
2×9 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cmax_2_4  cmax_5_8
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64   Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing      1.11     0.608
   2 │     2        2    100.0  ev       missing  missing      missing      1.11     0.652
NCA.cmax_stderr — Function

Standard error of cmax, the maximum observed mean concentration, for a sparse plasma profile.

For a sparse profile each reported concentration is the mean over the pooled subjects at a timepoint (see transform_nca), and cmax is the largest of these means. cmax_stderr is the standard error of that mean:

cmax_stderr = s* / √n*

where t* is the timepoint at which the mean concentration is maximal (the timepoint cmax reports), s* is the sample standard deviation of the concentrations at t*, and n* is the number of subjects sampled at t*.

This endpoint is only available for sparse profiles.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/sparse_example");

julia> df_r = NCA.read_nca(df);

julia> df_t = NCA.transform_nca(df_r; sparse = true);

julia> run_nca(df_t, [:cmax_stderr])
1×8 DataFrame
 Row │ id      profile  dose     route   duration  tau      assumed_tau  cmax_stderr
     │ String  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │               1    100.0  ev       missing  missing      missing    0.0669162
NCA.cmin — Function

Minimum observed concentration of a plasma profile. Predose measurements are ignored. If dosing interval is provided, measurements after dosing interval are ignored. This is the minimum over all the remaining measurements, regardless of their position relative to cmax/tmax; it is not restricted to the measurements after the peak. So a low concentration measured shortly after dosing is returned, even if later concentrations are higher. If no minimum is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cmin])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cmin
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  0.00808
   2 │     2        2    100.0  ev       missing  missing      missing  0.014
NCA.cmin_dn — Function

Dose normalized version of cmin.

NCA.cminss — Function

Minimum concentration of a non-steady state plasma profile, extrapolated to steady state. Calculated as cmin * accumulation_index, where the calculations assume that the profile has a dosing interval of assumed_tau. If no minimum is present, missing is returned. Returns missing (rather than erroring) if assumed_tau is not provided.

Example

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/ev_sd_example");

julia> df.assumed_tau .= 24;

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cminss])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cminss
     │ Int64  Int64    Float64  String  Missing   Missing  Float64      Float64
─────┼─────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing         24.0  0.00811494
   2 │     2        2    100.0  ev       missing  missing         24.0  0.0141112
NCA.cmin_interval — Function

Version of cmin that only considers timepoints inside a closed interval. The interval is a tuple (tstart, tend). Both tstart and tend should be relative to dosing time.

Other restrictions, already mentioned in cmin, such as exclusions of predose measurements, are also excluded in this version, even if these points are part of interval.

See cmax_interval for a full workflow example.

NCA.c0 — Function

Predicted or measured concentration at dosing time for a plasma profile. When a measurement occurs at dosing time, this measurement is returned.

For IVBolus dosing route: If no measurement is present at dosing time, the concentration is predicted by backextrapolation, using the first two measurements. If no two measurements are available to perform backextrapolation, missing is returned. If the second concentration is larger than the first, or is zero, no backextrapolation is performed, and the first measurement is returned.

For other dosing routes when no steady state is assumed: Zero is returned.

For other dosing routes when steady state is assumed: cmin is returned.

NCA.clast — Function

Last measured non-zero concentration. Predose measurements are ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:clast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  clast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  0.00808
   2 │     2        2    100.0  ev       missing  missing      missing  0.014
NCA.clast_pred — Function

Version of clast, which uses predicted concentration, instead of measured concentration. Predicted as exp(-lambdaz*tlast + lambdazintercept).

NCA.ctau — Function

Concentration at the end of the dosing interval, of a steady state plasma profile. It is evaluated at t = tau, so for example a steady state profile with tau = 24 returns the concentration at 24 hours. This requires a steady state profile, that is, a non-missing tau; assumed_tau is not used, and missing is returned for non-steady state profiles. This concentration is calculated using the same interpolation and extrapolation rules used by the AUC calculations, see auc_partial.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:ctau])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  ctau
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing    0.204
   2 │     2        2    100.0  ev       missing     12.0      missing    0.14
NCA.cavg — Function

Average concentration during dosing interval, for a plasma profile with steady state dosing. Calculated as auctau_pred / tau.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cavg])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cavg
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing  0.671896
   2 │     2        2    100.0  ev       missing     12.0      missing  0.603042
NCA.cavgss — Function

Average concentration during dosing interval, for a plasma profile with non-steady state dosing. The calculations assume that the profile has a dosing interval of assumed_tau. Calculated as aucinf_pred / assumed_tau.

Example

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/ev_sd_example");

julia> df.assumed_tau .= 24;

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cavgss])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cavgss
     │ Int64  Int64    Float64  String  Missing   Missing  Float64      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing         24.0  0.297089
   2 │     2        2    100.0  ev       missing  missing         24.0  0.322223
NCA.cpred — Function

Predicted concentration at time t for a plasma profile (or excretion rate for a urine profile), interpolated from the observed data within the measured range and extrapolated from the lambdaz regression beyond it:

  • t = 0: the value back-extrapolated to dosing time (c0).
  • 0 < t ≤ tfinal (mid_time_final for urine): interpolated between the surrounding observations using method; if a measurement exists at t, it is returned unchanged.
  • t > tfinal: extrapolated along the terminal regression line, exp(β̂₀ + β̂₁*t).

The lambdaz fit is only needed for t > tfinal; for such t, missing is returned when the lambdaz calculation returns missing. method selects the interpolation/extrapolation rule (see auc_partial); the default is :linear.

Example

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> select(
           run_nca(df_r, [
               :cpred => (; t = 2.5) => :cpred_interp,
               :cpred => (; t = 48.0) => :cpred_extrap,
           ]),
           :id,
           :cpred_interp,
           :cpred_extrap,
       )
2×3 DataFrame
 Row │ id     cpred_interp  cpred_extrap
     │ Int64  Float64       Float64
─────┼───────────────────────────────────
   1 │     1        1.025    3.49262e-5
   2 │     2        1.0345   0.000110632

Time Endpoints

Time of peak, trough, last measurable, and lag time.

NCA.tmax — Function

Time of the maximum observed concentration of a plasma profile, relative to the dosing time. Predose measurements are ignored. For steady state profiles, measurements after the dosing interval are ignored. If multiple maxima are present, the first one is returned. If no maximum is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:tmax])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  tmax
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing      1.5
   2 │     2        2    100.0  ev       missing  missing      missing      1.5
NCA.tmax_interval — Function

Version of tmax that only considers timepoints inside a closed interval. The interval is a tuple (tstart, tend). Both tstart and tend should be relative to dosing time.

Other restrictions, already mentioned in tmax, such as exclusions of predose measurements, are also excluded in this version, even if these points are part of interval.

See cmax_interval for a full workflow example.

NCA.tmin — Function

Time of the minimum observed concentration of a plasma profile, relative to the dosing time. Predose measurements are ignored. For steady state profiles, measurements after the dosing interval are ignored. This is the time of the minimum over all the remaining measurements, regardless of their position relative to cmax/tmax; it is not restricted to the measurements after the peak. If multiple minima are present, the first one is returned. If no minimum is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:tmin])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  tmin
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing     24.0
   2 │     2        2    100.0  ev       missing  missing      missing     24.0
NCA.tmin_interval — Function

Version of tmin that only considers timepoints inside a closed interval. The interval is a tuple (tstart, tend). Both tstart and tend should be relative to dosing time.

Other restrictions, already mentioned in tmin, such as exclusions of predose measurements, are also excluded in this version, even if these points are part of interval.

See cmax_interval for a full workflow example.

NCA.tlast — Function

Time of the last measured non-zero concentration, relative to the dosing time. Predose measurements are ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:tlast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  tlast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing     24.0
   2 │     2        2    100.0  ev       missing  missing      missing     24.0
NCA.tfinal — Function

Time of the last measured concentration, including zero, for a plasma profile, relative to the dosing time. Predose measurements are ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:tfinal])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  tfinal
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing     24.0
   2 │     2        2    100.0  ev       missing  missing      missing     24.0
NCA.tlag — Function

Time of the observation preceding the first above zero observation, for urine profiles, or plasma profiles with extravascular or infusion dosing, relative to dose time. If no preceding observation exists, zero is returned. If there exists no above zero observation, missing is returned. For plasma profiles with non-extravascular or infusion dosing, missing is returned.

The "above zero" test is applied to the concentrations after any BLQ handling from transform_nca has been applied, so the result depends on the chosen blq_rules:

  • A BLQ observation set to zero by the BLQ rule (or kept at zero) is retained and is not above zero, so it counts as a preceding observation and extends the lag.
  • A BLQ observation that the BLQ rule replaces with missing is dropped before analysis, so it does not count; the preceding observation is then the previous retained timepoint.
  • A BLQ observation kept at a positive value below the limit of quantification still counts as an above zero observation.

Lambda z & Half-life

Terminal elimination rate constant estimation and related statistics.

NCA.lambdaz_fit — Function

Rate constant associated with the terminal elimination phase. Calculated from simple linear regression of log-transformed observations over time.

Also contains the intercept, R², adjusted R², number of timepoints, as well as first and last timepoint used in this regression.

The datapoints used for this regression are selected automatically by default. If a lambdaz_mask column is passed with the input dataframe, it controls the selection for all profiles in which it contains only Booleans (true or false), while profiles for which it contains only missing values are still fit with the automatic mechanism. Within a single profile, the lambdaz_mask column may not mix Booleans and missing values.

If a profile has Booleans in all of its rows in the lambdaz_mask column, only the rows with true values are used for the regression.

When the datapoints are determined automatically, the process starts by fitting the regression model using the last 3 data-points, then the last 4 data-points, and so on. This process continues until the adjusted R² of the regression model is worse than the best found adjusted R² so far, minus adjr2factor (defaults to 0.0001). The model with more data-points is thus preferred, even if it has a slightly worse adjusted R².

Further technical remarks:

For the automatic lambdaz determination, the iterative process also stops once threshold points have been fitted (defaults to 100). Points that are excluded from the regression because their observation is not positive do not count towards threshold, so the largest candidate window is the one containing the last threshold positive observations. A threshold below 3 is an error because the regression needs 3 points.

For the automatic lambdaz determination, note that the rate constant is lambdaz = -β̂₁, where β̂₁ is the slope of the log-linear regression. A valid terminal phase is declining, so it has a negative regression slope β̂₁ and therefore a positive lambdaz. It is possible that some iterations instead produce a non-negative slope β̂₁, equivalently a non-positive lambdaz. Such fits do not update the running best adjusted R² that the adjr2factor comparison is made against, so they are not used when determining the set of datapoints with the best adjusted R².

For both the automatic and non-automatic lambdaz determination, the fitting process requires at least 3 non-missing data-points, else missing is returned.

For both the automatic and non-automatic lambdaz determination, negative or zero valued observations are excluded from the fitting process, even if they are included in lambdaz_mask.

For both the automatic and non-automatic lambdaz determination, for extravascular dosing and infusion dosing, only points after tmax are considered for plasma profiles, and only points after tmax_rate for urine profiles. For infusing dosing, only points at or after infusion duration are considered.

Example

A minimal call returns the fitted terminal-phase regression as a NamedTuple:

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/lambdaz_mask_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdaz_fit], adjr2factor = 0.0001, threshold = 100)
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdaz_fit                ⋯
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      NamedTuple…                ⋯
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  (β̂₀ = 0.707684, β̂₁ = -0.21 ⋯
   2 │     2        2    100.0  ev       missing  missing      missing  (β̂₀ = 0.772547, β̂₁ = -0.23
                                                                                    1 column omitted

The lambdaz_mask column lets you choose the terminal-phase points yourself instead of relying on the automatic selection. For a profile masked with Booleans, only the true rows enter the λz regression. The nca/lambdaz_mask_example dataset flags the points from t = 8 onward:

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/lambdaz_mask_example");

julia> d1 = filter(:id => ==(1), df);

julia> d1.time[d1.lambdaz_mask]
6-element Vector{Float64}:
  8.0
 10.0
 12.0
 16.0
 20.0
 24.0

With the mask, the fit uses exactly those rows: 6 points starting at t = 8.

julia> cols = [:lambdaznpoints, :lambdaztimefirst];

julia> masked_nca = NCA.read_nca(df);

julia> masked_results = run_nca(masked_nca, cols);

julia> select(masked_results, :id, cols...)
2×3 DataFrame
 Row │ id     lambdaznpoints  lambdaztimefirst
     │ Int64  Int64           Float64
─────┼─────────────────────────────────────────
   1 │     1               6               8.0
   2 │     2               6               8.0

Dropping the column lets the points be selected automatically instead, which here uses 10 points reaching back to t = 3:

julia> automatic_df = select(df, Not(:lambdaz_mask));

julia> automatic_nca = NCA.read_nca(automatic_df);

julia> automatic_results = run_nca(automatic_nca, cols);

julia> select(automatic_results, :id, cols...)
2×3 DataFrame
 Row │ id     lambdaznpoints  lambdaztimefirst
     │ Int64  Int64           Float64
─────┼─────────────────────────────────────────
   1 │     1              10               3.0
   2 │     2              10               3.0
NCA.lambdaz — Function

Rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdaz])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdaz
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  0.226995
   2 │     2        2    100.0  ev       missing  missing      missing  0.201826
NCA.half_life — Function

Time it takes for the observations to be reduced by half, for plasma and urine profiles. Calculated as log(2)/lambdaz. Returns missing if the terminal slope calculation also returns missing.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:half_life])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  half_life
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing    3.05358
   2 │     2        2    100.0  ev       missing  missing      missing    3.43439
NCA.lambdazintercept — Function

Intercept of the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdazintercept])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdazintercept
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing          0.633496
   2 │     2        2    100.0  ev       missing  missing      missing          0.578328
NCA.lambdazr2 — Function

R² of the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdazr2])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdazr2
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing   0.999987
   2 │     2        2    100.0  ev       missing  missing      missing   0.999983
NCA.lambdazadjr2 — Function

Adjusted R² of the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdazadjr2])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdazadjr2
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing      0.999986
   2 │     2        2    100.0  ev       missing  missing      missing      0.99998
NCA.lambdazcorr — Function

Correlation coefficient of the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdazcorr])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdazcorr
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing    -0.999994
   2 │     2        2    100.0  ev       missing  missing      missing    -0.999991
NCA.lambdaznpoints — Function

Number of points used in the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdaznpoints])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdaznpoints
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Int64
─────┼─────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing              10
   2 │     2        2    100.0  ev       missing  missing      missing              10
NCA.lambdaztimefirst — Function

First timepoint used in the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdaztimefirst])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdaztimefirst
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing               3.0
   2 │     2        2    100.0  ev       missing  missing      missing               3.0
NCA.lambdaztimelast — Function

Last timepoint used in the linear regression used in the fitting of the rate constant associated with the terminal elimination phase. See lambdaz_fit for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:lambdaztimelast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  lambdaztimelast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing             24.0
   2 │     2        2    100.0  ev       missing  missing      missing             24.0
NCA.span — Function

Calculated as (lambdaz_upper - lambdaz_lower)/half_life, for either a plasma or urine profile.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:span])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  span
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  6.87718
   2 │     2        2    100.0  ev       missing  missing      missing  6.11463

AUC Endpoints

Area under the concentration-time curve.

NCA.auclast — Function

Area under the concentration curve from time zero to tlast for a plasma profile. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:auclast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  auclast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  7.09441
   2 │     2        2    100.0  ev       missing  missing      missing  7.66375
NCA.aucall — Function

Area under the concentration curve from time zero to the last observation time for a plasma profile. Unlike auclast, which integrates to the last non-zero concentration, aucall integrates to the very last timepoint including trailing zeros.

NCA.auclast_stderr — Function

Standard error of auclast, the area under the curve from time zero to tlast, for a sparse plasma profile.

For sparse sampling, the concentration at each timepoint tᵢ is a group mean C̄ᵢ taken over the subjects sampled at that nominal time. The standard error treats auclast as the linear trapezoidal combination of these means, a linear combination with fixed weights:

auclast ≈ Σᵢ wᵢ·C̄ᵢ

The trapezoidal weights are:

  • First timepoint: w₁ = (t₂ - t₁)/2.
  • Interior timepoints: wᵢ = (tᵢ₊₁ - tᵢ₋₁)/2.
  • Last timepoint: wₙ = (tₙ - tₙ₋₁)/2.

Because the weights are fixed and the means are random, the variance of this linear combination is:

Var(auclast) = Σᵢ wᵢ²·Var(C̄ᵢ) + 2·Σᵢ<ⱼ wᵢ·wⱼ·Cov(C̄ᵢ, C̄ⱼ)

where the first sum runs over all timepoints and the second over all pairs of distinct timepoints i < j. The variance and covariance of the group means are estimated from the per-timepoint sample statistics:

  • Var(C̄ᵢ) = sᵢ²/nᵢ, with sᵢ² the sample variance of the observations at tᵢ and nᵢ the number of subjects sampled at tᵢ.
  • Cov(C̄ᵢ, C̄ⱼ) = sᵢⱼ·nᵢⱼ/(nᵢ·nⱼ), with sᵢⱼ the sample covariance of the paired observations at tᵢ and tⱼ and nᵢⱼ the number of subjects sampled at both timepoints. The covariance therefore contributes only when subjects are shared across timepoints (serial sampling); under fully destructive sampling nᵢⱼ = 0 and the timepoints are treated as independent.

The standard error is √Var(auclast). This is the standard variance estimator for the trapezoidal AUC under sparse sampling (Bailer's method).

Because the weights wᵢ are those of the linear trapezoidal rule, this standard error is only defined for method = :linear; with the logarithmic methods (:linlog, :linuplogdown) it returns missing. The per-timepoint sample statistics are produced by transform_nca(df; sparse = true), and the endpoint is only available for sparse profiles.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/sparse_example");

julia> df_r = NCA.read_nca(df);

julia> df_t = NCA.transform_nca(df_r; sparse = true);

julia> run_nca(df_t, [:auclast_stderr])
1×8 DataFrame
 Row │ id      profile  dose     route   duration  tau      assumed_tau  auclast_stderr
     │ String  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────────
   1 │               1    100.0  ev       missing  missing      missing        0.516476
NCA.aucinf_pred — Function

Area under the concentration curve from time zero to infinity for a plasma profile. Calculated as auclast plus the extrapolated area from tlast to infinity. The extrapolated portion is computed as: clast_pred/lambdaz. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aucinf_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aucinf_pred
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing      7.13015
   2 │     2        2    100.0  ev       missing  missing      missing      7.73334
NCA.aucinf_obs — Function

Version of aucinf_pred, where the extrapolated area uses the observed concentration clast, instead of the predicted concentration at tlast: clast/lambdaz.

NCA.auc_extrap_percent_pred — Function

Percentage of aucinf_pred due to extrapolation. Calculated as 100 * (aucinf_pred - auclast) / aucinf_pred.

NCA.auc_extrap_percent_obs — Function

Percentage of aucinf_obs due to extrapolation. Calculated as 100 * (aucinf_obs - auclast) / aucinf_obs.

NCA.auc_back_extrap_percent_pred — Function

Percentage of aucinf_pred due to back-extrapolation, from first observation to dosing time. Calculated as 100 * back_extrap / aucinf_pred, where back_extrap is the area under the concentration curve from time zero to the time of the first observation.

Returns missing for non IV-bolus dosing routes.

NCA.auctau_pred — Function

Area under the concentration curve from time zero to the dosing interval tau for a plasma profile. Returns missing if tau is not defined in the input dataframe. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:auctau_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  auctau_pred
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing      8.06275
   2 │     2        2    100.0  ev       missing     12.0      missing      7.2365
NCA.auctau_obs — Function

Version of auctau_pred where the extrapolated area (if tau > tlast) uses the observed concentration clast instead of the predicted concentration at tlast.

NCA.auc_tau — Function

Area under the concentration curve from time zero to the dosing interval tau for a plasma profile. This defaults to auctau_pred.

NCA.auc — Function

Area under the concentration curve for a plasma profile. Equals aucinf_pred for non-steady state profiles, and auctau_pred for steady state profiles.

NCA.auc_partial — Function

Partial area under the curve for a time interval for a plasma or urine profile, using the specified integration method. The interval is a tuple (tstart, tend) defining the integration bounds.

tstart must be a numeric value (with tstart ≥ 0).

tend can be:

  • A numeric value (with tend > tstart)
  • :last (end of the observed profile)
  • Inf (infinity)

use_obs controls extrapolation beyond tlast:

  • false (default): uses predicted concentration from lambdaz regression
  • true: uses observed clast as the starting point for extrapolation

When :last or Inf are used, the calculation is done by computing the AUC from time zero to the appropriate endpoint, and subtracting the AUC from time zero to tstart.

The area calculation is based on applying the linear or logarithmic trapezoidal integration rule to all subsequent pairs of datapoints within the interval. The first pair consists of the first and second datapoint, while the second pair consists of the second and third datapoint, and so on. For the first pair, these integration rules are calculated as:

  • Linear trapezoidal rule: (O₁ + O₂) × (t₂ - t₁) / 2.
  • Log trapezoidal rule: (t₂ - t₁) × (O₂ - O₁) / log(O₂/O₁).

In this equation, O stands for observation, i.e., concentration for plasma profiles and rate for urine profiles. The total area under curve from tstart to tend then equals the sum over all pairs.

The choice between linear and logarithmic integration depends on the method:

  • :linear: Always uses the linear rule, except after tlast for a plasma profile and mid_time_last for a urine profile, where the logarithmic rule is used instead.
  • :linuplogdown: Uses the linear rule when O₂ ≥ O₁, uses the logarithmic rule when O₂ < O₁.
  • :linlog: Uses the linear rule before tmax for a plasma profile and before tmax_rate for a urine profile, uses the logarithmic rule afterwards. For IVBolus dosing route, always uses the logarithmic rule.

The logarithmic rule automatically falls back to the linear rule if O₁ ≤ 0, O₂ ≤ 0, or O₁ = O₂.

The default method is :linear.

To account for tstart or tend not being present in the data, two additional data points are inserted. These inserted observation values are either interpolated or extrapolated.

Interpolation is used to insert points before tfinal for a plasma profile and before mid_time_final for a urine profile.

Interpolation is calculated as:

  • Linear interpolation: O₁ + |t - t₁|/(t₂ - t₁) × (O₂ - O₁).
  • logarithmic interpolation: exp(log(O₁) + (t - t₁)/(t₂ - t₁) × (log(O₂) - log(O₁))).

Where (t₁, O₁), (t₂, O₂) is the closest pair of datapoints around t.

The choice between linear and logarithmic interpolation depends on the method, following the same pattern as selection of the integration rule.

If tstart, and possibly tend, occur before the first observation, then interpolation is still used, after inserting another additional observation at time zero, based on c0 for a plasma profile and rate0 for a urine profile.

Extrapolation is used to insert points after tfinal for a plasma profile and mid_time_final for a urine profile. By default (use_obs=false), the predicted concentration from the lambdaz regression is used. When use_obs=true, the observed clast is used as the starting point for extrapolation.

Floating-point tolerance

The internal time-after-dose computation can introduce floating-point roundoff that makes a time that should equal tfinal slightly exceed it, which would incorrectly trigger extrapolation. Times that overshoot tfinal by no more than 1e4 * eps(tfinal) are clamped back to tfinal.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(
           df_r,
           [
               :auc_partial => (; interval = (2, 4)) => :auc_2_4,
               :auc_partial => (; interval = (2, :last)) => :auc_2_last,
               :auc_partial => (; interval = (2, Inf)) => :auc_2_inf,
               :auc_partial => (; interval = (2, Inf), use_obs = true) => :auc_2_inf_obs,
           ];
           method = :linlog,
       )
2×11 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  auc_2_4  auc_2_last  auc_2 ⋯
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64  Float64     Float ⋯
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  1.86946     5.19202    5.2 ⋯
   2 │     2        2    100.0  ev       missing  missing      missing  1.9071      5.79031    5.8
                                                                                   2 columns omitted

AUMC Endpoints

Area under the first moment curve.

NCA.aumclast — Function

Area under the first moment curve from time zero to tlast for a plasma profile. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aumclast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aumclast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing   34.998
   2 │     2        2    100.0  ev       missing  missing      missing   41.2331
NCA.aumcinf_pred — Function

Area under the first moment curve from time zero to infinity for a plasma profile. Calculated as aumclast plus the extrapolated area from tlast to infinity. The extrapolated portion is computed as: clast_pred*tlast/lambdaz + clast_pred/lambdaz^2. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aumcinf_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aumcinf_pred
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing       36.0131
   2 │     2        2    100.0  ev       missing  missing      missing       43.2481
NCA.aumcinf_obs — Function

Version of aumcinf_pred, where the extrapolated area uses the observed concentration clast, instead of the predicted concentration at tlast: clast*tlast/lambdaz + clast/lambdaz^2.

NCA.aumc_extrap_percent_pred — Function

Percentage of aumcinf_pred due to extrapolation. Calculated as 100 * (aumcinf_pred - aumclast) / aumcinf_pred.

NCA.aumc_extrap_percent_obs — Function

Percentage of aumcinf_obs due to extrapolation. Calculated as 100 * (aumcinf_obs - aumclast) / aumcinf_obs.

NCA.aumctau_pred — Function

Area under the first moment curve from time zero to the dosing interval tau for a plasma profile. Returns missing if tau is not defined in the input dataframe. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aumctau_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aumctau_pred
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing       35.2027
   2 │     2        2    100.0  ev       missing     12.0      missing       29.5939
NCA.aumctau_obs — Function

Version of aumctau_pred where the extrapolated area (if tau > tlast) uses the observed concentration clast instead of the predicted concentration at tlast.

NCA.aumc_tau — Function
aumc_tau(p::PlasmaProfile)

Area under the first moment curve from time zero to the dosing interval tau for a plasma profile. This defaults to aumctau_pred.

MRT Endpoints

Mean residence time.

NCA.mrtlast — Function

Mean residence time, for a plasma profile. Calculated as aumclast / auclast. For infusion dosing route, a correction is applied by subtracting half the duration of the infusion length.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:mrtlast])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  mrtlast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing  4.93318
   2 │     2        2    100.0  ev       missing  missing      missing  5.38028
NCA.mrtinf_pred — Function

Mean residence time extrapolated to infinity, for a plasma profile.

For non-steady state dosing, calculated as aumcinf_pred / aucinf_pred. For steady state dosing, calculated as (aumctau + tau * (aucinf_pred - auctau_pred)) / auctau_pred.

For infusion dosing route, a correction is applied by subtracting half the duration of the infusion length, this occurs both for steady state and non-steady state dosing.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:mrtinf_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  mrtinf_pred
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing      6.06043
   2 │     2        2    100.0  ev       missing     12.0      missing      5.19806
NCA.mrtinf_obs — Function

Version of mrtinf_pred, that uses aucinf_obs and aumcinf_obs.

Clearance & Volume of Distribution

NCA.cl_pred — Function

Total body clearance, for a plasma profile, with non-EV dosing route. For non-steady state dosing, calculated as dose / aucinf_pred, For steady state dosing, calculated as dose / auctau_pred. Returns missing for EV dosing route. The computation is identical to cl_f_pred; the two differ only in the dosing route they are reported for. cl_pred is reported for non-EV routes, while cl_f_pred is the apparent clearance CL/F reported for the EV route, where the bioavailable fraction F is unknown. See cl_f_pred for a workflow example.

NCA.cl_f_pred — Function

Total body clearance relative to the fraction of dose absorbed, for a plasma profile, with EV dosing route. For non-steady state dosing, calculated as dose / aucinf_pred, For steady state dosing, calculated as dose / auctau_pred. Returns missing for non-EV dosing route. The computation is identical to cl_pred; the two differ only in the dosing route they are reported for. cl_f_pred is the apparent clearance CL/F reported for the EV route, where the bioavailable fraction F is unknown, while cl_pred is reported for non-EV routes.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:cl_f_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  cl_f_pred
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing     14.025
   2 │     2        2    100.0  ev       missing  missing      missing     12.931
NCA.cl_obs — Function

Version of cl_pred using aucinf_obs, for non-steady state dosing. For steady state dosing, returns missing. As with cl_pred/cl_f_pred, the computation is identical to cl_f_obs; cl_obs is reported for non-EV routes, while cl_f_obs is the apparent clearance CL/F reported for the EV route.

NCA.cl_f_obs — Function

Version of cl_f_pred using aucinf_obs, for non-steady state dosing. For steady state dosing, returns missing. As with cl_pred/cl_f_pred, the computation is identical to cl_obs; cl_f_obs is the apparent clearance CL/F reported for the EV route, while cl_obs is reported for non-EV routes.

NCA.vss_pred — Function

Volume of distribution at steady state, for a plasma profile. Calculated as mrtinf_pred * cl_pred.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/iv_sd_1_nca");

julia> df_r = NCA.read_nca(df; concentration = :conc);

julia> result = run_nca(df_r, [:vss_pred]);

julia> round.(result.vss_pred[1:3]; digits = 2)
3-element Vector{Float64}:
 11.62
  5.66
  7.83
NCA.vss_obs — Function

Version of vss_pred which uses mrtinf_obs and cl_obs.

NCA.vz_pred — Function

Volume of distribution based on the terminal phase, for a plasma profile, with non-EV dosing route. For non-steady state dosing, calculated as dose / (lambdaz * aucinf_pred). For steady state dosing, calculated as dose / (lambdaz * auctau_pred). Returns missing for EV dosing route.

See vz_f_pred for a workflow example.

NCA.vz_f_pred — Function

Volume of distribution based on the terminal phase relative to the fraction of dose absorbed, for a plasma profile, with EV dosing route. For non-steady state dosing, calculated as dose / (lambdaz * aucinf_pred). For steady state dosing, calculated as dose / (lambdaz * auctau_pred). Returns missing for non-EV dosing route.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:vz_f_pred])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  vz_f_pred
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing    61.7853
   2 │     2        2    100.0  ev       missing  missing      missing    64.0703
NCA.vz_obs — Function

For non-steady state dosing, version of vzpred that uses `aucinfobs. For steady state dosing, returnsmissing`.

NCA.vz_f_obs — Function

For non-steady state dosing, version of vzfpred that uses aucinf_obs. For steady state dosing, returns missing.

Fluctuation, Swing & Accumulation

NCA.fluctuation — Function

Concentration fluctuation, for a plasma profile. Calculated as 100 * (cmax - cmin) / cavg

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:fluctuation])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  fluctuation
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing      158.656
   2 │     2        2    100.0  ev       missing     12.0      missing      184.067
NCA.swing — Function

Concentration swing, for a plasma profile. Calculated as (cmax - cmin) / cmin

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_md_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:swing])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  swing
     │ Int64  Int64    Float64  String  Missing   Float64  Missing      Float64
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing     12.0      missing  5.22549
   2 │     2        2    100.0  ev       missing     12.0      missing  7.92857
NCA.swing_tau — Function

Version of swing, which uses ctau instead of cmin.

NCA.accumulation_index — Function

Accumulation index of a non-steady state plasma profile. Calculated as 1/(1-exp(-lambdaz * assumed_tau)), where the calculations assume that the profile has a dosing interval of assumed_tau.

Example

julia> using NCA, PharmaDatasets, DataFrames

julia> df = dataset("nca/ev_sd_example");

julia> df.assumed_tau .= 24;

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:accumulation_index])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  accumulation_index
     │ Int64  Int64    Float64  String  Missing   Missing  Float64      Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing         24.0             1.00432
   2 │     2        2    100.0  ev       missing  missing         24.0             1.00794

Urine Endpoints

Endpoints specific to urine pharmacokinetic profiles.

NCA.tmax_rate — Function

Mid-time of the interval with the maximum observed excretion rate of a urine profile, relative to the dosing time. Predose measurements are ignored. Intervals starting before dosing and ending after dosing are also ignored. If multiple maxima are present, the first one is returned. If no maximum is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:tmax_rate])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  tmax_rate
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing        3.0
NCA.max_rate — Function

Maximum observed excretion rate of a urine profile. Predose measurements are ignored. Intervals starting before dosing and ending after dosing are also ignored. If no maximum is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:max_rate])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  max_rate
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing    1.5087
NCA.max_rate_stderr — Function

Standard error of max_rate, the maximum observed mean excretion rate, for a sparse urine profile.

Computed the same way as cmax_stderr, using the per-interval excretion rates in place of plasma concentrations: the standard error of the group-mean rate at the timepoint where the mean rate is maximal. See cmax_stderr for the calculation details.

This endpoint is only available for sparse profiles.

NCA.mid_time_last — Function

Mid-time of the interval with the last measured non-zero excretion rate, for a urine profile, relative to dosing time. Predose measurements are ignored. Intervals starting before dosing and ending after dosing are also ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:mid_time_last])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  mid_time_last
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing           21.0
NCA.mid_time_final — Function

Mid-time of the interval with the last measured excretion rate, including zero, for a urine profile, relative to dosing time. Predose measurements are ignored. Intervals starting before dosing and ending after dosing are also ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:mid_time_final])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  mid_time_final
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼─────────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing            21.0
NCA.rate_last — Function

Last measured non-zero excretion rate, for a urine profile. Predose measurements are ignored. If no such measurement is present, missing is returned.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:rate_last])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  rate_last
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing   0.040565
NCA.rate_last_pred — Function

Version of rate_last, which uses predicted rate, instead of measured rate. Predicted as exp(-lambdaz*tlast + lambdazintercept).

NCA.urine_volume — Function

Sum of volumes over all intervals of a urine profile.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:urine_volume])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  urine_volume
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing        1284.0
NCA.amount_recovered — Function

Sum of drug amount over all intervals of a urine profile. Drug amount is defined as drug concentration multiplied with urine volume.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:amount_recovered])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  amount_recovered
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing           11.8839
NCA.percent_recovered — Function

Sum of drug amount over all intervals, relative to dose amount of a urine profile. Drug amount is defined as drug concentration multiplied with urine volume.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:percent_recovered])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  percent_recovered
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼────────────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing            23.7678
NCA.aurclast — Function

Area under the excretion rate curve from time zero to mid_time_last for a urine profile. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aurclast])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aurclast
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing   11.4896
NCA.aurcall — Function

Area under the excretion rate curve from time zero to the last observation time for a urine profile. Unlike aurclast, which integrates to the last non-zero rate, aurcall integrates to the very last timepoint including trailing zeros.

NCA.aurclast_stderr — Function

Standard error of aurclast, the area under the rate curve from time zero to mid_time_last, for a sparse urine profile.

Computed by the same variance-of-a-linear-combination method as auclast_stderr, using the per-interval excretion rates at the interval mid-times in place of plasma concentrations. See auclast_stderr for the calculation details.

Like auclast_stderr, it is only defined for the linear trapezoidal rule (method = :linear) and returns missing for the logarithmic methods. The endpoint is only available for sparse profiles.

NCA.aurcinf_pred — Function

Area under the excretion rate curve from time zero to infinity for a urine profile. Calculated as aurclast plus the extrapolated area from mid_time_last to infinity. The extrapolated portion is computed as: rate_last_pred/lambdaz. See auc_partial for the calculation details.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/urine_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:aurcinf_pred])
1×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  aurcinf_pred
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Float64
─────┼───────────────────────────────────────────────────────────────────────────────
   1 │     1        1     50.0  ev       missing  missing      missing       11.6907
NCA.aurcinf_obs — Function

Version of aurcinf_pred, where the extrapolated area uses the observed rate rate_last, instead of the predicted rate at mid_time_last: rate_last/lambdaz.

NCA.aurc_extrap_percent_pred — Function

Percentage of aurcinf_pred due to extrapolation. Calculated as 100 * (aurcinf_pred - aurclast) / aurcinf_pred.

NCA.aurc_extrap_percent_obs — Function

Percentage of aurcinf_obs due to extrapolation. Calculated as 100 * (aurcinf_obs - aurclast) / aurcinf_obs.

Other

NCA.n_samples — Function

The number of non-missing concentrations at or after the dosing time. For urine profiles, rows where volume is missing are also not counted.

Example

julia> using NCA, PharmaDatasets

julia> df = dataset("nca/ev_sd_example");

julia> df_r = NCA.read_nca(df);

julia> run_nca(df_r, [:n_samples])
2×8 DataFrame
 Row │ id     profile  dose     route   duration  tau      assumed_tau  n_samples
     │ Int64  Int64    Float64  String  Missing   Missing  Missing      Int64
─────┼────────────────────────────────────────────────────────────────────────────
   1 │     1        1    100.0  ev       missing  missing      missing         16
   2 │     2        2    100.0  ev       missing  missing      missing         16
NCA.Route — Type
Route

Type of routes. There are IVBolus and IVInfusion which are intravenous while EV is used for extravascular.

NCA v3

NullRoute is deprecated. In NCA v3 APIs, use missing instead of NullRoute to represent an unspecified route.