Skip to content

Commit

Permalink
Merge pull request #64 from PharmCat/Remove-NCA
Browse files Browse the repository at this point in the history
Remove NCA
  • Loading branch information
PharmCat authored Feb 12, 2023
2 parents 87de3ac + 378e40c commit 1813f04
Show file tree
Hide file tree
Showing 21 changed files with 15 additions and 3,838 deletions.
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name = "ClinicalTrialUtilities"
uuid = "535c2557-d7d0-564d-8ff9-4ae146c18cfe"
authors = ["Vladimir Arnautov ([email protected])"]
version = "0.6.6"
version = "0.7.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand All @@ -17,8 +16,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
DataFrames = "1"
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24, 0.25"
QuadGK = "1, 2"
RecipesBase = "1"
Roots = "1.0, 2"
Roots = "1, 2"
SpecialFunctions = "1, 2"
StatsBase = "0.30, 0.31, 0.32, 0.33"
julia = "1"
Expand Down
5 changes: 1 addition & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ makedocs(
"Power" => "power.md",
"Confidence intervals" => "ci.md",
"Descriptive statistics" => "ds.md",
"NCA" => ["NCA" => "nca.md",
"Pharmakokinetics" => "pk.md",
"Pharmacodynamics" => "pd.md",
"PK Plots" => "pkplot.md"],
"NCA" => "nca.md",
"Randomization" => "random.md",
"Simulations" => "sim.md",
"Utilities" => "utils.md",
Expand Down
132 changes: 3 additions & 129 deletions docs/src/nca.md
Original file line number Diff line number Diff line change
@@ -1,133 +1,7 @@
# Non-compartment analysis

*See [MetidaNCA.jl](https://github.com/PharmCat/MetidaNCA.jl). MetidaNCA.jl will replace CTU in plans.*
Further development of NCA PK/PD will be based on [MetidaNCA.jl](https://github.com/PharmCat/MetidaNCA.jl) package.

NCA analysis based on following steps:
All NCA PK/PD functions moved to [MetidaNCA](https://github.com/PharmCat/MetidaNCA.jl).

1. Loadind data to DataFrame;
2. Constructing subjects list with pkimport/pdimport;
3. Run NCA;
4. Exporting to DataFrame;
5. Descriptive statistics / HTML export.

### Description

```julia
include("ncatable.jl")
```
#### AUC

```math
AUC = \sum_{n=1}^N AUC_{n}
```

Where `AUCn` - partial AUC.

Linear trapezoidal rule

```math
AUC\mid_{t_1}^{t_2} = \delta t \times \frac{C_1 + C_2}{2}
AUMC\mid_{t_1}^{t_2} = \delta t \times \frac{t_1 \times C_1 + t_2 \times C_2}{2}
```

Logarithmic trapezoidal rule

```math
AUC\mid_{t_1}^{t_2} = \delta t \times \frac{ C_2 - C_1}{ln(C_2/C_1)}
AUMC\mid_{t_1}^{t_2} = \delta t \times \frac{t_2 \times C_2 - t_1 \times C_1}{ln(C_2/C_1)} - \delta t^2 \times \frac{ C_2 - C_1}{ln(C_2/C_1)^2}
```

Linear interpolation rule

```math
C_x = C_1 + \frac{(t_x-t_1)\times(C_2 - C_1)}{t_2 - t_1}
```

Logarithmic interpolation rule

```math
C_x = exp\left(ln(C_1) + \frac{(t_x-t_1)\times(ln(C_2) - ln(C_1))}{t_2 - t_1}\right)
```

#### MRTlast

```math
MRTlast = AUMClast / AUClast
```

#### ```math \lambda_z ```- elimination constant

#### HL

```math
HL = ln(2) / \lambda_z
```

#### AUCinf

```math
AUCinf = AUClast + \frac{Clast}{\lambda_z}
```

#### AUMCinf

```math
AUMCinf = AUMClast + \frac{tlast\times Clast}{\lambda_z} + \frac{Clast}{\lambda_z^2}
```

#### AUCpct

```math
AUCpct = (AUCinf - AUClast) / AUCinf * 100.0%
```

#### Accumulation index

```math
Accind = \frac{1}{1 - exp(-\lambda_z \tau)}
```

### nca!
```@docs
ClinicalTrialUtilities.nca!
```

### Scenario

1 Loading DataFrame

```julia
using CSV, DataFrames, ClinicalTrialUtilities
pkdata2 = CSV.File("pkdata.csv") |> DataFrame
```
2 Subject list

```julia
pkds = pkimport(pkdata2, [:Subject, :Formulation]; time = :Time, conc = :Concentration)
```

3 NCA analysis with default settings

```julia
pk = nca!(pkds)
```

4 Exporting

```julia
ncadf = DataFrame(pk; unst = true)
```

5 Descriptive statistics

```julia
ds = ClinicalTrialUtilities.descriptive(ncadf, stats = [:n, :mean, :sd], sort = [:Formulation])
```

6 Exporting

```julia
dsdf = ClinicalTrialUtilities.DataFrame(ds; unst = true)
```
Validation included.
1 change: 0 additions & 1 deletion docs/src/ncatable.jl

This file was deleted.

9 changes: 5 additions & 4 deletions docs/src/pd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Pharmacodynamics

#### pdimport
```@docs
ClinicalTrialUtilities.pdimport
```
Further development of NCA PK/PD will be based on [MetidaNCA.jl](https://github.com/PharmCat/MetidaNCA.jl) package.

All NCA PK/PD functions moved to [MetidaNCA](https://github.com/PharmCat/MetidaNCA.jl).

Validation included.
11 changes: 0 additions & 11 deletions docs/src/pk.md

This file was deleted.

30 changes: 0 additions & 30 deletions docs/src/pkplot.md

This file was deleted.

7 changes: 2 additions & 5 deletions src/ClinicalTrialUtilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__precompile__(true)
module ClinicalTrialUtilities

using Distributions, Random, Roots, QuadGK, RecipesBase
using Distributions, Random, Roots, QuadGK

using StatsBase

Expand Down Expand Up @@ -63,8 +63,7 @@ include("info.jl")

#Descriptive statistics
include("descriptives.jl")
#PK
include("pk.jl")

#Export
include("export.jl")
#Randomization
Expand All @@ -73,8 +72,6 @@ include("randomization.jl")
include("utilities.jl")
#Show
include("show.jl")
#Plots
include("plots.jl")
#Deprecated
include("deprecated.jl")

Expand Down
Loading

0 comments on commit 1813f04

Please sign in to comment.