
  Ys=load('allseq_membership-noheaders.table'); % load data splits
  load psiblast_homologs addpts;

% loop over data splits
for i=1:54
    % allocate correct train and test set labels for this data split
    YY=Ys(:,i); 
    tmpY=YY;
    % test & test set sizes
    l=sum(YY==1)+sum(2==YY); lt=sum(YY==3)+sum(4==YY); 
    [trn]=find(YY==1 | YY==2); [tst]=find(YY==3 | YY==4);
    YY(trn(1:l))=sign((YY(trn(1:l))==1)-0.5); 
    YY(tst(1:lt))=sign((YY(tst(1:lt))==3)-0.5);

    %%--------------- pull in domain homologs -----------
    %f=addpts{i};  % already cached these computations
    %trn=[trn ;f']; trn=unique(trn); YY(f)=1;
    %% ------------------------------------------------
    

    % search a good alpha by training and validation
    % divide the original training set into a training set and a validation set to
    % decide a good value for alpha
    trpos = trn(find(YY(trn)==1));
    trneg = trn(find(YY(trn)==-1));
    
    numtrpos=size(trpos,1);
    numtrneg=size(trneg,1);
    NUMtrpos(i)=numtrpos;
    NUMtrneg(i)=numtrneg;
    Ratio(i)=numtrpos/numtrneg;

end;
save NUMnohom NUMtrpos NUMtrneg Ratio;
