Jump to content


Photo

Initial fcntheta1 NaN error in NLME

Modelling and Simulation

  • Please log in to reply
4 replies to this topic

#1 18963422692

18963422692

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 20 March 2023 - 08:31 AM

Dear all,

 

I am trying to write a QSP model  (See "Betts A, Haddish-Berhane N, Shah DK, van der Graaf PH, Barletta F, King L, Clark T, Kamperschroer C, Root A, Hooper A, Chen X. A Translational Quantitative Systems Pharmacology Model for CD3 Bispecific Molecules: Application to Quantify T Cell-Mediated Tumor Cell Killing by P-Cadherin LP DART®. AAPS J. 2019 May 22;21(4):66. doi: 10.1208/s12248-019-0332-z. Erratum in: AAPS J. 2019 Jun 4;21(4):73. PMID: 31119428; PMCID: PMC6531394. "). The model text is below. When running the model, I consistently get an error "Model execution failed. Initial fcntheta1 value NaN". I tried different initial estimates and different algorithms without success. Any suggestion?

 

Thank you

 

test(){
    TV = (4/3 * 3.14 * Rtumor^3) / 1000
 
    TD = (2 * P * Rcap/Rkrogh^2 + 6*D/Rtumor^2) * (C1 - C3/eps)
 
    Tot41BBp = (Tcellsp *BB/NA) * 10^9 
 
    TotPDL1t = (Tumorcellst * mPDL1/NA) * 10^9
    
    Tot41BBt = (Tcellst * BB/NA) * 10^9
 
    ksyn = kdeg * sPDL1_0
    
dosepoint(A1, idosevar = A1Dose, infdosevar = A1InfDose, infratevar = A1InfRate)
  
deriv(A1 = (-CL*C1 -CLd* C1 + CLd * C2  - (kon_41BB * C1 * (Tot41BBp - D41BBp) + koff_41BB * D41BBp - kon_PDL1 *C1 * sPDL1 + koff_PDL1 * DPDL1p -TD* TV/V1)*V1))
    
      
        deriv(A2= (CLd * C1  - CLd * C2))
    
 
    deriv(A3= (TD-(kon_PDL1* C3 * (TotPDL1t - DPDL1t-Trimer)/eps) + (koff_PDL1 * DPDL1t) - (kon_41BB * C3 * (Tot41BBt-D41BBt-Trimer)/eps) + (koff_41BB * D41BBt)))
 
 
 
 
    deriv(A4 = (ksyn-kdeg*sPDL1-kon_PDL1 * C1 * sPDL1 + koff_PDL1*DPDL1p))
 
    deriv(A5 = (kon_PDL1 * C1 * sPDL1 - koff_PDL1 * DPDL1p- kdegcx * DPDL1p))
    
    deriv(A6 = (kon_41BB * C1 * (Tot41BBp - D41BBp) - koff_41BB * D41BBp))
 
 
    deriv(A7 = (kon_41BB * C3 * (Tot41BBt - D41BBt - Trimer)/eps - koff_41BB * D41BBt - kon_PDL1 * D41BBt * (TotPDL1t-DPDL1t- Trimer)/eps + koff_PDL1 * Trimer))
  
    deriv(A8 = ((kon_PDL1 * C3 * (TotPDL1t - DPDL1t - Trimer)/eps - koff_PDL1 * DPDL1t - kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps + koff_41BB * Trimer - kint * DPDL1t)))
  
    deriv(A9 = ((kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps - (koff_41BB + koff_PDL1) * Trimer + kon_PDL1 * D41BBt * (TotPDL1t - DPDL1t - Trimer)/eps)))
    
 
    
    #M1
   deriv(A10 =  kg0 * (1 - w/Mmax) * M1 / ((1 + (kg0/kg * w)^psi)^(1/psi)) - kkill * mPDL1)
   deriv(A11 = kkill * M1 - M2/tao)
   deriv(A12 = (M2 - M3) / tao)
   deriv(A13 = (M3 - M4) / tao)
    kkill = kmax * Trimer / (kc50 + Trimer)
    w = M1 + M2 + M3 + M4
    TSC = kg0 * kc50 / (kmax - kg0)
 
 
 
#Plasma_conc = C1*MW/1000 ; convert from nM to ng/mL
#Tumor_conc = C3*MW/1000 ; convert from nM to ng/mL
#Trimer_conc = trimer/50
 
 
 
 
 
 
    C1 = A1/V1
    C2 = A2/V2
C3 = A3
sPDL1= A4
DPDL1p= A5
    D41BBp= A6
    D41BBt= A7
DPDL1t= A8
Trimer= A9
M1=A10
M2=A11
M3=A12
M4=A13
    #CL = kel*V1
#kel=CL/V1
    #CLd= k12 *V1
    #k21 = CLd/V2
#k12 = CLd/V1
 
    sequence{C1 = A1Dose/V1;C2 = 0;C3 = 0;D41BBp = 0;D41BBt = 0;DPDL1t = 0;Trimer = 0;sPDL1 = sPDL1_0;DPDL1p =0;M1 = TV*1000000; M2 = 0;M3 = 0;M4 = 0;}
   
    error(CEps = 0.1)
    
    observe(CObs = C1 + C1*CEps)
    
      fixef(V1 = c(, 40.2, ))
      fixef(V2 = c(,211, ) )
        fixef(CL= c(, 4.61, ))
          fixef(CLd= c(, 25.2, ))
           fixef(kon_41BB = c(, 1.72, ))
            fixef(koff_41BB = c(, 193.66, ))
             fixef(kon_PDL1 = c(, 1.57, ))
              fixef(koff_PDL1 = c(, 0.74, ))
             
    fixef(kdeg = c(, 0.15, ))
    fixef(kdegcx =  c(, 0.115, ))
    fixef( kint =c(0,0.1728,))
    fixef(Rtumor(freeze) = c(,1,))
    fixef(Rkrogh(freeze) = c(,75,))
    fixef(P(freeze) = c(,13.9,))
    fixef(D(freeze) = c(,0.000916,))
    fixef(eps(freeze) = c(,0.24,))
    fixef(Rcap(freeze) = c(,8,))
    fixef(mPDL1(freeze) = c(,28706,))
    fixef(NA(freeze) = c(,6.02*10^23,))
    fixef(ETRatio(freeze) = c(,5000000000,))
    fixef(Tumorcellst(freeze) = c(,100000000000,))
    fixef(Tcellsp(freeze) = c(,1,))
    fixef(Tcellst(freeze) = c(,6.02*10^23,))
    fixef(BB(freeze) = c(,64900000000,))
    fixef(sPDL1_0(freeze) = c(,1.1,))
    fixef(kg0(freeze) = c(,0.0125,))
    fixef(kg(freeze) = c(,4.37,))
    fixef(Mmax(freeze) = c(,3800,))
    fixef(psi(freeze) = c(,20,))
    fixef(kmax(freeze) = c(,0.03,))
    fixef(kc50(freeze) = c(,0.0004,))
    fixef(tao(freeze) = c(,0.199,))
 
}

