2 C Read the PDB file and convert the peptide geometry into virtual-chain
6 include 'DIMENSIONS.ZSCOPT'
7 include 'COMMON.CONTROL'
10 include 'COMMON.CHAIN'
11 include 'COMMON.INTERACT'
12 include 'COMMON.IOUNITS'
14 include 'COMMON.NAMES'
15 include 'COMMON.SBRIDGE'
17 character*3 seq,atom,res
19 double precision e1(3),e2(3),e3(3)
20 double precision sccor(3,50)
21 integer i,j,iii,ibeg,ishift,ishift1,ity,ires,ires_old
23 integer rescode,kkk,lll,icha,cou,kupa,iprzes
24 logical lsecondary,sccalc,fail,zero
25 integer iterter(maxres)
26 double precision efree_temp
43 read (ipdbin,'(a80)',end=10) card
44 c write (iout,'(a)') card
46 if (card(:5).eq.'HELIX') then
49 read(card(22:25),*) hfrag(1,nhfrag)
50 read(card(34:37),*) hfrag(2,nhfrag)
52 if (card(:5).eq.'SHEET') then
55 read(card(24:26),*) bfrag(1,nbfrag)
56 read(card(35:37),*) bfrag(2,nbfrag)
57 !rc----------------------------------------
58 !rc to be corrected !!!
59 bfrag(3,nbfrag)=bfrag(1,nbfrag)
60 bfrag(4,nbfrag)=bfrag(2,nbfrag)
61 !rc----------------------------------------
63 if (card(:3).eq.'END') then
65 else if (card(:3).eq.'TER') then
68 itype(ires_old-1)=ntyp1
74 write (iout,*) "Chain ended",ires,ishift,ires_old,ibeg
77 dc(j,ires)=sccor(j,iii)
80 call sccenter(ires,iii,sccor)
86 c if (index(card,"FREE ENERGY").gt.0) then
87 c ifree=index(card,"FREE ENERGY")+12
88 c read(card(ifree:),*,err=1115,end=1115) efree_temp
91 ! Fish out the ATOM cards.
92 if (index(card(1:4),'ATOM').gt.0) then
94 read (card(12:16),*) atom
95 c write (2,'(a)') card
96 c write (iout,*) "ibeg",ibeg
97 c write (iout,*) "! ",atom," !",ires
98 ! if (atom.eq.'CA' .or. atom.eq.'CH3') then
99 read (card(23:26),*) ires
100 read (card(18:20),'(a3)') res
101 c write (iout,*) "ires",ires,ires-ishift+ishift1,
102 c & " ires_old",ires_old
103 c write (iout,*) "ishift",ishift," ishift1",ishift1
104 c write (iout,*) "IRES",ires-ishift+ishift1,ires_old
105 if (ires-ishift+ishift1.ne.ires_old) then
106 ! Calculate the CM of the preceding residue.
107 ! if (ibeg.eq.0) call sccenter(ires,iii,sccor)
109 c write (iout,*) "Calculating sidechain center iii",iii
110 c write (iout,*) "ires",ires
112 c write (iout,'(i5,3f10.5)') ires,(sccor(j,iii),j=1,3)
114 dc(j,ires_old)=sccor(j,iii)
117 call sccenter(ires_old,iii,sccor)
123 c write (iout,*) "ibeg",ibeg
124 if (res.eq.'Cl-' .or. res.eq.'Na+') then
127 else if (ibeg.eq.1) then
128 c write (iout,*) "BEG ires",ires
130 if (res.ne.'GLY' .and. res.ne. 'ACE') then
134 ires=ires-ishift+ishift1
136 ! write (iout,*) "ishift",ishift," ires",ires,&
137 ! " ires_old",ires_old
139 else if (ibeg.eq.2) then
141 ishift=-ires_old+ires-1 !!!!!
142 c ishift1=ishift1-1 !!!!!
143 c write (iout,*) "New chain started",ires,ires_old,ishift,
145 ires=ires-ishift+ishift1
146 write (iout,*) "New chain started ires",ires
151 ishift=ishift-(ires-ishift+ishift1-ires_old-1)
152 ires=ires-ishift+ishift1
155 if (res.eq.'ACE' .or. res.eq.'NHE') then
158 itype(ires)=rescode(ires,res,0)
161 ires=ires-ishift+ishift1
163 c write (iout,*) "ires_old",ires_old," ires",ires
164 if (card(27:27).eq."A" .or. card(27:27).eq."B") then
167 c write (2,*) "ires",ires," res ",res!," ity"!,ity
168 if (atom.eq.'CA' .or. atom.eq.'CH3' .or.
169 & res.eq.'NHE'.and.atom(:2).eq.'HN') then
170 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
171 c write (iout,*) "backbone ",atom
172 c write (iout,*) ires,res,(c(j,ires),j=1,3)
174 write (iout,'(i6,i3,2x,a,3f8.3)')
175 & ires,itype(ires),res,(c(j,ires),j=1,3)
179 sccor(j,iii)=c(j,ires)
181 c write (2,*) card(23:27),ires,itype(ires),iii
182 else if (atom.ne.'O'.and.atom(1:1).ne.'H' .and.
183 & atom.ne.'N' .and. atom.ne.'C' .and.
184 & atom(:2).ne.'1H' .and. atom(:2).ne.'2H' .and.
185 & atom.ne.'OXT' .and. atom(:2).ne.'3H') then
186 ! write (iout,*) "sidechain ",atom
188 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
189 c write (2,*) "iii",iii
193 10 write (iout,'(a,i5)') ' Nres: ',ires
194 c write (iout,*) "iii",iii
195 C Calculate dummy residue coordinates inside the "chain" of a multichain
198 c write (iout,*) "dc"
200 c write (iout,'(i5,3f10.5)') i,(dc(j,i),j=1,3)
203 c write (iout,*) i,itype(i),itype(i+1),ntyp1,iterter(i)
204 if (itype(i).eq.ntyp1.and.iterter(i).eq.1) then
205 if (itype(i+1).eq.ntyp1.and.iterter(i+1).eq.1 ) then
206 C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
207 C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
208 C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
210 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
211 c print *,i,'tu dochodze'
212 call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
220 c(j,i)=c(j,i-1)+1.9d0*(-e1(j)+e2(j))/sqrt(2.0d0)
224 dcj=(c(j,i-2)-c(j,i-3))/2.0
225 if (dcj.eq.0) dcj=1.23591524223
231 else !itype(i+1).eq.ntyp1
233 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
234 call refsys(i+1,i+2,i+3,e1,e2,e3,fail)
241 c(j,i)=c(j,i+1)+1.9d0*(-e1(j)+e2(j))/sqrt(2.0d0)
245 dcj=(c(j,i+3)-c(j,i+2))/2.0
246 if (dcj.eq.0) dcj=1.23591524223
252 endif !itype(i+1).eq.ntyp1
253 endif !itype.eq.ntyp1
255 write (iout,*) "After loop in readpbd"
256 C Calculate the CM of the last side chain.
257 if (.not. sccalc) then
260 dc(j,ires)=sccor(j,iii)
263 c write (iout,*) "Calling sccenter iii",iii
264 call sccenter(ires,iii,sccor)
269 if (itype(nres).ne.10) then
273 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
274 call refsys(nres-3,nres-2,nres-1,e1,e2,e3,fail)
281 c(j,nres)=c(j,nres-1)+1.9d0*(-e1(j)+e2(j))/sqrt(2.0d0)
285 dcj=(c(j,nres-2)-c(j,nres-3))/2.0
286 if (dcj.eq.0) dcj=1.23591524223
287 c(j,nres)=c(j,nres-1)+dcj
288 c(j,2*nres)=c(j,nres)
299 c(j,2*nres)=c(j,nres)
301 if (itype(1).eq.ntyp1) then
305 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
306 call refsys(2,3,4,e1,e2,e3,fail)
313 c(j,1)=c(j,2)+1.9d0*(e1(j)-e2(j))/dsqrt(2.0d0)
317 dcj=(c(j,4)-c(j,3))/2.0
323 C Calculate internal coordinates.
325 & "Cartesian coordinates of the reference structure"
326 write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
327 & "Residue ","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
329 write (iout,'(a3,1x,i4,3f8.3,5x,3f8.3)')
330 & restyp(itype(ires)),ires,(c(j,ires),j=1,3),
331 & (c(j,ires+nres),j=1,3)
335 zero=zero.or.itype(ires).eq.0
338 write (iout,'(2a)') "Gaps in PDB coordinates detected;",
339 & " look for ZERO in the control output above."
340 write (iout,'(2a)') "Repair the PDB file using MODELLER",
341 & " or other softwared and resubmit."
345 c write(iout,*)"before int_from_cart nres",nres
346 call int_from_cart(.true.,.false.)
354 dc(j,i)=c(j,i+1)-c(j,i)
355 dc_norm(j,i)=dc(j,i)*vbld_inv(i+1)
357 c write (iout,*) i,(dc(j,i),j=1,3),(dc_norm(j,i),j=1,3),
362 dc(j,i+nres)=c(j,i+nres)-c(j,i)
363 dc_norm(j,i+nres)=dc(j,i+nres)*vbld_inv(i+nres)
365 c write (iout,*) i,(dc(j,i+nres),j=1,3),(dc_norm(j,i+nres),j=1,3),
368 call sc_loc_geom(.false.)
369 call int_from_cart1(.false.)
371 C Copy the coordinates to reference coordinates
375 cref(j,i+nres)=c(j,i+nres)
378 100 format (//' alpha-carbon coordinates ',
379 & ' centroid coordinates'/
380 1 ' ', 7X,'X',11X,'Y',11X,'Z',
381 & 10X,'X',11X,'Y',11X,'Z')
382 110 format (a,'(',i4,')',6f12.5)
386 bfrag(i,j)=bfrag(i,j)-ishift
392 hfrag(i,j)=hfrag(i,j)-ishift
397 c---------------------------------------------------------------------------
398 subroutine readpdb_template(k)
399 C Read the PDB file for read_constr_homology with read2sigma
400 C and convert the peptide geometry into virtual-chain geometry.
401 implicit real*8 (a-h,o-z)
403 include 'DIMENSIONS.ZSCOPT'
404 include 'COMMON.LOCAL'
406 include 'COMMON.CHAIN'
407 include 'COMMON.INTERACT'
408 include 'COMMON.IOUNITS'
410 include 'COMMON.NAMES'
411 include 'COMMON.CONTROL'
412 include 'COMMON.SETUP'
413 integer i,j,ibeg,ishift1,ires,iii,ires_old,ishift,ity
414 logical lprn /.false./,fail
415 double precision e1(3),e2(3),e3(3)
416 double precision dcj,efree_temp
420 double precision sccor(3,20)
421 integer rescode,iterter(maxres)
429 c write (2,*) "UNRES_PDB",unres_pdb
437 read (ipdbin,'(a80)',end=10) card
438 if (card(:3).eq.'END') then
440 else if (card(:3).eq.'TER') then
443 itype(ires_old-1)=ntyp1
444 iterter(ires_old-1)=1
445 itype(ires_old)=ntyp1
448 c write (iout,*) "Chain ended",ires,ishift,ires_old
451 dc(j,ires)=sccor(j,iii)
454 call sccenter(ires,iii,sccor)
457 C Fish out the ATOM cards.
458 if (index(card(1:4),'ATOM').gt.0) then
459 read (card(12:16),*) atom
460 c write (iout,*) "! ",atom," !",ires
461 c if (atom.eq.'CA' .or. atom.eq.'CH3') then
462 read (card(23:26),*) ires
463 read (card(18:20),'(a3)') res
464 c write (iout,*) "ires",ires,ires-ishift+ishift1,
465 c & " ires_old",ires_old
466 c write (iout,*) "ishift",ishift," ishift1",ishift1
467 c write (iout,*) "IRES",ires-ishift+ishift1,ires_old
468 if (ires-ishift+ishift1.ne.ires_old) then
469 C Calculate the CM of the preceding residue.
473 dc(j,ires_old)=sccor(j,iii)
476 call sccenter(ires_old,iii,sccor)
481 if (res.eq.'Cl-' .or. res.eq.'Na+') then
484 else if (ibeg.eq.1) then
485 c write (iout,*) "BEG ires",ires
487 if (res.ne.'GLY' .and. res.ne. 'ACE') then
491 ires=ires-ishift+ishift1
493 c write (iout,*) "ishift",ishift," ires",ires,
494 c & " ires_old",ires_old
495 c write (iout,*) "ires",ires," ibeg",ibeg," ishift",ishift
497 else if (ibeg.eq.2) then
499 ishift=-ires_old+ires-1
501 c write (iout,*) "New chain started",ires,ishift
504 ishift=ishift-(ires-ishift+ishift1-ires_old-1)
505 ires=ires-ishift+ishift1
508 if (res.eq.'ACE' .or. res.eq.'NHE') then
511 itype(ires)=rescode(ires,res,0)
514 ires=ires-ishift+ishift1
516 c write (iout,*) "ires_old",ires_old," ires",ires
517 c if (card(27:27).eq."A" .or. card(27:27).eq."B") then
520 c write (2,*) "ires",ires," res ",res," ity",ity
521 if (atom.eq.'CA' .or. atom.eq.'CH3' .or.
522 & res.eq.'NHE'.and.atom(:2).eq.'HN') then
523 read(card(31:54),'(3f8.3)') (c(j,ires),j=1,3)
524 c write (iout,*) "backbone ",atom ,ires,res, (c(j,ires),j=1,3)
526 write (iout,'(2i3,2x,a,3f8.3)')
527 & ires,itype(ires),res,(c(j,ires),j=1,3)
531 sccor(j,iii)=c(j,ires)
533 if (ishift.ne.0) then
534 ires_ca=ires+ishift-ishift1
538 c write (*,*) card(23:27),ires,itype(ires)
539 else if (atom.ne.'O'.and.atom(1:1).ne.'H' .and.
540 & atom.ne.'N' .and. atom.ne.'C' .and.
541 & atom(:2).ne.'1H' .and. atom(:2).ne.'2H' .and.
542 & atom.ne.'OXT' .and. atom(:2).ne.'3H') then
543 c write (iout,*) "sidechain ",atom
545 read(card(31:54),'(3f8.3)') (sccor(j,iii),j=1,3)
549 10 write (iout,'(a,i5)') ' Nres: ',ires
550 C Calculate dummy residue coordinates inside the "chain" of a multichain
554 c write (iout,*) i,itype(i),itype(i+1)
555 if (itype(i).eq.ntyp1.and.iterter(i).eq.1) then
556 if (itype(i+1).eq.ntyp1.and.iterter(i+1).eq.1 ) then
557 C 16/01/2014 by Adasko: Adding to dummy atoms in the chain
558 C first is connected prevous chain (itype(i+1).eq.ntyp1)=true
559 C second dummy atom is conected to next chain itype(i+1).eq.ntyp1=false
561 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
562 call refsys(i-3,i-2,i-1,e1,e2,e3,fail)
569 c(j,i)=c(j,i-1)-1.9d0*e2(j)
573 dcj=(c(j,i-2)-c(j,i-3))/2.0
574 if (dcj.eq.0) dcj=1.23591524223
579 else !itype(i+1).eq.ntyp1
581 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
582 call refsys(i+1,i+2,i+3,e1,e2,e3,fail)
589 c(j,i)=c(j,i+1)+1.9d0*(-e1(j)+e2(j))/sqrt(2.0d0)
593 dcj=(c(j,i+3)-c(j,i+2))/2.0
594 if (dcj.eq.0) dcj=1.23591524223
599 endif !itype(i+1).eq.ntyp1
600 endif !itype.eq.ntyp1
602 C Calculate the CM of the last side chain.
605 dc(j,ires)=sccor(j,iii)
608 call sccenter(ires,iii,sccor)
612 if (itype(nres).ne.10) then
616 C 2/15/2013 by Adam: corrected insertion of the last dummy residue
617 call refsys(nres-3,nres-2,nres-1,e1,e2,e3,fail)
624 c(j,nres)=c(j,nres-1)+1.9d0*(-e1(j)+e2(j))/sqrt(2.0d0)
628 dcj=(c(j,nres-2)-c(j,nres-3))/2.0
629 if (dcj.eq.0) dcj=1.23591524223
630 c(j,nres)=c(j,nres-1)+dcj
631 c(j,2*nres)=c(j,nres)
642 c(j,2*nres)=c(j,nres)
644 if (itype(1).eq.ntyp1) then
648 C 2/15/2013 by Adam: corrected insertion of the first dummy residue
649 call refsys(2,3,4,e1,e2,e3,fail)
656 c(j,1)=c(j,2)+1.9d0*(e1(j)-e2(j))/dsqrt(2.0d0)
660 dcj=(c(j,4)-c(j,3))/2.0
666 C Copy the coordinates to reference coordinates
672 C Calculate internal coordinates.
673 if (out_template_coord) then
675 & "Cartesian coordinates of the reference structure"
676 write (iout,'(a,3(3x,a5),5x,3(3x,a5))')
677 & "Residue ","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)"
679 write (iout,'(a3,1x,i4,3f8.3,5x,3f8.3)')
680 & restyp(itype(ires)),ires,(c(j,ires),j=1,3),
681 & (c(j,ires+nres),j=1,3)
686 zero=zero.or.itype(ires).eq.0
689 write (iout,'(2a)') "Gaps in PDB coordinates detected;",
690 & " look for ZERO in the control output above."
691 write (iout,'(2a)') "Repair the PDB file using MODELLER",
692 & " or other softwared and resubmit."
696 C Calculate internal coordinates.
697 call int_from_cart(.true.,out_template_coord)
698 call sc_loc_geom(.false.)
706 dc(j,i)=c(j,i+1)-c(j,i)
707 dc_norm(j,i)=dc(j,i)*vbld_inv(i+1)
712 dc(j,i+nres)=c(j,i+nres)-c(j,i)
713 dc_norm(j,i+nres)=dc(j,i+nres)*vbld_inv(i+nres)
715 c write (iout,*) i,(dc(j,i+nres),j=1,3),(dc_norm(j,i+nres),j=1,3),
721 cref(j,i+nres)=c(j,i+nres)
732 c---------------------------------------------------------------------------
733 subroutine int_from_cart(lside,lprn)
736 include 'DIMENSIONS.ZSCOPT'
737 include 'COMMON.LOCAL'
739 include 'COMMON.CHAIN'
740 include 'COMMON.INTERACT'
741 include 'COMMON.IOUNITS'
743 include 'COMMON.NAMES'
744 character*3 seq,atom,res
746 double precision sccor(3,50)
748 double precision dist,alpha,beta,di
753 & 'Internal coordinates calculated from crystal structure.'
755 write (iout,'(8a)') ' Res ',' dvb',' Theta',
756 & ' Phi',' Dsc_id',' Dsc',' Alpha',
759 write (iout,'(4a)') ' Res ',' dvb',' Theta',
765 c write (iout,*) i,i-1,(c(j,i),j=1,3),(c(j,i-1),j=1,3),dist(i,i-1)
766 if (itype(i-1).ne.ntyp1 .and. itype(i).ne.ntyp1 .and.
767 & (dist(i,i-1).lt.1.0D0 .or. dist(i,i-1).gt.6.0D0)) then
768 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
772 vbld_inv(i)=1.0d0/vbld(i)
773 theta(i+1)=alpha(i-1,i,i+1)
774 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
776 c if (itype(1).eq.ntyp1) then
778 c c(j,1)=c(j,2)+(c(j,3)-c(j,4))
781 c if (itype(nres).eq.ntyp1) then
783 c c(j,nres)=c(j,nres-1)+(c(j,nres-2)-c(j,nres-3))
789 c(j,maxres2)=0.5D0*(c(j,i-1)+c(j,i+1))
794 if (itype(i).ne.10) then
795 vbld_inv(i+nres)=1.0d0/di
797 vbld_inv(i+nres)=0.0d0
800 alph(i)=alpha(nres+i,i,maxres2)
801 omeg(i)=beta(nres+i,i,maxres2,i+1)
804 alph(i)=alpha(nres+i,i,maxres2)
805 omeg(i)=beta(nres+i,i,maxres2,i+1)
808 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
809 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),di,
810 & rad2deg*alph(i),rad2deg*omeg(i)
815 write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
816 & rad2deg*theta(i),rad2deg*phi(i)
821 c---------------------------------------------------------------------------
822 subroutine sccenter(ires,nscat,sccor)
825 include 'COMMON.CHAIN'
826 integer ires,nscat,i,j
827 double precision sccor(3,50),sccmj
831 sccmj=sccmj+sccor(j,i)
833 dc(j,ires)=sccmj/nscat
837 c---------------------------------------------------------------------------
838 subroutine sc_loc_geom(lprn)
839 implicit real*8 (a-h,o-z)
841 include 'DIMENSIONS.ZSCOPT'
842 include 'COMMON.LOCAL'
844 include 'COMMON.CHAIN'
845 include 'COMMON.INTERACT'
846 include 'COMMON.IOUNITS'
848 include 'COMMON.NAMES'
849 include 'COMMON.CONTROL'
850 include 'COMMON.SETUP'
851 double precision x_prime(3),y_prime(3),z_prime(3)
855 dc_norm(j,i)=vbld_inv(i+1)*(c(j,i+1)-c(j,i))
859 if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then
861 dc_norm(j,i+nres)=vbld_inv(i+nres)*(c(j,i+nres)-c(j,i))
865 dc_norm(j,i+nres)=0.0d0
870 costtab(i+1) =dcos(theta(i+1))
871 sinttab(i+1) =dsqrt(1-costtab(i+1)*costtab(i+1))
872 cost2tab(i+1)=dsqrt(0.5d0*(1.0d0+costtab(i+1)))
873 sint2tab(i+1)=dsqrt(0.5d0*(1.0d0-costtab(i+1)))
874 cosfac2=0.5d0/(1.0d0+costtab(i+1))
875 cosfac=dsqrt(cosfac2)
876 sinfac2=0.5d0/(1.0d0-costtab(i+1))
877 sinfac=dsqrt(sinfac2)
879 if (it.ne.10 .and. itype(i).ne.ntyp1) then
881 C Compute the axes of tghe local cartesian coordinates system; store in
882 c x_prime, y_prime and z_prime
890 x_prime(j) = (dc_norm(j,i) - dc_norm(j,i-1))*cosfac
891 y_prime(j) = (dc_norm(j,i) + dc_norm(j,i-1))*sinfac
893 c write (iout,*) "x_prime",(x_prime(j),j=1,3)
894 c write (iout,*) "y_prime",(y_prime(j),j=1,3)
895 call vecpr(x_prime,y_prime,z_prime)
896 c write (iout,*) "z_prime",(z_prime(j),j=1,3)
898 C Transform the unit vector of the ith side-chain centroid, dC_norm(*,i),
899 C to local coordinate system. Store in xx, yy, zz.
905 xx = xx + x_prime(j)*dc_norm(j,i+nres)
906 yy = yy + y_prime(j)*dc_norm(j,i+nres)
907 zz = zz + z_prime(j)*dc_norm(j,i+nres)
920 write (iout,*) "xxref,yyref,zzref"
923 write (iout,'(a3,i4,3f10.5)') restyp(iti),i,xxref(i),yyref(i),
929 c---------------------------------------------------------------------------
930 subroutine bond_regular
934 include 'COMMON.LOCAL'
935 include 'COMMON.INTERACT'
936 include 'COMMON.CHAIN'
941 vbld(i+1+nres)=dsc(iabs(itype(i+1)))
942 vbld_inv(i+1+nres)=dsc_inv(iabs(itype(i+1)))
943 c print *,vbld(i+1),vbld(i+1+nres)
945 c Adam 2/26/20 Alter virtual bonds for non-blocking end groups of each chain
951 vbld_inv(i1)=vbld_inv(i1)*2
954 vbld(i2+1)=vbld(i2+1)/2
955 vbld_inv(i2+1)=vbld_inv(i2+1)*2