From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Jan 25 2008 - 00:12:56 CST

Hi Vlad,
  VMD doesn't preserve the original PDB index strings at all, they
are discarded already within the PDB reader plugin before the structure
data enters VMD itself. VMD only uses an internal numbering mechanism
for atoms which can be accessed either by zero-based indexing
(e.g. "index" keyword) or 1-based indexing ("serial" keyword).
In the case of residue IDs, if you use the keyword "resid" you should
get the residue ID contained in the original PDB file, though it will
not attempt to parse this as a hexadecimal number, which might give you
some weird results. If you send me an example PDB file that's formatted
in the way you describe, along with a selection you want to make, I can
see if there's an easy workaround I can suggest, but the root of the
problem here is that the PDB format has inherent limitations, and its
difficult to develop a reader that accepts both legal and a number
of "illegal" variations of the format with the same code. You might find
it easier to hack the PDB plugin so it parses your unusual files the
way you want it to and load your modified version as "pdbhex" or
some other name that doesn't conflict with the existing plugin.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Jan 24, 2008 at 11:44:40AM +0100, Vlad Cojocaru wrote:
> Dear VMD users,
>
> I have a pdb structure with a periodic box created by VMD from an amber
> topology and coordinates. The waters after 9999 are numbered with
> hexadecimal numbers ...
>
> Now I run the following ....
>
> mol new orig.pdb type pdb
> set sel [atomselect 0 "same residue as {resname WAT and within 4 of
> resid 411 423}"]
> $sel writepdb test.pdb
>
> Is there a way to make VMD preserve either the atom index or the
> hexadecimal residue number from the orig.pdb to the test.pdb files ?
>
> Thanks a lot for answering
>
> Vlad
>
> P.S. The three lines script is just an example .. the file test.pdb
> contains a much larger number of ATOMs than suggested by this example ...
>
> --
> ----------------------------------------------------------------------------
> Dr. Vlad Cojocaru
>
> EML Research gGmbH
> Schloss-Wolfsbrunnenweg 33
> 69118 Heidelberg
>
> Tel: ++49-6221-533266
> Fax: ++49-6221-533298
>
> e-mail:Vlad.Cojocaru[at]eml-r.villa-bosch.de
>
> http://projects.villa-bosch.de/mcm/people/cojocaru/
>
> ----------------------------------------------------------------------------
> EML Research gGmbH
> Amtgericht Mannheim / HRB 337446
> Managing Partner: Dr. h.c. Klaus Tschira
> Scientific and Managing Director: Prof. Dr.-Ing. Andreas Reuter
> http://www.eml-r.org
> ----------------------------------------------------------------------------
>

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