[Chimera-users] create automatically all alternative protonation states of protein
Eric Pettersen
pett at cgl.ucsf.edu
Thu Mar 21 16:34:26 PDT 2019
Hi Thomas,
I don’t understand your aversion to the recursion solution. Recursion will enumerate all the combinations.
Well, regardless, if you wish to use another approach that’s okay. In order to install a Python package where Chimera will find it, you need to install it with Chimera’s Python interpreter. How you do so is covered in the Programmer’s FAQ: https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html <https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html> (actually tomorrow’s FAQ, since it needed a little tweak). So namely:
3b) Installing Python packages into Chimera. <>
To use a package from Chimera, you would need to install it with Chimera's Python. Chimera's Python has the Python version number appended to it, so it will be named python2.x (python2.7 when this was written; also on Windows add ".exe"). On non-Mac, it will be found in <your Chimera installation>/bin. On Mac it's in Chimera.app/Contents/Resources/bin — don't use the one in Chimera.app/Contents/MacOS!
The best way to install packages is with pip, using (Chimera's) python2.x -m pip install package. If the pip module is not found, you'll need to install it first with (Chimera's) python2.x -m ensurepip. Then -m pip install will work. For packages not supported by pip, you will have to follow the installation instructions that come with the package.
—Eric
Eric Pettersen
UCSF Computer Graphics Lab
> On Mar 20, 2019, at 4:17 PM, Thomas Evangelidis <tevang3 at gmail.com> wrote:
>
> Hi Eric,
>
> Thank you very much for the sample code. I am afraid though that recursion is not the proper solution. There are much more combinations of protonation states that must be created. I solved this problem by expanding Tree structures. However the python module for Tree structures named 'ete3' is not a standard one, hence Chimera's python interpreter cannot find it although I have installed in on my local Anaconda python distribution. Do you know how I can make Chimera find it? I can imagine that even if it finds it, there may be conflicts between my local python version and Chimera's python version.
>
> Traceback (most recent call last):
> File "/home/thomas/Programs/Chimera/share/chimeraInit.py", line 698, in init
> midas_text.doRunScript("runscript", script)
> File "/home/thomas/Programs/Chimera/share/Midas/midas_text.py", line 2248, in doRunScript
> execfile(scriptPath, scriptGlobals)
> File "/usr/local/bin/protonate_receptor.py", line 12, in <module>
> from ete3 import Tree
> ImportError: No module named ete3
>
>
>
>
> On Tue, 19 Mar 2019 at 19:04, Eric Pettersen <pett at cgl.ucsf.edu <mailto:pett at cgl.ucsf.edu>> wrote:
> hi Thomas,
> I’m pretty sure this would have to be a Python script. The general idea would be to select residues within a certain distance of the ligand, systematically change their names to indicate alternative protonation states, delete all protons and then run AddH and write out PDBs. Since you have an indeterminate number of loops needed, I would use recursion, so something like:
>
> pdb_num = 1
> from chimera import runCommand as rc
> rc(“sel ligands z<DIST”)
> from chimera.selection import currentResidues
> residues = currentResidues()
>
> def change_protonation(remaining_residues):
> if not remaining_residues:
> global pdb_num
> rc(“del H”)
> rc(“addh”)
> rc(“write %d.pdb” % pdb_num)
> pdb_num += 1
> return
> r = remaining_residues[0]
> if r.type == “GLU”:
> states = [“GLU”, “GLH”]
> elif r.type == “ASP”:
> states = [“ASP”, “ASH”]
> elif r.type == “HIS”:
> etc….
>
> else:
> states = [r.type]
> for state in states:
> r.type = state
> change_protonation(remaining_residues[1:])
>
> change_protonation(residues)
>
> The script is incomplete and I haven’t tested it, but you get the idea.
>
> —Eric
>
>
> Eric Pettersen
> UCSF Computer Graphics Lab
>
>
>
>
>> On Mar 19, 2019, at 7:59 AM, Thomas Evangelidis <tevang3 at gmail.com <mailto:tevang3 at gmail.com>> wrote:
>>
>> Greetings,
>>
>> I want to write a script that will read a protein-ligand complex, will find all residues with alternative protonation states within a radius from the ligand, and will write to separate pdb files all combinations of alternative protonations or the protein's binding site. Is this possible in Chimera? I saw at the documentation of addh command that there is not a way to specify explicitly which residues to protonate and how (e.g. I can protonate all ASP to ASH but not ASP34 to ASH34 and keep ASP52 as it is).
>>
>> Thanks in advance.
>> Thomas
>>
>> --
>> ======================================================================
>> Dr Thomas Evangelidis
>> Research Scientist
>> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy of Sciences <https://www.uochb.cz/web/structure/31.html?lang=en>
>> Prague, Czech Republic
>> &
>> CEITEC - Central European Institute of Technology <https://www.ceitec.eu/>
>> Brno, Czech Republic
>>
>> email: tevang3 at gmail.com <mailto:tevang3 at gmail.com>
>> website: https://sites.google.com/site/thomasevangelidishomepage/ <https://sites.google.com/site/thomasevangelidishomepage/>
>>
>>
>> _______________________________________________
>> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu <mailto:Chimera-users at cgl.ucsf.edu>
>> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
>
>
>
> --
> ======================================================================
> Dr Thomas Evangelidis
> Research Scientist
> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy of Sciences <https://www.uochb.cz/web/structure/31.html?lang=en>
> Prague, Czech Republic
> &
> CEITEC - Central European Institute of Technology <https://www.ceitec.eu/>
> Brno, Czech Republic
>
> email: tevang3 at gmail.com <mailto:tevang3 at gmail.com>
> website: https://sites.google.com/site/thomasevangelidishomepage/ <https://sites.google.com/site/thomasevangelidishomepage/>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190321/6def3d8d/attachment.html>
More information about the Chimera-users
mailing list