! Module file: printcoordinates ! ! CNS module ! ********** ! ! Authors: Piet Gros and Axel T. Brunger ! ! copyright Yale University ! ! Function: ! Print coordinates, B-factor and/or Q-factor for selected atoms. ! ! Requirements: ! 1. This module has to be called from the main level. ! Remarks: ! 1. This module becomes slow when many atoms are selected ! module {printcoordinates} ( &text=""; {identifying text} &sel=(all); {atom selection} &anomalous_mode="fano"; {anomalous mode, "fano" or "deltaf"} &ref_wavelength=1; {reference wavelength} &ref_fp=0; {f' at reference wavelength} &output=OUTPUT; {output filename} ) checkversion 1.3 set display=&output end if (&text # "") then display PRINTCOORDINATES: &text end if for $1 in id (&sel) loop prtc show (x) (id $1) evaluate ($prtc_x=$result) show (y) (id $1) evaluate ($prtc_y=$result) show (z) (id $1) evaluate ($prtc_z=$result) show (q) (id $1) evaluate ($prtc_q=$result) show (b) (id $1) evaluate ($prtc_b=$result) show (scatter_fp) (id $1) evaluate ($prtc_fp=$result) show (scatter_fdp) (id $1) evaluate ($prtc_fdp=$result) show (segid) ( id $1) evaluate ($prtc_segid=$result) show (resid) ( id $1) evaluate ($prtc_resid=$result) show (name) ( id $1) evaluate ($prtc_name=$result) if ( &anomalous_mode = "deltaf" ) then show (chemical) (id $1) evaluate ($chem=$result) evaluate ($down_ref="TO-"+encode(&ref_wavelength)) show ave(scatter_fdp) (segid $down_ref and chemical $chem) evaluate ($ref_fdp=$result) evaluate ($prtc_fp=$prtc_fp+&ref_fp) show sum(1) (id $1 and segid TO-# ) if ( $result > 0 ) then evaluate ($down=true) else evaluate ($up=true) end if if ( $up = true ) then evaluate ($prtc_fdp=$prtc_fdp-($ref_fdp/2)) else evaluate ($prtc_fdp=($ref_fdp/2)-$prtc_fdp) end if end if display site: ($prtc_segid $prtc_resid $prtc_name) \ x,y,z= ( $prtc_x[F9.2] $prtc_y[F9.2] $prtc_z[F9.2] ) \ q= $prtc_q[F9.2] b=$prtc_b[F9.2] fp=$prtc_fp[F9.2] fdp=$prtc_fdp[F9.2] end loop prtc set display=OUTPUT end