Edited by 18963422692, 20 March 2023 - 08:35 AM.


#2 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 20 March 2023 - 08:41 AM

you equations has NA not sure you can use NA as it might be a special word

 

try building your model little by little make sure things are working at every step

 

can you share a project that reproduce the error in our end ?



#3 18963422692

18963422692

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 20 March 2023 - 09:13 AM

Thank you for the suggestions.

I replaced NA, but it still doesn't work。

 

warnings and Errors:

 

Error in Population: 

Error reading file C:\UsersAppData\Local\Temp\Phoenix\DME_SI~1.842\out000001.txt: File does not exist
 Eng 6 process            1  of            1  is alive
 entering naive pooled engine 6, iteration limit=        1000
 
 READFLAGS
 environmental flags and variables
           0  iflagnp 
           0  iflagrestart
           1  norderAGQ
           1  iflagfocehess
           1  iflagverbose
           1  Allow Gaussian Fit
           1  METHODblup
          13  NDIGITblup
           1  METHODlagl
          13  NDIGITlagl
           1  iflagIEXP
   2.0000000949949026E-003  tolmodlinz
           0  nrep_pcwres
         500  Nsample
         200  Nburn
           0  iflaganagrad
           3  iodelevelused
 NorderAGQ not applicable to this engine            6
 NorderAGQ set to 1 but unchanged in nlmeflags.asc
 
 Initial thetas and bounds
    i      Thetalo(i)      Thetainit(i)    Thetahi(i)
    1     -0.1000+101      0.4020E+02      0.1000+101
    2     -0.1000+101      0.2110E+03      0.1000+101
    3     -0.1000+101      0.4610E+01      0.1000+101
    4     -0.1000+101      0.2520E+02      0.1000+101
    5     -0.1000+101      0.1720E+01      0.1000+101
    6     -0.1000+101      0.1937E+03      0.1000+101
    7     -0.1000+101      0.1570E+01      0.1000+101
    8     -0.1000+101      0.7400E+00      0.1000+101
    9     -0.1000+101      0.1500E+00      0.1000+101
   10     -0.1000+101      0.1150E+00      0.1000+101
   11      0.0000E+00      0.1728E+00      0.1000+101
   12      0.0000E+00      0.1000E+00      0.1000+101
 sigmaLchol=  0.10000000000000001     
 
 initial packed param vector and typx vector
         i        packed(i)        typx(i)
         1       40.200000       40.200000
         2      211.000000      211.000000
         3        4.610000        4.610000
         4       25.200000       25.200000
         5        1.720000        1.720000
         6      193.660000      193.660000
         7        1.570000        1.570000
         8        0.740000        0.740000
         9        0.150000        0.150000
        10        0.115000        0.115000
        11        0.172800        0.172800
        12        0.100000        0.100000
 
 Initial fcntheta1 value                       NaN
 
 Nsub from initxtheta=          21
 Nobstotal =          232
 
 corresponding ELSobj with zeroed blups=                       NaN
 
 Initial parameter values result in -LL = NaN
 Restart from new values
