2 C Read the PDB file and convert the peptide geometry into virtual-chain
4 implicit real*8 (a-h,o-z)
9 include 'COMMON.INTERACT'
10 include 'COMMON.IOUNITS'
12 include 'COMMON.NAMES'
13 include 'COMMON.CONTROL'
14 include 'COMMON.DISTFIT'
15 include 'COMMON.SETUP'
16 integer i,j,ibeg,ishift1,ires,iii,ires_old,ishift,ity,
18 logical lprn /.false./,fail
19 double precision e1(3),e2(3),e3(3)
20 double precision dcj,efree_temp
24 double precision sccor(3,20)
25 integer rescode,iterter(maxres)
32 c write (2,*) "UNRES_PDB",unres_pdb
40 read (ipdbin,'(a80)',end=10) card
41 if (card(:5).eq.'HELIX') then
44 read(card(22:25),*) hfrag(1,nhfrag)
45 read(card(34:37),*) hfrag(2,nhfrag)
47 if (card(:5).eq.'SHEET') then
50 read(card(24:26),*) bfrag(1,nbfrag)
51 read(card(35:37),*) bfrag(2,nbfrag)
52 crc----------------------------------------
53 crc to be corrected !!!
54 bfrag(3,nbfrag)=bfrag(1,nbfrag)
55 bfrag(4,nbfrag)=bfrag(2,nbfrag)
56 crc----------------------------------------
58 if (card(:3).eq.'END') then
60 else if (card(:3).eq.'TER') then
63 itype(ires_old-1)=ntyp1
68 c write (iout,*) "Chain ended",ires,ishift,ires_old
71 dc(j,ires)=sccor(j,iii)
74 call sccenter(ires,iii,sccor)
77 C Fish out the ATOM cards.
78 if (index(card(1:4),'ATOM').gt.0) then
79 read (card(12:16),*) atom
80 c write (iout,*) "! ",atom," !",ires
81 c if (atom.eq.'CA' .or. atom.eq.'CH3') then
82 read (card(23:26),*) ires
83 read (card(18:20),'(a3)') res
84 c write (iout,*) "ires",ires,ires-ishift+ishift1,
85 c & " ires_old",ires_old
86 c write (iout,*) "ishift",ishift," ishift1",ishift1
87 c write (iout,*) "IRES",ires-ishift+ishift1,ires_old
88 if (ires-ishift+ishift1.ne.ires_old) then
89 C Calculate the CM of the preceding residue.
93 dc(j,ires)=sccor(j,iii)
96 call sccenter(ires_old,iii,sccor)
101 if (res.eq.'Cl-' .or. res.eq.'Na+') then
104 else if (ibeg.eq.1) then
105 c write (iout,*) "BEG ires",ires
107 if (res.ne.'GLY' .and. res.ne. 'ACE') then
111 ires=ires-ishift+ishift1
113 c write (iout,*) "ishift",ishift," ires",ires,
114 c & " ires_old",ires_old
115 c write (iout,*) "ires",ires," ibeg",ibeg," ishift",ishift
117 else if (ibeg.eq.2) then
119 ishift=-ires_old+ires-1
121 c write (iout,*) "New chain started",ires,ishift
124 ishift=ishift-(ires-ishift+ishift1-ires_old-1)
125 ires=ires-ishift+ishift1
128 if (res.eq.'ACE' .or. res.eq.'NHE') then
131 itype(ires)=rescode(ires,res,0)
134 ires=ires-ishift+ishift1
136 c write (iout,*) "ires_old",ires_old," ires",ires
137 c if (card(27:27).eq."A" .or. card(27:27).eq."B") then
140 c write (2,*) "ires",ires," res ",res," ity",ity
141 if (atom.eq.'CA' .or. atom.eq.'CH3' .or.
142 & res.eq.'NHE'.and.atom(:2).eq.'HN') then
143 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
144 c write (iout,*) "backbone ",atom
146 write (iout,'(2i3,2x,a,3f8.3)')
147 & ires,itype(ires),res,(c(j,ires),j=1,3)
151 sccor(j,iii)=c(j,ires)
153 if (ishift.ne.0) then
154 ires_ca=ires+ishift-ishift1
158 c write (*,*) card(23:27),ires,itype(ires)
159 else if (atom.ne.'O'.and.atom(1:1).ne.'H' .and.
160 & atom.ne.'N' .and. atom.ne.'C' .and.
161 & atom(:2).ne.'1H' .and. atom(:2).ne.'2H' .and.
162 & atom.ne.'OXT' .and. atom(:2).ne.'3H') then
163 c write (iout,*) "sidechain ",atom
165 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
169 10 if(me.eq.king.or..not.out1file)
170 & write (iout,'(a,i5)') ' Nres: ',ires
171 C Calculate dummy residue coordinates inside the "chain" of a multichain
175 c write (iout,*) i,itype(i),itype(i+1)
176 if (itype(i).eq.ntyp1.and.iterter(i).eq.1) then
177 if (itype(i+1).eq.ntyp1.and.iterter(i+1).eq.1 ) then
178 C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
179 C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
180 C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
182 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
183 call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
190 c(j,i)=c(j,i-1)-1.9d0*e2(j)
194 dcj=(c(j,i-2)-c(j,i-3))/2.0
195 if (dcj.eq.0) dcj=1.23591524223
200 else !itype(i+1).eq.ntyp1
202 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
203 call refsys(i+1,i+2,i+3,e1,e2,e3,fail)
210 c(j,i)=c(j,i+1)-1.9d0*e2(j)
214 dcj=(c(j,i+3)-c(j,i+2))/2.0
215 if (dcj.eq.0) dcj=1.23591524223
220 endif !itype(i+1).eq.ntyp1
221 endif !itype.eq.ntyp1
223 C Calculate the CM of the last side chain.
226 dc(j,ires)=sccor(j,iii)
229 call sccenter(ires,iii,sccor)
233 if (itype(nres).ne.10) then
237 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
238 call refsys(nres-3,nres-2,nres-1,e1,e2,e3,fail)
245 c(j,nres)=c(j,nres-1)-1.9d0*e2(j)
249 dcj=(c(j,nres-2)-c(j,nres-3))/2.0
250 if (dcj.eq.0) dcj=1.23591524223
251 c(j,nres)=c(j,nres-1)+dcj
252 c(j,2*nres)=c(j,nres)
263 c(j,2*nres)=c(j,nres)
265 if (itype(1).eq.ntyp1) then
269 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
270 call refsys(2,3,4,e1,e2,e3,fail)
277 c(j,1)=c(j,2)-1.9d0*e2(j)
281 dcj=(c(j,4)-c(j,3))/2.0
287 C Copy the coordinates to reference coordinates
293 C Calculate internal coordinates.
296 & "Cartesian coordinates of the reference structure"
297 write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
298 & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
300 write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)')
301 & restyp(itype(ires)),ires,(c(j,ires),j=1,3),
302 & (c(j,ires+nres),j=1,3)
305 C Calculate internal coordinates.
306 if(me.eq.king.or..not.out1file)then
308 & "Backbone and SC coordinates as read from the PDB"
310 write (iout,'(2i3,2x,a,3f8.3,5x,3f8.3)')
311 & ires,itype(ires),restyp(itype(ires)),(c(j,ires),j=1,3),
312 & (c(j,nres+ires),j=1,3)
315 call int_from_cart(.true.,.false.)
316 call sc_loc_geom(.false.)
323 dc(j,i)=c(j,i+1)-c(j,i)
324 dc_norm(j,i)=dc(j,i)*vbld_inv(i+1)
329 dc(j,i+nres)=c(j,i+nres)-c(j,i)
330 dc_norm(j,i+nres)=dc(j,i+nres)*vbld_inv(i+nres)
332 c write (iout,*) i,(dc(j,i+nres),j=1,3),(dc_norm(j,i+nres),j=1,3),
336 C Copy the coordinates to reference coordinates
337 C Splits to single chain if occurs
343 cc write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
345 if ((itype(i-1).eq.ntyp1).and.(i.gt.2)) then
348 c write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
354 cref(j,i+nres,cou)=c(j,i+nres)
356 chain_rep(j,lll,kkk)=c(j,i)
357 chain_rep(j,lll+nres,kkk)=c(j,i+nres)
361 c write (iout,*) chain_length
362 if (chain_length.eq.0) chain_length=nres
364 chain_rep(j,chain_length,symetr)=chain_rep(j,chain_length,1)
365 chain_rep(j,chain_length+nres,symetr)
366 &=chain_rep(j,chain_length+nres,1)
369 c write (iout,*) "spraw lancuchy",chain_length,symetr
371 c do kkk=1,chain_length
372 c write (iout,*) itype(kkk),(chain_rep(j,kkk,i), j=1,3)
376 C makes copy of chains
377 c write (iout,*) "symetr", symetr
379 if (symetr.gt.1) then
386 write(iout,*) (tabperm(i,kkk),kkk=1,4)
392 c write (iout,*) i,icha
393 do lll=1,chain_length
395 if (cou.le.nres) then
397 kupa=mod(lll,chain_length)
398 iprzes=(kkk-1)*chain_length+lll
399 if (kupa.eq.0) kupa=chain_length
400 c write (iout,*) "kupa", kupa
401 cref(j,iprzes,i)=chain_rep(j,kupa,icha)
402 cref(j,iprzes+nres,i)=chain_rep(j,kupa+nres,icha)
409 C-koniec robienia kopii
412 write (iout,*) "nowa struktura", nperm
414 write (iout,110) restyp(itype(i)),i,cref(1,i,kkk),
416 &cref(3,i,kkk),cref(1,nres+i,kkk),
417 &cref(2,nres+i,kkk),cref(3,nres+i,kkk)
419 100 format (//' alpha-carbon coordinates ',
420 & ' centroid coordinates'/
421 1 ' ', 6X,'X',11X,'Y',11X,'Z',
422 & 10X,'X',11X,'Y',11X,'Z')
423 110 format (a,'(',i3,')',6f12.5)
429 bfrag(i,j)=bfrag(i,j)-ishift
435 hfrag(i,j)=hfrag(i,j)-ishift
440 c---------------------------------------------------------------------------
441 subroutine int_from_cart(lside,lprn)
442 implicit real*8 (a-h,o-z)
447 include 'COMMON.LOCAL'
449 include 'COMMON.CHAIN'
450 include 'COMMON.INTERACT'
451 include 'COMMON.IOUNITS'
453 include 'COMMON.NAMES'
454 include 'COMMON.CONTROL'
455 include 'COMMON.SETUP'
459 dimension sccor(3,20)
463 if(me.eq.king.or..not.out1file)then
467 & 'Internal coordinates calculated from crystal structure.'
469 write (iout,'(8a)') ' Res ',' dvb',' Theta',
470 & ' Gamma',' Dsc_id',' Dsc',' Alpha',
473 write (iout,'(4a)') ' Res ',' dvb',' Theta',
482 if (iti.ne.ntyp1 .and. itype(i+1).ne.ntyp1 .and.
483 & (dist(i,i+1).lt.2.0D0 .or. dist(i,i+1).gt.5.0D0)) then
484 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
487 vbld(i+1)=dist(i,i+1)
488 vbld_inv(i+1)=1.0d0/vbld(i+1)
489 if (i.gt.1) theta(i+1)=alpha(i-1,i,i+1)
490 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
492 c if (unres_pdb) then
493 c if (itype(1).eq.21) then
494 c theta(3)=90.0d0*deg2rad
495 c phi(4)=180.0d0*deg2rad
497 c vbld_inv(2)=1.0d0/vbld(2)
499 c if (itype(nres).eq.21) then
500 c theta(nres)=90.0d0*deg2rad
501 c phi(nres)=180.0d0*deg2rad
503 c vbld_inv(nres)=1.0d0/vbld(2)
509 c(j,maxres2)=0.5D0*(2*c(j,i)+(c(j,i-1)-c(j,i))*vbld_inv(i)
510 & +(c(j,i+1)-c(j,i))*vbld_inv(i+1))
514 C 10/03/12 Adam: Correction for zero SC-SC bond length
515 if (itype(i).ne.10 .and. itype(i).ne.21. and. di.eq.0.0d0)
518 if (itype(i).ne.10) then
519 vbld_inv(i+nres)=1.0d0/di
521 vbld_inv(i+nres)=0.0d0
524 alph(i)=alpha(nres+i,i,maxres2)
525 omeg(i)=beta(nres+i,i,maxres2,i+1)
527 if(me.eq.king.or..not.out1file)then
529 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,vbld(i),
530 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),vbld(nres+i),
531 & rad2deg*alph(i),rad2deg*omeg(i)
537 if(me.eq.king.or..not.out1file)
538 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
539 & rad2deg*theta(i),rad2deg*phi(i)
544 c-------------------------------------------------------------------------------
545 subroutine sc_loc_geom(lprn)
546 implicit real*8 (a-h,o-z)
551 include 'COMMON.LOCAL'
553 include 'COMMON.CHAIN'
554 include 'COMMON.INTERACT'
555 include 'COMMON.IOUNITS'
557 include 'COMMON.NAMES'
558 include 'COMMON.CONTROL'
559 include 'COMMON.SETUP'
560 double precision x_prime(3),y_prime(3),z_prime(3)
564 dc_norm(j,i)=vbld_inv(i+1)*(c(j,i+1)-c(j,i))
568 if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then
570 dc_norm(j,i+nres)=vbld_inv(i+nres)*(c(j,i+nres)-c(j,i))
574 dc_norm(j,i+nres)=0.0d0
579 costtab(i+1) =dcos(theta(i+1))
580 sinttab(i+1) =dsqrt(1-costtab(i+1)*costtab(i+1))
581 cost2tab(i+1)=dsqrt(0.5d0*(1.0d0+costtab(i+1)))
582 sint2tab(i+1)=dsqrt(0.5d0*(1.0d0-costtab(i+1)))
583 cosfac2=0.5d0/(1.0d0+costtab(i+1))
584 cosfac=dsqrt(cosfac2)
585 sinfac2=0.5d0/(1.0d0-costtab(i+1))
586 sinfac=dsqrt(sinfac2)
588 if (it.ne.10 .and. itype(i).ne.ntyp1) then
590 C Compute the axes of tghe local cartesian coordinates system; store in
591 c x_prime, y_prime and z_prime
599 x_prime(j) = (dc_norm(j,i) - dc_norm(j,i-1))*cosfac
600 y_prime(j) = (dc_norm(j,i) + dc_norm(j,i-1))*sinfac
602 call vecpr(x_prime,y_prime,z_prime)
604 C Transform the unit vector of the ith side-chain centroid, dC_norm(*,i),
605 C to local coordinate system. Store in xx, yy, zz.
611 xx = xx + x_prime(j)*dc_norm(j,i+nres)
612 yy = yy + y_prime(j)*dc_norm(j,i+nres)
613 zz = zz + z_prime(j)*dc_norm(j,i+nres)
629 if(me.eq.king.or..not.out1file)
630 & write (iout,'(a3,i4,3f10.5)') restyp(iti),i,xxref(i),
633 write (iout,'(a3,i4,3f10.5)') restyp(iti),i,xxref(i),yyref(i),
640 c---------------------------------------------------------------------------
641 subroutine sccenter(ires,nscat,sccor)
642 implicit real*8 (a-h,o-z)
644 include 'COMMON.CHAIN'
645 dimension sccor(3,20)
649 sccmj=sccmj+sccor(j,i)
651 dc(j,ires)=sccmj/nscat
655 c---------------------------------------------------------------------------
656 subroutine bond_regular
657 implicit real*8 (a-h,o-z)
660 include 'COMMON.LOCAL'
661 include 'COMMON.CALC'
662 include 'COMMON.INTERACT'
663 include 'COMMON.CHAIN'
666 vbld_inv(i+1)=1.0d0/vbld(i+1)
667 vbld(i+1+nres)=dsc(iabs(itype(i+1)))
668 vbld_inv(i+1+nres)=dsc_inv(iabs(itype(i+1)))
669 c print *,vbld(i+1),vbld(i+1+nres)
674 subroutine readpdb_template(k)
675 C Read the PDB file for read_constr_homology with read2sigma
676 C and convert the peptide geometry into virtual-chain geometry.
677 implicit real*8 (a-h,o-z)
679 include 'COMMON.LOCAL'
681 include 'COMMON.CHAIN'
682 include 'COMMON.INTERACT'
683 include 'COMMON.IOUNITS'
685 include 'COMMON.NAMES'
686 include 'COMMON.CONTROL'
687 include 'COMMON.DISTFIT'
688 include 'COMMON.SETUP'
689 integer i,j,ibeg,ishift1,ires,iii,ires_old,ishift,ity,
691 logical lprn /.false./,fail
692 double precision e1(3),e2(3),e3(3)
693 double precision dcj,efree_temp
697 double precision sccor(3,20)
698 integer rescode,iterter(maxres)
705 c write (2,*) "UNRES_PDB",unres_pdb
713 read (ipdbin,'(a80)',end=10) card
714 if (card(:3).eq.'END') then
716 else if (card(:3).eq.'TER') then
719 itype(ires_old-1)=ntyp1
720 iterter(ires_old-1)=1
721 itype(ires_old)=ntyp1
724 c write (iout,*) "Chain ended",ires,ishift,ires_old
727 dc(j,ires)=sccor(j,iii)
730 call sccenter(ires,iii,sccor)
733 C Fish out the ATOM cards.
734 if (index(card(1:4),'ATOM').gt.0) then
735 read (card(12:16),*) atom
736 c write (iout,*) "! ",atom," !",ires
737 c if (atom.eq.'CA' .or. atom.eq.'CH3') then
738 read (card(23:26),*) ires
739 read (card(18:20),'(a3)') res
740 c write (iout,*) "ires",ires,ires-ishift+ishift1,
741 c & " ires_old",ires_old
742 c write (iout,*) "ishift",ishift," ishift1",ishift1
743 c write (iout,*) "IRES",ires-ishift+ishift1,ires_old
744 if (ires-ishift+ishift1.ne.ires_old) then
745 C Calculate the CM of the preceding residue.
749 dc(j,ires)=sccor(j,iii)
752 call sccenter(ires_old,iii,sccor)
757 if (res.eq.'Cl-' .or. res.eq.'Na+') then
760 else if (ibeg.eq.1) then
761 c write (iout,*) "BEG ires",ires
763 if (res.ne.'GLY' .and. res.ne. 'ACE') then
767 ires=ires-ishift+ishift1
769 c write (iout,*) "ishift",ishift," ires",ires,
770 c & " ires_old",ires_old
771 c write (iout,*) "ires",ires," ibeg",ibeg," ishift",ishift
773 else if (ibeg.eq.2) then
775 ishift=-ires_old+ires-1
777 c write (iout,*) "New chain started",ires,ishift
780 ishift=ishift-(ires-ishift+ishift1-ires_old-1)
781 ires=ires-ishift+ishift1
784 if (res.eq.'ACE' .or. res.eq.'NHE') then
787 itype(ires)=rescode(ires,res,0)
790 ires=ires-ishift+ishift1
792 c write (iout,*) "ires_old",ires_old," ires",ires
793 c if (card(27:27).eq."A" .or. card(27:27).eq."B") then
796 c write (2,*) "ires",ires," res ",res," ity",ity
797 if (atom.eq.'CA' .or. atom.eq.'CH3' .or.
798 & res.eq.'NHE'.and.atom(:2).eq.'HN') then
799 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
800 c write (iout,*) "backbone ",atom ,ires,res, (c(j,ires),j=1,3)
802 write (iout,'(2i3,2x,a,3f8.3)')
803 & ires,itype(ires),res,(c(j,ires),j=1,3)
807 sccor(j,iii)=c(j,ires)
809 if (ishift.ne.0) then
810 ires_ca=ires+ishift-ishift1
814 c write (*,*) card(23:27),ires,itype(ires)
815 else if (atom.ne.'O'.and.atom(1:1).ne.'H' .and.
816 & atom.ne.'N' .and. atom.ne.'C' .and.
817 & atom(:2).ne.'1H' .and. atom(:2).ne.'2H' .and.
818 & atom.ne.'OXT' .and. atom(:2).ne.'3H') then
819 c write (iout,*) "sidechain ",atom
821 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
825 10 if(me.eq.king.or..not.out1file)
826 & write (iout,'(a,i5)') ' Nres: ',ires
827 C Calculate dummy residue coordinates inside the "chain" of a multichain
831 c write (iout,*) i,itype(i),itype(i+1)
832 if (itype(i).eq.ntyp1.and.iterter(i).eq.1) then
833 if (itype(i+1).eq.ntyp1.and.iterter(i+1).eq.1 ) then
834 C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
835 C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
836 C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
838 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
839 call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
846 c(j,i)=c(j,i-1)-1.9d0*e2(j)
850 dcj=(c(j,i-2)-c(j,i-3))/2.0
851 if (dcj.eq.0) dcj=1.23591524223
856 else !itype(i+1).eq.ntyp1
858 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
859 call refsys(i+1,i+2,i+3,e1,e2,e3,fail)
866 c(j,i)=c(j,i+1)-1.9d0*e2(j)
870 dcj=(c(j,i+3)-c(j,i+2))/2.0
871 if (dcj.eq.0) dcj=1.23591524223
876 endif !itype(i+1).eq.ntyp1
877 endif !itype.eq.ntyp1
879 C Calculate the CM of the last side chain.
882 dc(j,ires)=sccor(j,iii)
885 call sccenter(ires,iii,sccor)
889 if (itype(nres).ne.10) then
893 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
894 call refsys(nres-3,nres-2,nres-1,e1,e2,e3,fail)
901 c(j,nres)=c(j,nres-1)-1.9d0*e2(j)
905 dcj=(c(j,nres-2)-c(j,nres-3))/2.0
906 if (dcj.eq.0) dcj=1.23591524223
907 c(j,nres)=c(j,nres-1)+dcj
908 c(j,2*nres)=c(j,nres)
919 c(j,2*nres)=c(j,nres)
921 if (itype(1).eq.ntyp1) then
925 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
926 call refsys(2,3,4,e1,e2,e3,fail)
933 c(j,1)=c(j,2)-1.9d0*e2(j)
937 dcj=(c(j,4)-c(j,3))/2.0
943 C Copy the coordinates to reference coordinates
949 C Calculate internal coordinates.
952 & "Cartesian coordinates of the reference structure"
953 write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
954 & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
956 write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)')
957 & restyp(itype(ires)),ires,(c(j,ires),j=1,3),
958 & (c(j,ires+nres),j=1,3)
961 C Calculate internal coordinates.
962 if(me.eq.king.or..not.out1file)then
964 & "Backbone and SC coordinates as read from the PDB"
966 write (iout,'(2i3,2x,a,3f8.3,5x,3f8.3)')
967 & ires,itype(ires),restyp(itype(ires)),(c(j,ires),j=1,3),
968 & (c(j,nres+ires),j=1,3)
971 call int_from_cart(.true.,.false.)
972 call sc_loc_geom(.false.)
979 dc(j,i)=c(j,i+1)-c(j,i)
980 dc_norm(j,i)=dc(j,i)*vbld_inv(i+1)
985 dc(j,i+nres)=c(j,i+nres)-c(j,i)
986 dc_norm(j,i+nres)=dc(j,i+nres)*vbld_inv(i+nres)
988 c write (iout,*) i,(dc(j,i+nres),j=1,3),(dc_norm(j,i+nres),j=1,3),
992 C Copy the coordinates to reference coordinates
993 C Splits to single chain if occurs
999 cc write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
1001 if ((itype(i-1).eq.ntyp1).and.(i.gt.2)) then
1004 c write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
1009 cref(j,i,cou)=c(j,i)
1010 cref(j,i+nres,cou)=c(j,i+nres)
1012 chain_rep(j,lll,kkk)=c(j,i)
1013 chain_rep(j,lll+nres,kkk)=c(j,i+nres)
1023 c write (iout,*) chain_length
1024 if (chain_length.eq.0) chain_length=nres
1026 chain_rep(j,chain_length,symetr)=chain_rep(j,chain_length,1)
1027 chain_rep(j,chain_length+nres,symetr)
1028 &=chain_rep(j,chain_length+nres,1)
1031 c write (iout,*) "spraw lancuchy",chain_length,symetr
1033 c do kkk=1,chain_length
1034 c write (iout,*) itype(kkk),(chain_rep(j,kkk,i), j=1,3)