! Module file: get_rweight ! ! CNS module ! ********** ! ! Authors: Axel T. Brunger and Paul Adams ! ! copyright Yale University ! ! Function: ! Calculate the weight for the restraint term in ! individual B-factor refinement ! ! Requirements: ! To be called from the main level of CNS ! Uses comparision coordinate set and also vx, vy, vz module {get_rweight} ( &selected=(all); &fixed=(none); &rweight; ) set message ? end evaluate ($message_old=$result) set echo ? end evaluate ($echo_old=$result) if ( $log_level = verbose ) then set echo=on message=normal end else set echo=off message=off end end if checkversion 1.3 show sum(1) (&selected and not (&fixed)) evaluate ($gw_atoms=$result) flags exclude xref end energy end do (vx=dx) (&selected and not (&fixed)) do (vy=dy) (&selected and not (&fixed)) do (vz=dz) (&selected and not (&fixed)) flags include xref end energy end do (dx=dx-vx) (&selected and not (&fixed)) do (dy=dy-vy) (&selected and not (&fixed)) do (dz=dz-vz) (&selected and not (&fixed)) show sum(dx^2 + dy^2 + dz^2) (&selected and not (&fixed)) evaluate ($gw_mean=$result/(3*$gw_atoms)) evaluate ($gw_xrmsf=sqrt($gw_mean)) {- here we use the empirical observation that rweight is approximately 1/100th of the X-ray gradient -} evaluate (&rweight=$gw_xrmsf/100) display get_rweight: optimal rweight= &rweight set message=$message_old echo=$echo_old end