Well, it certainly could be done by a custom Python script, e.g.:
from chimera import openModels, Molecule, selection
sel_atoms = []
for m in openModels.list(modelTypes=[Molecule]):
for a in m.atoms:
x, y, z = a.coord().data()
if x0 <= x <= x1 and y0 <= y <= y1 and z0 <= z <= z1:
sel_atoms.append(a)
selection.setCurrent(sel_atoms)
This selection is working on the original coordinates, i.e. as provided by the input source. If you want to include rotations/translations that occurred in Chimera, you would use the .xformCoord() method instead of the .coord() method.
But perhaps if you described why you need to select atoms within a certain Cartesian box, we could provide better help.
—Eric
Eric Pettersen
UCSF Computer Graphics Lab
Hi Chimera Developers,
This is Dengpan, one of chimera users. I have a question about how to select atoms within a region? For example, I I want to select atoms within a rectangular region
x0 to x1,
y0 to y1,
z0 to z1.
Could you please give me a hint how to do it? Thanks.
Dengpan Dong
--
Department of Materials Science and Engineering,
University of Utah
_______________________________________________
Chimera-users mailing list:
Chimera-users@cgl.ucsf.eduManage subscription:
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users