*PURPOSE: setup truncated octahedron system
*AUTHOR: Lennart Nilsson, Karolinska Institutet, October 2003; overhauled January 2005
! Sets up crystal, defines basic image centering, which may have to be adjusted for production use
! Deletes all residues with at least one non-hydrogen atom outside the truncated octahedron.
! The truncated octahedron is centered at the origin and fits exactly in a cube with side A
!The same procedure can be used to generate any crystal - just change the crystal define command
! PSF and coordinates from a system at least as large as the truncated octahedron
! have to be present
! Coordinates should be centered at the origin
! One parameter is necessary: A, which is the sidelength of the cube in which the TO fits
! Selection SOLUTE should be defined as non-solvent (will not be subject to image centering)
! Comparison coordinates and WCOMP are overwritten
!read rtf,para,psf,coor for solvated system according to assumption above
!set A 40
!define SOLUTE select .not. segid wat end
!! then minimize and run eg CPT dynamics or just standard NVE
!shake bonh param
!dynamics start ....
!! for subsequent jobs the crystal and image centering have to be setup again
calc ax = @a * sqrt (0.75)
set b 109.4712206344907
!! Define the crystal.
crystal define octahedral @ax @ax @ax @b @b @b
crystal build cutoff 14.0
image byresidue select .not. SOLUTE end
! done with crystal and image centering definitions, now do the trimming of the system to
! fit in the desired primary shape.
coor copy comp
update cutim 14.0
! find and delete residues that have changed position,
! they are the ones that are outside the primary box
coor diff comp
coor dist comp weig
delete atom sele .byres. prop wcomp .gt. 0.0 end
Last edited by lennart; 01/20/05 10:28 AM.