Re: [Chimera-users] Scripting to write / save multiple models into single pdf file

Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script. If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote:
Hi Eric,
Thanks for the suggestion. I don’t really script, I usually use a c+ + code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =]
Mean while I try running the command “chimera.exe –nogui” in PATH/ chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I’m on a win7 X86 platform btw.
Thanks, Sumitro
-----------------------------------------------------------------------------------------------------
Chimera failed abnormally; the exit code was: 1 Use –debug command line option for the full error message.
-------------------------------------------------------------------------------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools
emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

That was a bull's eye, indeed, after turning off the autostart for Model panel, the simple command of ">chimera --nogui" does not make anymore complain. So I advanced a little and try to run a .cmd file using the command prompt:
chimera --nogui open e:\A.Model_receptor\model_env\calc_receptor_rmsds.cmd
But again I got the same error message: *********************************************************************** Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ************************************************************************ Below is what I see after adding "--debug" to the command: *********************************************************************** Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\chimeraInit.py", line 425, in init Chimera.openModels.open<a, prefixableType=1> File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" ValueError: Unknown model type Error while processing open: ValueError: Unknown model type File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" See reply log for Phyton traceback. Opening 2HN7.pdb... 1 model opened Opened ... ... ... (and actually continues to complete my script) *********************************************************************** Later on I tried to open a pdb instead (>chimera --nogui open e:\A.Model_receptor\PDB_MODELS\3B3I.pdb) and the same thing happened, even the debug window shows the same message about unknown model type. Any way to go around this..? I don't know if it helps, but below is my "preferences" file ********************************************************************* {'Model Panel': {'freqButs': {'2D Diagram': False, 'activate': False, 'activate all': True, 'activate only': True, 'add hydrogens...': False, 'add/edit note...': True, 'attributes...': True, 'blast protein...': True, 'clipping...': True, 'close': True, 'color by SS...': False, 'compute SS': True, 'copy/combine...': True, 'deactivate': False, 'focus': True, 'hide': False, 'match...': True, 'minimize...': False, 'rainbow...': True, 'rename...': True, 'render/sel by attr...': True, 'select': True, 'select chain(s)...': True, 'sequence...': True, 'show': False, 'show all atoms': True, 'show only': True, 'surface main': True, 'tile...': True, 'toggle active': True, 'trace backbones': True, 'trace chains': True, 'transform as...': True, 'write PDB': True}, 'lastUse': 1268231127.7550001}, 'Nucleotides': {'slab styles': {}}, 'Ribbon Styles': {'atoms': {}, 'scaling': {}, 'xsections': {}}, 'Tools': {'autoStart': {}, 'confirmOnStart': {}, 'dirList': [], 'inFavorites': {'Command Line': 2, 'Model Panel': 0, 'Reply Log': 4, 'Sequence': 3, 'Side View': 1}, 'onToolbar': {}}, 'command line gui': {'remembered commands': ['select #0:2-182.A@C', 'write selected format pdb 0 E:\\A.Model_receptor\\PDB_MODELS\\1W72_c.pdb']}, 'initial size': {'Window size': (525, 513)}, 'miller browser': {'dirHistory': [u'E:\\A.Model_receptor\\Chimera_log_parser', 'C:\\Users\\wiason\\Desktop'], 'fileHistory': {'': [u'E:\\A.Model_receptor\\Chimera_log_parser\\RMSD_raw.txt', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\reply_log', u'C:\\Users\\wiason\\Desktop\\try_combining2.pdb', u'C:\\Users\\wiason\\Desktop\\try_combining.pdb'], 'main chimera import dialog': [u'E:\\A.Model_receptor\\model_env\\calc_receptor_rmsds.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\extract_peptide_from_ PDB.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.fasta', u'E:\\A.Model_receptor\\PDB_MODELS\\3DTX.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3B3I.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2JCC.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2J8U.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1LP9.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1B0G.pdb']}, 'lastFilter': {'main chimera import dialog': 'all (guess type)'}}, 'update check': {'last time': (2010, 3, 3, 12, 50, 48, 371000, None)}, 'version tracking': {'last version': '1.4_b29093'}, 'write PDB dialog': {'multiSavePDB': 'single'}} ************************************************************************ **************************** ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 10 March 2010 3:17 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script. If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote: Hi Eric, Thanks for the suggestion. I don't really script, I usually use a c++ code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =] Mean while I try running the command "chimera.exe -nogui" in PATH/chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I'm on a win7 X86 platform btw. Thanks, Sumitro ------------------------------------------------------------------------ ----------------------------- Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ------------------------------------------------------------------------ -------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

