5 implicit real*8 (a-h,o-z)
7 include 'DIMENSIONS.ZSCOPT'
8 include 'COMMON.IOUNITS'
11 include 'COMMON.INTERACT'
12 include 'COMMON.LOCAL'
13 include 'COMMON.NAMES'
14 include 'COMMON.CHAIN'
15 include 'COMMON.FFIELD'
16 include 'COMMON.SBRIDGE'
17 include 'COMMON.TORCNSTR'
18 include 'COMMON.CONTROL'
19 character*4 sequence(maxres)
21 double precision x(maxvar)
22 character*320 controlcard,ucase
23 dimension itype_pdb(maxres)
25 double precision secprob(3,maxdih_constr),phihel,phibet
26 call card_concat(controlcard,.true.)
27 call reada(controlcard,'SCAL14',scal14,0.4d0)
28 call reada(controlcard,'SCALSCP',scalscp,1.0d0)
29 call reada(controlcard,'CUTOFF',cutoff_corr,7.0d0)
30 call reada(controlcard,'DELT_CORR',delt_corr,0.5d0)
31 r0_corr=cutoff_corr-delt_corr
33 call reada(controlcard,'WDFAD',wdfa_dist,0.0d0)
34 call reada(controlcard,'WDFAT',wdfa_tor,0.0d0)
35 call reada(controlcard,'WDFAN',wdfa_nei,0.0d0)
36 call reada(controlcard,'WDFAB',wdfa_beta,0.0d0)
37 write (iout,*) "wdfa_dist",wdfa_dist," wdfa_tor",wdfa_tor,
38 & " wdfa_nei",wdfa_nei," wdfa_beta",wdfa_beta
39 r0_corr=cutoff_corr-delt_corr
40 call readi(controlcard,"NRES",nres,0)
41 iscode=index(controlcard,"ONE_LETTER")
43 write (iout,*) "Error: no residues in molecule"
46 if (nres.gt.maxres) then
47 write (iout,*) "Error: too many residues",nres,maxres
49 write(iout,*) 'nres=',nres
50 C Read sequence of the protein
52 read (inp,'(80a1)') (sequence(i)(1:1),i=1,nres)
54 read (inp,'(20(1x,a3))') (sequence(i),i=1,nres)
56 C Convert sequence to numeric code
58 itype(i)=rescode(i,sequence(i),iscode)
60 write (iout,*) "Numeric code:"
61 write (iout,'(20i4)') (itype(i),i=1,nres)
64 if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1) then
66 if (itype(i).eq.ntyp1) then
70 else if (iabs(itype(i+1)).ne.20) then
72 else if (iabs(itype(i)).ne.20) then
81 write (iout,*) i,itype(i),itel(i)
86 call seq2chains(nres,itype,nchain,chain_length,chain_border,
88 write(iout,*) "nres",nres," nchain",nchain
90 write(iout,*)"chain",i,chain_length(i),chain_border(1,i),
93 call chain_symmetry(nchain,nres,itype,chain_border,
94 & chain_length,npermchain,tabpermchain)
95 write(iout,*) "ireschain permutations"
97 write(iout,*) i,(tperm(ireschain(i),ii,tabpermchain),
100 write(iout,*) "residue permutations"
102 write(iout,*) i,(iperm(i,ii),ii=1,npermchain)
105 if (itype(1).eq.ntyp1) nnt=2
106 if (itype(nres).eq.ntyp1) nct=nct-1
107 write(iout,*) 'NNT=',NNT,' NCT=',NCT
109 C Juyong:READ init_vars
110 C Initialize variables!
111 C Juyong:READ read_info
112 C READ fragment information!!
113 C both routines should be in dfa.F file!!
115 if (.not. (wdfa_dist.eq.0.0 .and. wdfa_tor.eq.0.0 .and.
116 & wdfa_nei.eq.0.0 .and. wdfa_beta.eq.0.0)) then
117 write (iout,*) "Calling init_dfa_vars"
120 write (iout,*) 'init_dfa_vars finished!'
123 write (iout,*) 'read_dfa_info finished!'
127 if (with_dihed_constr) then
129 read (inp,*) ndih_constr
130 write (iout,*) "ndih_constr",ndih_constr
131 if (ndih_constr.gt.0) then
134 C write (iout,*) 'FTORS',ftors
135 read (inp,*) (idih_constr(i),phi0(i),drange(i),ftors(i),
138 & 'There are',ndih_constr,' restraints on gamma angles.'
140 write (iout,'(i5,3f8.3)') idih_constr(i),phi0(i),drange(i),
144 phi0(i)=deg2rad*phi0(i)
145 drange(i)=deg2rad*drange(i)
147 else if (ndih_constr.lt.0) then
149 call card_concat(controlcard,.true.)
150 call reada(controlcard,"PHIHEL",phihel,50.0D0)
151 call reada(controlcard,"PHIBET",phibet,180.0D0)
152 call reada(controlcard,"SIGMAHEL",sigmahel,30.0d0)
153 call reada(controlcard,"SIGMABET",sigmabet,40.0d0)
154 call reada(controlcard,"WDIHC",wdihc,0.591d0)
155 write (iout,*) "Weight of the dihedral restraint term",wdihc
156 read(inp,'(9x,3f7.3)')
157 & (secprob(1,i),secprob(2,i),secprob(3,i),i=nnt,nct)
158 write (iout,*) "The secprob array"
160 write (iout,'(i5,3f8.3)') i,(secprob(j,i),j=1,3)
164 if (itype(i-3).ne.ntyp1 .and. itype(i-2).ne.ntyp1
165 & .and. itype(i-1).ne.ntyp1 .and. itype(i).ne.ntyp1) then
166 ndih_constr=ndih_constr+1
167 idih_constr(ndih_constr)=i
170 vpsipred(j,ndih_constr)=secprob(j,i-1)*secprob(j,i-2)
171 sumv=sumv+vpsipred(j,ndih_constr)
174 vpsipred(j,ndih_constr)=vpsipred(j,ndih_constr)/sumv
176 phibound(1,ndih_constr)=phihel*deg2rad
177 phibound(2,ndih_constr)=phibet*deg2rad
178 sdihed(1,ndih_constr)=sigmahel*deg2rad
179 sdihed(2,ndih_constr)=sigmabet*deg2rad
183 & 'There are',ndih_constr,
184 & ' bimodal restraints on gamma angles.'
186 write(iout,'(i5,1x,a4,i5,1h-,a4,i5,4f8.3,3f10.5)') i,
187 & restyp(itype(idih_constr(i)-2)),idih_constr(i)-2,
188 & restyp(itype(idih_constr(i)-1)),idih_constr(i)-1,
189 & phibound(1,i)*rad2deg,sdihed(1,i)*rad2deg,
190 & phibound(2,i)*rad2deg,sdihed(2,i)*rad2deg,
191 & (vpsipred(j,i),j=1,3)
197 if (with_theta_constr) then
198 C with_theta_constr is keyword allowing for occurance of theta constrains
199 read (inp,*) ntheta_constr
200 C ntheta_constr is the number of theta constrains
201 if (ntheta_constr.gt.0) then
203 read (inp,*) (itheta_constr(i),theta_constr0(i),
204 & theta_drange(i),for_thet_constr(i),
206 C the above code reads from 1 to ntheta_constr
207 C itheta_constr(i) residue i for which is theta_constr
208 C theta_constr0 the global minimum value
209 C theta_drange is range for which there is no energy penalty
210 C for_thet_constr is the force constant for quartic energy penalty
212 C if(me.eq.king.or..not.out1file)then
214 & 'There are',ntheta_constr,' constraints on phi angles.'
216 write (iout,'(i5,3f8.3)') itheta_constr(i),theta_constr0(i),
222 theta_constr0(i)=deg2rad*theta_constr0(i)
223 theta_drange(i)=deg2rad*theta_drange(i)
225 C if(me.eq.king.or..not.out1file)
226 C & write (iout,*) 'FTORS',ftors
227 C do i=1,ntheta_constr
228 C ii = itheta_constr(i)
229 C thetabound(1,ii) = phi0(i)-drange(i)
230 C thetabound(2,ii) = phi0(i)+drange(i)
232 endif ! ntheta_constr.gt.0
233 endif! with_theta_constr
234 if (constr_homology.gt.0) then
235 c write (iout,*) "About to call read_constr_homology"
237 call read_constr_homology
238 c write (iout,*) "Exit read_constr_homology"
240 if (indpdb.gt.0 .or. pdbref) then
244 cref(j,i)=crefjlee(j,i)
249 write (iout,*) "Array C"
251 write (iout,'(i5,3f8.3,5x,3f8.3)') i,(c(j,i),j=1,3),
252 & (c(j,i+nres),j=1,3)
254 write (iout,*) "Array Cref"
256 write (iout,'(i5,3f8.3,5x,3f8.3)') i,(cref(j,i),j=1,3),
257 & (cref(j,i+nres),j=1,3)
261 call int_from_cart1(.false.)
262 call sc_loc_geom(.false.)
266 write (iout,*) i," phiref",phiref(i)," thetaref",thetaref(i)
270 dc(j,i)=c(j,i+1)-c(j,i)
271 dc_norm(j,i)=dc(j,i)*vbld_inv(i+1)
276 dc(j,i+nres)=c(j,i+nres)-c(j,i)
277 dc_norm(j,i+nres)=dc(j,i+nres)*vbld_inv(i+nres)
288 write (iout,'(/a,i3,a)') 'The chain contains',ns,
289 & ' disulfide-bridging cysteines.'
290 write (iout,'(20i4)') (iss(i),i=1,ns)
292 write(iout,*)"Running with dynamic disulfide-bond formation"
294 write (iout,'(/a/)') 'Pre-formed links are:'
300 write (iout,'(2a,i3,3a,i3,a,3f10.3)')
301 & restyp(it1),'(',i1,') -- ',restyp(it2),'(',i2,')',
302 & dhpb(i),ebr,forcon(i)
307 if (ns.gt.0.and.dyn_ss) then
311 forcon(i-nss)=forcon(i)
318 dyn_ss_mask(iss(i))=.true.
321 write (iout,*) "calling read_saxs_consrtr",nsaxs
322 if (nsaxs.gt.0) call read_saxs_constr
326 c-----------------------------------------------------------------------------
327 logical function seq_comp(itypea,itypeb,length)
329 integer length,itypea(length),itypeb(length)
332 if (itypea(i).ne.itypeb(i)) then
340 c-----------------------------------------------------------------------------
341 subroutine read_bridge
342 C Read information about disulfide bridges.
343 implicit real*8 (a-h,o-z)
345 include 'DIMENSIONS.ZSCOPT'
346 include 'COMMON.IOUNITS'
349 include 'COMMON.INTERACT'
350 include 'COMMON.NAMES'
351 include 'COMMON.CHAIN'
352 include 'COMMON.FFIELD'
353 include 'COMMON.SBRIDGE'
354 C Read bridging residues.
355 read (inp,*) ns,(iss(i),i=1,ns)
357 write (iout,*) 'ns=',ns,' iss:',(iss(i),i=1,ns)
358 C Check whether the specified bridging residues are cystines.
360 if (itype(iss(i)).ne.1) then
361 write (iout,'(2a,i3,a)')
362 & 'Do you REALLY think that the residue ',
363 & restyp(itype(iss(i))),i,
364 & ' can form a disulfide bridge?!!!'
365 write (*,'(2a,i3,a)')
366 & 'Do you REALLY think that the residue ',
367 & restyp(itype(iss(i))),i,
368 & ' can form a disulfide bridge?!!!'
372 C Read preformed bridges.
374 read (inp,*) nss,(ihpb(i),jhpb(i),i=1,nss)
375 write (iout,*) 'nss=',nss,' ihpb,jhpb: ',(ihpb(i),jhpb(i),i=1,nss)
378 C Check if the residues involved in bridges are in the specified list of
382 if (ihpb(i).eq.ihpb(j).or.ihpb(i).eq.jhpb(j)
383 & .or.jhpb(i).eq.ihpb(j).or.jhpb(i).eq.jhpb(j)) then
384 write (iout,'(a,i3,a)') 'Disulfide pair',i,
385 & ' contains residues present in other pairs.'
386 write (*,'(a,i3,a)') 'Disulfide pair',i,
387 & ' contains residues present in other pairs.'
392 if (ihpb(i).eq.iss(j)) goto 10
394 write (iout,'(a,i3,a)') 'Pair',i,' contains unknown cystine.'
397 if (jhpb(i).eq.iss(j)) goto 20
399 write (iout,'(a,i3,a)') 'Pair',i,' contains unknown cystine.'
412 c------------------------------------------------------------------------------
413 subroutine read_angles(kanal,iscor,energ,iprot,*)
414 implicit real*8 (a-h,o-z)
416 include 'DIMENSIONS.ZSCOPT'
417 include 'COMMON.INTERACT'
418 include 'COMMON.SBRIDGE'
421 include 'COMMON.CHAIN'
422 include 'COMMON.IOUNITS'
424 read(kanal,'(a80)',end=10,err=10) lineh
425 read(lineh(:5),*,err=8) ic
426 read(lineh(6:),*,err=8) energ
429 print *,'error, assuming e=1d10',lineh
433 read(lineh(18:),*,end=10,err=10) nss
435 read (lineh(20:),*,end=10,err=10)
436 & (IHPB(I),JHPB(I),I=1,NSS),iscor
438 read (lineh(20:),*,end=10,err=10) (IHPB(I),JHPB(I),I=1,8)
439 read (kanal,*,end=10,err=10) (IHPB(I),JHPB(I),
442 c print *,"energy",energ," iscor",iscor
443 read (kanal,*,err=10,end=10) (theta(i),i=3,nres)
444 read (kanal,*,err=10,end=10) (phi(i),i=4,nres)
445 read (kanal,*,err=10,end=10) (alph(i),i=2,nres-1)
446 read (kanal,*,err=10,end=10) (omeg(i),i=2,nres-1)
448 theta(i)=deg2rad*theta(i)
449 phi(i)=deg2rad*phi(i)
450 alph(i)=deg2rad*alph(i)
451 omeg(i)=deg2rad*omeg(i)
456 c-------------------------------------------------------------------------------
457 subroutine read_saxs_constr
458 implicit real*8 (a-h,o-z)
460 include 'DIMENSIONS.ZSCOPT'
461 include 'DIMENSIONS.FREE'
465 include 'COMMON.CONTROL'
466 include 'COMMON.CHAIN'
467 include 'COMMON.IOUNITS'
468 include 'COMMON.SBRIDGE'
469 double precision cm(3)
471 write (iout,*) "Calling read_saxs nsaxs",nsaxs
473 if (saxs_mode.eq.0) then
474 c SAXS distance distribution
476 read(inp,*) distsaxs(i),Psaxs(i)
480 Cnorm = Cnorm + Psaxs(i)
482 write (iout,*) "Cnorm",Cnorm
484 Psaxs(i)=Psaxs(i)/Cnorm
486 write (iout,*) "Normalized distance distribution from SAXS"
488 write (iout,'(f8.2,e15.5)') distsaxs(i),Psaxs(i)
492 Wsaxs0=Wsaxs0-Psaxs(i)*dlog(Psaxs(i))
494 write (iout,*) "Wsaxs0",Wsaxs0
498 read (inp,'(30x,3f8.3)') (Csaxs(j,i),j=1,3)
505 cm(j)=cm(j)+Csaxs(j,i)
513 Csaxs(j,i)=Csaxs(j,i)-cm(j)
516 write (iout,*) "SAXS sphere coordinates"
518 write (iout,'(i5,3f10.5)') i,(Csaxs(j,i),j=1,3)