- Timestamp:
- 11/19/09 11:29:41 (14 years ago)
- Branches:
- master
- Children:
- 38d77eb
- Parents:
- 6650a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bgs.f
r6650a56 r32289cd 2 2 ! Trial version implementing the semi-local conformational update 3 3 ! BGS (Biased Gaussian Steps). This file presently contains the 4 ! functions initlund, bgsposs and bgs. 4 ! functions initlund, bgsposs and bgs. 5 5 ! 6 6 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, … … 9 9 10 10 11 ! Checks if it is possible to perform a BGS update starting at the 11 ! Checks if it is possible to perform a BGS update starting at the 12 12 ! variable indexed ipos. Calls: none. 13 13 logical function bgsposs(ips) 14 14 include 'INCL.H' 15 15 include 'incl_lund.h' 16 integer jv, ips, iaa, nursvr, nnonfx, i 17 16 18 logical ians 17 19 … … 20 22 ians=.true. 21 23 ! print *,'evaluating bgs possibility for ',ips,nmvr(jv) 22 if (nmvr(jv).ne.'phi') then 24 if (nmvr(jv).ne.'phi') then 23 25 ! print *,'bgs not possible because variable name is ',nmvr(jv) 24 26 ians=.false. 25 else if (iaa.gt.(irsml2(mlvr(jv))-3)) then 27 else if (iaa.gt.(irsml2(mlvr(jv))-3)) then 26 28 ! print *,'bgs impossible, residue too close to end' 27 29 ! print *,'iaa = ',iaa,' end = ',irsml2(mlvr(jv)) 28 30 ians=.false. 29 else 30 nnonfx=0 31 else 32 nnonfx=0 31 33 do i=iaa,iaa+3 32 if (iphi(i).gt.0) then 34 if (iphi(i).gt.0) then 33 35 if (.not.fxvr(iphi(i))) then 34 36 nnonfx=nnonfx+1 35 37 endif 36 38 endif 37 if (.not.fxvr(ipsi(i))) then 39 if (.not.fxvr(ipsi(i))) then 38 40 nnonfx=nnonfx+1 39 41 endif … … 52 54 53 55 ! Biased Gaussian Steps. Implements a semi-local conformational update 54 ! which modifies the protein backbone locally in a certain range of 55 ! amino acids. The 'down-stream' parts of the molecule outside the 56 ! which modifies the protein backbone locally in a certain range of 57 ! amino acids. The 'down-stream' parts of the molecule outside the 56 58 ! region of update get small rigid body translations and rotations. 57 59 ! 58 ! Use the update sparingly. It is rather local, and is not of great 60 ! Use the update sparingly. It is rather local, and is not of great 59 61 ! value if we need big changes in the conformation. It is recommended 60 ! that this update be used to refine a structure around a low energy 62 ! that this update be used to refine a structure around a low energy 61 63 ! candidate structure. Even at low energies, if you always 62 ! perform BGS, the chances of coming out of that minimum are small. 63 ! So, there is a probability bgsprob, which decides whether BGS or the 64 ! normal single angle update is used. 64 ! perform BGS, the chances of coming out of that minimum are small. 65 ! So, there is a probability bgsprob, which decides whether BGS or the 66 ! normal single angle update is used. 65 67 ! 66 68 ! Calls: energy, dummy (function provided as argument), addang, (rand) … … 70 72 include 'INCL.H' 71 73 include 'incl_lund.h' 74 double precision grnd, xiv, bv, ab, rv, dv, a, sum, p, r1, r2 75 double precision ppsi, wfw, addang, enw, energy, wbw, rd, delta 76 double precision dummy, eol1 77 78 integer ivar, i, nph, jv, ia, nursvr, icurraa, j, k, l 79 72 80 external dummy 73 81 dimension xiv(8,3),bv(8,3),rv(3,3),dv(3,8,3) … … 76 84 ! Initialize 77 85 ! print *,'using BGS on angle ',nmvr(idvr(ivar)) 78 if (bgsnvar.eq.0) then 86 if (bgsnvar.eq.0) then 79 87 bgs=0 80 88 goto 171 … … 91 99 do i=1,4 92 100 icurraa=ia+i-1 93 if (iphi(icurraa).gt.0.and..not.fxvr(iphi(icurraa))) then 101 if (iphi(icurraa).gt.0.and..not.fxvr(iphi(icurraa))) then 94 102 nph=nph+1 95 103 xiv(nph,1)=xat(iCa(icurraa)) … … 102 110 & +bv(nph,3)*bv(nph,3) 103 111 iph(nph)=iphi(icurraa) 104 endif 112 endif 105 113 if (.not.fxvr(ipsi(icurraa))) then 106 114 nph=nph+1 … … 136 144 enddo 137 145 enddo 138 do i=1,nph 146 do i=1,nph 139 147 do j=i,nph 140 148 A(i,j)=0 … … 157 165 sum=sum-A(i,k)*A(j,k) 158 166 enddo 159 if (i.eq.j) then 160 p(i)=sqrt(sum) 161 else 167 if (i.eq.j) then 168 p(i)=sqrt(sum) 169 else 162 170 A(j,i)=sum/p(i) 163 171 endif … … 177 185 dph(i)=0 178 186 enddo 179 ! Solve lower triangular matrix to get dphi proposals 187 ! Solve lower triangular matrix to get dphi proposals 180 188 do i=nph,1,-1 181 189 sum=ppsi(i) … … 190 198 do i=1,nph 191 199 sum=sum+ppsi(i)*ppsi(i) 192 enddo 200 enddo 193 201 wfw=exp(-sum) 194 202 do i=1,nph … … 208 216 do i=1,4 209 217 icurraa=ia+i-1 210 if (iphi(icurraa).gt.0.and..not.fxvr(iphi(icurraa))) then 218 if (iphi(icurraa).gt.0.and..not.fxvr(iphi(icurraa))) then 211 219 nph=nph+1 212 220 xiv(nph,1)=xat(iCa(icurraa)) … … 219 227 & +bv(nph,3)*bv(nph,3) 220 228 iph(nph)=iphi(icurraa) 221 endif 222 if (.not.fxvr(ipsi(icurraa))) then 229 endif 230 if (.not.fxvr(ipsi(icurraa))) then 223 231 nph=nph+1 224 232 xiv(nph,1)=xat(iC(icurraa)) … … 253 261 enddo 254 262 enddo 255 do i=1,nph 263 do i=1,nph 256 264 do j=i,nph 257 265 A(i,j)=0 … … 262 270 enddo 263 271 A(i,j)=bbgs*A(i,j) 264 if (i.eq.j) then 272 if (i.eq.j) then 265 273 A(i,j)=A(i,j)+1 266 274 endif … … 274 282 sum=sum-A(i,k)*A(j,k) 275 283 enddo 276 if (i.eq.j) then 277 p(i)=sqrt(sum) 278 else 284 if (i.eq.j) then 285 p(i)=sqrt(sum) 286 else 279 287 A(j,i)=sum/p(i) 280 288 endif … … 285 293 do j=i+1,nph 286 294 ppsi(i)=ppsi(i)+A(j,i)*dph(j) 287 enddo 295 enddo 288 296 enddo 289 297 sum=0 … … 291 299 sum=sum+ppsi(i)*ppsi(i) 292 300 enddo 293 wbw=exp(-sum) 301 wbw=exp(-sum) 294 302 do i=1,nph 295 303 wbw=wbw*p(i) … … 306 314 ! call outpdb(0,'after.pdb') 307 315 ! print *,'after outpdb for after.pdb' 308 ! do i=1,nph 316 ! do i=1,nph 309 317 ! print *,'BGS>',i,iph(i),vlvr(iph(i)),dph(i) 310 318 ! enddo 311 if (rd.ge.delta) then 319 if (rd.ge.delta) then 312 320 ! accept 313 321 eol1=enw 314 322 bgs=1 315 323 ! print *,'BGS move accepted' 316 else 324 else 317 325 ! reject 318 326 vlvr = ovr
Note:
See TracChangeset
for help on using the changeset viewer.