PharmCat
★

Russia,
2019-12-01 00:06
(689 d 20:44 ago)

Posting: # 20902
Views: 3,309

## Julia: Bioequivalence and Pharmacokinetics packages [Software]

Hello, dear colleagues!

Some time ago two packages for bioequivalence and pharmacokinetics was relesed. (Julia is a high-level, high-performance, dynamic programming language. Who knows nothing about Julia can look here.)

One released package is ReplicateBE.jl. This package made for parameter estimation in linear mixed-effects models with restricted maximum likelihood method and provides variance components and fixed-effect coefficients with confidence intervals estimates. Covariance structure: CSH (Type C). Confidence interval (90%) for bioequivalence included in standard output.

Results was compared with IBM SPSS v25 (MIXED), validation program include following design types:
• 24 subjects, sequence balanced dataset
• TRTR/RTRT
• TRRT/RTTR
• TTRR/RRTT
• TRT/RTR
• 48 subjects, sequence unbalanced, 20 randomly dropped observations
• TRTR/RTRT
• TRRT/RTTR
• TTRR/RRTT
• TRT/RTR
• 36 subjects, sequence unbalanced dataset
• TRTR/RTRT
• TRT/RTR
• 128 subjects, sequence unbalanced dataset
• TRTR/RTRT
• TRT/RTR
• 512 subjects, sequence unbalanced dataset
• TRTR/RTRT
• TRT/RTR
• 1024 subjects, sequence unbalanced, 2000 randomly dropped observations
• TRTR/RTRT
• 4096 subjects, sequence unbalanced, 2000 randomly dropped observations

This and other results can found here. Current package version is 1.0.4 - this is a public release with stable API and some validation checks. Package stable in basic using patterns, but approximately 1 from 10^5 datasets lead to handled critical error (no wrong results because no results at all).

Package version 1.1.0 would be first public stable release.

Second package is ClinicalTrialUtilities.jl. This package provides related clinical trial calculations: descriptive statistics, power and sample size calculation, power simulations (bioequivalence), confidence interval, pharmacokinetics / pharmacodynamics parameters calculation. TOST approach based on PowerTOST R package. Scope of package - development unified system for sample size estimating and simulation, PK data analysis with following descriptive statistics and export with interface to ReplicateBE if necessary.

Current package version is 0.2.0 - this is a public beta release with basic functionality. Documents and description can be found here.

Edit: Tabulators changed to spaces and BBcoded to lists; see also this post #6[Helmut]
Helmut
★★★

Vienna, Austria,
2019-12-01 13:50
(689 d 06:59 ago)

@ PharmCat
Posting: # 20903
Views: 2,465

## Congratulations!

Hi PharmCat,

my deepest respect for the work you have done! Julia is a nasty beast (IMHO, more than SAS and R combined).

» […] Covariance structure: CSH (Type C).

OK, the FDA’s guidance states:

PROC MIXED;
CLASSES SEQ SUBJ PER TRT;
MODEL Y = SEQ PER TRT/ DDFM=SATTERTH;
RANDOM TRT/TYPE=FA0(2) SUB=SUBJ G;
REPEATED/GRP=TRT SUB=SUBJ;
ESTIMATE 'T vs. R' TRT 1 -1/CL ALPHA=0.1;

In the Random statement, TYPE=FA0(2) could possibly be replaced by TYPE=CSH.

(my emphasis)

In some of our reference datasets (and terrible ones posted by John in the forum) of the partial replicate TRR|RTR|RRT we ran into convergence issues with FA0(2) but never with FA0(1) and CSH. Do I understand correctly that you have given up to support partial replicates as all?

Dif-tor heh smusma 🖖
Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
PharmCat
★

Russia,
2019-12-01 16:21
(689 d 04:28 ago)

(edited by PharmCat on 2019-12-02 01:58)
@ Helmut
Posting: # 20904
Views: 2,443

## Thank you so much!

Hi Helmut! Thank you for appreciation of the work!

» Julia is a nasty beast (IMHO, more than SAS and R combined).

Agree, Sometimes)