Error: Model Exception: Fortran Exception
NlmeErrorExit: close files and exit(0)
 
 
Model execution failed.


#4 kniefort

kniefort

    Member

  • Val_Members
  • PipPip
  • 29 posts

Posted 20 March 2023 - 10:20 PM

In addition to renaming the NA variable, try the following:

 

  • Move your variable definitions above your de's
  • Comment out Cl and Cld definitions
  • Change CL to Cl in your definitions
  • Comment out ETratio in fixef

The following should run: 

 

test(){
 
dosepoint(A1)
 
C1 = A1/V1
        C2 = A2/V2
C3 = A3/TV
Rtumor = 1
D41BBp= A6/V1
    sPDL1= A4/V1
DPDL1p= A5/V1
    ksyn = kdeg * sPDL1_0
#Cl = kel*V1
kel=Cl/V1
#    Cld= k12 *V1
    k21 = Cld/V2
k12 = Cld/V1
D41BBt= A7/TV
DPDL1t= A8/TV
Trimer= A9/TV
Rkrogh = 75 
    Rtumor = 1
              P = 334/24
                 D = 0.022/24
           eps = 0.24
            Rcap = 8
mPDL1 = 28706
AVOG=6.02*10^23
 
deriv(A1 = (-kel*C1 -k12* C1 + k21 * C2 * V2/V1 - kon_41BB * C1 * (Tot41BBp - D41BBp) + koff_41BB * D41BBp - kon_PDL1 *C1 * sPDL1 + koff_PDL1 * DPDL1p -TD* TV/V1)*V1)
 
    deriv(A2= (k12 * C1 * V1/V2 - k21 * C2)*V2)
 
    TV = (4/3 * 3.14 * Rtumor^3) / 1000
 
    deriv(A3= (TD-(kon_PDL1* C3 * (TotPDL1t -DPDL1t-Trimer)/eps) + (koff_PDL1 * DPDL1t) - (kon_41BB * C3 * (Tot41BBt-D41BBt-Trimer)/eps) + (koff_41BB * D41BBt)*TV))
 
TD = (2 * P * Rcap/Rkrogh^2 + 6*D/Rtumor^2) * (C1 - C3/eps)
 
Tot41BBp = (Tcellsp *BB/AVOG) * 10^9 
    deriv(A4 = (ksyn-kdeg*sPDL1-kon_PDL1 * C1 * sPDL1 + koff_PDL1*DPDL1p)*V1)
    
    deriv(A5 = (kon_PDL1 * C1 * sPDL1 - koff_PDL1 * DPDL1p- kdegcx * DPDL1p)*V1)
    deriv(A6 = (kon_41BB * C1 * (Tot41BBp - D41BBp) - koff_41BB * D41BBp)*V1)
 
TotPDL1t = (Tumorcellst * mPDL1/AVOG) * 10^9
    
    Tot41BBt = (Tcellst * BB/AVOG) * 10^9
    
    deriv(A7 = (kon_41BB * C3 * (Tot41BBt - D41BBt - Trimer)/eps - koff_41BB * D41BBt - kon_PDL1 * D41BBt * (TotPDL1t-DPDL1t- Trimer)/eps + koff_PDL1 * Trimer)*TV)
    
    deriv(A8 = ((kon_PDL1 * C3 * (TotPDL1t - DPDL1t - Trimer)/eps - koff_PDL1 * DPDL1t - kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps + koff_41BB * Trimer - kint * DPDL1t)*TV))
    
    deriv(A9 = ((kon_41BB * DPDL1t * (Tot41BBt - D41BBt - Trimer)/eps - (koff_41BB + koff_PDL1) * Trimer + kon_PDL1 * D41BBt * (TotPDL1t - DPDL1t - Trimer)/eps)*TV))
    
    
    sequence{C2 = 0
             C3 = 0
             D41BBp = 0
             D41BBt = 0
             DPDL1t = 0
             Trimer = 0
     sPDL1 = sPDL1_0
             DPDL1p = 0
             mPDL1 = 28706
             sPDL1_0 = 1.1
             Rkrogh = 75 
             Rtumor = 1
             P = 334/24
             D = 0.022/24
             eps = 0.24
             Rcap = 8
     }
 
             
    
    error(CEps = 0.1)
    
    observe(CObs = C1 + C1*CEps)
    
    fixef(V1 = c(, 0.05, ), V2 = c(, 0.1, ), Cl = c(, 0.001, ), Cld = c(, 0.003, ), sPDL1_0 = c(, 12, ),kon_41BB = c(, 0.824, ),
koff_41BB = c(, 10.944, ),kon_PDL1 = c(, 4.54, ),koff_PDL1 = c(, 1.5588, ),kdeg = c(, 0.15, ), kdegcx =  c(, 0.115, ),
Tcellsp(freeze)=c(, 5000000000, ),Tumorcellst(freeze)= c(, 100000000000, ), Tcellst (freeze)=  c(, 6.4900000000, ), BB (freeze)=  c(, 100000, ),
#ETRatio  (freeze)=  c(, 150 , ),
kint =c(0,0.1728,))
}


#5 18963422692

18963422692

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 21 March 2023 - 05:44 AM

<full quote removed for brevity>

 

Thank you very much for your help!


Edited by Simon Davis, 21 March 2023 - 09:08 AM.
full quote removed for brevity






Also tagged with one or more of these keywords: Modelling and Simulation

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users