<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Christos,<div class=""><br class=""></div><div class="">&nbsp; I think your error is because the “—nogui” option in your subprocess.call() has spaces before and after inside the quote marks. &nbsp;Take those spaces out and I bet it will work. &nbsp;The error seems to be trying to create the Chimera splash screen which would not happen in nogui mode.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Tom</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 16, 2015, at 8:30 PM, Christos Deligkaris wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">Dear all,<div class=""><br class=""></div><div class="">I have a python script that creates a .com command script for chimera and then attempts to run the chimera script. Here is the python script:</div><div class=""><br class=""></div><div class="">**************</div><div class=""><br class=""></div><div class=""><div class="">#!/usr/bin/env python</div><div class="">import re,os,sys,math, decimal, subprocess</div><div class="">from copy import deepcopy</div><div class="">from openeye.oechem import *</div><div class="">from decimal import *</div><div class=""><br class=""></div><div class="">script_file=open("chimera_script_for_" + "ligand" +".com", 'w')</div><div class="">script_file.write("open "+ "127D" +"\n")</div><div class="">script_file.write("open " + "127D" +"\n")</div><div class="">script_file.write("open "+ "ligand.pdb" +"\n")</div><div class="">script_file.write("match #0:"+ "6" + " " + "#1:"+ "18" +"\n")</div><div class="">script_file.write("write format pdb 2 "+ "flipped_" + "ligand" + "\n")</div><div class="">script_file.write("stop")</div><div class="">script_file.close</div><div class="">print <a href="http://script_file.name/" target="_blank" class="">script_file.name</a></div><div class="">chimera=subprocess.call(["chimera", " --nogui ", "<a href="http://chimera_script_for_ligand.com/" target="_blank" class="">chimera_script_for_ligand.com</a>"]) &nbsp; &nbsp; &nbsp;&nbsp;</div><div class="">print chimera<br class=""></div><div class="">#delete the script, leaving just the flipped ligand</div><div class="">#os.remove(<a href="http://script_file.name/" target="_blank" class="">script_file.name</a>)</div></div><div class=""><br class=""></div><div class="">*******************</div><div class=""><br class=""></div><div class="">When I run the script, it successfully generates the .com chimera script. However, I get the following error message:</div><div class=""><br class=""></div><div class="">*******************</div><div class=""><br class=""></div><div class=""><div class="">[christos@biophysics Desktop]$ ./script.py&nbsp;</div><div class=""><a href="http://chimera_script_for_ligand.com/" target="_blank" class="">chimera_script_for_ligand.com</a></div><div class="">Traceback (most recent call last):</div><div class="">&nbsp; File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/__main__.py", line 69, in &lt;module&gt;</div><div class="">&nbsp; &nbsp; value = chimeraInit.init(sys.argv)</div><div class="">&nbsp; File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimeraInit.py", line 638, in init</div><div class="">&nbsp; &nbsp; splash.create()</div><div class="">&nbsp; File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimera/splash.py", line 25, in create</div><div class="">&nbsp; &nbsp; sync=chimera.debug)</div><div class="">&nbsp; File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/lib/python2.7/lib-tk/Tkinter.py", line 1747, in __init__</div><div class="">&nbsp; &nbsp; <a href="http://self.tk/" target="_blank" class="">self.tk</a> = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)</div><div class="">_tkinter.TclError: no display name and no $DISPLAY environment variable</div><div class="">1</div></div><div class=""><br class=""></div><div class="">**********************</div><div class=""><br class=""></div><div class="">The python script successfully creates the .com script:</div><div class=""><br class=""></div><div class="">******************************</div><div class=""><br class=""></div><div class=""><div class="">[christos@biophysics Desktop]$ more <a href="http://chimera_script_for_ligand.com/" target="_blank" class="">chimera_script_for_ligand.com</a></div><div class="">open 127D</div><div class="">open 127D</div><div class="">open ligand.pdb</div><div class="">match #0:6 #1:18</div><div class="">write format pdb 2 flipped_ligand</div><div class="">stop</div></div><div class=""><br class=""></div><div class="">***************************</div><div class=""><br class=""></div><div class="">and if I manually execute this chimera script, everything works out well:</div><div class=""><br class=""></div><div class="">**************************</div><div class=""><br class=""></div><div class=""><div class="">[christos@biophysics Desktop]$ chimera --nogui <a href="http://chimera_script_for_ligand.com/" target="_blank" class="">chimera_script_for_ligand.com</a></div><div class="">Fetching 127D from web site <a href="http://www.rcsb.org/" target="_blank" class="">www.rcsb.org</a></div><div class="">0 Kbytes received</div><div class="">Fetch 127D: finished</div><div class="">Done fetching 127D; verifying...</div><div class="">Opening 127D...</div><div class="">#0, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div class=""><br class=""></div><div class="">#0, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div class=""><br class=""></div><div class="">Opening VRML model in 127D - Nucleotides...</div><div class="">127D opened</div><div class="">Opened VRML model in 127D - Nucleotides</div><div class="">Opened 127D containing 1 model, 639 atoms, and 146 residues</div><div class="">Fetching 127D from web site <a href="http://www.rcsb.org/" target="_blank" class="">www.rcsb.org</a></div><div class="">88 Kbytes received</div><div class="">80 Kbytes received</div><div class="">Fetch 127D: finished</div><div class="">Done fetching 127D; verifying...</div><div class="">Opening 127D...</div><div class="">#1, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div class=""><br class=""></div><div class="">#1, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div class=""><br class=""></div><div class="">Opening VRML model in 127D - Nucleotides...</div><div class="">127D opened</div><div class="">Opened VRML model in 127D - Nucleotides</div><div class="">Opened 127D containing 1 model, 639 atoms, and 146 residues</div><div class="">Opening ligand.pdb...</div><div class="">ligand.pdb opened</div><div class="">Opened ligand.pdb containing 1 model, 32 atoms, and 1 residues</div><div class="">Executing match ['#0:6', '#1:18'], no iteration</div><div class=""><br class=""></div><div class="">RMSD between 21 atom pairs is 0.630 angstroms</div><div class="">Wrote flipped_ligand into /home/christos/Desktop</div></div><div class=""><br class=""></div><div class="">*****************************</div><div class=""><br class=""></div><div class="">Why do I get the error message when I attempt to run chimera through script.py? Is this a python issue or a chimera issue? I appreciate any thoughts on solving this problem....thank you,</div><div class=""><br class=""></div><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Christos Deligkaris, PhD<br class=""></div>Assistant Professor of Physics, Drury University<br class=""></div>900 N Benton Ave, Springfield MO, 65802<br class=""></div><span class="">Office Phone: <span title="Call with Google Voice" class=""><a href="tel:%28417%29%20873-7234" value="+14178737234" target="_blank" class="">(417) 873-7234</a></span></span><br class=""><a href="http://www2.drury.edu/christos/index.html" target="_blank" class="">www2.drury.edu/christos</a> <a href="https://twitter.com/DeligkarisGroup" target="_blank" class="">@DeligkarisGroup</a> <a href="http://google.com/+ChristosDeligkaris" target="_blank" class="">+ChristosDeligkaris</a><br class=""><br class=""><br class=""></div></div></div></div>
</div></div>
</div><br class=""></div>
_______________________________________________<br class="">Chimera-users mailing list<br class=""><a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users<br class=""></div></blockquote></div><br class=""></div></body></html>