clc
clear
close all
load test2sample1000.mat;
RandSeed = round(sum(100*clock));
rand('state', RandSeed);
rand_ind = randperm(1000);
throed=20;
test2sample=test2sample1000(rand_ind(1:throed));
n=size(test2sample,1);
for i=1:n
    k=rand_ind(i);
    nm=['C:\Users\user\Documents\MATLAB\Glypredictor\S2test\',num2str(k),'.ss2'];
    temp=importdata(nm);
    test2sample(i).SS=temp.data;
end
% save('test2sample.mat','test2sample');
fid=fopen('ftest2sample.txt','wt');
nnn=size(test2sample,1);
for i=1:nnn
    fprintf(fid,'>%s\n',test2sample(i).ID);
    fprintf(fid,'%s\n',test2sample(i).Sequence);
end
fclose(fid);
load feature_ind.mat;
load model.mat;
for i=1:nnn
    [testvector,testlabel,index]=testExtract(test2sample,i);
    [a b c]=svmpredict(testlabel, testvector(:,feature_ind),model,'-b 1');
    test2sample(i).ind=(index-15)';
    test2sample(i).reallabel=testlabel;
    test2sample(i).plabel=a;
     test2sample(i).p=c(:,1);
end
save('test2sample.mat','test2sample');