From: Tim Isgro (timisgro_at_ks.uiuc.edu)
Date: Thu Feb 12 2004 - 13:58:28 CST

Thanks for the info, Andrew.

The weak type system makes some sense, but perhaps a VMD warning message
is in order if the string is not actually an integer (but 'residue' is
interpreting it as such).

Also, would "VP1", "VP2", and "VP3" be interpreted as integers 1, 2, and
3 by 'segname', or not as integers at all? If they were, it would be
advantageous.

Tim

On Thu, 12 Feb 2004, Andrew Dalke wrote:

> Tim Isgro:
> > Also, use 'resname' instead of 'residue'. VMD doesn't complain about
> > something like 'residue ASP', even though it should since 'residue'
> > arguments are numbers, not 3-letter codes. As far as I can tell
> > 'residue
> > xxx' simply selects the first residue in the protein chain, as opposed
> > to
> > spitting out an error message. This should be fixed.
>
> VMD numbers residues starting at 0, so 'residue 0' is the first residue
> it
> finds, 'residue 1' the second, etc. That's a numeric field assigned by
> Python and is different for each residue. It does not depend on anyone
> else's numbering system.
>
> The reason for the 'residue' property is so you can say
> "same residue as within 5 of name FE"
> which gives you all atoms within 5Å of any iron atom, as well as all
> the atoms covalently bound to those atoms which are in the same residue.
>
> The 'resname' is the residue name. You may have many ALA residues.
>
> The 'resid' is the residue identifier from the PDB file. This is an
> external
> numbering system. These numbers may make special sense to the user so
> VMD
> doesn't attempt to change them.
>
> VMD's atom selections use an automatic type conversion system taken from
> Perl. Strings are converted to integers when the field is an integer
> field.
> This means a string like "ALA" is converted into an integer. Since ALA
> isn't
> an integer, the value returned it, as I recall, 0. Since the residue
> with
> value 0 is the first one, it selects the first residue.
>
> I chose a weak type system because some fields should be interpreted as
> a
> string for some structures, and as integers for other structures. For
> example,
> a virus structure has many copies of the same protomers, and the
> segment names
> may be 1, 2, 3, 4 for the first copy, 5, 6, 7, 8 for the second, etc.
> Then I
> can turn on all copies of the first protomer with "segname % 4 == 1".
> On the
> other hand, in some cases the protomers may be labeled "VP1", "VP2",
> "VP3",
> etc., or there may be some segments which are numbered and others which
> have
> text.
>
> Historically yours,
>
> Andrew
> dalke_at_dalkescientific.com
>
>