# Target Mediated Drug Disposition (TMDD)

**URL:** <https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324>\
**Category:** Uncategorized\
**Created:** [April 17, 2020, 3:43pm UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324 "2020-04-17T15:43:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aishwarya](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Aishwarya](https://discourse.pumas.ai/u/Aishwarya)\
**Post date:** [April 17, 2020, 3:43pm UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324/1 "2020-04-17T15:43:43Z")

</div>

Hi all. Just trying to understand TMDD model. Here is the attached code that I am sharing. I am able to capture the graph of a typical TMDD profile, but I don’t replicate the plots in the book (Gabrielson PK27), I have tried my best to construct the model, I would highly appreciate someone to go through my model and identify the flaw…!

```auto
pk27 = @model begin
   @param begin
       tvcl ∈ RealDomain(lower=0)
       tvkon ∈ RealDomain(lower=0)
       tvkoff ∈ RealDomain(lower=0)
       tvvc ∈ RealDomain(lower=0)
       tvvp ∈ RealDomain(lower=0)
       tvq ∈ RealDomain(lower=0)
       tvkout ∈ RealDomain(lower=0)
       tvkerl ∈ RealDomain(lower=0)
       tvkin ∈ RealDomain(lower=0)
       Ω ∈ PDiagDomain(9)
       σ ∈ RealDomain(lower=0)
       σ_prop ∈ RealDomain(lower=0)
   end

   @random begin
     η ~ MvNormal(Ω)
   end

   @pre begin
       cl = tvcl * exp(η[1])
       kon = tvkon * exp(η[2])
       koff = tvkoff * exp(η[3])
       vc = tvvc * exp(η[4])
       vp = tvvp * exp(η[5])
       q = tvq * exp(η[6])
       kout = tvkout * exp(η[7])
       kerl = tvkerl * exp(η[8])
       kin = tvkin * exp(η[9])
       ro = kin/kout
   end
      ### I wanted to include ro = kin/kout in @init begin block, but when if do so,an error pops up saying ro not defined. So I had to define ro in the pre block! Why does that show up?

      ### Assuming my complex would be present in the central compartment, and it is the concentration of the complex, I use complex/vc in the equation !

    @dynamics begin
        Central' = - (cl/vc) * Central - (q/vc) * Central + (q/vp) * Peripheral - kon * (Central) * (ro) + koff * (Complex/vc)
        Peripheral' = (q/vc) * Central - (q/vp) * Peripheral
        Target' = kin - kout * (ro) - (kon) * Central * (ro) + koff * (Complex/vc)
        Complex' = kon * (Central) * (ro) - (koff)* (Complex/vc) - kerl * (Complex/vc)
   end

   @derived begin
       cp = @. Central/vc
       dv ~ @. Normal(cp,sqrt(cp^2*σ))
       target = @. Target
       complex = @. Complex

   end
end

```

### Parameters

```auto
para = ( tvcl = 0.001,
          tvkon = 0.096 ,
          tvkoff = 0.001,
          tvvc = 0.05,
          tvvp = 0.100,
          tvq = 0.003,
          tvkout = 0.009,
          tvro = 12,
          tvkerl = 0.003,
          tvkin = 0.11,
          Ω = Diagonal([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]),
          σ_prop = 0.00,
          σ = 0.00)

```

```auto
evs1 = DosageRegimen(1.5,time=0,cmt=1)
S1 = Subject(id=1, evs=evs1)
evs2 = DosageRegimen(5,time=0,cmt=1)
S2 = Subject(id=2, evs=evs2)
evs3 = DosageRegimen(15,time=0,cmt=1)
S3 = Subject(id=3, evs=evs3)
evs4 = DosageRegimen(45,time=0,cmt=1)
S4 = Subject(id=4, evs=evs4)
population = Population([S1,S2,S3,S4])

```

```auto
obs1 = simobs(pk27,population,para,obstimes=0:0.1:500);
obs2 = simobs(pk27,population,para,obstimes=[0, 1, 10, 24, 72, 120, 168, 240, 360, 500])
obs3= simobs(pk27, population, para, obstimes=[0, 1, 5, 10, 10, 15, 20, 24, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 72, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 168, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325, 330, 335, 340, 345, 350, 355, 360, 360, 365, 370, 375, 380, 385, 390, 395, 400, 405, 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 460, 465, 470, 475, 480, 5, 490, 495, 500, 504])
df = DataFrame(obs1)
df1 = DataFrame(obs2)
df2 = DataFrame(obs3)
plot(obs1,yaxis=:log, yticks=[0.001,0.01,0.1,1,10,100,1000], ylims=(0.001,1000))
plot(obs2)
gr()
@df df plot(:time, :cp, yaxis=:log, yticks=[0.001,0.01,0.1,1,10,100,1000], ylims=(0.001,1000))
@df df plot!(:time, :target)
@df df plot!(:time, :complex)
@df df1 scatter!(:time, :target, color=[:blue])
@df df1 scatter!(:time, :complex, color=[:darkgreen])
@df df1 scatter!(:time, :cp, color=[:red])

```

![image](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/a98197c6d6acd3543d289fff8e91f4d97bb71fdf.png)  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/ecc5bc4d08f770bfa95c68cfaf01fb15850076b6.png)  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/62e96d3a2a980de2da31fbbd3b0617ab09e945fd.png)

