NCA Docstrings
NCA.DoseLinearityPowerModel — MethodDoseLinearityPowerModel(nca::NCA.NCAReport, variable::Symbol; level = 0.95)Run a power model to assess dose linearity of variable in NCAReport nca. The power model is of the form log(variable) ~ log(α) + β × log(dose).
The fitted parameters can be assessed by showing the model or running StatsBase.coeftable(model).
The confidence interval level can be set using level.
Example
DoseLinearityPowerModel(ncareport, :cmax; level = 0.9)NCA.DoseLinearityRatioTest — MethodDoseLinearityRatioTest(nca::NCA.NCAReport, variable::Symbol; level = 0.95)Run ratio tests to assess dose linearity for variable in NCAReport nca. The test runs HypothesisTests.EqualVarianceTTests on the log transform of variable. This effectively tests the difference of geometric means between two doses. The groups in each TTest are the low dose and one of each of the remaining dose groups. A confidence interval level for the difference of the means of the log transformed data can be set using level.
The result can be inspected by showing the returned object or using StatsBase.coeftable(model). The real dose ratio can be compared with the estimated ratio and its confidence interval, where these values are re-transformed from the TTest output using exp.
Example
DoseLinearityRatioTest(ncareport, :cmax; level = 0.9)NCA.NCADose — TypeNCADoseNCADose takes the following arguments
time: time of the doseamt: The amount of dosageroute: Type of route,NCA.IVBolus,NCA.IVInfusionorNCA.EVii: interdose intervalss: steady-state
NCA.NCASubject — MethodNCASubject(conc, time; start_time=nothing, nominal_time=nothing, end_time=nothing, volume=nothing, concu=true, timeu=true, volumeu=true,
id="1", group=nothing, dose=nothing, llq=nothing,
clean=true, check=true num_blqs_df = 0, )Constructs a NCASubject
Note that llq keyword argument still takes effects with the presence of the blq data column, and llq defaults to 0.
Setting clean=false disables all checks on conc and time to remove the cost of checking and cleaning data. It should only be used when the data is for sure "clean".
NCA.read_nca — Functionread_nca(file::AbstractString; kwargs...)
read_nca(df_obs::AbstractDataFrame, df_dose::AbstractDataFrame; id = :id, time = :time, kwargs...)
read_nca(df::DataFrame; id=:id, time=:time, observations=:conc, nominal_time = :nominal_time,
start_time=:start_time, end_time=:end_time, volume=:volume,
amt=:amt, route=:route, duration=:duration, blq=:blq,
ii=:ii, ss=:ss, group=nothing, concu=true, timeu=true, amtu=true, volumeu=true,
verbose=true, sparse = false, kwargs...)Parse a DataFrame object or a CSV file to NCAPopulation. NCAPopulation holds an array of NCASubjects which contain relevant data for the individual subjects.
Concentrations at dosing rows are NOT ignored in read_nca.
df:DataFramecontaining the data for the analysis.
2 dataframes, in order, observations dataframe and dosing dataframe, can be passed to read_nca as well, rest of the arguments stay consistent in this case.
The following keyword arguments are used to specify column names in the df:
id: The numeric or string id of the subject. Defaults to:id.time: The actual time at which the observations were measured. Defaults to:time.observations: The observation (e.g. concentration) time series measurements. Values must be numbers or missing. Defaults to:conc.amt: The amount of a dose. Can either be the dosing amount at each dosing time and otherwise missing or the dosing amount is present at each time, in this case the first time (for a subject in a subgroup) is considered as the dosing time. Defaults to:amt.route: The route of administration. Possible choices areivfor intravenous,evfor extravascular, andinffor infusion. These can be specified as lower, upper or mixed case. E.g.iv,IVorEvare accepted. Defaults to:route.duration: The infusion duration. Should be the duration value or missing. Defaults to:duration.blq: Below the lower Limit of Quantification (BLQ). Used to specify the observation is BLQ. The BLQ column can take a value of 1 for BLQ observation and 0 otherwise. Defaults to:blq.ii: The interdose interval, equivalent totau. Used to specify the interval length for steady-state dosing. Defaults to the:iicolumn. If specified, andssistrue, then analysis returns steady-state parameters e.g.,cminss, cavgss, cmaxssby computing theaccumulationindex.ss: The steady-state. Used to specify whether a dose is steady-state, a steady-state dose takes the value1and0otherwise. It defaults to the:sscolumn. Ifssis set to1for a subject,iishould be greater than0.group: The columns to group the data by, splits the subjects based on the group information associated with them. Defaults to no grouping.llq: The Lower Limit of Quantification (LLQ). Defaults tonothing.concblq: The scheme for handling of BLQ values. Defaults to the dictionaryDict(:first=>:keep, :middle=>:drop, :last=>:keep), further explanation is available in the Handling BLQ Data section.concu: The units forobservations(e.g. concentration). Defaults to no units.amtu: The units for dosing amount. Defaults to no units.timeu: The units for time. Defaults to no units.volumeu: The units for volume. Defaults to no units.verbose: When true, warnings will be thrown when the output does not match PumasNCADF. Defaults totrue.nominal_time: The nominal time corresponding to the observations. Defaults to:nominal_time.sparse: Boolean flag to indicate if the dataset should be treated as a case of sparse sampling. Defaults tofalse.
Urine analysis requires the following columns not used in case of plasma.
start_time: The beginning of the urine collection time. Defaults to:start_time.end_time: The end of the urine collection time. Defaults to:end_time.volume: Collected urine volume. Defaults to:volume.
For details about the handling of concentration values below the lower limit of quantification, please check out the documentation of NCA.cleanblq. All the keyword arguments of NCA.cleanblq are applicable to read_nca, too.
NCA.run_nca — Method run_nca(pop::NCAPopulation;
parameters = nothing,
studyid::String="",
studytitle::String="",
author=[],
sponsor::String = "",
date::DateTime=Dates.now(),
conclabel::String="",
timelabel::String="",
grouplabels::Array=String[],
groupsizes::NamedTuple=NamedTuple(),
versionnumber::Union{String, VersionNumber}=v"0.1",
sigdigits=nothing,
)The primary function in NCA.jl, to run NCA analysis on a population. Returns a NCAReport object that has a data frame of parameters computed in the analysis and other metadata information passed when run_nca is called.
NCA.summarize — Method summarize(data::AbstractDataFrame;
stratify_by::AbstractVector{<:Union{Symbol,Integer,AbstractString}} = Symbol[],
parameters::AbstractVector{<:Union{Symbol,Integer,AbstractString}} = [:cmax, :tmax, :half_life, :aucinf_obs, :auclast, :cl, :vz],
stats::AbstractVector{<:Function} = [NCA.numsamples, extrema, Statistics.mean, Statistics.std, StatsBase.geomean, NCA.geostd, NCA.geomeanCV])Computes summary statistics specified by stats kwarg for parameters obtained from NCA analysis with run_nca. stratify_by allows you to group your computations.