

SNP_vector=[25,37,46,60];
vfrac_vector=[0.5,0.45,0.4,0.35,0.3,0.25,0.2,0.15,0.1,0.09,0.08,0.07,0.06,0.05,0.04,0.03,0.02,0.01];
successful_run=zeros(3,length(vfrac_vector));
successful_freq=zeros(3,length(vfrac_vector));
successful_freq(1,:)=vfrac_vector;
successful_run(1,:)=vfrac_vector;
filename11='mouse_snp_';
filename22='_variance_fraction_';
filename33='_trial_';
load_count=0;
triallength=25;


for k=1:1%length(SNP_vector)
    
    SNP=46;%SNP_vector(k);
    SNP_name1=num2str(SNP);
    
    for i =1:length(vfrac_vector)
        smcmc=0;
        sfreq=0;
        vfrac=vfrac_vector(i);
        vfrac_name1=num2str(vfrac*100);
        filename4 = [filename11 SNP_name1  filename22 vfrac_name1 filename33];
        [smcmc,sfreq]= MCMCplotter(SNP, triallength, filename4 );
        successful_freq(2,i)=successful_freq(2,i)+sfreq;
        successful_run(2,i)=successful_run(2,i)+smcmc;
       
    end
end

lc=25;


for m=1:18
successful_run(3,m)=successful_run(2,m)/lc;
successful_freq(3,m)=successful_freq(2,m)/lc;
end



% plot colours (c, m, y, k, r, g, b, w)

plot( successful_run(1,:), successful_run(3,:), 'red');
xlabel (' Variance fraction explained ');
ylabel ( ' Probability that simulated snp is found');
title ( 'A plot showing the probability that simuated marker 46 is found using MCMC method (red line) and frequentist (blue line)');
hold on
plot( successful_freq(1,:), successful_freq(3,:), 'blue');
hold off

saveas(gcf,'mouse_sim_plot_46','pdf'); 
saveas(gcf,'mouse_sim_plot_46','fig'); 
newfile='ccplot';
save(newfile)
