[Chimera-users] Re: save selected atoms in a pdb file?

Elaine Meng meng at cgl.ucsf.edu
Thu Jan 8 10:42:01 PST 2004

Hi Sabuj,
You can make surfaces that surround a set of atoms without making a separate
PDB file.  For example, if you have those atoms selected already, just use
the command:
    surfcat mygroup sel
where "mygroup" could be whatever you choose to name this set of atoms and
"sel" means what is currently selected.  Then, the command
    surface mygroup
will show surface surrounding that group.  There are several ways you could
select the atoms of interest, and it sounds like you already figured out that
part; the following detailed example is just one possibility:
     open pdb:2gbp
     sel :glc z<4.5
     ~sel :glc
     ~sel solvent
     surfcat nearby sel
     surf nearby
Here I opened a glucose-binding protein structure, selected all residues
with any atom within 4.5 A of the ligand glucose (glc), then subtracted
glucose itself and waters from the selection.  Then I made the selected
atoms a surface category with "surfcat," unselected them, and showed
the corresponding surface.

If you really want to save the selection to a file, it can be done on
unix systems.  Chimera can send information on what atoms are displayed
to the system, and then the system command "cat" can send the
information to a file.  In Chimera, if the atoms of interest are selected:
     show sel
     pdbrun nouser cat > ~homedir/myfile.pdb
(where "homedir" is your username) saves the displayed atoms to a PDB
file named myfile.pdb in your home directory.  It is necessary to use
show (which undisplays everything else) since pdbrun includes all atoms
that are displayed.  The coordinates are transformed, so will be different
from the original coordinates if you have moved the view around.  If you
want the untransformed coords, use the "reset" command before the "pdbrun"
command. This process doesn't work on Windows as there is no cat command.

I hope this helps,
Elaine C. Meng, Ph.D.
Computer Graphics Lab and Babbitt Lab
meng at cgl.ucsf.edu

More information about the Chimera-users mailing list