Unable to run UCSF chimera using
Hi,
Is it possible to use python to execute commands on the command line of UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html
System command-line Chimera startup options: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users chimera-users@cgl.ucsf.edu wrote:
Hi,
Is it possible to use python to execute commands on the command line of UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
Thanks Elaine. Your reply helped a lot.
On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng meng@cgl.ucsf.edu wrote:
Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html
System command-line Chimera startup options: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <
chimera-users@cgl.ucsf.edu> wrote:
Hi,
Is it possible to use python to execute commands on the command line of
UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its
GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
Just a follow-up query. Suppose I want to run two different python scripts using the "runscript" command. Is it possible that instead of declaring them in two separate python files, I create one python file, declare two separate functions and call them one after the another using the "runscript" command?
On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng meng@cgl.ucsf.edu wrote:
Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html
System command-line Chimera startup options: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <
chimera-users@cgl.ucsf.edu> wrote:
Hi,
Is it possible to use python to execute commands on the command line of
UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its
GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
Hi Prathvi, If you mean the script provided to runscript has two functions defined in it, and then calls one and then the other, then yes, absolutely. If you mean that the script defines two functions, but that some runscript calls call one of the functions, and some call the other, then which function to call would somehow need to be indicated by the arguments to the runscript commands, but basically also yes.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Aug 26, 2023, at 8:33 AM, Prathvi Singh via Chimera-users chimera-users@cgl.ucsf.edu wrote:
Just a follow-up query. Suppose I want to run two different python scripts using the "runscript" command. Is it possible that instead of declaring them in two separate python files, I create one python file, declare two separate functions and call them one after the another using the "runscript" command?
On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng <meng@cgl.ucsf.edu mailto:meng@cgl.ucsf.edu> wrote:
Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html
System command-line Chimera startup options: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu mailto:chimera-users@cgl.ucsf.edu> wrote:
Hi,
Is it possible to use python to execute commands on the command line of UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
-- Prathvi Singh, Research Fellow, Department of Biological Sciences & Bioengineering, Indian Institute of Technology, Kanpur-208016 _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
Hi Eric,
Thank you for your response but I am still left with 2 questions. I am using the following code to run chimera GUI and then execute the runscript command for a script containing two functions "func1" (which prints hello on the reply log) and "func2" (which prints bye on the reply log):
import subprocess p1 = subprocess.Popen(["C:\Program Files\Chimera 1.17.1\bin\chimera.exe", "--script", "D:\myscript.py"], stdout = subprocess.PIPE, stderr = subprocess.PIPE) out, err = p1.communicate() print(out.decode("utf-8")) print(err.decode("utf-8"))
Suppose I declare a variable called "myvar" in the above code, then is it possible to send this variable to "func1" and execute only "func1"?
On Tue, Aug 29, 2023 at 12:29 AM Eric Pettersen pett@cgl.ucsf.edu wrote:
Hi Prathvi, If you mean the script provided to runscript has two functions defined in it, and then calls one and then the other, then yes, absolutely. If you mean that the script defines two functions, but that some runscript calls call one of the functions, and some call the other, then which function to call would somehow need to be indicated by the arguments to the runscript commands, but basically also yes.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Aug 26, 2023, at 8:33 AM, Prathvi Singh via Chimera-users < chimera-users@cgl.ucsf.edu> wrote:
Just a follow-up query. Suppose I want to run two different python scripts using the "runscript" command. Is it possible that instead of declaring them in two separate python files, I create one python file, declare two separate functions and call them one after the another using the "runscript" command?
On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng meng@cgl.ucsf.edu wrote:
Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html
System command-line Chimera startup options: https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <
chimera-users@cgl.ucsf.edu> wrote:
Hi,
Is it possible to use python to execute commands on the command line of
UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its
GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
-- Prathvi Singh, Research Fellow, Department of Biological Sciences & Bioengineering, Indian Institute of Technology, Kanpur-208016 _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
Hi Prathvi, No, it isn't possible. Chimera only accepts Chimera commands on standard input, and only if you aren't supplying a "--script" argument (or if you also supply "--start ReadStdin"). Perhaps if you described what the actual goal of this coding effort is then we would be able to offer more effective advice. You may be trying to fit a square peg in a round hole with this run-Chimera-as-subprocess approach.
--Eric
On Aug 30, 2023, at 1:59 AM, Prathvi Singh via Chimera-users chimera-users@cgl.ucsf.edu wrote:
Hi Eric,
Thank you for your response but I am still left with 2 questions. I am using the following code to run chimera GUI and then execute the runscript command for a script containing two functions "func1" (which prints hello on the reply log) and "func2" (which prints bye on the reply log):
import subprocess p1 = subprocess.Popen(["C:\Program Files\Chimera 1.17.1\bin\chimera.exe", "--script", "D:\myscript.py"], stdout = subprocess.PIPE, stderr = subprocess.PIPE) out, err = p1.communicate() print(out.decode("utf-8")) print(err.decode("utf-8"))
Suppose I declare a variable called "myvar" in the above code, then is it possible to send this variable to "func1" and execute only "func1"?
On Tue, Aug 29, 2023 at 12:29 AM Eric Pettersen <pett@cgl.ucsf.edu mailto:pett@cgl.ucsf.edu> wrote: Hi Prathvi, If you mean the script provided to runscript has two functions defined in it, and then calls one and then the other, then yes, absolutely. If you mean that the script defines two functions, but that some runscript calls call one of the functions, and some call the other, then which function to call would somehow need to be indicated by the arguments to the runscript commands, but basically also yes.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Aug 26, 2023, at 8:33 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu mailto:chimera-users@cgl.ucsf.edu> wrote:
Just a follow-up query. Suppose I want to run two different python scripts using the "runscript" command. Is it possible that instead of declaring them in two separate python files, I create one python file, declare two separate functions and call them one after the another using the "runscript" command?
On Fri, Aug 25, 2023 at 4:59 AM Elaine Meng <meng@cgl.ucsf.edu mailto:meng@cgl.ucsf.edu> wrote: Hi Prathvi, I don't know about startup using python, but you can start Chimera from the system command line with startup option --nogui and specify input files that could include a python script or Chimera command script for Chimera to execute. See the following help pages:
Chimera startup: <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html>
System command-line Chimera startup options: <https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html https://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html>
I hope this helps, Elaine
Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Aug 24, 2023, at 1:18 AM, Prathvi Singh via Chimera-users <chimera-users@cgl.ucsf.edu mailto:chimera-users@cgl.ucsf.edu> wrote:
Hi,
Is it possible to use python to execute commands on the command line of UCSF chimera without actually opening its GUI on the Windows platform?
If not, then how to use python to open its GUI and execute the commands?
I tried the "subprocess.Popen()" and "os.system()" methods to run its GUI by passing the path of chimera executable (version 1.17.1) to them but chimera is displaying an error with exit code 1 (snapshot attached). However, I am able to launch chimeraX (version 1.6.1) via these methods.
-- Prathvi Singh, Research Fellow, Department of Biological Sciences & Bioengineering, Indian Institute of Technology, Kanpur-208016 _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu mailto:chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu mailto:chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/ https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
-- Prathvi Singh, Research Fellow, Department of Biological Sciences & Bioengineering, Indian Institute of Technology, Kanpur-208016 _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Prathvi Singh