[Chimera-users] using IDLE

Elaine Meng meng at cgl.ucsf.edu
Thu Feb 7 09:48:50 PST 2008

Hi Ben,
When creating a script or alias, the first thing is to try all the  
commands individually rather than generating the whole thing at once  
and then wondering which one has not performed as expected.

It looks like you had a space after the colon, which would not select  

For example, I have a file ala12.mol2, so I tried the following  

open ala12.mol2  (it was in the same directory in which I started  
sel :2-6
write selected 0 ala12.stuff.mol2

I could see the selection command selected something, and then I  
could look in the output file, which did indeed contain those residues.

Having validated the process, I can then try

alias ^dostuff open $1.mol2; sel :2-6; write selected 0 $1.stuff.mol2
dostuff ala12

This does not address your underscore issue; I haven't experimented  
with that yet, but you may need to rename your inputs at least for now.
I hope this helps,
Elaine C. Meng, Ph.D.                          meng at cgl.ucsf.edu
UCSF Computer Graphics Lab and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Feb 7, 2008, at 9:32 AM, Ben Keshet wrote:
> Hi Eric,
> Thanks for the detailed answer.  I think the .cmd script will be  
> sufficient for my purpose, however I was unable to write it  
> correctly.  What I want to do is slightly more complex than I  
> outlined – I need to: open a mol2 structure, select certain  
> residues (say select: 69-70), save the selected residues as a mol2  
> file, and select different residues and save them several more  
> times.  The .cmd looks something like that:
> alias ^process open $1.mol2; sel : 69-70; write selected 0  
> $1.his_CEGI.mol2;
> process p2
> However, I was unable to create a proper mol2 file (I tried  
> different options but my guess is that I have a syntax error).  In  
> some cases I was able to write out a file, but it was never a  
> proper mol2 file.  Alternatively, I tried:
> alias ^process open $1.mol2; sel : 69-70; select invert; del sel;  
> write 0 $1.his_CEGI.mol2;
> process p2
> which generated p2.his_CEGI.mol2, but the file could not be viewed  
> with Chimera, and when inspected it looked different (no charge  
> column and extra 3 columns: 1.00, 0.00, atom name).  The whole  
> script should be able to save mol2 files of several subsequences of  
> several different structures.  I would appreciate if you could help  
> me identify what missing in the script.
> On a related note, the name of my structures have an underline in  
> them (_), I noticed that Chimera puts a space instead.  How do I  
> make Chimera read, for example, p2_3.mol2 as it is (and not as p2  
> 3.mol2)?
> Thanks a lot for you help,
> ben

More information about the Chimera-users mailing list