# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: redac - CYANA macro ## ## Parameters: name= (required) ## schedule= (default: 0.4,0.0,0.0) ## structures= (default: 50) ## steps= (default: 150,400,800) ## minimizer= (default: vtfmin) ## ## Performs REDAC cycles (Guntert & Wuthrich, 1991) with n structures ## according to the given schedule. Overview and angle files of every cycle ## are written to the files "name*.ovw" and "name*.ang" where the asterisk is ## replaced by "a", "b", "c" etc. for successive cycles. The schedule is a ## comma-separated list of ang_cut values that will be used to generate ## redundant dihedral angle restraints. Structures are calculated using the ## given macro for minimization. This macro must accept the same parameters ## as the standard variable target function minimization macro, vtfmin. A ## zero or negative ang_cut value means that no redundant angle restraints ## will be generated in this cycle. The next cycle will therefore use the ## original angle restraints to minimize the current structures on the last ## level during N3 iterations. Otherwise, i.e. if ang_cut was positive in the ## previous cycle, structures will be calculated using N1 and N2 minimization ## steps at intermediate levels and at the final level, respectively. ## ## redac er2 schedule=1.0,1.0,0.4,0.0,0.0 50 ## In the first cycle, 50 structures are calculated with the original ## restraints and angle restraints are generated with ang_cut = 1.0. After ## this, new structures are calculated three times using the previously ## generated restraints. No new angle restraints are generated the third ## time. Finally, the structures are minimized on the last level. In this ## cycle too, no angle restraints are generated. var r iter mr nam str cycle cycles syntax $macro:name=* schedule=*=0.4,0.0,0.0 structures=0<@i=50 \ steps=*=150,400,800 minimizer=*=vtfmin steps(1)=$steps(1) steps(2)=$steps(2) steps(3)=$steps(3) cycles=length('schedule') if (master) then if (cycles.le.1) error "REDAC schedule must contain more than one entry." angstat clear write aco cyana$getpid.aco print " ----------------------------------" print " REDAC schedule used:" print " ----------------------------------" print " cyc levels ang_cut restraints" print " ----------------------------------" str:=$schedule(1) mr=rnum(nr)-rnum(1) print " a 1-$mr $str(F5.1) original" do r 2 $cycles cycle=char(ichar('a')+r-1) str=$schedule(r); str:='$str(F5.1)' if (schedule(r).le.0.0) str:=' ---' if (schedule(r-1).gt.0.0) then print " $cycle 1-$mr $str redac" else print " $cycle $mr $str original" end if end do print " ----------------------------------" end if synchronize random_all $structures iter:=$steps(1),$steps(2) do r 1 $cycles # Loop over REDAC cycles cycle=char(ichar('a')+r-1) print " ----------------------------------" print " REDAC cycle $cycle" print " ----------------------------------" nam:={$name}$cycle calc_all command=$minimizer steps=$iter overview $nam range=- ang if (schedule(r).gt.0.0) then if (master) then angstat clear ang_cut=schedule(r) forall "$minimizer tf; angstat make" write aco $nam.aco redac end if synchronize read aco $nam.aco iter:=$steps(1),$steps(2) else read aco cyana$getpid.aco # Read original .aco file read ang $nam.ang iter:=0,$steps(3) end if end do if (master) remove cyana$getpid.aco