MetidaNCA.DoseTimeType
DoseTime(dose::D, time::T, tau::TAU) where D <: Number where T <: Number where TAU <: Number

Dose settings.

  • dose - dose;
  • time - dose time;
  • tau - tau (τ);

Dose time set 0 by default.

MetidaNCA.ElimRangeType
ElimRange(kelstart::Int, kelend::Int, kelexcl::Vector{Int})::ElimRange

Elimination settings for PK subject.

  • kelstart - start point;
  • kelend - end point;
  • kelexcl - excluded points.
MetidaNCA.LimitRuleType
LimitRule(lloq::T, btmax, atmax, nan, rm::Bool) where T <: Real

LimitRule(;lloq = NaN, btmax = NaN, atmax = NaN, nan = NaN, rm::Bool = false)
  • lloq - LLOQ - low limit of quantification;
  • btmax - value for points before Tmax;
  • atmat - values for points after Tmax;
  • nan - values for replacing NaN;
  • rm - if true, removee all NaN points.

Rule for PK subject.

  • STEP 1 (NaN step): replace all NaN and missing values with nan keyword value (if nan not NaN);
  • STEP 2 (LLOQ step): replace values below lloq with btmax value if this value befor Tmax or with atmax if this value after Tmax (if lloq not NaN);
  • STEP 3 (remove NaN): rm == true, then remove all NaN and missing values.
MetidaNCA.applylimitrule!Method
applylimitrule!(data::Union{PKSubject, PDSubject}, rule::LimitRule)

Apply rule to PK subject .

  • STEP 1 (NaN step): replace all NaN and missing values with nan keyword value (if nan not NaN);
  • STEP 2 (LLOQ step): replace values below lloq with btmax value if this value befor Tmax or with atmax if this value after Tmax (if lloq not NaN);
  • STEP 3 (remove NaN): rm == true, then remove all NaN and missing values.
MetidaNCA.applylimitrule!Method
applylimitrule!(f::Function, data::DataSet{T}, rule::LimitRule) where T <: Union{PKSubject, PDSubject}

Apply if f(subj) return true.

MetidaNCA.applylimitrule!Method
applylimitrule!(data::DataSet{T}, rule::LimitRule, ind::Int) where T <: Union{PKSubject, PDSubject}

Apply by ind.

MetidaNCA.applylimitrule!Method
applylimitrule!(data::DataSet{T}, rule::LimitRule, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}}) where T <: Union{PKSubject, PDSubject}

Apply by inds.

MetidaNCA.applylimitrule!Method
applylimitrule!(data::DataSet{T}, rule::LimitRule) where T <: Union{PKSubject, PDSubject}

Apply to all dataset.

MetidaNCA.aucMethod
auc(time::AbstractVector, obs::AbstractVector;  calcm = :lint)

Return AUC. All concentration points included in calculation.

  • calcm - AUC/AUMC calculation method:
    • :lint - linear trapezoidal;
    • :logt - log-trapezoidal after Tmax;
    • :luld - linar up log down;
    • :luldt - linear up log down after Tmax;
Note

This function doesn't contain NaN, missing or dosing time checks.

MetidaNCA.cmaxMethod
cmax(time::AbstractVector, obs::AbstractVector)

Return Cmax

MetidaNCA.nca!Method
nca!(data::DataSet{Subj}; adm = :ev, calcm = :lint, intpm = nothing, verbose = 0, warn = true, io::IO = stdout, modify! = identity) where Subj <: AbstractSubject

Non-compartmental (NCA) analysis of PK/PD data.

MetidaNCA.nca!Method
nca!(data::PDSubject{T,O}; calcm = :lint, intpm = nothing, verbose = 0, warn = true, io::IO = stdout, modify! = identity, kwargs...) where T where O

Non-compartmental (NCA) analysis of pharmacodynamic data.

Results:

  • Rmax - max responce;
  • Tmax - time for maximum responce;
  • AUCABL - AUC above baseline;
  • AUCBBL - AUC below baseline;
  • AUCATH - AUC above threshold;
  • AUCBTH - AUC below threshold;
  • TABL - time above baseline;
  • TBBL - time below baseline;
  • TATH - time above threshold;
  • TBTH - time below threshold;
  • AUCBTW - AUC between baseline and threshold;
MetidaNCA.nca!Method
nca!(data::PKSubject{T,O}; adm = :ev, calcm = :lint, intpm = nothing, verbose = 0, warn = true, io::IO = stdout, modify! = nothing) where T where O
  • adm - administration:
    • :ev - extra vascular;
    • :iv - intravascular bolus;
  • calcm - AUC/AUMC calculation method:
    • :lint - linear trapezoidal;
    • :logt - log-trapezoidal after Tmax;
    • :luld - linar up log down;
    • :luldt - linear up log down after Tmax;
  • intpm - interpolation method:
    • :lint - linear trapezoidal;
    • :logt - log-trapezoidal after Tmax;
    • :luld - linar up log down;
    • :luldt - linear up log down after Tmax;
  • verbose - print to io, 1: partial areas table, 2: 1, and results;
  • warn - show warnings;
  • io - output stream;
  • modify! - function to modify output paramaters, call modify!(data, result) if difined.

