<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>You can change the names of selected atoms with the “setattr” command, e.g.:</div><div class=""><br class=""></div><div class="">setattr a name HX sel</div><div class=""><br class=""></div><div class="">will change the name of all selected atoms to HX. You can’t easily modify an atom name though (i.e. add a character or number to the existing name) without using Python.</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>UCSF Computer Graphics Lab</div></div><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 17, 2017, at 10:49 AM, Elaine Meng <<a href="mailto:meng@cgl.ucsf.edu" class="">meng@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear Vladislav Dziuba,<br class="">Chimera doesn’t have a tool to rename the atoms. It would probably be simplest to text-edit the input file to change the names directly, or write a script to do it. But maybe some of the following will make what you want to do possible without changing the names.<br class=""><br class="">You can write a list of the selected atoms with menu: Actions… Write List, or command “writesel”. However, this list will give the atom names but not their serial numbers, so in your example it would give H27, not 100. <br class=""><br class="">In Chimera commands, you can actually specify atoms by serial number, for example:<br class=""><br class="">color blue @/serialNumber=12<br class="">select @/serialNumber>8<br class=""><br class="">Serial number is an attribute of the atom, and although in general you can write a list of atoms with attribute values, this specific attribute is kept hidden. There is a tricky way to copy it to a new attribute and then write it out. First select the atoms you want, then:<br class=""><br class="">(1) open the Attribute Calculator tool (in menu under Tools… Structure Analysis)<br class="">(2) in that dialog, enter Formula: atom.serialNumber<br class=""> (and whatever name you want for the new atom attribute in the entry field at the top, I just kept the default “attributeName”)<br class="">(3) check the 2nd and 5th boxes in dialog “Restrict formula domain…” (to only include the selected atoms) and “Save calculation results to file”<br class="">(you can optionally check the 4th box to also show output in the Reply Log)<br class="">(4) click OK or Apply and then specify output filename and location in the resulting dialog<br class=""><br class="">One stupid thing, however, is that it changes the integers (e.g. 10) to real numbers (e.g. 10.0) so you may still have to text-edit the results. This process might not be any easier than text-editing the atom names in the original input… your choice.<br class=""><br class="">I hope this helps,<br class="">Elaine<br class="">-----<br class="">Elaine C. Meng, Ph.D. <br class="">UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab<br class="">Department of Pharmaceutical Chemistry<br class="">University of California, San Francisco<br class=""><br class=""><blockquote type="cite" class="">On Mar 16, 2017, at 6:03 PM, Vladyslav Dziuba <<a href="mailto:xenonbat@ya.ru" class="">xenonbat@ya.ru</a>> wrote:<br class=""><br class="">Dear Sir or Madam,<br class="">I have some difficulties with using ORCA and UCSF Chimera together. Let me describe my problem first. I need to freeze some atoms (actually, a lot of atoms) in my calculations (geometry optimization), e.g. make their coordinates constant. To do that I need to specify numbers of atoms from xyz file, which is obtained from pdb-file. The problem is that for every atom in pdb-file OpenBabel generates a new number (for example H27 may become 100th atom in xyz file), so that specifying atoms that must be frozen becomes much more complicated. Given that, I'd like to ask to help me find answer on some questions:<br class="">1. How can I rename atoms? It would greatly help me identificate atoms that must be frozen. Can I rename only all selected atoms?<br class="">2.Can I modify names of selected atoms?<br class="">3. How can I get list of numbers of selected atoms? For instance I've chosen some aminoacids residues and I want to get names or numbers of all atoms chosen.<br class="">Because if I one wants to get a list of atoms in xyz file, he needs names or numbers of atoms in pdb file, but the last ones are disordered. Manual atom picking and comparison in pdb- and xyz-files is very time-consuming. UCSF Chimera is a truly powerful program so I believe there must exist an elegant solution to my problem.<br class="">Hope to receive a letter from you soon.<br class="">Thanks in advance!<br class="">Best regards,<br class="">Vladislav Dziuba<br class=""><br class=""></blockquote><br class="">_______________________________________________<br class="">Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">Manage subscription: <a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>