Hi Eric,
Thanks for your information! Could I ask a new question on the method you mentioned? Thanks!

In previous python scripts, I used chimera module and runCommand method to perform the regular chimera commands smoothly.
Because I am not familiar with BuildStructure.changeAtom(), I tried to write a color-change python script trial according to "Chimera Program Guide":
import Midas
modellist = Midas.open("lig.pdb")
Midas.color('red', '@/element=F')
out_path = 'test.pdb'
Midas.write(modellist, None, out_path)
However, this did not work.
Actually, I am not sure if I can use the above similar strategy to perform the changeAtom() method.
Could you please give me a hint or recommend a tutorial? Thanks!
Best,

Lei





From: Eric Pettersen <pett@cgl.ucsf.edu>
Sent: Wednesday, March 24, 2021 6:42 AM
To: Lei Qian <leiqian-temple2@outlook.com>
Cc: chimera-users@cgl.ucsf.edu BB <chimera-users@cgl.ucsf.edu>
Subject: Re: [Chimera-users] [External] Re: [External] Re: in *.gro file, chimera takes CL atom as C (in compound) and gives it wrong color
 
Hi Lei,
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.
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 (e.g. PDB) and go from there.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Mar 22, 2021, at 7:24 PM, Lei Qian <leiqian-temple2@outlook.com> wrote:

Hi Eric,
Thanks for your information!

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)

Could I ask you another question?
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?

Thanks!

Best,
Lei


From: Eric Pettersen <pett@cgl.ucsf.edu>
Sent: Tuesday, March 23, 2021 1:52 AM
To: Lei Qian <tuk04130@temple.edu>
Cc: chimera-users@cgl.ucsf.edu BB <chimera-users@cgl.ucsf.edu>
Subject: [External] Re: [Chimera-users] [External] Re: in *.gro file, chimera takes CL atom as C (in compound) and gives it wrong color
 
Hi Lei,
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→Command Line):

setattr a element Cl @CL=

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Mar 21, 2021, at 7:54 PM, Lei Qian <tuk04130@temple.edu> wrote:

Hi Eric, 
Sorry for my late reply.
Yes you are right.
I tried it again: I made a new gro file containing only CL and K as ions, and opened it using chimera. 
I found chimera colored K as violet, which is good; but it colored CL as the same color as Carbon: yellow.
Thank you again for your help!
Best,
Lei








On Tue, Feb 23, 2021 at 5:04 AM Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Hi Lei,
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.
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.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Feb 18, 2021, at 8:30 PM, Lei Qian <tuk04130@temple.edu> wrote:

Dear users,
Could I ask a question on chimera? Thanks!
I tried to open a gro file (small compound) using chimera. Like below:
... ...
    1  LIG   CL   18   x.xxx    x.xxx      x.xxx  
    1  LIG  CL1   19   x.xxx    x.xxx      x.xxx    

... ...
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. 
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? 
Thanks!
Best,
Lei


_______________________________________________
Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

_______________________________________________
Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

_______________________________________________
Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users