Hi Sumitro, Don't include "open" on the Unix command line. You only need that when typing into Chimera's own command line. --Eric On Mar 10, 2010, at 10:28 AM, Sumitro Harjanto wrote:
That was a bull’s eye, indeed, after turning off the autostart for Model panel, the simple command of “>chimera --nogui” does not make anymore complain.
So I advanced a little and try to run a .cmd file using the command prompt:
chimera --nogui open e:\A.Model_receptor\model_env \calc_receptor_rmsds.cmd
But again I got the same error message: *********************************************************************** Chimera failed abnormally; the exit code was: 1 Use –debug command line option for the full error message. ************************************************************************
Below is what I see after adding "--debug" to the command: *********************************************************************** Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\chimeraInit.py", line 425, in init Chimera.openModels.open<a, prefixableType=1> File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" ValueError: Unknown model type Error while processing open: ValueError: Unknown model type
File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type"
See reply log for Phyton traceback.
Opening 2HN7.pdb… 1 model opened Opened … … … (and actually continues to complete my script) *********************************************************************** Later on I tried to open a pdb instead (>chimera --nogui open e: \A.Model_receptor\PDB_MODELS\3B3I.pdb) and the same thing happened, even the debug window shows the same message about unknown model type.
Any way to go around this..? I don’t know if it helps, but below is my “preferences” file ********************************************************************* {'Model Panel': {'freqButs': {'2D Diagram': False, 'activate': False, 'activate all': True, 'activate only': True, 'add hydrogens...': False, 'add/edit note...': True, 'attributes...': True, 'blast protein...': True, 'clipping...': True, 'close': True, 'color by SS...': False, 'compute SS': True, 'copy/combine...': True, 'deactivate': False, 'focus': True, 'hide': False, 'match...': True, 'minimize...': False, 'rainbow...': True, 'rename...': True, 'render/sel by attr...': True, 'select': True, 'select chain(s)...': True, 'sequence...': True, 'show': False, 'show all atoms': True, 'show only': True, 'surface main': True, 'tile...': True, 'toggle active': True, 'trace backbones': True, 'trace chains': True, 'transform as...': True, 'write PDB': True}, 'lastUse': 1268231127.7550001}, 'Nucleotides': {'slab styles': {}}, 'Ribbon Styles': {'atoms': {}, 'scaling': {}, 'xsections': {}}, 'Tools': {'autoStart': {}, 'confirmOnStart': {}, 'dirList': [], 'inFavorites': {'Command Line': 2, 'Model Panel': 0, 'Reply Log': 4, 'Sequence': 3, 'Side View': 1}, 'onToolbar': {}}, 'command line gui': {'remembered commands': ['select #0:2-182.A@C', 'write selected format pdb 0 E:\\A.Model_receptor\\PDB_MODELS\\1W72_c.pdb']}, 'initial size': {'Window size': (525, 513)}, 'miller browser': {'dirHistory': [u'E:\\A.Model_receptor\ \Chimera_log_parser', 'C:\\Users\\wiason\\Desktop'], 'fileHistory': {'': [u'E:\\A.Model_receptor\ \Chimera_log_parser\\RMSD_raw.txt', u'E:\\A.Model_receptor\ \PDB_MODELS\\peptide_chain\\reply_log', u'C:\\Users\\wiason\\Desktop \\try_combining2.pdb', u'C:\\Users\\wiason\\Desktop \\try_combining.pdb'], 'main chimera import dialog': [u'E:\\A.Model_receptor\\model_env\\calc_receptor_rmsds.cmd',
u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\ \extract_peptide_from_PDB.cmd',
u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.fasta',
u'E:\\A.Model_receptor\\PDB_MODELS\\3DTX.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\3B3I.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\2JCC.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\2J8U.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\1LP9.pdb',
u'E:\\A.Model_receptor\\PDB_MODELS\\1B0G.pdb']}, 'lastFilter': {'main chimera import dialog': 'all (guess type)'}}, 'update check': {'last time': (2010, 3, 3, 12, 50, 48, 371000, None)}, 'version tracking': {'last version': '1.4_b29093'}, 'write PDB dialog': {'multiSavePDB': 'single'}}
****************************************************************************************************
From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 10 March 2010 3:17 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file
Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script.
If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote:
Hi Eric,
Thanks for the suggestion. I don’t really script, I usually use a c+ + code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =]
Mean while I try running the command “chimera.exe –nogui” in PATH/ chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I’m on a win7 X86 platform btw.
Thanks, Sumitro
-----------------------------------------------------------------------------------------------------
Chimera failed abnormally; the exit code was: 1 Use –debug command line option for the full error message.
-------------------------------------------------------------------------------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools
emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

