X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Fcluster%2Fwham%2Fsrc-M%2Freadpdb.f;h=d6742c67d0468bab3b2ea022c00505f4b2534a95;hb=f556d80a6510feca5aaf727b8f62720e7bd07aa0;hp=62f3f2bbd577e5e913185fd291964eb71d398450;hpb=a45ce81aae2c857c30b821e39e45a7a08356de4d;p=unres.git diff --git a/source/cluster/wham/src-M/readpdb.f b/source/cluster/wham/src-M/readpdb.f index 62f3f2b..d6742c6 100644 --- a/source/cluster/wham/src-M/readpdb.f +++ b/source/cluster/wham/src-M/readpdb.f @@ -22,8 +22,9 @@ C geometry. goto 10 else if (card(:3).eq.'TER') then C End current chain - ires_old=ires+1 - itype(ires_old)=21 + ires_old=ires+2 + itype(ires_old-1)=ntyp1 + itype(ires_old)=ntyp1 ibeg=2 c write (iout,*) "Chain ended",ires,ishift,ires_old call sccenter(ires,iii,sccor) @@ -44,7 +45,7 @@ c write (iout,'(a80)') card ishift=ires-1 if (res.ne.'GLY' .and. res.ne. 'ACE') then ishift=ishift-1 - itype(1)=21 + itype(1)=ntyp1 endif c write (iout,*) "ires",ires," ibeg",ibeg," ishift",ishift ibeg=0 @@ -81,14 +82,30 @@ C system nres=ires do i=2,nres-1 c write (iout,*) i,itype(i) - if (itype(i).eq.21) then + if (itype(i).eq.ntyp1) then + if (itype(i+1).eq.ntyp1) then + c write (iout,*) "dummy",i,itype(i) - do j=1,3 - c(j,i)=((c(j,i-1)+c(j,i+1))/2+2*c(j,i-1)-c(j,i-2))/2 +C do j=1,3 +C c(j,i)=((c(j,i-1)+c(j,i+1))/2+2*c(j,i-1)-c(j,i-2))/2 c c(j,i)=(c(j,i-1)+c(j,i+1))/2 - dc(j,i)=c(j,i) - enddo - endif +C dc(j,i)=c(j,i) +C enddo + do j=1,3 + dcj=(c(j,i-2)-c(j,i-3))/2.0 + c(j,i)=c(j,i-1)+dcj + c(j,nres+i)=c(j,i) + enddo +C endif !unres_pdb + else !itype(i+1).eq.ntyp1 + do j=1,3 + dcj=(c(j,i+3)-c(j,i+2))/2.0 + c(j,i)=c(j,i+1)-dcj + c(j,nres+i)=c(j,i) + enddo +C endif !unres_pdb + endif !itype(i+1).eq.ntyp1 + endif !itype.eq.ntyp1 enddo C Calculate the CM of the last side chain. call sccenter(ires,iii,sccor) @@ -96,9 +113,9 @@ C Calculate the CM of the last side chain. nstart_sup=1 if (itype(nres).ne.10) then nres=nres+1 - itype(nres)=21 + itype(nres)=ntyp1 do j=1,3 - dcj=c(j,nres-2)-c(j,nres-3) + dcj=(c(j,nres-2)-c(j,nres-3))/2.0 c(j,nres)=c(j,nres-1)+dcj c(j,2*nres)=c(j,nres) enddo @@ -112,11 +129,11 @@ C Calculate the CM of the last side chain. c(j,nres+1)=c(j,1) c(j,2*nres)=c(j,nres) enddo - if (itype(1).eq.21) then + if (itype(1).eq.ntyp1) then nsup=nsup-1 nstart_sup=2 do j=1,3 - dcj=c(j,4)-c(j,3) + dcj=(c(j,4)-c(j,3))/2.0 c(j,1)=c(j,2)-dcj c(j,nres+1)=c(j,1) enddo @@ -144,11 +161,88 @@ c & vbld_inv(i+nres) enddo c call chainbuild C Copy the coordinates to reference coordinates - do i=1,2*nres +c do i=1,2*nres +c do j=1,3 +c cref(j,i)=c(j,i) +c enddo +c enddo + + kkk=1 + lll=0 + cou=1 + do i=1,nres + lll=lll+1 +cc write (iout,*) "spraw lancuchy",(c(j,i),j=1,3) + if (i.gt.1) then + if ((itype(i-1).eq.ntyp1).and.(i.gt.2)) then + chain_length=lll-1 + kkk=kkk+1 +c write (iout,*) "spraw lancuchy",(c(j,i),j=1,3) + lll=1 + endif + endif do j=1,3 - cref(j,i)=c(j,i) + cref(j,i,cou)=c(j,i) + cref(j,i+nres,cou)=c(j,i+nres) + if (i.le.nres) then + chain_rep(j,lll,kkk)=c(j,i) + chain_rep(j,lll+nres,kkk)=c(j,i+nres) + endif + enddo + enddo + do j=1,3 + chain_rep(j,chain_length,symetr)=chain_rep(j,chain_length,1) + chain_rep(j,chain_length+nres,symetr) + &=chain_rep(j,chain_length+nres,1) + enddo + + if (symetr.gt.1) then + call permut(symetr) + nperm=1 + do i=1,symetr + nperm=nperm*i + enddo +c do i=1,nperm +c write(iout,*) "tabperm", (tabperm(i,kkk),kkk=1,4) +c enddo + do i=1,nperm + cou=0 + do kkk=1,symetr + icha=tabperm(i,kkk) +c write (iout,*) i,icha + do lll=1,chain_length + cou=cou+1 + if (cou.le.nres) then + do j=1,3 + kupa=mod(lll,chain_length) + iprzes=(kkk-1)*chain_length+lll + if (kupa.eq.0) kupa=chain_length +c write (iout,*) "kupa", kupa + cref(j,iprzes,i)=chain_rep(j,kupa,icha) + cref(j,iprzes+nres,i)=chain_rep(j,kupa+nres,icha) + enddo + endif + enddo enddo + enddo + endif + +C-koniec robienia kopidm + do kkk=1,nperm + write (iout,*) "nowa struktura", nperm + do i=1,nres + write (iout,110) restyp(itype(i)),i,cref(1,i,kkk), + &cref(2,i,kkk), + &cref(3,i,kkk),cref(1,nres+i,kkk), + &cref(2,nres+i,kkk),cref(3,nres+i,kkk) enddo + 100 format (//' alpha-carbon coordinates ', + & ' centroid coordinates'/ + 1 ' ', 6X,'X',11X,'Y',11X,'Z', + & 10X,'X',11X,'Y',11X,'Z') + 110 format (a,'(',i3,')',6f12.5) + enddo + ishift_pdb=ishift return