<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, </div><div><br></div><div> I am just trying to get started coding some plugins to Chimera, by following the Programmer's Guide 1.3.</div><div>I have limited programming experience, and the points below were where I got stuck... Not sure if the guide is generally aimed at those with more or less developer skills? </div><div><br></div><div><br></div><div>Starting with the examples (writeMol2.py) it isn't clear that all these commands should be typed in the IDLE window. </div><div>I see that it is mentioned previously in the text, but it would be helpful to make clear that this is not in the command line or python prompt. </div><div><br></div><div>When you've downloaded 4fun.pdb and saved it somewhere, does it matter where you save it, and how should you specify this in commands like</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); ">opened = chimera.openModels.open('4fun.pdb')</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); ">E.g. this would have made it more clear that you don't just put the file in a particular place that Chimera knows were to look:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); ">opened = chimera.openModels.open('Users/username/Downloads/4fun.pdb')</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: medium; ">Actually, this point was more relevant to the command:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; color: rgb(255, 0, 0); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">execfile("backbone.py")</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: medium; ">which I was working on earlier. I was trying to save backbone.py in one of the Chimera.app/Contents/Resources folders, and hoping that Chimera would find it with the above command:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: medium; ">When really the command should be more like:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: medium; "><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-size: 12px; ">execfile("Users/username/Desktop/backbone.py")</span> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium;">Running chimera from the command line:</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium;">A note that it is necessary to add the Chimera bin to the PATH variable would have been handy, especially for novice developers.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium;">export PATH=$PATH:/Applications/Chimera.app/Contents/Resources/bin/</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "> </span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; ">ToolbarButton.py</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; ">I got errors when running this script unless I put the import statements in the mainchain function like this</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">import os</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">import chimera</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">def mainchain():</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">import re</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">import chimera</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">MAINCHAIN = re.compile("^(N|CA|C)$", re.I)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">for m in chimera.openModels.list(modelTypes=[chimera.Molecule]):</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">for a in m.atoms:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span><span class="Apple-style-span" style="font-size: medium; ">a.display = MAINCHAIN.match(a.name) != None</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="font-size: medium; "> </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">chimera.tkgui.app.toolbar.add('ToolbarButton.tiff', mainchain, 'Show Main Chain',</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">None)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">Otherwise I got errors like:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">Traceback (most recent call last):</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Resources/share/__main__.py", line 65, in <module></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> value = chimeraInit.init(sys.argv)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Resources/share/chimeraInit.py", line 434, in init</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> tkgui.eventLoop()</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Resources/share/chimera/tkgui.py", line 2885, in eventLoop</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> app.mainloop()</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tkinter.py", line 1023, in mainloop</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> self.tk.mainloop(n)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Pmw/Pmw_1_3/lib/PmwBase.py", line 1747, in __call__</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> return apply(self.func, args)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Resources/share/chimera/toolbar.py", line 191, in <lambda></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> command=lambda func=callback: _guard(func))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "/Applications/Chimera.app/Contents/Resources/share/chimera/toolbar.py", line 28, in _guard</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> func()</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> File "ToolbarButton.py", line 8, in mainchain</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> MAINCHAIN = re.compile("^(N|CA|C)$", re.I)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">NameError: global name 're' is not defined</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">Error in toolbar callback:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">NameError: global name 're' is not defined</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">(see reply log for Python traceback info)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">This is just my feedback, which I hope is useful </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; ">Cheers,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><span class="Apple-style-span" style="font-size: medium; "> Will. </span></div></span></div></span></font></div></div></div></div></body></html>