From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Thu Jan 29 2015 - 13:42:33 CST

Hi Brian,

Here is an example I pulled from a script I wrote:
coord P 1 CA [list 1.500 0.000 0.000]

So I think your syntax is fine. However I think you got tripped up on
something silly get {x y z} does. It wraps the output in an extra list!
Check it for yourself by printing llength $cbx. You'll get 1, not 3 like
you were expecting. The answer in this case is to use lindex $cbx 0 in
place of $cbx, which has the correct length. I know, its dumb, but I'm
sure there is a good reason for it.

-Josh Vermaas

On 01/29/2015 12:30 PM, Brian Radak wrote:
> Hello,
>
> I'm using vmd to call psfgen in order to patch a solvated structure
> and create duplicate "dummy" atoms. I'd like psfgen to build the new
> atoms in accord with patch's IC table and
> without changing the existing ones. As such, I believe it should
> suffice to "seed" the psfgen guesscoord command by explicitly setting
> a few atoms in the chain as direct copies of existing atoms (these
> will be non-interacting, so it is not a problem).
>
> My script looks something like this:
>
> # load psfgen and load psf and coordinates into psfgen and vmd (these
> must be separate?)
> package require psfgen
> <load topology files with patch, etc.>
> readpsf ...
> mol load psf ..
>
> # apply the patch (which adds new atoms) and regenerate
> bond/angle/dihedral terms
> patch ...
> regenerate angles dihedrals
>
> # "seed" the ic build by copying the atom CB to its copy CB1
> set cb [atomselect top "segid PROT and resid 2 and name CB"]
> set cbx [$cb get {x y z}]
> coord PROT 2 CB1 $cbx # <-- PROBLEM HAPPENS HERE
>
> guesscoord
> writepsf ..
> writepdb ...
>
> however I seem to be missing something as to how Tcl and/or psfgen
> take the coordinate values. The psfgen coord command keeps giving a
> standard usage error:
>
> arguments: segid resid atomname { x y z }
> MOLECULE DESTROYED BY FATAL ERROR! Use resetpsf to start over
>
> I've tried a number of ways of reformatting the coordinates with puts
> or expr or [], but I can't even tell what vmd/tcl /thinks/ I am giving it.
>
> Any help much appreciated,
> Brian
>
> --
> Brian Radak
> Postdoctoral Scholar
> University of Chicago
> Department of Biochemistry & Molecular Biology
> Gordon Center for Integrative Science, W323A
> 929 E. 57th St.
> Chicago, IL 60637-1454
> Tel: 773/834-2812
> e-mail: radak_at_uchicago.edu <mailto:radak_at_uchicago.edu>