Hmm, I actually did that because after typing in "chimera -nogui" into my command prompt (in windows btw) , I don't see anything happening. Am I supposed to see a new Chimera own command line window popping up to which I can now enter chimera's command..? Cheers, Sumitro ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 12 March 2010 6:24 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hi Sumitro, Don't include "open" on the Unix command line. You only need that when typing into Chimera's own command line. --Eric On Mar 10, 2010, at 10:28 AM, Sumitro Harjanto wrote: That was a bull's eye, indeed, after turning off the autostart for Model panel, the simple command of ">chimera --nogui" does not make anymore complain. So I advanced a little and try to run a .cmd file using the command prompt:
chimera --nogui open e:\A.Model_receptor\model_env\calc_receptor_rmsds.cmd
But again I got the same error message: *********************************************************************** Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ************************************************************************ Below is what I see after adding "--debug" to the command: *********************************************************************** Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\chimeraInit.py", line 425, in init Chimera.openModels.open<a, prefixableType=1> File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" ValueError: Unknown model type Error while processing open: ValueError: Unknown model type File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" See reply log for Phyton traceback. Opening 2HN7.pdb... 1 model opened Opened ... ... ... (and actually continues to complete my script) *********************************************************************** Later on I tried to open a pdb instead (>chimera --nogui open e:\A.Model_receptor\PDB_MODELS\3B3I.pdb) and the same thing happened, even the debug window shows the same message about unknown model type. Any way to go around this..? I don't know if it helps, but below is my "preferences" file ********************************************************************* {'Model Panel': {'freqButs': {'2D Diagram': False, 'activate': False, 'activate all': True, 'activate only': True, 'add hydrogens...': False, 'add/edit note...': True, 'attributes...': True, 'blast protein...': True, 'clipping...': True, 'close': True, 'color by SS...': False, 'compute SS': True, 'copy/combine...': True, 'deactivate': False, 'focus': True, 'hide': False, 'match...': True, 'minimize...': False, 'rainbow...': True, 'rename...': True, 'render/sel by attr...': True, 'select': True, 'select chain(s)...': True, 'sequence...': True, 'show': False, 'show all atoms': True, 'show only': True, 'surface main': True, 'tile...': True, 'toggle active': True, 'trace backbones': True, 'trace chains': True, 'transform as...': True, 'write PDB': True}, 'lastUse': 1268231127.7550001}, 'Nucleotides': {'slab styles': {}}, 'Ribbon Styles': {'atoms': {}, 'scaling': {}, 'xsections': {}}, 'Tools': {'autoStart': {}, 'confirmOnStart': {}, 'dirList': [], 'inFavorites': {'Command Line': 2, 'Model Panel': 0, 'Reply Log': 4, 'Sequence': 3, 'Side View': 1}, 'onToolbar': {}}, 'command line gui': {'remembered commands': ['select #0:2-182.A@C', 'write selected format pdb 0 E:\\A.Model_receptor\\PDB_MODELS\\1W72_c.pdb']}, 'initial size': {'Window size': (525, 513)}, 'miller browser': {'dirHistory': [u'E:\\A.Model_receptor\\Chimera_log_parser', 'C:\\Users\\wiason\\Desktop'], 'fileHistory': {'': [u'E:\\A.Model_receptor\\Chimera_log_parser\\RMSD_raw.txt', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\reply_log', u'C:\\Users\\wiason\\Desktop\\try_combining2.pdb', u'C:\\Users\\wiason\\Desktop\\try_combining.pdb'], 'main chimera import dialog': [u'E:\\A.Model_receptor\\model_env\\calc_receptor_rmsds.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\extract_peptide_from_ PDB.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.fasta', u'E:\\A.Model_receptor\\PDB_MODELS\\3DTX.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3B3I.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2JCC.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2J8U.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1LP9.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1B0G.pdb']}, 'lastFilter': {'main chimera import dialog': 'all (guess type)'}}, 'update check': {'last time': (2010, 3, 3, 12, 50, 48, 371000, None)}, 'version tracking': {'last version': '1.4_b29093'}, 'write PDB dialog': {'multiSavePDB': 'single'}} ************************************************************************ **************************** ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 10 March 2010 3:17 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script. If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote: Hi Eric, Thanks for the suggestion. I don't really script, I usually use a c++ code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =] Mean while I try running the command "chimera.exe -nogui" in PATH/chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I'm on a win7 X86 platform btw. Thanks, Sumitro ------------------------------------------------------------------------ ----------------------------- Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ------------------------------------------------------------------------ -------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

