%study data from Huntington 2001
%single oral dose of malathion (5,50, 150, or 450 mg/kg) to adult male and female rats
%Brain, plasma, and RBC ChE measurements taken 2 hr postdose

%mean male BW 325 g 
%mean female BW 225 g

prepare @clear @all

rat_parameters 	        % rat parameters
TSTOP=20;      			    % Simulation duration
BW = 0.325;   	 			  % kg
ORALMAL=450000;          % ug/kg
FA=1;                   % fractional absorption

prepare @clear @all

load @format=ascii @separator=comma @ignoreheader @file=Huntington_2001_singledose_1.csv Huntington_2001_1
tdata1=Huntington_2001_1

load @format=ascii @separator=comma @ignoreheader @file=Huntington_2001_singledose_2.csv Huntington_2001_2
tdata2=Huntington_2001_2

load @format=ascii @separator=comma @ignoreheader @file=Huntington_2001_singledose_3.csv Huntington_2001_3
tdata3=Huntington_2001_3

load @format=ascii @separator=comma @ignoreheader @file=Huntington_2001_singledose_4.csv Huntington_2001_4
tdata4=Huntington_2001_4


start@nocallback

%5 mg/kg
%plot(_time, _blbes, "-", tdata1(:,1), tdata1(:,2),tdata1(:,1), tdata1(:,5), "*", 'Huntingdon_singledose_plasma_1.aps')
%plot(_time, _rbcce, "-", tdata1(:,1), tdata1(:,3),tdata1(:,1), tdata1(:,6), "*", 'Huntingdon_singledose_RBC_1.aps')
%plot(_time, _bce, "-", tdata1(:,1), tdata1(:,4), tdata1(:,1), tdata1(:,7),"*", 'Huntingdon_singledose_brain_1.aps')

%50 mg/kg
%plot(_time, _blbes, "-", tdata2(:,1), tdata2(:,2),tdata2(:,1), tdata2(:,5), "*", 'Huntingdon_singledose_plasma_2.aps')
%plot(_time, _rbcce, "-", tdata2(:,1), tdata2(:,3),tdata2(:,1), tdata2(:,6), "*", 'Huntingdon_singledose_RBC_2.aps')
%plot(_time, _bce, "-", tdata2(:,1), tdata2(:,4), tdata2(:,1), tdata2(:,7),"*", 'Huntingdon_singledose_brain_2.aps')

%150 mg/kg
%plot(_time, _blbes, "-", tdata3(:,1), tdata3(:,2),tdata3(:,1), tdata3(:,5), "*", 'Huntingdon_singledose_plasma_3.aps')
%plot(_time, _rbcce, "-", tdata3(:,1), tdata3(:,3),tdata3(:,1), tdata3(:,6), "*", 'Huntingdon_singledose_RBC_3.aps')
%plot(_time, _bce, "-", tdata3(:,1), tdata3(:,4),tdata3(:,1), tdata3(:,7), "*", 'Huntingdon_singledose_brain_3.aps')

%450 mg/kg
plot(_time, _blbes, "-", tdata4(:,1), tdata4(:,2),tdata4(:,1), tdata4(:,5), "*", 'Huntingdon_singledose_plasma_4.aps')
plot(_time, _rbcce, "-", tdata4(:,1), tdata4(:,3),tdata4(:,1), tdata4(:,6), "*", 'Huntingdon_singledose_RBC_4.aps')
plot(_time, _bce, "-", tdata4(:,1), tdata4(:,4), tdata4(:,1), tdata4(:,7),"*", 'Huntingdon_singledose_brain_4.aps')