Results:

  • Cmax
  • Tmax
  • Cdose
  • Tlag
  • Clast
  • AUClast
  • AUMClast
  • AUCall
  • Rsq
  • ARsq
  • Kel
  • HL
  • LZint
  • NpLZ
  • Clast_pred
  • AUCinf
  • AUCinf_pred
  • AUMCinf
  • AUMCinf_pred
  • AUCpct
  • MRTlast
  • MRTinf
  • MRTinf_pred
  • Cllast
  • Clinf
  • Vzlast
  • Vzinf
  • Vssinf

Stable state (tau used):

  • AUCtau
  • AUMCtau
  • Ctau
  • Cavg
  • Ctaumin
  • Accind
  • Fluc
  • Fluctau
  • Swing
  • Swingtau
  • MRTtauinf
  • Cltau
  • Vztau
MetidaNCA.nca!Method
nca!(data::UPKSubject{T, O, VOL, V}; adm = :ev, calcm = :lint, intpm = nothing, verbose = 0, warn = true, io::IO = stdout, modify! = identity) where T where O where VOL where V

Non-compartmental (NCA) analysis of pharmacokinetic for urine data.

Results:

  • AUCall
  • AUClast
  • Rlast
  • Maxrate
  • Tmax
  • AR
  • Vol
  • Prec
  • ARsq
  • Rsq
  • Kel
  • LZ
  • LZint
  • Rsqn
  • HL
  • AUCinf
MetidaNCA.ncaMethod
nca(args...; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime(), kwargs...)

nca(data, time, conc, sort; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime(), kwargs...)

nca(data, time, conc; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime(), kwargs...)

nca(time, conc; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime(), kwargs...)

Import data and perform NCA analysis.

Syntax simillar to pkimport

Applicable kwargs see nca!.

MetidaNCA.pdimportMethod
pdimport(data, time, obs, sort;
    bl = 0,
    th = 0,
    limitrule::Union{Nothing, LimitRule} = nothing,
    warn = true)

Import pharmackodynamic data from table:

  • data - data table;
  • time - observation time;
  • obs - observation value;
  • sort - sorting columns.

Keywords:

  • bl - baseline;
  • th - threshold;
  • limitrule - limit rule;
  • warn - warning supress if false.
MetidaNCA.pdimportMethod
pdimport(data, time, obs;
    warn = true,
    kwargs...)

Import PD data from tabular data data, time - time column, obs - observations column.

MetidaNCA.pdimportMethod
pdimport(time, obs;
    bl = 0,
    th = 0,
    id = Dict{Symbol, Any}(),
    warn = true)

Import PD data from time vector time and observations vector obs.

MetidaNCA.pkimportMethod
pkimport(data, time, conc, sort;
    kelauto = true,
    elimrange = ElimRange(),
    dosetime = DoseTime(),
    limitrule::Union{Nothing, LimitRule} = nothing,
    warn = true,
    kwargs...)

Import PK data from table data.

  • time - time column;
  • conc - concentration column;
  • sort - subject sorting columns.

keywords:

  • kelauto - if true auto range settings, if false used kelstart/kelend from elimrange;
  • elimrange - set elimination range settings;
  • dosetime - set dose and dose time, by default dosetime = 0, dose is NaN;
  • limitrule - apply limitrule to subject;
  • warn - false for warnings supress.
Note

If time column have non-unique values - last pair time-concentration will be used.

MetidaNCA.pkimportMethod
pkimport(data, time, conc;
    warn = true,
    kwargs...)

Import PK data from tabular data data, time - time column, conc - concentration column.

MetidaNCA.pkimportMethod
pkimport(time, conc;
    kelauto = true,
    elimrange = ElimRange(),
    dosetime = DoseTime(),
    id = Dict{Symbol, Any}(),
    limitrule::Union{Nothing, LimitRule} = nothing,
    warn = true,
    kwargs...)

Import PK data from time vector time and concentration vector conc.

MetidaNCA.pkplotMethod
pkplot(subj; ls = false, elim = false, xticksn = :auto, yticksn = :auto, kwargs...)

Plot for subject

  • ls - concentration in log scale;
  • elim - draw elimination curve;
  • xticksn - number of ticks on x axis;
  • yticksn - number of ticks on y axis;

Other keywords:

  • plotstyle - predefined plot style from PKPLOTSTYLE;
  • drawbl (false) - draw baseline, only for PDSubject;
  • drawth (false) - draw threshold, only for PDSubject;
MetidaNCA.pkplotMethod
pkplot(data::DataSet{T};
typesort::Union{Nothing, Symbol, AbstractVector{Symbol}} = nothing,
pagesort::Union{Nothing, Symbol, AbstractVector{Symbol}} = nothing,
sort::Union{Nothing, Dict{Symbol}} = nothing,
uylims::Bool = false,
kwargs...) where T <: AbstractSubject