Ok Eric, I think you can ignore my last email. I realised I can use "chimera -nogui -debug" to make the chimera command line appear and then I can open my .cmd file from there. But I realised also I cant save the reply log, which contain the rmsd information I need (my result!! T.T) I found this codet on the chimera mailing list: def save_reply_log(path): from chimera import dialogs r = dialogs.find('reply') text = r.text.get('1.0', 'end') f = open(path, 'w') f.write(text) f.close() save_reply_log("/tmp/tmplog.txt") but how do I incorporate this into my .cmd..? or must I now script in python..? thanks! Cheers, Sumitr. ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 12 March 2010 6:24 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hi Sumitro, Don't include "open" on the Unix command line. You only need that when typing into Chimera's own command line. --Eric On Mar 10, 2010, at 10:28 AM, Sumitro Harjanto wrote: That was a bull's eye, indeed, after turning off the autostart for Model panel, the simple command of ">chimera --nogui" does not make anymore complain. So I advanced a little and try to run a .cmd file using the command prompt:
chimera --nogui open e:\A.Model_receptor\model_env\calc_receptor_rmsds.cmd
But again I got the same error message: *********************************************************************** Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ************************************************************************ Below is what I see after adding "--debug" to the command: *********************************************************************** Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\chimeraInit.py", line 425, in init Chimera.openModels.open<a, prefixableType=1> File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" ValueError: Unknown model type Error while processing open: ValueError: Unknown model type File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" See reply log for Phyton traceback. Opening 2HN7.pdb... 1 model opened Opened ... ... ... (and actually continues to complete my script) *********************************************************************** Later on I tried to open a pdb instead (>chimera --nogui open e:\A.Model_receptor\PDB_MODELS\3B3I.pdb) and the same thing happened, even the debug window shows the same message about unknown model type. Any way to go around this..? I don't know if it helps, but below is my "preferences" file ********************************************************************* {'Model Panel': {'freqButs': {'2D Diagram': False, 'activate': False, 'activate all': True, 'activate only': True, 'add hydrogens...': False, 'add/edit note...': True, 'attributes...': True, 'blast protein...': True, 'clipping...': True, 'close': True, 'color by SS...': False, 'compute SS': True, 'copy/combine...': True, 'deactivate': False, 'focus': True, 'hide': False, 'match...': True, 'minimize...': False, 'rainbow...': True, 'rename...': True, 'render/sel by attr...': True, 'select': True, 'select chain(s)...': True, 'sequence...': True, 'show': False, 'show all atoms': True, 'show only': True, 'surface main': True, 'tile...': True, 'toggle active': True, 'trace backbones': True, 'trace chains': True, 'transform as...': True, 'write PDB': True}, 'lastUse': 1268231127.7550001}, 'Nucleotides': {'slab styles': {}}, 'Ribbon Styles': {'atoms': {}, 'scaling': {}, 'xsections': {}}, 'Tools': {'autoStart': {}, 'confirmOnStart': {}, 'dirList': [], 'inFavorites': {'Command Line': 2, 'Model Panel': 0, 'Reply Log': 4, 'Sequence': 3, 'Side View': 1}, 'onToolbar': {}}, 'command line gui': {'remembered commands': ['select #0:2-182.A@C', 'write selected format pdb 0 E:\\A.Model_receptor\\PDB_MODELS\\1W72_c.pdb']}, 'initial size': {'Window size': (525, 513)}, 'miller browser': {'dirHistory': [u'E:\\A.Model_receptor\\Chimera_log_parser', 'C:\\Users\\wiason\\Desktop'], 'fileHistory': {'': [u'E:\\A.Model_receptor\\Chimera_log_parser\\RMSD_raw.txt', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\reply_log', u'C:\\Users\\wiason\\Desktop\\try_combining2.pdb', u'C:\\Users\\wiason\\Desktop\\try_combining.pdb'], 'main chimera import dialog': [u'E:\\A.Model_receptor\\model_env\\calc_receptor_rmsds.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\extract_peptide_from_ PDB.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.fasta', u'E:\\A.Model_receptor\\PDB_MODELS\\3DTX.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3B3I.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2JCC.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2J8U.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1LP9.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1B0G.pdb']}, 'lastFilter': {'main chimera import dialog': 'all (guess type)'}}, 'update check': {'last time': (2010, 3, 3, 12, 50, 48, 371000, None)}, 'version tracking': {'last version': '1.4_b29093'}, 'write PDB dialog': {'multiSavePDB': 'single'}} ************************************************************************ **************************** ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 10 March 2010 3:17 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script. If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote: Hi Eric, Thanks for the suggestion. I don't really script, I usually use a c++ code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =] Mean while I try running the command "chimera.exe -nogui" in PATH/chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I'm on a win7 X86 platform btw. Thanks, Sumitro ------------------------------------------------------------------------ ----------------------------- Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ------------------------------------------------------------------------ -------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

On Mar 12, 2010, at 8:22 PM, Sumitro Harjanto wrote:
Ok Eric, I think you can ignore my last email. I realised I can use “chimera –nogui –debug” to make the chimera command line appear and then I can open my .cmd file from there.
Yes, on Windows there really is no concept of "standard input" and "standard output" so in addition to --nogui you also have to supply -- console (or --debug, which implies a console window) in order to see standard output and to supply standard input. We will try to make it so that --nogui with no script argument will also bring up a console window. However, the point of my previous mail was that you don't need to type commands. If you just do this: chimera --nogui myscript.py Then Chimera will run "myscript.py" in nogui mode. You don't need to get a command prompt and type "open myscript.py".
But I realised also I cant save the reply log, which contain the rmsd information I need (my result!! T.T)
I found this codet on the chimera mailing list: def save_reply_log(path): from chimera import dialogs r = dialogs.find('reply') text = r.text.get('1.0', 'end') f = open(path, 'w') f.write(text) f.close()
save_reply_log("/tmp/tmplog.txt")
but how do I incorporate this into my .cmd..? or must I now script in python..?
There is no reply log in nogui mode. All the output will come to the console window. In order to copy from the console window you will need to right-click in the title bar of the console window. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

Hi, Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments? Cheers, Sumitro ------------------------------------------------------------------------ --------------------------------------------------------------------- ... Opening B-7301_SRWGYQVKH_1K5N.pdb... Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Model 2 (B-7301_SRWGYQVKH_1K5N.pdb) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information. ... ------------------------------------------------------------------------ ---------------------------------------------------------------------

Hi Sumitro, The shortest answer is no, there is no way (barring some Python shenanigans). You could clear SS assignments afterward with: setattr r isHelix false # setattr r isStrand false # Can you describe why you want to turn off the SS computation? We might make it optional somehow if it was of general use. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 14, 2010, at 6:54 AM, Sumitro Harjanto wrote:
Hi,
Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments?
Cheers, Sumitro
--------------------------------------------------------------------------------------------------------------------------------------------- … Opening B-7301_SRWGYQVKH_1K5N.pdb... Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Model 2 (B-7301_SRWGYQVKH_1K5N.pdb) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information. …

