============================================================
          |                                                          |
          |            Crystallography & NMR System (CNS)            |
          |                         CNSsolve                         |
          |                                                          |
          ============================================================
           Version: 1.1
           Status: General release
          ============================================================
           Written by: A.T.Brunger, P.D.Adams, G.M.Clore, W.L.DeLano,
                       P.Gros, R.W.Grosse-Kunstleve, J.-S.Jiang,
                       J.Kuszewski, M.Nilges, N.S.Pannu, R.J.Read,
                       L.M.Rice, T.Simonson, G.L.Warren.
           Copyright (c) 1997-2001 Yale University
          ============================================================
           Running on machine: sharptail.lbl.gov (Linux,32-bit)
           Program started by: phzwart
           Program started at: 23:11:22 on  9-Jul-06
          ============================================================

 FFT3C: Using FFTPACK4.1

 CNSsolve>{+ file: make_cv_twin.inp +} 
 CNSsolve>{+ directory: xtal_twin +} 
 CNSsolve>{+ description: Setup test array for cross-validation (free R) using a 
 CNSsolve>                random selection data with hemihedral twinning  +} 
 CNSsolve>{+ comment: 
 CNSsolve>            This script MUST be used for refinement of twinned structures. 
 CNSsolve>            Friedel mates are conserved for anomalous data. 
 CNSsolve>            The test set array can also be extended if it already 
 CNSsolve>            exists in the data set.  In this case, a resolution range 
 CNSsolve>            or selection should be specified for the generation of 
 CNSsolve>            the test set. +} 
 CNSsolve>{+ authors: Axel T. Brunger and Paul D. Adams +} 
 CNSsolve>{+ copyright: Yale University +} 
 CNSsolve> 
 CNSsolve>{+ reference: A.T. Brunger, The Free R Value: a Novel Statistical 
 CNSsolve>              Quantity for Assessing the Accuracy of Crystal Structures, 
 CNSsolve>              Nature 355, 472-474 (1992) +} 
 CNSsolve> 
 CNSsolve>{- Guidelines for using this file: 
 CNSsolve>   - all strings must be quoted by double-quotes 
 CNSsolve>   - logical variables (true/false) are not quoted 
 CNSsolve>   - do not remove any evaluate statements from the file -} 
 CNSsolve> 
 CNSsolve>{- begin block parameter definition -} define( 
 DEFINE> 
 DEFINE>{====================== crystallographic data ========================} 
 DEFINE> 
 DEFINE>{* space group *} 
 DEFINE>{* use International Table conventions with subscripts substituted 
 DEFINE>   by parenthesis *} 
 DEFINE>{===>} sg="P2(1)"; 
 DEFINE> 
 DEFINE>{* unit cell parameters in Angstroms and degrees *} 
 DEFINE>{+ table: rows=1 "cell" cols=6 "a" "b" "c" "alpha" "beta" "gamma" +} 
 DEFINE>{===>} a=34.99; 
 DEFINE>{===>} b=46.89; 
 DEFINE>{===>} c=35.02; 
 DEFINE>{===>} alpha=90; 
 DEFINE>{===>} beta=103.94; 
 DEFINE>{===>} gamma=90; 
 DEFINE> 
 DEFINE>{* reciprocal space array containing test set for cross-validation *} 
 DEFINE>{* this array will be created if it does not already exist and 
 DEFINE>   defined for the selected reflections.  If it exists the 
 DEFINE>   test set will be (re)defined for the selected reflections. *} 
 DEFINE>{===>} test_set="test"; 
 DEFINE> 
 DEFINE>{* number for selection of test reflections: required *} 
 DEFINE>{* ie. reflections with the test set array equal to this number will be 
 DEFINE>       used for cross-validation, all other reflections form the working set *} 
 DEFINE>{===>} test_flag=1; 
 DEFINE> 
 DEFINE>{* reflection file - to which test set array will be added *} 
 DEFINE>{===>} reflection_infile="1ku5.cv"; 
 DEFINE> 
 DEFINE>{======================= twinning parameters =========================} 
 DEFINE> 
 DEFINE>{* twinning operation *} 
 DEFINE>{===>} twin_oper="-l,-k,-h"; 
 DEFINE> 
 DEFINE>{======================= test set generation ==========================} 
 DEFINE> 
 DEFINE>{* To generate a new test set, use the whole resolution range and 
 DEFINE>   select all reflections.  To extend a test array (e.g. to a higher 
 DEFINE>   resolution data set), use the xtal_util/merge.inp task file 
 DEFINE>   to merge the test set and the new diffraction data, and then use 
 DEFINE>   this task file to extend the test set. *} 
 DEFINE> 
 DEFINE>{* percentage of reflections to be used for TEST set - ie. 10% *} 
 DEFINE>{===>} percentage=10.0; 
 DEFINE> 
 DEFINE>{* Resolution limits for generation of test set *} 
 DEFINE>{* Normally, the full resolution range (or larger) of observed data 
 DEFINE>   should be used. Use a restricted set when extending an existing test 
 DEFINE>   array (e.g, to high resolution). *} 
 DEFINE>{+ table: rows=1 "resolution" cols=2 "lowest" "highest" +} 
 DEFINE>{===>} low_res=500.0; 
 DEFINE>{===>} high_res=1.0; 
 DEFINE> 
 DEFINE>{* Additional selection for generation of test set *} 
 DEFINE>{* Normally, select all reflections.  Specify this additional selection 
 DEFINE>   if the test set needs to be expanded for specific subset(s) of 
 DEFINE>   reflections. *} 
 DEFINE>{===>} ref_sel=(all); 
 DEFINE> 
 DEFINE>{=========================== output files ============================} 
 DEFINE> 
 DEFINE>{* output reflection file *} 
 DEFINE>{===>} reflection_outfile="make_cv_twin.cv"; 
 DEFINE> 
 DEFINE>{===========================================================================} 
 DEFINE>{        things below this line do not normally need to be changed          } 
 DEFINE>{===========================================================================} 
 DEFINE> 
 DEFINE> ) {- end block parameter definition -} 
 CNSsolve> 
 CNSsolve> checkversion 1.1 
 Program version= 1.1 File version= 1.1
 CNSsolve> 
 CNSsolve> evaluate ($log_level=quiet) 
 Assuming literal string "QUIET"
 EVALUATE: symbol $LOG_LEVEL set to "QUIET" (string)
 CNSsolve> 
 CNSsolve> xray 
 XRAY> 
 XRAY>   @CNS_XTALLIB:spacegroup.lib (sg=&sg;) 
 ASSFIL: file /net/cci/xp/cns_solve_1.1/libraries/xtal/spacegroup.lib opened.
 XRAY>! file  libraries/xtal/spacegroup.lib 
 XRAY>! library of symmetry operators for CNS 
 XRAY>! Automatically generated with SgInfo Version 2.00a13 
 XRAY> 
 XRAY>module 
 MODULE-DECLARATION>( 
 MODULE-DECLARATION>  &sg=$sg; 
 MODULE-DECLARATION>  &sgparam=$sgparam; 
 MODULE-DECLARATION>) 
 &_2_SG set to &_1_SG 
 XRAY> 
 XRAY>set message ? end 
 MESSage=NORM
 XRAY>evaluate ($message_old=$result) 
 EVALUATE: symbol $MESSAGE_OLD set to "NORM" (string)
 XRAY>set echo ? end 
 ECHO=TRUE {ON}
 XRAY>evaluate ($echo_old=$result) 
 EVALUATE: symbol $ECHO_OLD set to TRUE (logical)
 XRAY>set echo=off message=off end 
 Program version= 1.1 File version= 1.1
