From: BIN ZHANG (zhngbn_at_gmail.com)
Date: Wed Dec 24 2008 - 14:57:47 CST

Hi, Axel:

All I was trying to do is to generate a pdb file that has beta values
indicating the CG bead IDs of each atom. ( similar to the pdb ref file
in SBCG. http://www.ks.uiuc.edu/Research/vmd/plugins/cgtools/ )

Part of the pdb file would look like :
================================
ATOM 8432 HH21 ARG C 51 -20.634 15.396 16.541
0.001005.00 C H
ATOM 8433 HH22 ARG C 51 -20.973 16.254 18.005
0.001005.00 C H
ATOM 8434 C ARG C 51 -18.590 23.234 16.157
1.001004.00 C C
ATOM 8435 O ARG C 51 -17.968 24.157 16.689
1.001004.00 C O
ATOM 8436 N PHE C 52 -19.916 23.193 16.061
1.001006.00 C N
ATOM 8437 HN PHE C 52 -20.392 22.428 15.630
0.001006.00 C H
================================

I think now the problem comes from the floating point comparison
rather than the format itself. Because when I use :
set $sel [atomselect top "beta 1004"]
puts [$sel get beta]
I would get 1004, 1005, and 1006, which means these 3 numbers are not
distinguished anymore.

But the following trick gives what I want :
set $sel [atomselect top "beta > 1004-0.5 and beta < 1004 + 0.5"]

Does this make sense?

If this was true, I would expect SBCG also have similar problems,
because I didn't see any attention was paid to deal with this issue.

Thanks a lot.

Bin

On Dec 24, 2008, at 12:33 PM, Axel Kohlmeyer wrote:

> On Wed, 24 Dec 2008, BIN ZHANG wrote:
>
> BZ> Dear all:
>
> dear bin
>
> BZ> I was trying to use the PDB beta column for numbering, and found
> it
> BZ> problematic when the number was bigger than 1000.
>
> for numbering how? and what?
>
> BZ> Say if I do the following:
> BZ>
> BZ> set sel [atomselect top "resid 200"]
> BZ> $sel set beta 1002
> BZ> puts [$sel get index]
> BZ>
> BZ> set sel2 [atomselect top "beta 1002"]
> BZ> puts [$sel2 get index]
> BZ>
> BZ> these two index outputs won't be the same.
> BZ>
> BZ> I know this issue comes from the format "%6.2f", but not sure
> how to deal
> BZ> with it.
>
> there is no way around this in the pdb standard. you could check
> other formats. you can also store arbitrary numbers in the user
> field and save them in a separate file, if needed.
> the user field also has the advantage over beta, that it is a
> per timestep field, i.e. you can assign different numbers for
> each timestep.
>
> BZ> One way I can see would be divide the ID by 100 for writing, and
> modify it
> BZ> back while selecting. Is there any other easier way, like
> changing the
> BZ> format?
>
> there are already too many tools that write incorrectly formatted
> .pdb files. don't add another one. if you'd describe what you want
> to achieve, then there is probably a solution (and probably much
> easier than messing with pdb files, which i consider rather clumsy).
>
> cheers,
> axel.
>
> BZ>
> BZ> Thanks a lot.
> BZ>
> BZ> Bin
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ>
> BZ> -------------------------------------------------------------
> BZ> The tree of liberty must be refreshed from time to time with the
> blood of
> BZ> patriots and tyrants.
> BZ>
>
> --
> =
> ======================================================================
> Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://
> www.cmm.upenn.edu
> Center for Molecular Modeling -- University of Pennsylvania
> Department of Chemistry, 231 S.34th Street, Philadelphia, PA
> 19104-6323
> tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
> =
> ======================================================================
> If you make something idiot-proof, the universe creates a better
> idiot.

-------------------------------------------------------------
The tree of liberty must be refreshed from time to time with the blood
of patriots and tyrants.