Hi Sumitro, I thought you might be using the "matchmaker" command to superimpose structures and calculate RMSDs. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/mmaker.html> If so, be aware that matchmaker uses secondary structure assignments to help guide the alignment, unless you specify "ssFraction false". Without secondary structure information, it will use the sequences only, and the superposition might not be as good if the the sequences have low similarity. If the sequences have high similarity it shouldn't make much difference, however. Elaine On Mar 15, 2010, at 4:17 PM, Eric Pettersen wrote:
Hi Sumitro, The shortest answer is no, there is no way (barring some Python shenanigans). You could clear SS assignments afterward with:
setattr r isHelix false # setattr r isStrand false #
Can you describe why you want to turn off the SS computation? We might make it optional somehow if it was of general use.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
On Mar 14, 2010, at 6:54 AM, Sumitro Harjanto wrote:
Hi,
Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments?
Cheers, Sumitro
--------------------------------------------------------------------------------------------------------------------------------------------- … Opening B-7301_SRWGYQVKH_1K5N.pdb... Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Model 2 (B-7301_SRWGYQVKH_1K5N.pdb) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information. …
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Elaine, I am using "match" to calculate the rmsds. But the ksdssp algo was automatically invoked when I opened my model. My models are generally 85% similar by sequence. Can I turn it off in this case..? and I will have to weigh the same implication on accuracy if using "match"? Thanks, Sumitro -----Original Message----- From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Tuesday, March 16, 2010 7:54 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu BB Subject: Re: [Chimera-users] turning ksdssp off? Hi Sumitro, I thought you might be using the "matchmaker" command to superimpose structures and calculate RMSDs. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/mmaker.html> If so, be aware that matchmaker uses secondary structure assignments to help guide the alignment, unless you specify "ssFraction false". Without secondary structure information, it will use the sequences only, and the superposition might not be as good if the the sequences have low similarity. If the sequences have high similarity it shouldn't make much difference, however. Elaine On Mar 15, 2010, at 4:17 PM, Eric Pettersen wrote:
Hi Sumitro, The shortest answer is no, there is no way (barring some Python
shenanigans). You could clear SS assignments afterward with:
setattr r isHelix false # setattr r isStrand false #
Can you describe why you want to turn off the SS computation? We might make it optional somehow if it was of general use.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
On Mar 14, 2010, at 6:54 AM, Sumitro Harjanto wrote:
Hi,
Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments?
Cheers, Sumitro
---------------------------------------------------------------------
... Opening B-7301_SRWGYQVKH_1K5N.pdb... Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Model 2 (B-7301_SRWGYQVKH_1K5N.pdb) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information. ...
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Sumitro, No, currently you can't turn that off, as Eric said in his previous reply. I was only mentioning matchmaker in case you were using it. The match command is not affected by this issue; it only uses whatever atoms you tell it to use. Why do you want to avoid the ksdssp calculation? Let us know so we can consider adding an option to control that. Thanks, Elaine On Mar 15, 2010, at 8:10 PM, Sumitro Harjanto wrote:
Hi Elaine,
I am using "match" to calculate the rmsds. But the ksdssp algo was automatically invoked when I opened my model. My models are generally 85% similar by sequence. Can I turn it off in this case..? and I will have to weigh the same implication on accuracy if using "match"?
Thanks, Sumitro
-----Original Message----- From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Tuesday, March 16, 2010 7:54 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu BB Subject: Re: [Chimera-users] turning ksdssp off?
Hi Sumitro,
I thought you might be using the "matchmaker" command to superimpose structures and calculate RMSDs. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/mmaker.html>
If so, be aware that matchmaker uses secondary structure assignments to help guide the alignment, unless you specify "ssFraction false". Without secondary structure information, it will use the sequences only, and the superposition might not be as good if the the sequences have low similarity. If the sequences have high similarity it shouldn't make much difference, however.
Elaine
On Mar 15, 2010, at 4:17 PM, Eric Pettersen wrote:
Hi Sumitro, The shortest answer is no, there is no way (barring some Python
shenanigans). You could clear SS assignments afterward with:
setattr r isHelix false # setattr r isStrand false #
Can you describe why you want to turn off the SS computation? We might make it optional somehow if it was of general use.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
On Mar 14, 2010, at 6:54 AM, Sumitro Harjanto wrote:
Hi,
Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments?
Cheers, Sumitro

