
Hi Matt, Many Chimera commands are defined in chimera/share/Midas/__init__.py They are sometimes a pain to call from Python. Here is some code for the align command. Tom from chimera import openModels, selection m = openModels.list()[0] sel = selection.ItemizedSelection() sel.add(m.atoms[0:2]) from Midas import align align(sel) Matthew Baker wrote:
I'm writing a module. I've created a model and added it to the open models. How can I reproduce the command-line function
align #1:1 #1:2
The variable names for my two atoms are newModel.atoms[0] and newModel.atoms[1].
Thanks, Matt

Hello, I thought the EZ way to translate Chimera->python was simply to use makeCommand and enclose the command, for example: import Midas from Midas.midas_text import makeCommand makeCommand('align #0:1.b@ca #1:1@ca') Maybe this doesn't always work, or is less efficient? Elaine On Oct 4, 2007, at 2:37 PM, Thomas Goddard wrote:
Hi Matt,
Many Chimera commands are defined in
chimera/share/Midas/__init__.py
They are sometimes a pain to call from Python. Here is some code for the align command.
Tom
from chimera import openModels, selection m = openModels.list()[0] sel = selection.ItemizedSelection() sel.add(m.atoms[0:2]) from Midas import align align(sel)
Matthew Baker wrote:
I'm writing a module. I've created a model and added it to the open models. How can I reproduce the command-line function
align #1:1 #1:2
The variable names for my two atoms are newModel.atoms[0] and newModel.atoms[1].
Thanks, Matt
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Elaine, You're right. I forgot about this easy way of running Chimera commands from Python. I think the preferred Python call has changed to: from chimera import runCommand runCommand('align #1:1@ca #1:2@ca') Tom Elaine Meng wrote:
Hello, I thought the EZ way to translate Chimera->python was simply to use makeCommand and enclose the command, for example:
import Midas from Midas.midas_text import makeCommand makeCommand('align #0:1.b@ca #1:1@ca')
Maybe this doesn't always work, or is less efficient? Elaine
On Oct 4, 2007, at 2:37 PM, Thomas Goddard wrote:
Hi Matt,
Many Chimera commands are defined in
chimera/share/Midas/__init__.py
They are sometimes a pain to call from Python. Here is some code for the align command.
Tom
from chimera import openModels, selection m = openModels.list()[0] sel = selection.ItemizedSelection() sel.add(m.atoms[0:2]) from Midas import align align(sel)
Matthew Baker wrote:
I'm writing a module. I've created a model and added it to the open models. How can I reproduce the command-line function
align #1:1 #1:2
The variable names for my two atoms are newModel.atoms[0] and newModel.atoms[1].
Thanks, Matt
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Elaine Meng
-
Thomas Goddard