---

<div class="post-metadata">

**Author:** ![wpark](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wpark](https://discourse.pumas.ai/u/wpark)\
**Post date:** [April 17, 2020, 7:03pm UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324/2 "2020-04-17T19:03:41Z")

</div>

Hi @Aishwarya

I slightly changed @dynamics block in your code as below.

```auto
        Central' = - (cl/vc) * Central - (q/vc) * Central + (q/vp) * Peripheral - kon * (Central) * (Target) + koff * (Complex*vc)
        Peripheral' = (q/vc) * Central - (q/vp) * Peripheral
        Target' = kin - kout * (Target) - (kon) * (Central/vc) * (Target) + koff * (Complex)
        Complex' = kon * (Central/vc) * (Target) - (koff)* (Complex) - kerl * (Complex)

```

- Changed `ro` into `Target` because `Target` is dynamically changed, but `ro` is constant parameter.
- Just make sure that unit of compartment and its parameters are well matched. I just changed to my preference. `Central` and `Peripheral` is amount, `Target` and `Complex` is concentration in my code.

For the target related parameters, you need two of three parameters (kin, kout, ro). And you have to initialize for `Target` compartment, not parameter `ro`. So @init block is as below.

```auto
  @init begin
          Target = ro
      end

```

where `ro` is defined in @pre block as `ro = kin/kout`. Or you can define directly in @init like this `Target = kin/kout` as you did in your original code.

I got the plots below. I don’t have textbook now so I’m not able to check this figure is similar to figure in the textbook. Please let me know if it’s not well matched.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/b81f8800b5b053a8f916a61abef76f9e941a5798.png)  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pumas/original/1X/54eca31fb8886613a6eb9bf025ed7f436c069985.png)

---

<div class="post-metadata">

**Author:** ![Aishwarya](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Aishwarya](https://discourse.pumas.ai/u/Aishwarya)\
**Post date:** [April 17, 2020, 7:53pm UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324/3 "2020-04-17T19:53:00Z")

</div>

Hey @wpark. Thanks for that detailed explanation. It gave me more clarity now.  
And the plots are matching perfectly. Thanks for helping. 😀

---

<div class="post-metadata">

**Author:** ![sai\_matcha](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/sai_matcha/32/297_2.png) [@sai\_matcha](https://discourse.pumas.ai/u/sai_matcha)\
**Post date:** [April 18, 2020, 8:57am UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324/4 "2020-04-18T08:57:07Z")

</div>

@wpark may i know , why two compartments are in amount and remaining two in concentration?

---

<div class="post-metadata">

**Author:** ![wpark](https://avatars.discourse-cdn.com/v4/letter/w/67e7ee/32.png) [@wpark](https://discourse.pumas.ai/u/wpark)\
**Post date:** [April 18, 2020, 5:30pm UTC](https://discourse.pumas.ai/t/target-mediated-drug-disposition-tmdd/324/5 "2020-04-18T17:30:34Z")

</div>

@sai_matcha That was just my preference. Actually, it’s easy to understand to write these differential equations in concentration unit. But unit of dose is amount so it should be scaled before entering the central compartment. In Pumas, I tried `bioav` parameter for this purpose. In terms of simulation, it shows exactly same plot but I didn’t try if there is any difference between two differential equation model in estimation step. Following code is differential equations as concentration unit.

```auto
 @pre begin
       cl = tvcl * exp(η[1])
       kon = tvkon * exp(η[2])
       koff = tvkoff * exp(η[3])
       vc = tvvc * exp(η[4])
       vp = tvvp * exp(η[5])
       q = tvq * exp(η[6])
       kout = tvkout * exp(η[7])
       kerl = tvkerl * exp(η[8])
       kin = tvkin * exp(η[9])
       ro = kin/kout
       bioav = 1/vc
   end

    @init begin
        Target = ro
      end

    @dynamics begin
        Central' = - (cl/vc) * Central - (q/vc) * Central + (q/vp) * Peripheral - kon * (Central) * (Target) + koff * (Complex)
        Peripheral' = (q/vc) * Central - (q/vp) * Peripheral
        Target' = kin - kout * (Target) - (kon) * (Central) * (Target) + koff * (Complex)
        Complex' = kon * (Central) * (Target) - (koff)* (Complex) - kerl * (Complex)
   end

```
