Re: [Chimera-users] Running a job in chimera

Dear Tuhin, The script to perform the actions (your #1 or #2) could be written in python or in Chimera commands. Just opening the python file (*.py) or Chimera command file (*.com) in Chimera will execute it. The trickier part would be how to automatically loop through your multiple structures. You could write a long Chimera command script that includes the names of the structures, or you could use a python script that loops through a list of filenames. The methods can be combined; for example, the python script could merely loop through the names and open the structures, then open a separate Chimera command script. You could also use a shell script to loop through filenames, but I guess that would be slower because it would involve starting a new Chimera for each input (#1) or set of inputs (#2). If that is easier for you, however, it is reasonable. Please see this previous posting for examples/discussion of Chimera scripts for processing multiple structures, calling a script from another script, and using aliases: <http://www.cgl.ucsf.edu/pipermail/chimera-users/2008-October/003218.html
See also Chimera nogui mode: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/options.html#nogui> I believe all the actions you want to perform can be done with Chimera commands, for example open /location/location/frame20.pdb delete solvent & protein z>5 write format pdb relative 0 0 /location/location/frame20zone5.pdb close 0 or open /location/mystruct1.pdb open /location/mystruct2.pdb open /location/mystruct3.pdb matchmaker #0 #1 matchmaker #0 #2 These are just possibilities out of several ways to perform the tasks. For example, the top example assumes your structure is a protein, and in the bottom example, you could use "match" instead of "matchmaker" to superimpose structures. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On Nov 11, 2008, at 1:41 AM, tuhin@iitk.ac.in wrote:
Dear All, I have run several simulations. But, I need to analyse a selective number of structures from each simulation saved at a given time step "t". Thus, for a 20ns simulation, starting t=0 and incrementing it by 50ps, I'll have ~400 individual structures. Each structure is within a waterbox, which contains approx. 20,000 water molecules. Once I get the structures, I need to do the following using CHIMERA:
1. Open each structure and save water molecules within a cutoff distance of 5.0 Angstrom from the protein. Thus, I'll end-up having a shell (<=5.0A) of water molecules around the protein. The saved structure will be in .pdb format and include the protein with 5.0A water shell. I know how to do it in CHIMERA using the commandline option/ pulldown menu, but, how to do it for 400 structures. Is there a way to run it in a "Batch Job" ?
2. I also need to superimpose Ca-Ca atoms of 400 structures. But, I feel there is a limit to the no. of structures that CHIMERA could handle, thus, at max. I would be superimposing 20-30 structures at a time. How could I automatize the same through a script sothat I could run it in batches?
Thanks in advance. Any suggestion(s) is welcomed. Warm regards, Tuhin

Just to add a few tidbits to Elaine's reply:
2. I also need to superimpose Ca-Ca atoms of 400 structures. But, I feel there is a limit to the no. of structures that CHIMERA could handle, thus, at max. I would be superimposing 20-30 structures at a time. How could I automatize the same through a script sothat I could run it in batches?
You might consider doing this by opening one structure in model #0 as your reference structure then opening your 400 structures, one at a time, in model #1 and matching them on the reference, pruning the unwanted waters, and then writing them out, closing each one as you finish with it. As for the script you use, you could use any programming language you know in order to generate a Chimera command script that performs the functions I outlined. If you don't know any programming languages, you might as well try writing a Python script since it's pretty easy to learn Python and Chimera can execute it directly. The most important single thing to know is that you can run any regular Chimera command via Chimera's runCommand() function. Here's a tiny script that opens files model001.pdb through model400.pdb into model #1, colors them red, and then closes them. You can probably figure out how to flesh out the script to do what you want: from chimera import runCommand for i in range(400): runCommand("open 1 model%03d.pdb" % (i+1)) runCommand("color red") runCommand("close 1") --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Nov 12, 2008, at 11:04 AM, Elaine Meng wrote:
Dear Tuhin, The script to perform the actions (your #1 or #2) could be written in python or in Chimera commands. Just opening the python file (*.py) or Chimera command file (*.com) in Chimera will execute it. The trickier part would be how to automatically loop through your multiple structures. You could write a long Chimera command script that includes the names of the structures, or you could use a python script that loops through a list of filenames. The methods can be combined; for example, the python script could merely loop through the names and open the structures, then open a separate Chimera command script. You could also use a shell script to loop through filenames, but I guess that would be slower because it would involve starting a new Chimera for each input (#1) or set of inputs (#2). If that is easier for you, however, it is reasonable.
Please see this previous posting for examples/discussion of Chimera scripts for processing multiple structures, calling a script from another script, and using aliases: <http://www.cgl.ucsf.edu/pipermail/chimera-users/2008-October/003218.html
See also Chimera nogui mode: <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/options.html#nogui>
I believe all the actions you want to perform can be done with Chimera commands, for example
open /location/location/frame20.pdb delete solvent & protein z>5 write format pdb relative 0 0 /location/location/frame20zone5.pdb close 0
or
open /location/mystruct1.pdb open /location/mystruct2.pdb open /location/mystruct3.pdb matchmaker #0 #1 matchmaker #0 #2
These are just possibilities out of several ways to perform the tasks. For example, the top example assumes your structure is a protein, and in the bottom example, you could use "match" instead of "matchmaker" to superimpose structures.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html
On Nov 11, 2008, at 1:41 AM, tuhin@iitk.ac.in wrote:
Dear All, I have run several simulations. But, I need to analyse a selective number of structures from each simulation saved at a given time step "t". Thus, for a 20ns simulation, starting t=0 and incrementing it by 50ps, I'll have ~400 individual structures. Each structure is within a waterbox, which contains approx. 20,000 water molecules. Once I get the structures, I need to do the following using CHIMERA:
1. Open each structure and save water molecules within a cutoff distance of 5.0 Angstrom from the protein. Thus, I'll end-up having a shell (<=5.0A) of water molecules around the protein. The saved structure will be in .pdb format and include the protein with 5.0A water shell. I know how to do it in CHIMERA using the commandline option/ pulldown menu, but, how to do it for 400 structures. Is there a way to run it in a "Batch Job" ?
2. I also need to superimpose Ca-Ca atoms of 400 structures. But, I feel there is a limit to the no. of structures that CHIMERA could handle, thus, at max. I would be superimposing 20-30 structures at a time. How could I automatize the same through a script sothat I could run it in batches?
Thanks in advance. Any suggestion(s) is welcomed. Warm regards, Tuhin
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Elaine Meng
-
Eric Pettersen