[Chimera-users] metadata mrc files
Eric Pettersen
pett at cgl.ucsf.edu
Mon Jan 7 11:24:42 PST 2019
> On Jan 4, 2019, at 10:34 AM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
>
> I believe that group/ungroup models is only in the Model Panel. Undoubtedly it could be done with python, but someone else would have to help with that.
Indeed you need to use Python. In Python, assuming you had the models you wanted to group in a variable named “models”, it would be:
from ModelPanel import groupCmd
groupCmd(models, name=“group name”)
You can obtain a list of all open models from Chimera’s “openModels” variable, e.g.:
from chimera import openModels
allModels = openModels.list()
Every model has a ‘name’ attribute, and ‘id’ attribute containing the main model ID number and ‘subid’ containing the sub-ID number, if any. Therefore you could get a list of all models whose name starts with ‘exp1_’ with:
from chimera import openModels
models = [m.name.startswith(“exp1_”) for m in openModels.list()]
This whole process may be easy or quite difficult, depending on your pre-existing familiarity with working with Chimera’s Python.
—Eric
Eric Pettersen
UCSF Computer Graphics Lab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190107/11fbfed6/attachment.html>
More information about the Chimera-users
mailing list