Writing residues coordinates and COMs

Hello, I am writing a python script to iterate through all the residues of my model and write the residue coordinates and its correspondent center of mass. I tried with 'runCommand' with the command 'write' but it only accepts a model to be written, not a specific residue. Any thoughts? Thanks in advance. Yasser

Hi Yasser, In general you should first figure out all the commands you need to use before putting them into python form. (And then if there are some things not available as commands, they may be possible to do in python, but that is not the issue here.) You can use a command to select the residue and then use the "write" command option "selected" to include only the atoms that are selected, for example, commands: select #0:25.A write selected 25.pdb <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/write.html> However, it will require more python knowledge to loop through all the residues and substitute their numbers into the "select" command (and output file name, if that's what you want). I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 14, 2020, at 1:26 AM, Yasser Almeida <yasser.almeida@gmail.com> wrote:
Hello,
I am writing a python script to iterate through all the residues of my model and write the residue coordinates and its correspondent center of mass. I tried with 'runCommand' with the command 'write' but it only accepts a model to be written, not a specific residue.
Any thoughts?
Thanks in advance.
Yasser

Hi Elaine, Thank you for your message and sorry for the late reply. I found a pythonic way to get the COMs of the residues of interest and save their xyz coordinates. That's more flexible for my problem. Best, Yasser El mié., 14 oct. 2020 a las 18:42, Elaine Meng (<meng@cgl.ucsf.edu>) escribió:
Hi Yasser, In general you should first figure out all the commands you need to use before putting them into python form. (And then if there are some things not available as commands, they may be possible to do in python, but that is not the issue here.)
You can use a command to select the residue and then use the "write" command option "selected" to include only the atoms that are selected, for example, commands:
select #0:25.A write selected 25.pdb
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/write.html>
However, it will require more python knowledge to loop through all the residues and substitute their numbers into the "select" command (and output file name, if that's what you want). I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Oct 14, 2020, at 1:26 AM, Yasser Almeida <yasser.almeida@gmail.com> wrote:
Hello,
I am writing a python script to iterate through all the residues of my model and write the residue coordinates and its correspondent center of mass. I tried with 'runCommand' with the command 'write' but it only accepts a model to be written, not a specific residue.
Any thoughts?
Thanks in advance.
Yasser
participants (2)
-
Elaine Meng
-
Yasser Almeida