%study data from Barnett 2008b
%single oral dose of malathion (10, 25, 50, 100, or 150 mg/kg) OR
%single oral dose of oxon (1.0, 3.5, 7.0, 10, or 12.5 mg/kg) to male and female PND11 rats
%Brain and RBC ChE measurements taken 60 min postdose

%mean male BW 0.0195 kg; mean female BW 0.0183 kg

prepare @clear @all

rat_parameters_postnatal 	        % rat parameters
TSTOP=20;      			        % Simulation duration
BW0=0.0195;   	 			   % kg
AGE0=11.0;               % simulation starts @PND 11
%ORALMAL=25000            % ug/kg
ORALMOX=3500             % ug/kg--use if dosing with oxon


prepare @clear @all

%malathion data
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_mal_1.csv Barnett_mal_1
tdata1=Barnett_mal_1
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_mal_2.csv Barnett_mal_2
tdata2=Barnett_mal_2
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_mal_3.csv Barnett_mal_3
tdata3=Barnett_mal_3
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_mal_4.csv Barnett_mal_4
tdata4=Barnett_mal_4
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_mal_5.csv Barnett_mal_5
tdata5=Barnett_mal_5

%oxon data
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_oxon_1.csv Barnett_oxon_1
tdata6=Barnett_oxon_1
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_oxon_2.csv Barnett_oxon_2
tdata7=Barnett_oxon_2
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_oxon_3.csv Barnett_oxon_3
tdata8=Barnett_oxon_3
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_oxon_4.csv Barnett_oxon_4
tdata9=Barnett_oxon_4
load @format=ascii @separator=comma @ignoreheader @file=Barnett_2008b_singledose_oxon_5.csv Barnett_oxon_5
tdata10=Barnett_oxon_5


start@nocallback

%uncomment for what you want to plot--malathion dose or oxon dose--make sure it's reading the correct columns for the data

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

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

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

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

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


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

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

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

%10.0 mg/kg
%plot(_time, _bce, "-", tdata9(:,1), tdata9(:,2), tdata9(:,1), tdata9(:,3),"*", 'Barnett_2008b_brain_O4.aps')
%plot(_time, _rbcce, "-", tdata9(:,1), tdata9(:,4),tdata9(:,1), tdata9(:,5), "*", 'Barnett_2008b_RBC_O4.aps')

%12.5 mg/kg
%plot(_time, _bce, "-", tdata10(:,1), tdata10(:,2),tdata10(:,1), tdata10(:,3), "*", 'Barnett_2008b_brain_O5.aps')
%plot(_time, _rbcce, "-", tdata10(:,1), tdata10(:,4), tdata10(:,1), tdata10(:,5),"*", 'Barnett_2008b_RBC_O5.aps')

