%%%%%%%%%把Glycation.elm里数据importdata，生成data.mat，生成fasta.txt，构造样本72个蛋白质的结构体
clc
clear
close all
load data.mat;
fid=fopen('fasta.txt','wt');
sample=[];
L=length(ID);
for i=1:L
    label=0;
    for j=1:length(sample)
        if strcmp(ID{i,1},sample(j).ID)
            sample(j).Position=[sample(j).Position Position(i,1)];
            label=1;
        end
    end
    if label==0
      temp.ID=ID{i,1};
      temp.Sequence=Sequence{i,1};
      temp.Position=[];
      temp.Position=[temp.Position Position(i,1)]; 
      sample=[sample; temp];
    end
end
l=length(sample);
for i=1:l
fprintf(fid,'>%s\n',sample(i).ID);
fprintf(fid,'%s\n',sample(i).Sequence);
end
save('sample.mat','sample');
fclose(fid);
% %%%%%%%%%%%%%%生成72个txt文件%%%%%%%%%%%
% n=size(sample,1);
% for i=1:n
%     nm=['H:\SS\',num2str(i),'.txt'];
%     fid=fopen(nm,'wt');
%     fprintf(fid,'>%s\n',sample(i).ID);
%     fprintf(fid,'%s\n',sample(i).Sequence);
%     fclose(fid);
% end
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%