function MetaSim(SimParameter,seqFolder,antFolder,outFile)
SimParameter=load(SimParameter);
SimParameter=SimParameter.SimParameter;
shortest=SimParameter.shortest;
longest=SimParameter.longest;
All_Data=[];
SimSetting=SimParameter.SimSetting;
c=1;
for i=1:1:size(SimSetting,1)
    ID=SimSetting(i).ID;
    seq=fastaread([seqFolder,'/',ID]);%........folder
    seq=seq.Sequence;
    Gsize=SimSetting(i).Len;
    ID=ID(1:end-4);
    ant=load([antFolder,'/',ID,'.mat']);%.......folder
    ant=ant.ant;
    ShiftAnt=ant.ShiftAnt;
    num=SimSetting(i).num;
    length=round(unifrnd(shortest,longest,1,2*num));

    ShortF=zeros(2*num,2);
    for j=1:1:2*num
        stPoint=randperm(Gsize-length(j)+1,1);
        ShortF(j,1)=stPoint;
        ShortF(j,2)=stPoint+length(j)-1;
    end
%     de=[];
%     for j=1:1:2*num
%         for shi=1:1:size(ShiftAnt,1)
%             if1 = ( ShiftAnt(shi,1)>=ShortF(j,1) && ShiftAnt(shi,1)<=ShortF(j,2) );
%             if2 = ( ShiftAnt(shi,2)>=ShortF(j,1) && ShiftAnt(shi,2)<=ShortF(j,2) );
%             if if1 || if2
%                 de=[de j];
%                 break
%             end
%         end
%     end
%     
%     ShortF(de,:)=[];
    if size(ShortF,1)<num
        disp('not enougth')
    else
        ShortF((num+1):end,:)=[];
    end
    
    for j=1:1:size(ShortF,1)
        All_Data(c,1).genomeID=ID;
        All_Data(c,1).genomesize=ant.len;
        All_Data(c,1).readID=[ID '_read' num2str(j)];
        All_Data(c,1).readlocation=ShortF(j,:);
        All_Data(c,1).readseq=seq(ShortF(j,1):ShortF(j,2));
        s=randperm(2,1);
        if s==1
            s='+';
        else
            s='-';
        end
        All_Data(c,1).simstrand=s;
        c=c+1;
    end
end
save(outFile,'All_Data','-v7.3')
    
    
    
    
            
    