PharmCat
★    

Russia,
2019-12-01 01:06
(1579 d 10:41 ago)

Posting: # 20902
Views: 4,935
 

 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
★★★
avatar
Homepage
Vienna, Austria,
2019-12-01 14:50
(1578 d 20:57 ago)

@ PharmCat
Posting: # 20903
Views: 3,813
 

 Congratulations!

Hi PharmCat,

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

❝ […] 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 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

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

Russia,
2019-12-01 17:21
(1578 d 18:26 ago)

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

 Thank you so much!

Hi Helmut! Thank you for appreciation of the work! :cool:

❝ Julia is a nasty beast (IMHO, more than SAS and R combined). :-D


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. ;-):-D

❝ 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. :-D

❝ 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
★★★
avatar
Homepage
Vienna, Austria,
2019-12-02 17:25
(1577 d 18:22 ago)

@ PharmCat
Posting: # 20906
Views: 3,694
 

 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 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

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

Russia,
2019-12-02 18:29
(1577 d 17:18 ago)

@ Helmut
Posting: # 20907
Views: 3,743
 

 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 :angry:

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 ?
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,639 registered users;
81 visitors (0 registered, 81 guests [including 3 identified bots]).
Forum time: 11:47 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5