From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Jun 25 2010 - 13:51:18 CDT

Hi,
  Which tutorial were you working through when you ran into the problem
you described below? If you can tell me which one you were working through,
we should be able to try and reproduce the problem you encountered by running
through the same steps you did. In order to help you, we'd need all of the
scripts/files you were using.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Jun 17, 2010 at 10:10:52AM -0400, Michael LeVine wrote:
> Hi,
> I'm solvating a protein into a water sphere using the script supplied in
> the tutorial. The script can only run until it has made the combined
> files, and then gets this error:
> invalid command name "HIS"
> ERROR: failed while building segment
> MOLECULE DESTROYED BY FATAL ERROR! Use resetpsf to start over.
> In my psfgen script I aliases HIS as HSE. Do I need to add this into the
> water sphere script somewhere? Here is the script:
> ### Script to immerse ubiquitin in a sphere of water just large enough
> ### to cover it
> set molname NAME
> mol new ${molname}.psf
> mol addfile ${molname}.pdb
> ### Determine the center of mass of the molecule and store the coordinates
> set cen [measure center [atomselect top all] weight mass]
> set x1 [lindex $cen 0]
> set y1 [lindex $cen 1]
> set z1 [lindex $cen 2]
> set max 0
> ### Determine the distance of the farthest atom from the center of mass
> foreach atom [[atomselect top all] get index] {
> set pos [lindex [[atomselect top "index $atom"] get {x y z}] 0]
> set x2 [lindex $pos 0]
> set y2 [lindex $pos 1]
> set z2 [lindex $pos 2]
> set dist [expr pow(($x2-$x1)*($x2-$x1) + ($y2-$y1)*($y2-$y1) +
> ($z2-$z1)*($z2-$z1),0.5)]
> if {$dist > $max} {set max $dist}
> }
> mol delete top
> ### Solvate the molecule in a water box with enough padding (15 A).
> ### One could alternatively align the molecule such that the vector
> ### from the center of mass to the farthest atom is aligned with an axis,
> ### and then use no padding
> package require solvate
> solvate ${molname}.psf ${molname}.pdb -t 15 -o del_water
> resetpsf
> package require psfgen
> mol new del_water.psf
> mol addfile del_water.pdb
> readpsf del_water.psf
> coordpdb del_water.pdb
> ### Determine which water molecules need to be deleted and use a for loop
> ### to delete them
> set wat [atomselect top "same residue as {water and ((x-$x1)*(x-$x1) +
> (y-$y1)*(y-$y1) + (z-$z1)*(z-$z1))<($max*$max)}"]
> set del [atomselect top "water and not same residue as {water and
> ((x-$x1)*(x-$x1) + (y-$y1)*(y-$y1) + (z-$z1)*(z-$z1))<($max*$max)}"]
> set seg [$del get segid]
> set res [$del get resid]
> set name [$del get name]
> for {set i 0} {$i < [llength $seg]} {incr i} {
> delatom [lindex $seg $i] [lindex $res $i] [lindex $name $i]
> }
> writepsf ${molname}_ws.psf
> writepdb ${molname}_ws.pdb
> mol delete top
> mol new ${molname}_ws.psf
> mol addfile ${molname}_ws.pdb
> puts "CENTER OF MASS OF SPHERE IS: [measure center [atomselect top all]
> weight mass]"
> puts "RADIUS OF SPHERE IS: $max"
> mol delete top
> Is the problem somewhere in the step where it deletes the waters? In VMD,
> I got a PDB file with the protein hanging out a water box. Hopefully you
> can help, thanks!
> Mike

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078