ENV["GKSwstype"] = "nul"
Use pkimport
to import PK data from table to subject set.
using MetidaNCA, CSV, DataFrames;
pkdata2 = CSV.File(joinpath(dirname(pathof(MetidaNCA)), "..", "test", "csv", "pkdata2.csv")) |> DataFrame
ds = pkimport(pkdata2, :Time, :Concentration, [:Subject, :Formulation]; dosetime = DoseTime(dose = 100, time = 0))
sort!(ds, :Subject)
Perform NCA analysis with nca!
. Access to result set is similar to DataFrame or any table.
Find parameter list [here](@ref parameter_list).
dsnca = nca!(ds, adm = :ev, calcm = :lint)
dsnca[:, :AUClast]
dsnca = nca!(ds, adm = :ev, calcm = :lint, partials = [(1, 7)])
dsnca[:, :AUC_1_7]
dsnca = nca!(ds[1], adm = :ev, calcm = :lint, verbose = 2);
using Plots
p = pkplot(ds; typesort = :Subject, pagesort = nothing, filter = Dict(:Formulation => "R"))
png(p, "plot1.png")
p = pkplot(ds; typesort = :Formulation, pagesort = nothing, legend = true)
png(p, "plot2.png")
p = pkplot(ds; elim = true, ls = true)
png(p[1], "plot3.png")
p = pkplot(ds; typesort = :Subject, pagesort = :Formulation)
png(p[1], "plot4.png")
You can set dose time with setdosetime!
for whole subject set or for
selected subjects.
dt = DoseTime(dose = 200, time = 0)
setdosetime!(ds, dt, Dict(:Formulation => "R"))
dsnca = nca!(ds)
dsnca[:, :Dose]
By default no exclusion or range specified. With setkelrange!
elimination range and exclusion
can be specified for whole subject set or for any selected subjects.
kr = ElimRange(kelstart = 4, kelend = 12, kelexcl = Int[5,6])
setkelrange!(ds, kr, [1,2,3])
dsnca = nca!(ds)
p = pkplot(ds[1]; elim = true)
png(p, "plot5.png")
getkeldata(ds[1])
You can use nca
for NCA analysis directly from tabular data.
dsnca = nca(pkdata2, :Time, :Concentration, [:Subject, :Formulation]; dosetime = DoseTime(dose = 100, time = 0))
sort!(dsnca, :Subject)
dsnca[:, :AUClast]
Use pdimport
to import PD data from table to subject set.
pddata = CSV.File(joinpath(dirname(pathof(MetidaNCA)), "..", "test", "csv", "pddata.csv")) |> DataFrame
pd = MetidaNCA.pdimport(pddata, :time, :obs, :subj; bl = 1.5, th = 5.0)
MetidaNCA.nca!(pd[1])
p = MetidaNCA.pkplot(pd[1], drawth = true, drawbl = true)
png(p, "plot6.png")