Thank you Tom. If I take out the spaces, those error messages disappear. It seems that that was a chimera issue.However, the chimera .com script is still not being executed with the subprocess.call command. I am not sure now whether this is a chimera issue or a python issue....Office Phone: (417) 873-7234900 N Benton Ave, Springfield MO, 65802Christos Deligkaris, PhDAssistant Professor of Physics, Drury University
www2.drury.edu/christos @DeligkarisGroup +ChristosDeligkarisOn Mon, Feb 16, 2015 at 11:02 PM, Tom Goddard <goddard@sonic.net> wrote:Hi Christos,I think your error is because the “—nogui” option in your subprocess.call() has spaces before and after inside the quote marks. Take those spaces out and I bet it will work. The error seems to be trying to create the Chimera splash screen which would not happen in nogui mode.TomOn Feb 16, 2015, at 8:30 PM, Christos Deligkaris wrote:_______________________________________________Dear all,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:**************#!/usr/bin/env pythonimport re,os,sys,math, decimal, subprocessfrom copy import deepcopyfrom openeye.oechem import *from decimal import *script_file=open("chimera_script_for_" + "ligand" +".com", 'w')script_file.write("open "+ "127D" +"\n")script_file.write("open " + "127D" +"\n")script_file.write("open "+ "ligand.pdb" +"\n")script_file.write("match #0:"+ "6" + " " + "#1:"+ "18" +"\n")script_file.write("write format pdb 2 "+ "flipped_" + "ligand" + "\n")script_file.write("stop")script_file.closeprint script_file.namechimera=subprocess.call(["chimera", " --nogui ", "chimera_script_for_ligand.com"])print chimera#delete the script, leaving just the flipped ligand#os.remove(script_file.name)*******************When I run the script, it successfully generates the .com chimera script. However, I get the following error message:*******************[christos@biophysics Desktop]$ ./script.pyTraceback (most recent call last):File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/__main__.py", line 69, in <module>value = chimeraInit.init(sys.argv)File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimeraInit.py", line 638, in initsplash.create()File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/share/chimera/splash.py", line 25, in createsync=chimera.debug)File "/share/apps/PROGRAMS/CHIMERA/CHIMERA-1.9/lib/python2.7/lib-tk/Tkinter.py", line 1747, in __init__self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)_tkinter.TclError: no display name and no $DISPLAY environment variable1**********************The python script successfully creates the .com script:******************************[christos@biophysics Desktop]$ more chimera_script_for_ligand.comopen 127Dopen 127Dopen ligand.pdbmatch #0:6 #1:18write format pdb 2 flipped_ligandstop***************************and if I manually execute this chimera script, everything works out well:**************************[christos@biophysics Desktop]$ chimera --nogui chimera_script_for_ligand.comFetching 127D from web site www.rcsb.org0 Kbytes receivedFetch 127D: finishedDone fetching 127D; verifying...Opening 127D...#0, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')#0, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')Opening VRML model in 127D - Nucleotides...127D openedOpened VRML model in 127D - NucleotidesOpened 127D containing 1 model, 639 atoms, and 146 residuesFetching 127D from web site www.rcsb.org88 Kbytes received80 Kbytes receivedFetch 127D: finishedDone fetching 127D; verifying...Opening 127D...#1, chain A: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')#1, chain B: dna (5'-D(*cp*gp*cp*gp*ap*ap*tp*tp*cp*gp*cp*G)- 3')Opening VRML model in 127D - Nucleotides...127D openedOpened VRML model in 127D - NucleotidesOpened 127D containing 1 model, 639 atoms, and 146 residuesOpening ligand.pdb...ligand.pdb openedOpened ligand.pdb containing 1 model, 32 atoms, and 1 residuesExecuting match ['#0:6', '#1:18'], no iterationRMSD between 21 atom pairs is 0.630 angstromsWrote flipped_ligand into /home/christos/Desktop*****************************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,Office Phone: (417) 873-7234900 N Benton Ave, Springfield MO, 65802Christos Deligkaris, PhDAssistant Professor of Physics, Drury University
www2.drury.edu/christos @DeligkarisGroup +ChristosDeligkaris
Chimera-users mailing list
Chimera-users@cgl.ucsf.edu
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
_______________________________________________
Chimera-users mailing list
Chimera-users@cgl.ucsf.edu
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users