Hi Elaine, Eric, Actually I now don't need to do that anymore. Initially I wanted to do that to reduce the screen output lines (OK, bad reason!!) since I couldn't find a way to retrieve the replylog other than copying it from the console, and the console has a limit of 9999 lines. But now I can redirect the output to a file so I no longer have to worry about the number of lines output by chimera. Of course, I kinda overlook the possible implications on alignment by "match" when I turn ksdssp off. But anyway, thanks for the prompt reply. And I admire your sincere interest in improving the program! Thanks guys! Cheers, Sumitro -----Original Message----- From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: 16 March 2010 1:29 PM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] turning ksdssp off? Hi Sumitro, No, currently you can't turn that off, as Eric said in his previous reply. I was only mentioning matchmaker in case you were using it. The match command is not affected by this issue; it only uses whatever atoms you tell it to use. Why do you want to avoid the ksdssp calculation? Let us know so we can consider adding an option to control that. Thanks, Elaine On Mar 15, 2010, at 8:10 PM, Sumitro Harjanto wrote:
Hi Elaine,
I am using "match" to calculate the rmsds. But the ksdssp algo was automatically invoked when I opened my model. My models are generally 85% similar by sequence. Can I turn it off in this case..? and I will have to weigh the same implication on accuracy if using "match"?
Thanks, Sumitro
-----Original Message----- From: Elaine Meng [mailto:meng@cgl.ucsf.edu] Sent: Tuesday, March 16, 2010 7:54 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu BB Subject: Re: [Chimera-users] turning ksdssp off?
Hi Sumitro,
I thought you might be using the "matchmaker" command to superimpose structures and calculate RMSDs. <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/mmaker.html>
If so, be aware that matchmaker uses secondary structure assignments to help guide the alignment, unless you specify "ssFraction false". Without secondary structure information, it will use the sequences only, and the superposition might not be as good if the the sequences have low similarity. If the sequences have high similarity it shouldn't make much difference, however.
Elaine
On Mar 15, 2010, at 4:17 PM, Eric Pettersen wrote:
Hi Sumitro, The shortest answer is no, there is no way (barring some Python
shenanigans). You could clear SS assignments afterward with:
setattr r isHelix false # setattr r isStrand false #
Can you describe why you want to turn off the SS computation? We might make it optional somehow if it was of general use.
--Eric
Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu
On Mar 14, 2010, at 6:54 AM, Sumitro Harjanto wrote:
Hi,
Is there any way to turn off automatic secondary structure assignment upon opening a pdb file that does not contain secondary assignments?
Cheers, Sumitro

Hi , Is it possible to use chimera to report the psi-phi angle of pdb protein models..? Cheers, Sumitro

Hi Sumitro, As soon as you open a protein structure, the angle values are available as the residue attributes named "phi" and "psi". Chimera doesn't make a Ramachandran plot, but you can write out the values to a file or show them as labels (or as colors etc. just like any other numerical attributes). To save the values to a file or show them with colors etc., you would use Render by Attribute (under Tools... Structure Analysis) as documented here: <http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/render/render.html#...
How to save to a file is described at the very bottom of that page. To show the values as labels you could use "Actions... Label... residue... custom" and substitute phi or psi for name or number, but the values are not rounded and not easy to view all at once. It is reasonable if you only select and label a few residues at a time, however. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Mar 23, 2010, at 4:00 AM, Sumitro Harjanto wrote:
Hi , Is it possible to use chimera to report the psi-phi angle of pdb protein models..? Cheers, Sumitro

