typenames = {'coverage';'dali';'gdtts';'gsas';'lgas3';'mi';'rmsd';'sas';'si';'structal';'tmscore';'zscore';'ia';'cmp'};
prognames = {'dali';'tmalign';'fatcat';'lga';'ce';'mmligner'};
uppernames= {'DALI';'TMAlign';'Fatcat';'LGA';'CE';'MMLigner'};

 for i = 1:14
     for j = 1:6
        infname = strcat('mmligner_paper_score_data\',typenames(i),'_',prognames(j),'.txt')
        M = load(infname{1});
        fam = M(:,1); %fam = fam(fam~=0);
        sup = M(:,2); %sup = sup(sup~=0);
        fol = M(:,3); %fol = fol(fol~=0);
        cla = M(:,4); %cla = cla(cla~=0);
        dec = M(:,5); %dec = dec(dec~=0);
        group = [repmat({'Family'},length(fam),1); repmat({'Superfamily'},length(sup),1); repmat({'Fold'},length(fol),1);repmat({'Class'},length(cla),1);repmat({'Decoy'},length(dec),1)];
        boxplot([fam;sup;fol;cla;dec], group, 'notch', 'on')
        xlabel('SCOP Levels','FontSize',14,'FontWeight','bold');
        if i == 1 
            titlestr = strcat('Alignment Coverage statistics -- ',uppernames(j));
            ylim([0 450])
            ylabel('Number of CA residue-residue correspondences','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==2
            titlestr = strcat('Dali Elastic Score statistics -- ',uppernames(j));
            ylim([-8200 7000])
            ylabel('Dali Elastic Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==3
            titlestr = strcat('GDT\_TS statistics -- ',uppernames(j));
            ylim([0 100])
            ylabel('Global Distance Test: Total Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==4
            titlestr = strcat('GSAS Score statistics -- ',uppernames(j));
            ylim([0 400])
            ylabel('GSAS Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==5
            titlestr = strcat('LGA\_S3 statistics -- ',uppernames(j));
            ylim([0,100])
            ylabel('Local Global Alignment Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==6
            titlestr = strcat('MI statistics -- ',uppernames(j));
            ylim([0,1])
            ylabel('MI Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==7
            titlestr = strcat('Alignment RMSD statistics -- ',uppernames(j));
            ylim([0,10])
            ylabel('RMSD of corresponding residues (in Angstroms)','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==8
            titlestr = strcat('SAS statistics -- ',uppernames(j));
            ylim([0,40])
            ylabel('SAS Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==9
            titlestr = strcat('SI statistics -- ',uppernames(j));
            ylim([0,100])
            ylabel('SI Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==10
            titlestr = strcat('Structal Score statistics -- ',uppernames(j));
            ylim([-9200,5500])
            ylabel('Structal Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==11
            titlestr = strcat('TM-Score statistics -- ',uppernames(j));
            ylim([0,1])
            ylabel('TM-Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==12
            titlestr = strcat('Dali Z-Score statistics -- ',uppernames(j));
            ylim([-100,100])
            ylabel('Dali Elastic Z-Score','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==13
            titlestr = strcat('Alignment Complexity statistics -- ',uppernames(j));
            ylim([0,500])
            ylabel('I(A): Alignment complexity (in bits)','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        elseif i==14
            titlestr = strcat('Alignment Compression statistics -- ',uppernames(j));
            ylim([-1000,1000])
            ylabel('Total Compression w.r.t. Null model (in bits)','FontSize',14,'FontWeight','bold');
            title(titlestr{1},'FontSize',18,'FontWeight','bold');
        end
        grid on;
        grid minor;
        outfname = strcat('figs\',typenames(i),'_',prognames(j),'.eps')
        saveas(gcf,outfname{1},'epsc')
    end
 end