setuptruncatedoctahedron.str

Joined: Sep 2003
Posts: 4,762
Forum Member

OP
Forum Member
Joined: Sep 2003
Posts: 4,762 
*FILENAME: setuptruncatedoctahedron.str
*PURPOSE: setup truncated octahedron system
*AUTHOR: Lennart Nilsson, Karolinska Institutet, October 2003; overhauled January 2005
*
!RESULTS:
! Sets up crystal, defines basic image centering, which may have to be adjusted for production use
! Deletes all residues with at least one nonhydrogen 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
!ASSUMPTIONS:
! 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 nonsolvent (will not be subject to image centering)
! Comparison coordinates and WCOMP are overwritten
!USAGE EXAMPLE:
!
!read rtf,para,psf,coor for solvated system according to assumption above
!set A 40
!define SOLUTE select .not. segid wat end
!stream setuptruncatedoctahedron.str
!! 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
return
Last edited by lennart; 01/20/05 10:28 AM.
Lennart Nilsson Karolinska Institutet Stockholm, Sweden



Re: setuptruncatedoctahedron.str

Joined: May 2004
Posts: 222
Forum Member

Forum Member
Joined: May 2004
Posts: 222 
I m not sure if this script is understood. Right before the small script component below, we have a ready protein in waterbox with multiple water segid e.g. WAT2, WAT5, etc.
BOX was set to 70.But when i run the component below, we have a final octahedral of about 18A. Parameter A was founded also to have a value of 18A. Most of my protein residues are and water molecules are lost.
Can someone enlighten me?
set A @BOX ! parameters required for setuptruncatedoctahedron.str stream $CHM_STREAM/setuptruncatedoctahedron.str calc ax = @A * sqrt (0.75) ! required for crystal facilities set b 109.4712206344907 ! same coor conv align symm @ax @ax @ax @b @b @b
! save coordinates and psf ! C write psf card name @FILEsolv.psf ! * @FILE with crystal waters solvated with TIP3 waters, setup from top_all22_prot ! * ! write coor card name @FILEsolv.crd ! * @FILE with crystal waters solvated with TIP3 ! * in rectangular box: @XSIZ x @YSIZ x @ZSIZ ! *
! save the PSF and coordinates for later use open write formatted unit 27 name @FILEsolv.psf write psf card unit 27 * with crystal waters solvated with TIP3 waters, par lipidprot 27 *
open unit 1 write card name @FILEsolv.pdb write coor pdb unit 1 * @FILE for viewing * in rectangular box: @XSIZ x @YSIZ x @ZSIZ *
! save size to file so we can reuse it write title name @FILEboxsize.str ** PBC box definition for @FILE simulation ** *set XSIZ @XSIZ *set YSIZ @YSIZ *set ZSIZ @ZSIZ *set A @A *return *
CHARMM 30b1 driven by
1/ Xeon (32 bits)
2/ Redhat 7.3 (32 bits) with a Quadricsmodified 2.4185 kernel
3/ Chuan, with 95% of the mentorship coming from great scientists frequenting this forum.
4/ Gracious support from the forum.



Re: setuptruncatedoctahedron.str

Joined: Sep 2003
Posts: 4,762
Forum Member

OP
Forum Member
Joined: Sep 2003
Posts: 4,762 
Curious. There is nothing in the original script that changes variable A. If you post the output produced by: set A @BOX stream $CHM_STREAM/setuptruncatedoctahedron.str
it may clarify matters.
Lennart Nilsson Karolinska Institutet Stockholm, Sweden



Re: setuptruncatedoctahedron.str

Joined: May 2004
Posts: 222
Forum Member

Forum Member
Joined: May 2004
Posts: 222 
CHARMM 30b1 driven by
1/ Xeon (32 bits)
2/ Redhat 7.3 (32 bits) with a Quadricsmodified 2.4185 kernel
3/ Chuan, with 95% of the mentorship coming from great scientists frequenting this forum.
4/ Gracious support from the forum.



Re: setuptruncatedoctahedron.str

Joined: Sep 2003
Posts: 4,762
Forum Member

OP
Forum Member
Joined: Sep 2003
Posts: 4,762 
I have replaced this script with a somewhat simpler version.
Lennart Nilsson Karolinska Institutet Stockholm, Sweden



Re: setuptruncatedoctahedron.str

Joined: May 2008
Posts: 7
Forum Member

Forum Member
Joined: May 2008
Posts: 7 
Hello! I am trying to understand the volume formula for the truncated octahedron which is according to http://mathworld.wolfram.com/TruncatedOctahedron.html V=8*sqrt(2)*a**3 where "a" is the length of an edge. The distance "b" between two quadratic faces is b=2*sqrt(2)*a also: V=b**3/2 The crystl.doc file says: Quote:
OCTAhedral  a = b = c, alpha = beta = gamma = 109.4712206344907 (a.k.a truncated octahedron) (example: 40.0 40.0 40.0 109.471220634 109.471220634 109.471220634 ) (volume = 4*sqrt(3))/9 * a**3 ) (truncated cube length = a * sqrt(4/3) ) (degrees of freedom = 1)
Here, the distance "b" between two quadratic faces, called truncated cube length in the doc, is b=a*sqrt(4/3) Also here: V=b**3/2
When charmm sets up a truncated octahedron from a cubic box it obviously rotates the whole system, ie. the atoms or does it rotate only the truncated octahedron within the cubic box leaving out the atoms and thus reduces the resulting edge length and volume? Thanks for any help.



Re: setuptruncatedoctahedron.str

Joined: Sep 2003
Posts: 8,425
Forum Member

Forum Member
Joined: Sep 2003
Posts: 8,425 
I'm not so sure that equating 'b' with the 'truncated cube length' is correct.
If you apply an OCTA lattice to a cube of water atoms, you'll likely get large energies; the user must arrange the atoms in the desired shape. The initial script in this post by Lennart (and a simplified followup) demonstrate one approach. I've found that one can also use a sphere of matching volume as a pathway (via minimization) to RHDO and OCTA lattices of water; there's an RHDO example here in the Script Archive.



Re: setuptruncatedoctahedron.str

Joined: May 2008
Posts: 7
Forum Member

Forum Member
Joined: May 2008
Posts: 7 
Mystery solved:
CHARMM formula for the volume of the trunc.cuboctahedron: V = 4*sqrt(3)/9 * a**3 'a' is the distance between two hexagonal faces and not as I initially thought the edge length.
'b' is the length between two quadratic faces (truncated cube length). b = a*sqrt(4/3.) 'a' can also be seen as a = b*sqrt(3) / 2 which is half of the space diagonal.
Unfortunately, I haven't found a proof for the CHARMM formula but numerical results are equal to results of V=8*sqrt(2)*a**3



Re: setuptruncatedoctahedron.str

Joined: Nov 2006
Posts: 15
Forum Member

Forum Member
Joined: Nov 2006
Posts: 15 
Hi,
We're been using this script to cut a truncated octahedron out from the sphere and are curious as to how the TO is orientated. When we look at it on the graphics there does not seem to be an obvious reason for the TO orientation. We expected either the center of a square faces or hexagonal face to be aligned with the Xaxis but it seems that no faces are actually aligned on any axes.
Is there a reason for the TO to have an orientation that does not have any obvious alignments to the Xaxes?
Jon




