Skip to content

Commit 29705e6

Browse files
authored
Merge pull request #31 from PharmCat/dev
Multiple observations and covariates for PK data
2 parents 0ac0fcd + bdfae36 commit 29705e6

17 files changed

Lines changed: 568 additions & 181 deletions

.github/workflows/Tier1.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,9 @@ jobs:
2525
runs-on: ${{ matrix.os }}
2626
strategy:
2727
matrix:
28-
version:
29-
- '1.6'
30-
- '1.8'
31-
- '1'
32-
os:
33-
- ubuntu-latest
34-
- macOS-latest
35-
- windows-latest
36-
arch:
37-
- x64
28+
version: ['1.8', '1.10', '1']
29+
arch: [x64]
30+
os: [ubuntu-latest, windows-latest]
3831
steps:
3932
- uses: actions/checkout@v4
4033
- uses: julia-actions/setup-julia@v2

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MetidaNCA"
22
uuid = "097c2839-c7bc-4c4b-a5f2-b4167c1b4e7c"
33
authors = ["PharmCat <v.s.arnautov@yandex.ru>"]
4-
version = "0.5.18"
4+
version = "0.6.0"
55

66

77

@@ -10,6 +10,7 @@ version = "0.5.18"
1010
MetidaBase = "075456b7-4006-432f-9324-2f8453996c49"
1111
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1212
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
13+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1314

1415
[compat]
1516

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1111

1212
[compat]
1313
Documenter = "1"
14-
MetidaNCA = "0.5"
14+
MetidaNCA = "0.6"
1515
CSV = "0.8, 0.9, 0.10"
1616
DataFrames = "1"
1717
PrettyTables = "1, 2"

docs/manual_ru.jmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,25 @@ MetidaNCA.nca!(ds[1], adm = :ev, calcm = :lint, verbose = 1)
236236

237237
## ElimRange
238238

239+
# Вычисление параметров
240+
241+
## Пропущенные значения и интерполяция
242+
243+
## Количество наблюдений
244+
245+
## Время дозирования
246+
247+
## Kel
248+
249+
## Cdose
250+
251+
## AUC/AUMC
252+
253+
## Параметры равновесного состояния
254+
255+
## Частичные AUC/AUMC
256+
257+
239258

240259
\pagebreak
241260

docs/src/api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ MetidaNCA.getth
115115
MetidaNCA.pkplot
116116
```
117117

118+
### vpcplot
119+
120+
```@docs
121+
MetidaNCA.vpcplot
122+
```
123+
118124
### setbl!
119125

120126
```@docs

docs/src/examples.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,36 @@ dsnca = nca!(ds[1], adm = :ev, calcm = :lint, verbose = 2);
6666
```@example ncaexample
6767
using Plots
6868
69+
# plot 1
70+
6971
p = pkplot(ds; typesort = :Subject, pagesort = NoPageSort(), filter = Dict(:Formulation => "R"))
7072
7173
png(p, "plot1.png")
7274
75+
# plot 2
76+
7377
p = pkplot(ds; typesort = :Formulation, pagesort = NoPageSort(), legend = true)
7478
7579
png(p, "plot2.png")
7680
81+
# plot 3
82+
7783
p = pkplot(ds; elim = true, ls = true)
7884
7985
png(p[1][2], "plot3.png")
8086
87+
# plot 4
8188
# If pagesort used - return pairs with `Page ID` => `Plot`
8289
8390
p = pkplot(ds; typesort = :Subject, pagesort = :Formulation)
8491
8592
png(p[1][2], "plot4.png")
93+
94+
# plot 5
95+
96+
p = vpcplot(ds)
97+
98+
png(p, "plot5.png")
8699
```
87100

88101
#### Plot 1
@@ -101,6 +114,10 @@ png(p[1][2], "plot4.png")
101114

102115
![](plot4.png)
103116

117+
#### Plot 5
118+
119+
![](plot5.png)
120+
104121
## Set dose time
105122

106123
You can set dose time with [`setdosetime!`](@ref) for whole subject set or for

src/MetidaNCA.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module MetidaNCA
66
using RecipesBase
77

88
import RecipesBase: plot!, plot
9-
10-
import Base: length, length, push!, resize!
9+
import Statistics: mean, quantile
10+
import Base: length, push!, resize!, ht_keyindex, convert, first
1111
import MetidaBase
1212
import MetidaBase: Tables, StatsBase, PrecompileTools,
1313
PrettyTables,
@@ -29,7 +29,7 @@ using MetidaBase.Requires
2929
export pkimport, upkimport, pdimport, nca!, nca, DoseTime, ElimRange, LimitRule, NoPageSort,
3030
auc_sparse,
3131
setdosetime!, setkelauto!, setkelrange!, applylimitrule!, setbl!, setth!,
32-
pkplot,
32+
pkplot, vpcplot,
3333
getkeldata, getkelauto, getkelrange, getdosetime, getbl, getth, subset,
3434
metida_table,
3535
PKSubject, UPKSubject, PDSubject, NCAResult
@@ -56,6 +56,7 @@ const LOG2 = log(2)
5656
include("metidatable.jl")
5757
include("setblth.jl")
5858
include("timefilter.jl")
59+
include("dropnanormissing.jl")
5960
include("sparse.jl")
6061
include("atomic.jl")
6162
include("precompile.jl")

src/applylimitrule.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Apply rule to PK subject .
99
* STEP 3 (remove NaN): `rm` == true, then remove all `NaN` and `missing` values.
1010
"""
1111
function applylimitrule!(data::Union{PKSubject, PDSubject}, rule::LimitRule)
12-
applylimitrule!(data.time, data.obs, rule)
12+
applylimitrule!(data.time, getobs(data), rule)
1313
data
1414
end
1515
"""

src/dropnanormissing.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function dropfunction!(f::Function, subj::PKSubject)
2+
inds = findall(f, getobs(subj))
3+
deleteat!(gettime(subj), inds)
4+
deleteat!(getobs(subj), inds)
5+
return subj
6+
end
7+
8+
function dropfunction(f::Function, subj::PKSubject)
9+
return dropfunction!(f, deepcopy(subj))
10+
end
11+
12+
dropnanormissing!(subj::PKSubject) = dropfunction!(isnanormissing, subj)
13+
dropnanormissing(subj::PKSubject) = dropfunction(isnanormissing, subj)
14+
15+
dropnan!(subj::PKSubject) = dropfunction!(isnan, subj)
16+
dropnan(subj::PKSubject) = dropfunction(isnan, subj)
17+
18+
dropmissing!(subj::PKSubject) = dropfunction!(ismissing, subj)
19+
dropmissing(subj::PKSubject) = dropfunction(ismissing, subj)
20+
21+
22+

0 commit comments

Comments
 (0)