From: Brian Radak (brian.radak.accts_at_gmail.com)
Date: Thu Jan 29 2015 - 14:04:08 CST

Sorry, I should have jumped ahead in my Tcl tutorial rather than sticking
on my gmail tab. Hopefully I will have more intelligent questions in the
future.

Thanks for everyone's help!
Brian

On Thu, Jan 29, 2015 at 1:56 PM, Axel Kohlmeyer <akohlmey_at_gmail.com> wrote:

> On Thu, Jan 29, 2015 at 2:49 PM, Brian Radak
> <brian.radak.accts_at_gmail.com> wrote:
> > Thank you for the replies.
> >
> > That gets me closer I think. The following changes to the middle portion:
> >
> > set cb [atomselect top "segid PROT and resid 2 and name CB"]
> > set cbx [lindex 0 [$cb get {x y z}]]
> > coord PROT 2 CB1 $cbx
> >
> > give me the following new error:
> >
> > bad index "5.249566555023193 5.02329158782959 -0.4891093969345093": must
> be
> > integer?[+-]integer? or end?[+-]integer?
> > can't read "cbx": no such variable
> >
> > It is still hard to tell where this error is coming from (I'm more
> > accustomed to Python tracebacks),
>
> it is coming from you trusting me getting the syntax right from memory. ;-)
>
> if you (or me) had checked the lindex syntax we both would have seen
> that the order of the arguments in the lindex command is the other way
> around. i.e.:
>
> > set cbx [lindex [$cb get {x y z}] 0]
>
> JC got it right.
>
> axel
>
> >
> > Brian
> >
> >
> >
> >
> > On Thu, Jan 29, 2015 at 1:33 PM, Axel Kohlmeyer <akohlmey_at_gmail.com>
> wrote:
> >>
> >> On Thu, Jan 29, 2015 at 1:30 PM, Brian Radak
> >> <brian.radak.accts_at_gmail.com> 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.
> >>
> >> that is most likely because an atomselect function returns not just a
> >> simple {x y z} coordinate tuple, but a list of those, one for each
> >> atom in the selection. so what you get is not a list, but a list of
> >> lists, i.e. { {x y z} }.
> >>
> >> the simplest way to get rid of the additional braces would be to use:
> >>
> >> set cbx [lindex 0 [$cb get {x y z}]]
> >>
> >>
> >> axel.
> >> >
> >> > 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
> >>
> >>
> >>
> >> --
> >> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
> >> College of Science & Technology, Temple University, Philadelphia PA, USA
> >> International Centre for Theoretical Physics, Trieste. Italy.
> >
> >
> >
> >
> > --
> > 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
>
>
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
> College of Science & Technology, Temple University, Philadelphia PA, USA
> International Centre for Theoretical Physics, Trieste. Italy.
>

-- 
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