Hint: Using Juno IDE (Atom based) makes Julia much more appeasable.

» In the Random statement, TYPE=FA0(2) could possibly be replaced by TYPE=CSH.

I understand and agree, that "possibly" has an indefinite connotation. But, for example, in SPSS it is a only opportunity to fit model with variance-covariance structure that include free covariance. And in current case FA0 (2) == CSH, results is equal. There is no big broblem to implement FA0 (2), but it little more computationally complex matrix and this get only decrease of performance. If "variance-covariance structure police" will bring charges of violation of covariation law - ok, there will be no other way out but to realize this.

» In some of our reference datasets (and terrible ones posted by John in the forum) of the partial replicate TRR|RTR|RRT we ran into convergence issues with FA0(2) but never with FA0(1) and CSH.

Very ironic, given that FA0(x) is often touted as a more stable version of CSH.

» Do I understand correctly that you have given up to support partial replicates as all?

With partial replicates design there is good news and bad. Good news: fixed effects, variance components, REML value, SE for all coefficients is full complient in all datasets with SPSS/SAS. And in some cases when convergence fail in SPSS/SAS in Julia you can get better results. Bad news: Satterthwaite degree of freedom is full complient only in designes mantioned above. In other datasets we have miserable deviations but they leads to small changing in CI (± 0.01%), really upset. In other side a similar situation is observed when comparing Phoenix with SAS - the difference in the assessment of degrees of freedom on some datasets, but this does not bother anyone. Anyway, at this moment I can't recommend to use this package with partial replicated designs untill there is any evidence of the absence of significance of these deviations. If you are not limited by regulators in use only Satterthwaite DF - you can use "contain" DF or define it manually and get resulst for any dataset you want.

Edit: Merged with a later (now deleted) post. You can edit your posts within 24 hours. [Helmut]
Helmut
★★★

Vienna, Austria,
2019-12-02 16:25
(688 d 04:25 ago)

@ PharmCat
Posting: # 20906
Views: 2,361

## OT: I hate software not asking me for the installation path

Hi PharmCat,

» Hint: Using Juno IDE (Atom based) makes Julia much more appeasable.

See the subject line. Part of the procedure is “Download, install and open Atom.” I always try to keep the OS and virtual machines on one disk, software on another, and data on a third.
Bad luck with Atom. Ended up in c:\Users\{user}\AppData\Local\atom and glued an icon/link on my desktop. Now I have another 850 MiB (7,988 files in 3,982 folders) on my system disk. 😡
Already Julia gave me the creeps. Though installed on my second disk (375 MiB, 1,143 files in 304 folders), I have additionally 221 MiB (24,769 files in 8,951 folders) in c:\Users\{user}\.julia …

Dif-tor heh smusma 🖖
Helmut Schütz

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
PharmCat
★

Russia,
2019-12-02 17:29
(688 d 03:20 ago)

(edited by PharmCat on 2019-12-02 17:53)
@ Helmut
Posting: # 20907
Views: 2,386

## OT: I hate software not asking me for the installation path

» Bad luck with Atom. Ended up in c:\Users\{user}\AppData\Local\atom and glued an icon/link on my desktop. Now I have another 850 MiB (7,988 files in 3,982 folders) on my system disk. 😡

Hi Helmut,

My apologies - I did not pay attention to it. 😓 Recently, on Windows machines, there has been a tendency to install software in user directories. I am saddened by this too. And there is no such problems with Linux.

Atom ZIP version could be installed, but in this situation automatically update makes copy in your User directory

Another way - make a symlink - discussion here.

Other way is to use other IDE: Julia extension for Visual Studio Code or IntelliJ IDEA.

» Already Julia gave me the creeps. Though installed on my second disk, I have 221 MiB (24,769 files in 8,951 folders) in c:\Users\{user}\.julia

There are some headache with changing dafault package directory and working directory in Windows, some discussion here and here. 🤬

One of the best way - to make computation Linux server with Julia and call remote execution from Atom or other IDE. 🤓

P.S. Just to sweeten the pot - Atom can be used with R and Pyton 🙀