Hi Eric, I managed to figure out something by pirating some python codes I found from chimera mailing list through googling. I want to use the code to save my reply log, which is going to be about 3.4 million lines (by the way, is there a maximum buffer for the number of lines reply log can take? I feared overrunning the buffer and losing my some part of the replylog) Below is the code; I commented away the part I do not use from the original code. I tried the code by opening it using the chimera gui, and it worked just fine, producing the log file I want. But when I tried opening the same code using command line the log file was produced, but empty. I tried : E:\Chimera\bin>chimera --nogui save_replylog.py <- - doesnot show anything, no popup command window, nothing. E:\Chimera\bin>chimera --nogui --debug save_replylog.py <- - shows a new pop up window Both commands created my log file, but were both empty files. I would want to run the script later in nogui mode, but I need to retrieve the log for rmsd values, therefore I need to overcome this problem. Any advise..? Thanks! Cheers, Sumitro ************************************************************************ ******************************************** from chimera import runCommand from chimera.tkgui import saveReplyLog #def rms2ref(ref, pose, no): # runCommand('open %s; open %s' % (ref, pose)) # i = 1 # while i <= no: # # only hetatms are included --> ~@/element=h # runCommand('sel #1.%i & ~@/element=h' % i) # runCommand('rmsd #0 sel') # i += 1 # #rms2ref('lig_cryst.pdb', 'poses.sdf', 10) runCommand('open noprefs E:\\D.combine\\receptor_models\\A-0101_1W72_A.pdb') runCommand('open noprefs E:\\A.Model_receptor\\PDB_MODELS\\1DUZ.pdb') runCommand('open noprefs E:\\D.combine\\chain_models\\A-0101_ITLVYKVYY_2CIK.pdb') runCommand('rmsd #0:@ca #1:2-182.A@ca') runCommand('match #0:@ca,n,c,o #1:2-182.A@ca,n,c,o') runCommand('match #2:1-3.C,7-9.C@ca #1:1-3.C,7-9.C@ca ') runCommand('match #2:1-3.C,7-9.C@ca,n,c,o #1:1-3.C,7-9.C@ca,n,c,o ') runCommand('combine #0|#2:1-9.C name A-0101_ITLVYKVYY_2CIK.C.(1DUZ.C).A-0101_1W72_A modelId 5') runCommand('write format pdb 5 E:\\D.combine\\complex\\A-0101_ITLVYKVYY_2CIK.C.(1DUZ.C).A-0101_1W72_A.p db') runCommand('close all') # generate output from replyLog.txt saveReplyLog('e:\\D.combine\\mylog.txt') #rmsds = [] #for i in open('mylog2.txt').readlines(): # if i.startswith('RMSD between'): # rmsds.append(i.split()[-2]) # #print rmsds ************************************************************************ ********* ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 12 March 2010 6:24 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hi Sumitro, Don't include "open" on the Unix command line. You only need that when typing into Chimera's own command line. --Eric On Mar 10, 2010, at 10:28 AM, Sumitro Harjanto wrote: That was a bull's eye, indeed, after turning off the autostart for Model panel, the simple command of ">chimera --nogui" does not make anymore complain. So I advanced a little and try to run a .cmd file using the command prompt:
chimera --nogui open e:\A.Model_receptor\model_env\calc_receptor_rmsds.cmd
But again I got the same error message: *********************************************************************** Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ************************************************************************ Below is what I see after adding "--debug" to the command: *********************************************************************** Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\chimeraInit.py", line 425, in init Chimera.openModels.open<a, prefixableType=1> File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" ValueError: Unknown model type Error while processing open: ValueError: Unknown model type File "E:\Chimera\share\chimera\__init__.py", line 1405, in open Raise ValueError, "Unknown model type" See reply log for Phyton traceback. Opening 2HN7.pdb... 1 model opened Opened ... ... ... (and actually continues to complete my script) *********************************************************************** Later on I tried to open a pdb instead (>chimera --nogui open e:\A.Model_receptor\PDB_MODELS\3B3I.pdb) and the same thing happened, even the debug window shows the same message about unknown model type. Any way to go around this..? I don't know if it helps, but below is my "preferences" file ********************************************************************* {'Model Panel': {'freqButs': {'2D Diagram': False, 'activate': False, 'activate all': True, 'activate only': True, 'add hydrogens...': False, 'add/edit note...': True, 'attributes...': True, 'blast protein...': True, 'clipping...': True, 'close': True, 'color by SS...': False, 'compute SS': True, 'copy/combine...': True, 'deactivate': False, 'focus': True, 'hide': False, 'match...': True, 'minimize...': False, 'rainbow...': True, 'rename...': True, 'render/sel by attr...': True, 'select': True, 'select chain(s)...': True, 'sequence...': True, 'show': False, 'show all atoms': True, 'show only': True, 'surface main': True, 'tile...': True, 'toggle active': True, 'trace backbones': True, 'trace chains': True, 'transform as...': True, 'write PDB': True}, 'lastUse': 1268231127.7550001}, 'Nucleotides': {'slab styles': {}}, 'Ribbon Styles': {'atoms': {}, 'scaling': {}, 'xsections': {}}, 'Tools': {'autoStart': {}, 'confirmOnStart': {}, 'dirList': [], 'inFavorites': {'Command Line': 2, 'Model Panel': 0, 'Reply Log': 4, 'Sequence': 3, 'Side View': 1}, 'onToolbar': {}}, 'command line gui': {'remembered commands': ['select #0:2-182.A@C', 'write selected format pdb 0 E:\\A.Model_receptor\\PDB_MODELS\\1W72_c.pdb']}, 'initial size': {'Window size': (525, 513)}, 'miller browser': {'dirHistory': [u'E:\\A.Model_receptor\\Chimera_log_parser', 'C:\\Users\\wiason\\Desktop'], 'fileHistory': {'': [u'E:\\A.Model_receptor\\Chimera_log_parser\\RMSD_raw.txt', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\reply_log', u'C:\\Users\\wiason\\Desktop\\try_combining2.pdb', u'C:\\Users\\wiason\\Desktop\\try_combining.pdb'], 'main chimera import dialog': [u'E:\\A.Model_receptor\\model_env\\calc_receptor_rmsds.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\peptide_chain\\extract_peptide_from_ PDB.cmd', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3D39.fasta', u'E:\\A.Model_receptor\\PDB_MODELS\\3DTX.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\3B3I.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2JCC.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\2J8U.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1LP9.pdb', u'E:\\A.Model_receptor\\PDB_MODELS\\1B0G.pdb']}, 'lastFilter': {'main chimera import dialog': 'all (guess type)'}}, 'update check': {'last time': (2010, 3, 3, 12, 50, 48, 371000, None)}, 'version tracking': {'last version': '1.4_b29093'}, 'write PDB dialog': {'multiSavePDB': 'single'}} ************************************************************************ **************************** ________________________________ From: Eric Pettersen [mailto:pett@cgl.ucsf.edu] Sent: 10 March 2010 3:17 AM To: Sumitro Harjanto Cc: chimera-users@cgl.ucsf.edu Subject: Re: [Chimera-users] Scripting to write / save multiple models into single pdf file Hmm, it seems that you have the Model Panel set to autostart in your preferences. Now, Chimera probably should ignore autostarting tools when it is in nogui mode, but currently it doesn't. So what you will have to do for now (until we fix this) is to start Chimera normally, turn off the autostart of the Model Panel (and any other graphical tools probably), save the new preferences, and then run your script. If you look in the "Preferences" preference category, it will show the location of the preferences file. You could squirrel away your original preferences file somewhere, make the version with no autostarting, copy that somewhere, and then put your original version back. You would then be able to use the no-autostarting preferences by specifying it's location with the --preferences startup option. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 8, 2010, at 7:32 PM, Sumitro Harjanto wrote: Hi Eric, Thanks for the suggestion. I don't really script, I usually use a c++ code / excel to generate the command (.cmd) files. Should be okay for the automation for now, if I run into any problem then I will post it up here again. =] Mean while I try running the command "chimera.exe -nogui" in PATH/chimera/bin but got the following error message. I followed the instruction and copy over the debug message (below). any advise? I'm on a win7 X86 platform btw. Thanks, Sumitro ------------------------------------------------------------------------ ----------------------------- Chimera failed abnormally; the exit code was: 1 Use -debug command line option for the full error message. ------------------------------------------------------------------------ -------------------------- Cannot execute 'gzip': no automatic decompression of .Z files Traceback (most recent call last): File "E:\Chimera\share\__main__.py", line 65, in <module> value = chimeraInit.init(sys.argv) File "E:\Chimera\share\chimeraInit.py", line 401, in init extension.startup(startExtensions) File "E:\Chimera\share\chimera\extension\base.py", line 1056, in startup manager.autostartTools(extNames) File "E:\Chimera\share\chimera\extension\base.py", line 959, in autostartTools emo.activate() File "E:\Chimera\share\ModelPanel\ChimeraExtension.py", line 23, in activate display(self.module('base').ModelPanel.name) File "E:\Chimera\share\chimera\dialogs.py", line 77, in display dialog = find(name, create=1) File "E:\Chimera\share\chimera\dialogs.py", line 62, in find return d() File "E:\Chimera\share\chimera\baseDialog.py", line 523, in __init__ BaseDialog.__init__(self, master, *args, **kw) File "E:\Chimera\share\chimera\baseDialog.py", line 244, in __init__ self.fillInUI(self.__top) File "E:\Chimera\share\ModelPanel\base.py", line 217, in fillInUI self._addColumns() File "E:\Chimera\share\ModelPanel\base.py", line 436, in _addColumns self._buildTable() File "E:\Chimera\share\ModelPanel\base.py", line 454, in _buildTable % len(filter(lambda s: s == 1, self.shownColumns))) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 1306, in __init__ cnf, kw) File "E:\Chimera\bin\Lib\lib-tk\Tix.py", line 307, in __init__ self.tk.call(widgetName, self._w, *extra) _tkinter.TclError: invalid command name "tixScrolledHList" Return code: 1 Press return or enter to to exit

