[Chimera-users] could not save model using write command

Zafer AYDIN zafer.aydin at agu.edu.tr
Mon Mar 18 08:40:13 PDT 2019


Dear Elaine,

I am struggling a little bit with the links you sent me and the command 
formats of chimea. I wrote the following Python script called 
addh_addcharge.py to add hydrogens and charges to a drug molecule.

import chimera
from chimera import runCommand
runCommand("addh")
runCommand("addcharge")
runCommand("write 1 format mol2 %s" % "drug.mol2")
I ran this code from command-line as

${chimera_dir}chimera --nogui --script "addh_addcharge.py" 
$drug_mol2_filename
Although I am able to add hydrogens and charges without any errors, I am 
getting the following error when I try to save the model using the last 
write command in my Python code:

MidasError: no model ids match "1"
File 
"/vol1/software/edock/2018.08.6/script/beforedocking/chimera/share/Midas/__init__.py", 
line 4253, in _getModelsFromId
    raise MidasError, "no model ids match \"%s\"" % s
Looks like the command expects me to include a model number. I checked the 
link below but could not figure out which model number I should provide:

http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/framecommand.html 
[http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/framecommand.html]
It would be quite useful if the link of each command includes an example.

I also tried the commands in

http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/save.py 
[http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/save.py]

but received other errors. I will appreciate if you can you tell me how I 
can save the model using the write command.
Thanks,
Zafer

From: "Elaine Meng (meng at cgl.ucsf.edu)" <meng at cgl.ucsf.edu>
To: Zafer AYDIN <zafer.aydin at agu.edu.tr>
Cc: chimera List <chimera-users at cgl.ucsf.edu>
Date: Fri, 15 Mar 2019 09:30:20 -0700
Subject: Re: [Chimera-users] could not find binaries for addh and addcharge 
programs


Please see the last paragraph of my previous reply.

First to figure out the commands you want, you would have to try them 
yourself in the GUI.  Then, you would put the commands in a script.  Then 
you would start Chimera with the nogui option and input your script.  These 
topics are covered in the links I sent.

Best,
Elaine

> On Mar 15, 2019, at 9:11 AM, Zafer AYDIN <zafer.aydin at agu.edu.tr 
[mailto:zafer.aydin%40agu.edu.tr]> wrote:
>
> Dear Elaine,
>  
> I want to be able to run these commands (findhbond and addcharge) from 
Linux command-line only. I don't know how I can do it through the chimera 
executable. Can you send me an example command-line that does that? I don't 
want to open structures in GUI.
>  
> Thanks,
> Zafer
>  
>  
> From: "Elaine Meng (meng at cgl.ucsf.edu [mailto:meng%40cgl.ucsf.edu])" 
<meng at cgl.ucsf.edu [mailto:meng%40cgl.ucsf.edu]>
> To: Zafer AYDIN <zafer.aydin at agu.edu.tr [mailto:zafer.aydin%40agu.edu.tr]>
> Cc: chimera-users at cgl.ucsf.edu [mailto:chimera-users%40cgl.ucsf.edu]
> Date: Fri, 15 Mar 2019 08:44:42 -0700
> Subject: Re: [Chimera-users] could not find binaries for addh and 
addcharge programs
>  
> Hi Zafer Aydin,
> The commands are “findhbond” (or “hbonds”) and “addcharge” — 
they are in the Chimera executable, and they are not separate binaries.
>  
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/hbonds.html 
[http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/hbonds.html]>
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/addcharge.html 
[http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/addcharge.html]>
>
> For example, open your structure(s) and then use commands:
>
> findhbond reveal true
> addcharge
>
> Of course, there are other command options, and you would need to read the 
manual pages linked above to decide whether you want to use any of them.
>
> If you want to use Chimera without any graphical interface (not even the 
Chimera window), you need to start it with the nogui option and input your 
structures and commands in a script.  See
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html 
[http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/startup.html]>
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html 
[http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/options.html]>
> <http://www.rbvi.ucsf.edu/chimera/docs/ProgrammersGuide/basicPrimer.html 
[http://www.rbvi.ucsf.edu/chimera/docs/ProgrammersGuide/basicPrimer.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 Mar 15, 2019, at 7:31 AM, Zafer AYDIN <zafer.aydin at agu.edu.tr 
[mailto:zafer.aydin%40agu.edu.tr]> wrote:
> >
> > Hi,
> >  
> > I installed chimera software to my Ubuntu workstation. I want to add 
hydrogen bonds and charges to ligand molecules. I could not find the addh 
and addcharge executables under the chimera directory.
> >  
> > I would readlly appreciate if you can provide me basic guidelines for 
how to add hydrogen bonds and charges to ligand molecules using chimera from 
command-line (not from GUI).
> >  
> > Many thanks,
> >  
> > Zafer Aydin
> > AGÜ Computer Engineering Department
> > Kayseri, Turkey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190318/9ccd055b/attachment.html>


More information about the Chimera-users mailing list