{+ file: delta_phipsi.inp +} {+ directory: general +} {+ description: Calculate Phi/Psi difference between 2 structures +} {+ comment: calculates overall phi/psi difference between the structure and lists phi/psi difference as a function of residue number +} {+ authors: Axel T. Brunger, and Paul D. Adams +} {+ copyright: Yale University +} {- Guidelines for using this file: - all strings must be quoted by double-quotes - logical variables (true/false) are not quoted - do not remove any evaluate statements from the file -} {- begin block parameter definition -} define( {============================ coordinates ============================} {* coordinate file *} {===>} coordinate_infile="amy_anneal.pdb"; {* reference coordinate file *} {===>} comp_coordinate_infile="amy.pdb"; {==================== molecular information ==========================} {* topology files *} {===>} topology_infile_1="CNS_TOPPAR:protein.top"; {===>} topology_infile_2="CNS_TOPPAR:dna-rna.top"; {===>} topology_infile_3="CNS_TOPPAR:water.top"; {===>} topology_infile_4="CNS_TOPPAR:ion.top"; {===>} topology_infile_5="CNS_TOPPAR:carbohydrate.top"; {===>} topology_infile_6=""; {===>} topology_infile_7=""; {===>} topology_infile_8=""; {* linkage files for linear, continuous polymers (protein, DNA, RNA) *} {===>} link_infile_1="CNS_TOPPAR:protein.link"; {===>} link_infile_2="CNS_TOPPAR:dna-rna-pho.link"; {===>} link_infile_3=""; {* parameter files *} {===>} parameter_infile_1="CNS_TOPPAR:protein_rep.param"; {===>} parameter_infile_2="CNS_TOPPAR:dna-rna_rep.param"; {===>} parameter_infile_3="CNS_TOPPAR:water_rep.param"; {===>} parameter_infile_4="CNS_TOPPAR:ion.param"; {===>} parameter_infile_5="CNS_TOPPAR:carbohydrate.param"; {===>} parameter_infile_6=""; {===>} parameter_infile_7=""; {===>} parameter_infile_8=""; {* molecular topology file: optional (leave blank for auto generation) *} {* Auto generation of the molecular topology from the coordinates should only be used if: (1) Each distinct protein, DNA, or RNA chain must have a separate segid (or chainid if the chainid is non-blank). (2) Each contiguous protein, RNA, or RNA chain must not be disrupted by other types of residues or ligands. Rather, these other residues should be listed after protein, RNA/DNA chains. (3) Disulphides are automatically detected based on distances between the sulfur atoms (must be less than 3 A apart). (4) Broken protein/RNA/DNA chains without terminii must be more than 2.5 A apart to be recognized as such. (5) N-linked glycan links are automatically recognized if the bonded atoms are less than 2.5 A apart. (6) Automatic generation cannot be used with alternate conformations. For ligands, the user must make suitable topology and parameter files. For non-standard covalent linkages, the custom patch file should be used. Alternatively, the generate.inp or generate_easy.inp task files can be used to generated the mtf prior to running this task file. *} {===>} structure_infile="amy.mtf"; {* for auto generation: extra linkages and modifications by custom patches *} {===>} patch_infile=""; {========================== atom selection ===========================} {* select atoms to be included in calculation *} {===>} atom_select=(known and not hydrogen); {=========================== output files ============================} {* output listing file *} {===>} list_outfile="delta_phipsi.list"; {===========================================================================} { things below this line do not normally need to be changed } {===========================================================================} ) {- end block parameter definition -} checkversion 1.3 evaluate ($log_level=quiet) if ( $log_level = verbose ) then set message=normal echo=on end else set message=off echo=off end end if if ( &BLANK%structure_infile = true ) then {- read topology files -} topology evaluate ($counter=1) evaluate ($done=false) while ( $done = false ) loop read if ( &exist_topology_infile_$counter = true ) then if ( &BLANK%topology_infile_$counter = false ) then @@&topology_infile_$counter end if else evaluate ($done=true) end if evaluate ($counter=$counter+1) end loop read end @CNS_XTALMODULE:mtfautogenerate ( coordinate_infile=&coordinate_infile; convert=true; separate=true; atom_delete=(not known); hydrogen_flag=true; break_cutoff=2.5; disulphide_dist=3.0; carbo_dist=2.5; patch_infile=&patch_infile; O5_becomes="O"; ) else structure @&structure_infile end coordinates @&coordinate_infile end if {- read parameter files -} parameter evaluate ($counter=1) evaluate ($done=false) while ( $done = false ) loop read if ( &exist_parameter_infile_$counter = true ) then if ( &BLANK%parameter_infile_$counter = false ) then @@¶meter_infile_$counter end if else evaluate ($done=true) end if evaluate ($counter=$counter+1) end loop read end set message=normal echo=on end coordinates disp=comp @&comp_coordinate_infile set display=&list_outfile end display >>>> Phi/psi difference calculated between 2 structures: display >>>> main coordinate set= &STRIP%main_coordinate_infile display >>>> reference coordinate set= &STRIP%comp_coordinate_infile display display >>>> the difference is defined as: display >>>> difference = sqrt((phi_1 - phi_2)^2 + (psi_1 - psi_2)^2) display display segid resid delta phi/psi display set display=OUTPUT end evaluate ($overall_phipsi=0) evaluate ($nphipsi=0) for $id in id ( &atom_select and name ca ) loop dram show (segid) (id $id) evaluate ($segid=$result) show (resid) (id $id) evaluate ($resid=$result) evaluate ($phi1=-9999) evaluate ($psi1=-9999) evaluate ($phi2=-9999) evaluate ($psi2=-9999) identity (store1) (name c and bondedto (name n and resid $resid and segid $segid )) if ( $select = 1 ) then show element (store1) (attribute store1 > 0) evaluate ($id_prev=$result) show (segid) (id $id_prev) evaluate ($segid_prev=$result) show (resid) (id $id_prev) evaluate ($resid_prev=$result) pick dihedral (name c and segid $segid_prev and resid $resid_prev) (name n and segid $segid and resid $resid) (name ca and segid $segid and resid $resid) (name c and segid $segid and resid $resid) geometry evaluate ($phi1=mod($result+360,360)) coord swap end pick dihedral (name c and segid $segid_prev and resid $resid_prev) (name n and segid $segid and resid $resid) (name ca and segid $segid and resid $resid) (name c and segid $segid and resid $resid) geometry evaluate ($phi2=mod($result+360,360)) coord swap end end if identity (store1) (name n and bondedto (name c and resid $resid and segid $segid )) if ( $select = 1 ) then show element (store1) (attribute store1 > 0) evaluate ($id_next=$result) show (segid) (id $id_next) evaluate ($segid_next=$result) show (resid) (id $id_next) evaluate ($resid_next=$result) pick dihedral (name n and segid $segid and resid $resid) (name ca and segid $segid and resid $resid) (name c and segid $segid and resid $resid) (name n and segid $segid_next and resid $resid_next) geometry evaluate ($psi1=mod($result+360,360)) coord swap end pick dihedral (name n and segid $segid and resid $resid) (name ca and segid $segid and resid $resid) (name c and segid $segid and resid $resid) (name n and segid $segid_next and resid $resid_next) geometry evaluate ($psi2=mod($result+360,360)) coord swap end end if if ( $phi1 # -9999 ) then if ( $psi1 # -9999 ) then evaluate ($dphi=abs($phi1-$phi2)) if ( $dphi > 180 ) then evaluate ($dphi=360-$dphi) end if evaluate ($dpsi=abs($psi1-$psi2)) if ( $dpsi > 180 ) then evaluate ($dpsi=360-$dpsi) end if evaluate ($distance=sqrt($dphi^2 + $dpsi^2)) set display=&list_outfile end display $segid[a4] $resid[a4] $distance[f8.4] set display=OUTPUT end evaluate ($overall_phipsi=$overall_phipsi+$distance) evaluate ($nphipsi=$nphipsi+1) end if end if end loop dram evaluate ($overall_phipsi=$overall_phipsi/$nphipsi) set display=&list_outfile end display display >>>> overall difference= $overall_phipsi[f8.4] degrees display set display=OUTPUT end stop