SYMMETRY: found symmetry operators for space group "P2(1)" in library
 XRAY> 
 XRAY> 
 XRAY>   a=&a b=&b c=&c  alpha=&alpha beta=&beta gamma=&gamma 
 XRAY> 
 XRAY>   reflection @&reflection_infile end 
 ASSFIL: file 1ku5.cv opened.
 REFLection>{ file: 1ku5.cns } 
 REFLection>{ Unit cell: 34.993 46.887 35.023 90 103.94 90 } 
 REFLection>{ Space group: "P 1 21 1" } 
 REFLection>{ source of data: ../1ku5_refine_001.mtz:FOBS,SIGFOBS } 
 REFLection>NREFlections=4895 
 XRAY: increasing space allocation for up to    4895 reflections.
 REFLection>ANOMalous=FALSe 
 REFLection>DECLare NAME=FOBS DOMAin=RECIprocal TYPE=REAL END 
 XDECLARE: Object FOBS has been declared.
 REFLection>DECLare NAME=SIGMA DOMAin=RECIprocal TYPE=REAL END 
 XDECLARE: Object SIGMA has been declared.
 REFLection>INDEx -15 0 2 FOBS= 25.7864 SIGMA= 6.87011 
 XSFAL: allocating space for real reciprocal space object.
 XSFAL: allocating space for real reciprocal space object.
 XRRR2:     4895 new h,k,l indices have been added.
 XRAY> 
 XRAY>   if (&test_flag=0) then 
 NEXTCD: condition evaluated as false
 XRAY>      evaluate ($work_flag=-1) 
 XRAY>   else 
 XRAY>      evaluate ($work_flag=0) 
 EVALUATE: symbol $WORK_FLAG set to    0.00000     (real)
 XRAY>   end if 
 XRAY> 
 XRAY>   set echo=off end 
 NEXTCD: condition evaluated as false
 Reciprocal space object TEST does not exist.
 NEXTCD: condition evaluated as true
 XDECLARE: Object TEST has been declared.
 XSFAL: allocating space for integer reciprocal space object.
 Total of      4895 structure factor elements were selected.
 XRAY> 
 XRAY>   declare name=twin_sel domain=reciprocal type=integer end 
 XDECLARE: Object TWIN_SEL has been declared.
 XRAY> 
 XRAY>   do ( twin_sel=0 ) (all) 
 XSFAL: allocating space for integer reciprocal space object.
 Total of      4895 structure factor elements were selected.
 XRAY>   do ( twin_sel=1 ) ( &low_res >= d >= &high_res and &ref_sel ) 
 Total of      4895 structure factor elements were selected.
 XRAY>   do ( twin_sel=min(twin_sel,abs(remap[&STRIP%twin_oper](twin_sel))) ) 
 DO>                         ( &low_res >= d >= &high_res and &ref_sel ) 
 Total of      4895 structure factor elements were selected.
 XRAY> 
 XRAY>   do ( &STRIP%test_set = $work_flag ) 
 DO>      ( &low_res >= d >= &high_res and &ref_sel ) 
 Total of      4895 structure factor elements were selected.
 XRAY> 
 XRAY>   anomalous ? 
 ANOMalous=FALSe {OFF}
 XRAY>   if ($result=FALSE) then 
 NEXTCD: condition evaluated as true
 XRAY>      do (&STRIP%test_set=&test_flag*int(random()+&percentage/200.)) 
 DO>             ( &low_res >= d >= &high_res and &ref_sel and twin_sel=1 ) 
 Total of      4838 structure factor elements were selected.
 XRAY>   else 
 XRAY>      {- make sure both Friedel mates are included for each test reflection -} 
 XRAY>      do (&STRIP%test_set=&test_flag*int(random()+&percentage/200.)) 
 XRAY>             ( centric  and &low_res >= d >= &high_res and &ref_sel and twin_sel=1 ) 
 XRAY>      do (&STRIP%test_set=&test_flag*int(random()+&percentage/400.)) 
 XRAY>             ( acentric and &low_res >= d >= &high_res and &ref_sel and twin_sel=1 ) 
 XRAY>      do (&STRIP%test_set=max(&STRIP%test_set,friedel(&STRIP%test_set))) 
 XRAY>             ( acentric and &low_res >= d >= &high_res and &ref_sel and twin_sel=1 ) 
 XRAY>   end if 
 XRAY> 
 XRAY>   {- make sure all twin related reflections are in the same set -} 
 XRAY>   do (&STRIP%test_set=max(&STRIP%test_set, 
 DO>                           abs(remap[&STRIP%twin_oper](&STRIP%test_set)))) 
 DO>          ( &low_res >= d >= &high_res and &ref_sel and twin_sel=1 ) 
 Total of      4838 structure factor elements were selected.
 XRAY> 
 XRAY>   undeclare name=twin_sel domain=reciprocal end 
 Object TWIN_SEL             has been undeclared.
 XRAY> 
 XRAY>   write reflection 
 WRITE>      output=&reflection_outfile 
 WRITE>   end 
 ASSFIL: file make_cv_twin.cv opened.
 XRAY> 
 XRAY> end 
 CNSsolve> 
 CNSsolve> stop 
          ============================================================
           Maximum dynamic memory allocation:     1189520 bytes
           Maximum dynamic memory overhead:           152 bytes
           Program started at: 23:11:22 on  9-Jul-06  
           Program stopped at: 23:11:23 on  9-Jul-06
           CPU time used:       0.5300 seconds
          ============================================================