PK plot for subject set.

  • typesort - sort on page by this id key;
  • pagesort - different pages by this id key;
  • sort - use only subjects if sort ⊆ subject id;
  • uylims - same ylims for all dataset.
MetidaNCA.setbl!Method
setbl!(data::DataSet{T}, bl, sort::Dict) where T <: PDSubject
MetidaNCA.setbl!Method
setbl!(data::DataSet{T}, bl, ind::Int) where T <: PDSubject
MetidaNCA.setbl!Method
setbl!(data::DataSet{T}, bl, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}})
MetidaNCA.setbl!Method
setbl!(data::T, bl) where T <: PDSubject

Set baseline for subject data.

MetidaNCA.setdosetime!Method
setdosetime!(data::DataSet{T}, dosetime::DoseTime, sort::Dict) where T <: PKSubject

Set dose time dosetime for subjects if sort ⊆ subject's id.

MetidaNCA.setdosetime!Method
setdosetime!(data::DataSet{T}, dosetime::DoseTime, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}}) where T <: PKSubject
  • inds - indexes in DataSet.
MetidaNCA.setdosetime!Method
setdosetime!(data::DataSet{T}, dosetime::DoseTime) where T <: PKSubject

For all subjects in DataSet.

MetidaNCA.setdosetime!Method
setdosetime!(data::DataSet{T}, dosetime::DoseTime, ind::Int) where T <: PKSubject
  • ind - index in DataSet.
MetidaNCA.setdosetime!Method
setdosetime!(data::T, dosetime::DoseTime) where T <: PKSubject

Set dose time dosetime for subject data.

MetidaNCA.setkelauto!Method
setkelauto!(data::DataSet{T}, kelauto::Bool, sort::Dict) where T <: PKSubject
MetidaNCA.setkelauto!Method
setkelauto!(data::DataSet{T}, kelauto::Bool, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}}) where T <: PKSubject
MetidaNCA.setkelauto!Method
setkelauto!(data::DataSet{T}, kelauto::Bool, ind::Int) where T <: PKSubject
MetidaNCA.setkelauto!Method
setkelauto!(data::T, kelauto::Bool) where T <: PKSubject

Set range for elimination parameters calculation for subject.

  • data - PK subject;
  • kelauto - value.
MetidaNCA.setkelrange!Method
setkelrange!(data::DataSet{T}, range::ElimRange{:point}, sort::Dict; kelauto = false) where T <: PKSubject
MetidaNCA.setkelrange!Method
setdosetime!(data::DataSet{T}, dosetime::DoseTime, ind::Int) where T <: PKSubject
MetidaNCA.setkelrange!Method
setkelrange!(data::DataSet{T}, range::ElimRange{:point}, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}}; kelauto = false)
MetidaNCA.setkelrange!Method
setkelrange!(data::DataSet{T}, range::ElimRange{:point}; kelauto = false) where T <: PKSubject
MetidaNCA.setkelrange!Method
setkelrange!(data::T, range::ElimRange{:point}; kelauto = false) where T <: PKSubject

Set range for subject data. Set kelauto if possible.

MetidaNCA.setth!Method
setth!(data::DataSet{T}, th, sort::Dict) where T <: PDSubject
MetidaNCA.setth!Method
setth!(data::DataSet{T}, th, ind::Int) where T <: PDSubject
MetidaNCA.setth!Method
setth!(data::DataSet{T}, th, inds::Union{Vector{Int}, UnitRange{Int}, Tuple{Vararg{Int}}})
MetidaNCA.setth!Method
setth!(data::T, th) where T <: PDSubject

Set threshold for subject data.

MetidaNCA.timefilterMethod
timefilter(data::DataSet{<: PKSubject}, time)

Make new DataSet with new filtered subjects.

MetidaNCA.timefilterMethod
timefilter(subj::PKSubject, time::AbstractRange)

Exclude all observation than not in time range.

MetidaNCA.timefilterMethod
timefilter(subj::PKSubject, time::Tuple{<:Number, <:Number})

Make deepcopy of subj and remove all observations < time[1] or > time[2]. Then resize keldata to 0.

If any of points in elimination rage not in min/max time, then elimination settings reset.

MetidaNCA.tmaxMethod
tmax(time::AbstractVector, obs::AbstractVector)

Return Tmax

MetidaNCA.upkimportMethod
upkimport(stime, etime, conc, vol; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime())

Import urine PK data from time vectors:

  • stime - start times;
  • etime - end times;
  • conc - concentrations;
  • vol - volumes.
MetidaNCA.upkimportMethod
upkimport(data, stime, etime, conc, vol; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime())

Import single urine PK data from table data.

  • stime - start time column;
  • etime - end time column;
  • conc - concentration column;
  • vol - volume column.
MetidaNCA.upkimportMethod
upkimport(data, stime, etime, conc, vol, sort; kelauto = true,  elimrange = ElimRange(), dosetime = DoseTime())

Import urine PK data from table data.

  • stime - start time column;
  • etime - end time column;
  • conc - concentration column;
  • vol - volume column;
  • sort - subject sorting columns.