Code covered by the BSD License  

Highlights from
Using SimBiology for Mechanism-Based PK/PD Modeling in Preclinical & Discovery

image thumbnail

Using SimBiology for Mechanism-Based PK/PD Modeling in Preclinical & Discovery

by

 

Examples used in the March 2012 webinar: Using SimBiology for Mechanism-Based PK/PD Modeling

doseResponse(mObj, drugName, strainName, PKPD, MIC)
function results = doseResponse(mObj, drugName, strainName, PKPD, MIC)
% Function simulates the SimBiology model, mObj, at varying dose amount 
% Copyright 2011 - 2012 MathWorks, Inc.

% Identify total daily dose 
[totalDailyDose] = logspace(-1, 4, 20); 

% Set dosing parameters
d1              = sbiodose('new') ;
d1.TargetName   = 'Central.Dose';
d1.AmountUnits  = 'milligram';
d1.TimeUnits    = 'hour' ;

% Select variants 
v1 = sbioselect(mObj, 'Type', 'variant', 'Name', drugName     ) ; % Drug PK
v2 = sbioselect(mObj, 'Type', 'variant', 'Name', PKPD         ) ; % Drug PD
v3 = sbioselect(mObj, 'Type', 'variant', 'Name', strainName   ) ; % Constant drug concentration; no PK model

% Define simulation setting
cs = getconfigset(mObj);
cs.StopTime     = 24;
cs.TimeUnits    = 'hour';

% Preallocate variables
time_gt_MIC     =  nan(length(totalDailyDose), 1) ;
AUC             =  nan(length(totalDailyDose), 1) ;
log10CFU_at24hr =  nan(length(totalDailyDose), 1) ;
CMax            =  nan(length(totalDailyDose), 1) ;
Cu_ss           =  nan(length(totalDailyDose), 1) ; 
log10CFU        =  nan(length(0:0.1:24), length(totalDailyDose)) ;

iDose = 1 ; 

    
    % Define dosing interval and number of repeat doses
    % Dosing intervals = 24, 12, 8 and 4 hour for nDose = 1,2,3 and 4, respectively.
    nDose           = 1         ;    
    d1.Interval     = 24/nDose  ;  % dosing interval (hour)
    d1.RepeatCount  = nDose - 1 ;  % number of additional dose
   
    for i = 1:length(totalDailyDose)
        
        % Define dosing amount
        d1.Amount = totalDailyDose(i)/nDose;
                
        % Simulate and resample with 0.5 hour time steps
        data = sbiosimulate(mObj, cs, [v1, v2, v3], d1);
        data = resample(data, 0:0.1:24) ;         
       
        % Extract simulation data for Unbound Drug concentration, and the
        % Growing and Resting Bacterial population
        [t, x] =  selectbyname(data, {'Central.Drug', 'Growing', 'Resting'}) ;
     
        % Calculate Exposure and Efficacy Metrics
        log10CFU_at24hr(i, iDose)   = log10(sum(x(end, 2:3)))           ;
        CMax(i,iDose)               = max(x(:, 1))                    ;
        AUC(i, iDose)               = trapz(t,x(:, 1))                  ;
        Cu_ss(i, iDose)             = trapz(t,x(:,1))/24  ;
        log10CFU(:, i)              = log10(sum(x(:, 2:3),2)) ;
        drug(:, i)                  = x(:, 1) ; 
        data_rs                     = resample(data, 0:0.01:24) ; 
        [~,x]                       = selectbyname(data_rs, 'Central.Drug') ; 
        time_gt_MIC(i, iDose)       = (max(sum(x > MIC) - 1, 0))*0.01/24*100    ;
       
    end
       

% save results

results = struct ; 
results.log10CFU_at_24hr    = log10CFU_at24hr ;            
results.CMax_over_MIC       = CMax/MIC; 
results.AUC_over_MIC        = AUC/MIC ; 
results.Time_gt_MIC         = time_gt_MIC  ; 
results.Time                = t ;
results.log10CFU            = log10CFU ;
results.drug                = drug ;
results.Dose                = totalDailyDose' ;

Contact us