From: JC Gumbart (
Date: Thu Jan 29 2015 - 13:06:04 CST

It’s seemingly counterintuitive at first but the list is nested within another one (because it could return more than one triplet). So use “lindex $cbx 0”.

On Jan 29, 2015, at 3: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: