<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Dear all,<div><br></div><div>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><br></div><div>**************</div><div><br></div><div><div>#!/usr/bin/env python</div><div>import re,os,sys,math, decimal, subprocess</div><div>from copy import deepcopy</div><div>from openeye.oechem import *</div><div>from decimal import *</div><div><br></div><div>script_file=open("chimera_script_for_" + "ligand" +".com", 'w')</div><div>script_file.write("open "+ "127D" +"\n")</div><div>script_file.write("open " + "127D" +"\n")</div><div>script_file.write("open "+ "ligand.pdb" +"\n")</div><div>script_file.write("match #0:"+ "6" + " " + "#1:"+ "18" +"\n")</div><div>script_file.write("write format pdb 2 "+ "flipped_" + "ligand" + "\n")</div><div>script_file.write("stop")</div><div>script_file.close</div><div>print <a href="http://script_file.name" target="_blank">script_file.name</a></div><div>chimera=subprocess.call(["chimera", " --nogui ", "<a href="http://chimera_script_for_ligand.com" target="_blank">chimera_script_for_ligand.com</a>"]) </div><div>print chimera<br></div><div>#delete the script, leaving just the flipped ligand</div><div>#os.remove(<a href="http://script_file.name" target="_blank">script_file.name</a>)</div></div><div><br></div><div>*******************</div><div><br></div><div>When I run the script, it successfully generates the .com chimera script. However, I get the following error message:</div><div><br></div><div>*******************</div><div><br></div><div><div>[christos@biophysics Desktop]$ ./script.py </div><div><a href="http://chimera_script_for_ligand.com" target="_blank">chimera_script_for_ligand.com</a></div><div>Traceback (most recent call last):</div><div> File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/__main__.py", line 69, in <module></div><div> value = chimeraInit.init(sys.argv)</div><div> File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimeraInit.py", line 638, in init</div><div> splash.create()</div><div> File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimera/splash.py", line 25, in create</div><div> sync=chimera.debug)</div><div> File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/lib/python2.7/lib-tk/Tkinter.py", line 1747, in __init__</div><div> <a href="http://self.tk" target="_blank">self.tk</a> = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)</div><div>_tkinter.TclError: no display name and no $DISPLAY environment variable</div><div>1</div></div><div><br></div><div>**********************</div><div><br></div><div>The python script successfully creates the .com script:</div><div><br></div><div>******************************</div><div><br></div><div><div>[christos@biophysics Desktop]$ more <a href="http://chimera_script_for_ligand.com" target="_blank">chimera_script_for_ligand.com</a></div><div>open 127D</div><div>open 127D</div><div>open ligand.pdb</div><div>match #0:6 #1:18</div><div>write format pdb 2 flipped_ligand</div><div>stop</div></div><div><br></div><div>***************************</div><div><br></div><div>and if I manually execute this chimera script, everything works out well:</div><div><br></div><div>**************************</div><div><br></div><div><div>[christos@biophysics Desktop]$ chimera --nogui <a href="http://chimera_script_for_ligand.com" target="_blank">chimera_script_for_ligand.com</a></div><div>Fetching 127D from web site <a href="http://www.rcsb.org" target="_blank">www.rcsb.org</a></div><div>0 Kbytes received</div><div>Fetch 127D: finished</div><div>Done fetching 127D; verifying...</div><div>Opening 127D...</div><div>#0, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div><br></div><div>#0, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div><br></div><div>Opening VRML model in 127D - Nucleotides...</div><div>127D opened</div><div>Opened VRML model in 127D - Nucleotides</div><div>Opened 127D containing 1 model, 639 atoms, and 146 residues</div><div>Fetching 127D from web site <a href="http://www.rcsb.org" target="_blank">www.rcsb.org</a></div><div>88 Kbytes received</div><div>80 Kbytes received</div><div>Fetch 127D: finished</div><div>Done fetching 127D; verifying...</div><div>Opening 127D...</div><div>#1, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div><br></div><div>#1, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')</div><div><br></div><div>Opening VRML model in 127D - Nucleotides...</div><div>127D opened</div><div>Opened VRML model in 127D - Nucleotides</div><div>Opened 127D containing 1 model, 639 atoms, and 146 residues</div><div>Opening ligand.pdb...</div><div>ligand.pdb opened</div><div>Opened ligand.pdb containing 1 model, 32 atoms, and 1 residues</div><div>Executing match ['#0:6', '#1:18'], no iteration</div><div><br></div><div>RMSD between 21 atom pairs is 0.630 angstroms</div><div>Wrote flipped_ligand into /home/christos/Desktop</div></div><div><br></div><div>*****************************</div><div><br></div><div>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><br></div><div><div><div><div dir="ltr"><div><div><div><div>Christos Deligkaris, PhD<br></div>Assistant Professor of Physics, Drury University<br></div>900 N Benton Ave, Springfield MO, 65802<br></div><span>Office Phone: <span title="Call with Google Voice"><a href="tel:%28417%29%20873-7234" value="+14178737234" target="_blank">(417) 873-7234</a></span></span><br><a href="http://www2.drury.edu/christos/index.html" target="_blank">www2.drury.edu/christos</a> <a href="https://twitter.com/DeligkarisGroup" target="_blank">@DeligkarisGroup</a> <a href="http://google.com/+ChristosDeligkaris" target="_blank">+ChristosDeligkaris</a><br><br><br></div></div></div></div>
</div></div>
</div><br></div>