%%%%%%baraye nij tedad tekrar amid haye amine dar har position%%%%%%%%
W=zeros(1,1000);
s=seqs;
for i=1:1000
  n=zeros(1,size(seqs,2));
  numA=0;
  numR=0;
  numN=0;
  numD=0;
  numC=0;
  numE=0;
  numQ=0;
  numG=0;
  numI=0;
  numL=0;
  numK=0;
  numM=0;
  numF=0;
  numP=0;
  numS=0;
  numT=0;
  numW=0;
  numY=0;
  numV=0;
  numH=0;
  numgap=0;
    for j=1:size(seqs,2)
        if s(i,j)=='A'
            numA=numA+1;
        elseif s(i,j)=='R'
            numR=numR+1;
        elseif s(i,j)=='N'
            numN=numN+1;
        elseif s(i,j)=='D'
            numD=numD+1;
        elseif s(i,j)=='C'
            numC=numC+1;
        elseif s(i,j)=='E'
            numE=numE+1;
        elseif s(i,j)=='Q'
            numQ=numQ+1;
        elseif s(i,j)=='G'
            numG=numG+1;
        elseif s(i,j)=='I'
            numI=numI+1;
        elseif s(i,j)=='L'
            numL=numL+1;
        elseif s(i,j)=='K'
            numK=numK+1;
        elseif s(i,j)=='M'
            numM=numM+1;
        elseif s(i,j)=='F'
            numF=numF+1;
        elseif s(i,j)=='P'
            numP=numP+1;
        elseif s(i,j)=='S'
            numS=numS+1;
        elseif s(i,j)=='T'
            numT=numT+1;
        elseif s(i,j)=='W'
            numW=numW+1;
        elseif s(i,j)=='Y'
            numY=numY+1;
        elseif s(i,j)=='V'
            numV=numV+1;
        elseif s(i,j)=='H'
            numH=numH+1;
        elseif s(i,j)=='-'
            numgap=numgap+1;
        end
    end
    for k=1:size(seqs,2)
        if s(i,k)=='A' 
           n(i,k)=numA;
        end
        if s(i,k)=='R'
           n(i,k)=numR;
        end
        if s(i,k)=='N' 
           n(i,k)=numN;
        end
        if s(i,k)=='D' 
           n(i,k)=numD;
        end
        if s(i,k)=='C' 
           n(i,k)=numC;
        end
        if s(i,k)=='E' 
           n(i,k)=numE;
        end
        if s(i,k)=='Q' 
           n(i,k)=numQ;
        end
        if s(i,k)=='G' 
           n(i,k)=numG;
        end
        if s(i,k)=='I' 
           n(i,k)=numI;
        end
        if s(i,k)=='L' 
           n(i,k)=numL;
        end
        if s(i,k)=='K' 
           n(i,k)=numK;
        end
        if s(i,k)=='M' 
           n(i,k)=numM;
        end
        if s(i,k)=='F' 
           n(i,k)=numF;
        end
        if s(i,k)=='P' 
           n(i,k)=numP;
        end
        if s(i,k)=='S' 
           n(i,k)=numS;
        end
        if s(i,k)=='T' 
           n(i,k)=numT;
        end
        if s(i,k)=='W' 
           n(i,k)=numW;
        end
        if s(i,k)=='Y' 
           n(i,k)=numY;
        end
        if s(i,k)=='V' 
           n(i,k)=numV;
        end
        if s(i,k)=='H' 
           n(i,k)=numH;
        end  
        if s(i,k)=='-'
            n(i,k)=numgap;
        end
    end
     for q=1:size(seqs,2)
      W(i)=W(i)+(1/(r(q)*n(i,q)));
    end
end


