<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Eric, <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your information! Could I ask a new question on the method you mentioned? Thanks!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In previous python scripts, I used chimera module and runCommand method to perform the regular chimera commands smoothly.
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Because I am not familiar with BuildStructure.changeAtom(), I tried to write a color-change python script trial according to "Chimera Program Guide":</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
import Midas
<div>modellist = Midas.open("lig.pdb")</div>
<div>Midas.color('red', '@/element=F')</div>
<div>out_path = 'test.pdb'</div>
Midas.write(modellist, None, out_path)<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However, this did not work. <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Actually, I am not sure if I can use the above similar strategy to perform the changeAtom() method.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Could you please give me a hint or recommend a tutorial? Thanks!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Lei<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Eric Pettersen <pett@cgl.ucsf.edu><br>
<b>Sent:</b> Wednesday, March 24, 2021 6:42 AM<br>
<b>To:</b> Lei Qian <leiqian-temple2@outlook.com><br>
<b>Cc:</b> chimera-users@cgl.ucsf.edu BB <chimera-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [Chimera-users] [External] Re: [External] Re: in *.gro file, chimera takes CL atom as C (in compound) and gives it wrong color</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi Lei,
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Chimera does not have a command equivalent for that function.  If you know how to program in Python, you could write a Python script to call the method that Chimera is using:  BuildStructure.changeAtom().
  That method is in <your Chimera installation>/share/BuildStructure/__init__.py if you want to see the arguments it takes.</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Alternatively you could use ChimeraX, which does have a command equivalent ("build modify") for this.  You would use Chimera to write out your .gro structures as something ChimeraX
 can read (<i class="">e.g.</i> PDB) and go from there.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">--Eric</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
<div class=""><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 22, 2021, at 7:24 PM, Lei Qian <<a href="mailto:leiqian-temple2@outlook.com" class="">leiqian-temple2@outlook.com</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Hi Eric,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Thanks for your information!</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
I tried the command, saved this gro to pdb file, opened new pdb, and it worked! BTW, it seems chimera cannot write new gro file (It can write these four files: 'pdb', 'pqr', 'mol2' or 'sph', but not gro)</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Could I ask you another question?<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
In chimera I can manually change Carbon with 4 bonds to Nitrogen with 3 bonds using Tools/StructureEditing/BuildStructure/ModifyStructure. But I cannot find corresponding command line to do the same thing in chimera tutorial. So, is it possible that we can
 use command line to modify atom/element, its bonds and its geometry?<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Thanks!</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Best,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Lei<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div id="x_appendonsend" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
