% Barnett 2006
% PND11 male and female rats administered malathion OR oxon from PND11 through PND21

% malathion: 5, 25, 50, or 150 mg/kg
% oxon: 0.1, 1.0, 2.5, or 4 mg/kg


prepare @clear @all

rat_parameters_postnatal 	       % rat parameters
TSTOP=360;      			       % Simulation duration
BW0=0.0100;   	 			  % kg
AGE0=11.0;                        % simulation starts


%MAXT=0.01;       %maximum time step
%MINT=1.0e-3;      %minimum time step


%11 days of dosing
%columns B through E are different dose levels
%malathion
DT = xlsRead("Barnett_2006_dosing.xls", "malathion", "A1:A16");  % Dosing Times (hr)
DORAL=xlsRead("Barnett_2006_dosing.xls", "malathion", "e1:e16"); % Dose in ug/kg

%oxon
%DT = xlsRead("Barnett_2006_dosing.xls", "oxon", "A1:A16");  % Dosing Times (hr)
%DORALO=xlsRead("Barnett_2006_dosing.xls", "oxon", "e1:e16"); % Dose in ug/kg


prepare @clear @all

load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_mal_1.csv Barnett_1
tdata1=Barnett_1
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_mal_2.csv Barnett_2
tdata2=Barnett_2
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_mal_3.csv Barnett_3
tdata3=Barnett_3
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_mal_4.csv Barnett_4
tdata4=Barnett_4
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_oxon_1.csv Barnett_5
tdata5=Barnett_5
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_oxon_2.csv Barnett_6
tdata6=Barnett_6
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_oxon_3.csv Barnett_7
tdata7=Barnett_7
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2006_repeatdose_oxon_4.csv Barnett_8
tdata8=Barnett_8


start@nocallback

%malathion
%5 mg/kg
%plot(_time, _bce, "-", tdata1(:,1), tdata1(:,2), "*", tdata1(:,1),tdata1(:,3),"*",'Barnett_2006_brain_M1.aps')
%plot(_time, _rbcce, "-", tdata1(:,1), tdata1(:,4), "*", tdata1(:,1),tdata1(:,5),"*",'Barnett_2006_RBC_M1.aps')

%25 mg/kg
%plot(_time, _bce, "-", tdata2(:,1), tdata2(:,2), "*", tdata2(:,1),tdata2(:,3),"*",'Barnett_2006_brain_M2.aps')
%plot(_time, _rbcce, "-", tdata2(:,1), tdata2(:,4), "*", tdata2(:,1),tdata2(:,5),"*",'Barnett_2006_RBC_M2.aps') 

%50 mg/kg
%plot(_time, _bce, "-", tdata3(:,1), tdata3(:,2), "*", tdata3(:,1),tdata3(:,3),"*",'Barnett_2006_brain_M3.aps')
%plot(_time, _rbcce, "-", tdata3(:,1), tdata3(:,4), "*", tdata3(:,1),tdata3(:,5),"*",'Barnett_2006_RBC_M3.aps')

%150 mg/kg
plot(_time, _bce, "-", tdata4(:,1), tdata4(:,2), "*", tdata4(:,1),tdata4(:,3),"*",'Barnett_2006_brain_M4.aps')
plot(_time, _rbcce, "-", tdata4(:,1), tdata4(:,4), "*", tdata4(:,1),tdata4(:,5),"*",'Barnett_2006_RBC_M4.aps')

%oxon
%0.1 mg/kg
%plot(_time, _bce, "-", tdata5(:,1), tdata5(:,2), "*", tdata5(:,1),tdata5(:,3),"*",'Barnett_2006_brain_O1.aps')
%plot(_time, _rbcce, "-", tdata5(:,1), tdata5(:,4), "*", tdata5(:,1),tdata5(:,5),"*",'Barnett_2006_RBC_O1.aps')

%1.0 mg/kg
%plot(_time, _bce, "-", tdata6(:,1), tdata6(:,2), "*", tdata6(:,1),tdata6(:,3),"*",'Barnett_2006_brain_O2.aps')
%plot(_time, _rbcce, "-", tdata6(:,1), tdata6(:,4), "*", tdata6(:,1),tdata6(:,5),"*",'Barnett_2006_RBC_O2.aps')

%2.5 mg/kg
%plot(_time, _bce, "-", tdata7(:,1), tdata7(:,2), "*", tdata7(:,1),tdata7(:,3),"*",'Barnett_2006_brain_O3.aps')
%plot(_time, _rbcce, "-", tdata7(:,1), tdata7(:,4), "*", tdata7(:,1),tdata7(:,5),"*",'Barnett_2006_RBC_O3.aps')

%4.0 mg/kg
%plot(_time, _bce, "-", tdata8(:,1), tdata8(:,2), "*", tdata8(:,1),tdata8(:,3),"*",'Barnett_2006_brain_O4.aps')
%plot(_time, _rbcce, "-", tdata8(:,1), tdata8(:,4), "*", tdata8(:,1),tdata8(:,5),"*",'Barnett_2006_RBC_O4.aps')

