I got into pharmacometrics after studying and working as a pharmacist, both in a community pharmacy (interning while I was a pharmacy student) and in an inpatient (hospital) pharmacy (practicing as a pharmacist while studying pharmacometrics and clinical pharmacology). So I always thought it would be cool to have mrgsolve take in dosing information like you would see on a Rx or written in a chart
sig: 100 mg po daily x 7
This post introduces something new in mrgsolve 0.9.0 that works along those lines.
1 Review
First, a review: we have these things called
For example, say we want a dose every day for one week. Assuming that our model is in hours, we could write
Building pk1 ... done.
And if I wanted to follow that by a week at every 48 hours, first create the q48h event object
and then combine them together in a sequence
And then if we wanted to repeat 3 cycles of that
2 New in 0.9.0
New in 0.9.0 is a grammar of specifying some of this dose event information. I’ve been wanting to do something like this for a while, but never quite had the right implementation. The current try isn’t perfect, but I thought it was worth it to give a try and see if we can improve.
2.1 Bolus doses
Events:
time amt ii addl cmt evid
1 0 100 24 6 1 1
2 168 100 48 3 1 1
The syntax is:
- Start with
amt
- Dosing interval follows
q
- Total number of doses follows
x
- A second part of the sequence follows
then
2.2 Infusion
To do an infusion, the duration of the infusion comes after over
Events:
time amt rate ii addl cmt evid
1 0 100 10 48 2 1 1
Hrm … but we wanted the infusion to be IV, not in the depot compartment. To do that, put the compartment number after in
2.3 Another sequence
Rather than then
you can separate by comma
. Also, see if you can tell what after
does here:
Events:
time amt ii addl cmt evid
1 0 100 24 6 1 1
2 168 50 12 13 1 1
3 408 200 48 2 1 1
It still takes a fair amount of text to get all of this out, but hopefully the notation is relatively compact and expressive.
3 Important note
I don’t see this ever replacing the regular event object construction. Maybe it is force of habit for me, but I still regularly just use the constructor. That might be easier in the end. For now, this alternate syntax is sort of proof of concept to see how it might work. Definitely you can’t do everything you might want to do with this syntax. In that case, just revert to the usual constructors.