My previous reply was kind of misleading. Windows does know about standard input/output, but only for "console" apps, not GUI apps. Chimera tries to be both. So instead of bring up a console window, you can simply redirect standard output (which will have your RMSD info) into a file, like so: E:\Chimera\bin>chimera --nogui myscript.py > E:\rmsds.txt Don't use the saveReplyFunction in nogui mode since it will always produce an empty file (since there is no reply log). --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Mar 14, 2010, at 11:12 PM, Sumitro Harjanto wrote:
Hi Eric,
I managed to figure out something by pirating some python codes I found from chimera mailing list through googling. I want to use the code to save my reply log, which is going to be about 3.4 million lines (by the way, is there a maximum buffer for the number of lines reply log can take? I feared overrunning the buffer and losing my some part of the replylog)
Below is the code; I commented away the part I do not use from the original code.
I tried the code by opening it using the chimera gui, and it worked just fine, producing the log file I want. But when I tried opening the same code using command line the log file was produced, but empty. I tried :
E:\Chimera\bin>chimera --nogui save_replylog.py <- - doesnot show anything, no popup command window, nothing. E:\Chimera\bin>chimera --nogui --debug save_replylog.py <- - shows a new pop up window
Both commands created my log file, but were both empty files.
I would want to run the script later in nogui mode, but I need to retrieve the log for rmsd values, therefore I need to overcome this problem. Any advise..?
Thanks!
Cheers, Sumitro
******************************************************************************************************************** from chimera import runCommand from chimera.tkgui import saveReplyLog
#def rms2ref(ref, pose, no): # runCommand('open %s; open %s' % (ref, pose)) # i = 1 # while i <= no: # # only hetatms are included --> ~@/element=h # runCommand('sel #1.%i & ~@/element=h' % i) # runCommand('rmsd #0 sel') # i += 1 # #rms2ref('lig_cryst.pdb', 'poses.sdf', 10)
runCommand('open noprefs E:\\D.combine\\receptor_models\ \A-0101_1W72_A.pdb') runCommand('open noprefs E:\\A.Model_receptor\\PDB_MODELS\\1DUZ.pdb') runCommand('open noprefs E:\\D.combine\\chain_models\ \A-0101_ITLVYKVYY_2CIK.pdb') runCommand('rmsd #0:@ca #1:2-182.A@ca') runCommand('match #0:@ca,n,c,o #1:2-182.A@ca,n,c,o') runCommand('match #2:1-3.C,7-9.C@ca #1:1-3.C,7-9.C@ca ') runCommand('match #2:1-3.C,7-9.C@ca,n,c,o #1:1-3.C,7-9.C@ca,n,c,o ') runCommand('combine #0|#2:1-9.C name A-0101_ITLVYKVYY_2CIK.C. (1DUZ.C).A-0101_1W72_A modelId 5') runCommand('write format pdb 5 E:\\D.combine\\complex\ \A-0101_ITLVYKVYY_2CIK.C.(1DUZ.C).A-0101_1W72_A.pdb') runCommand('close all')
# generate output from replyLog.txt
saveReplyLog('e:\\D.combine\\mylog.txt')
#rmsds = [] #for i in open('mylog2.txt').readlines(): # if i.startswith('RMSD between'): # rmsds.append(i.split()[-2]) # #print rmsds *********************************************************************************
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Sumitro Harjanto