</div>
<hr tabindex="-1" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; display:inline-block; width:497.828125px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important"></span>
<div id="x_divRplyFwdMsg" dir="ltr" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_Apple-converted-space"> </span>Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>><br class="">
<b class="">Sent:</b><span class="x_Apple-converted-space"> </span>Tuesday, March 23, 2021 1:52 AM<br class="">
<b class="">To:</b><span class="x_Apple-converted-space"> </span>Lei Qian <<a href="mailto:tuk04130@temple.edu" class="">tuk04130@temple.edu</a>><br class="">
<b class="">Cc:</b><span class="x_Apple-converted-space"> </span><a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a> BB <<a href="mailto:chimera-users@cgl.ucsf.edu" class="">chimera-users@cgl.ucsf.edu</a>><br class="">
<b class="">Subject:</b><span class="x_Apple-converted-space"> </span>[External] Re: [Chimera-users] [External] Re: in *.gro file, chimera takes CL atom as C (in compound) and gives it wrong color</font>
<div class=""> </div>
</div>
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
Hi Lei,
<div class=""><span class="x_x_Apple-tab-span" style="white-space:pre"></span>If all your chlorine atom names start with the characters "CL", you can change them all to chlorine after you open the .gro file with this command (Favorites$B"*(BCommand Line):</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_x_Apple-tab-span" style="white-space:pre"></span>setattr a element Cl @CL=</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">--Eric</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div class=""><span class="x_x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Mar 21, 2021, at 7:54 PM, Lei Qian <<a href="mailto:tuk04130@temple.edu" class="">tuk04130@temple.edu</a>> wrote:</div>
<br class="x_x_Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi Eric, 
<div class="">Sorry for my late reply.</div>
<div class="">Yes you are right.</div>
<div class="">I tried it again: I made a new gro file containing only CL and K as ions, and opened it using chimera. </div>
<div class="">I found chimera colored K as violet, which is good; but it colored CL as the same color as Carbon: yellow.</div>
<div class="">Thank you again for your help!</div>
<div class="">Best,</div>
<div class="">Lei</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<br class="">
<div class="x_x_gmail_quote">
<div dir="ltr" class="x_x_gmail_attr">On Tue, Feb 23, 2021 at 5:04 AM Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:<br class="">
</div>
<blockquote class="x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-style:solid; border-left-color:rgb(204,204,204); padding-left:1ex">
<div class="">Hi Lei,
<div class=""><span class="" style="white-space:pre-wrap"></span>There is no explicit indication of the chemical element type in a .gro file, so it's all guesswork.  Chimera assumes that atom names that begin with any of the letters C, O, P, S, H, or N are
 the corresponding single letter element type.  This prevents atom names like CA and HG from being interpreted as calcium and mercury, rather than carbon and hydrogen.</div>
<div class=""><span class="" style="white-space:pre-wrap"></span>There aren't any great solutions.  One option is to read in the .gro file, write it out as a .mol2 file, then edit that file to change the atom type of the CL atoms to Cl, then read that back
 in.  Another is to select your CL atoms and use the "Modify Structure" tab of the Build Structure tool to change their element to Cl.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">--Eric</div>
<div class=""><br class="">
</div>
<div class=""><span class="" style="white-space:pre-wrap"></span>Eric Pettersen</div>
<div class=""><span class="" style="white-space:pre-wrap"></span>UCSF Computer Graphics Lab</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 18, 2021, at 8:30 PM, Lei Qian <<a href="mailto:tuk04130@temple.edu" target="_blank" class="">tuk04130@temple.edu</a>> wrote:</div>
<br class="">
<div class="">
<div dir="ltr" class="">Dear users,
<div class="">Could I ask a question on chimera? Thanks!</div>
<div class="">I tried to open a gro file (small compound) using chimera. Like below:</div>
<div class="">... ...</div>
<div class=""><span class="" style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"> </span><font face="tahoma, sans-serif" class=""><span class="" style="font-size:14px"><span class="x_Apple-converted-space"> </span>  1  LIG   CL   18   x.xxx   </span><span class="x_Apple-converted-space"> </span>x.xxx  <span class="" style="font-size:14px"> 
  </span><span class="x_Apple-converted-space"> </span>x.xxx  <br class="" style="font-size:14px">
<span class="" style="font-size:14px">    1  LIG  CL1   19   </span>x.xxx  <span class="" style="font-size:14px"> <span class="x_Apple-converted-space"> </span></span>x.xxx  <span class="" style="font-size:14px">   </span><span class="x_Apple-converted-space"> </span>x.xxx    </font><br class="">
</div>
<div class="">... ...</div>
<div class="">Although chimera shows the CL name "CL" when the cursor is above the atom, but the CL atom color is incorrect: the same as Carbon. </div>
<div class="">I tried to change the "CL" to "BR", and the chimera shows the correct color: dark red. It seems weird to me. Could you please give me any suggestions? </div>
<div class="">Thanks!</div>
<div class="">Best,</div>
<div class="">Lei</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
_______________________________________________<br class="">
Chimera-users mailing list:<span class="x_Apple-converted-space"> </span><a href="mailto:Chimera-users@cgl.ucsf.edu" target="_blank" class="">Chimera-users@cgl.ucsf.edu</a><br class="">
Manage subscription:<span class="x_Apple-converted-space"> </span><a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" target="_blank" class="">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
_______________________________________________<br class="">
Chimera-users mailing list:<span class="x_Apple-converted-space"> </span><a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">
Manage subscription:<span class="x_Apple-converted-space"> </span><a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Chimera-users
 mailing list:<span class="x_Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">Chimera-users@cgl.ucsf.edu</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Manage
 subscription:<span class="x_Apple-converted-space"> </span></span><a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>