
Hello list, I received an answer concerning this topic but via the chimera menus which I tested in the first place and works fine. Actually I want to do this from the python shell, so here is my repost: ----------------------------------------------------------------------- I'd like to change the guide atom in res.ribbonData to use C instead of CA as an example. Here is what I did: for r in mol.residues: for a in r.atoms: if a.name == 'C': r.ribbonData.guide = a # Set C as guide Atom if r.isHelix: # Update the display r.ribbonDisplay = True r.ribbonDrawMode = chimera.Residue.Ribbon_Round This does not seem to redisplay/recompute the helix through C Atoms, the helix still goes through CA but not C atoms. I am not confident with the way I altered the guide Atom or maybe is it another problem like updating the ribbon or so... If someone can help... Thanks to all PL

The reason your code did not work is that "ribbonData" is recomputed whenever the molecule representation is changed (thereby wiping out your changes). The attribute that actually controls the atoms being used for ribbon representation is in "ribbonResidueClass" (the name made sense when I wrote the code :-). Attached is a script that changes the guide atom for all residues to "C". Please let me know if you have any questions or suggestions. Conrad Patrick Ladam wrote:
Hello list,
I received an answer concerning this topic but via the chimera menus which I tested in the first place and works fine. Actually I want to do this from the python shell, so here is my repost: -----------------------------------------------------------------------
I'd like to change the guide atom in res.ribbonData to use C instead of CA as an example. Here is what I did:
for r in mol.residues: for a in r.atoms: if a.name == 'C': r.ribbonData.guide = a # Set C as guide Atom if r.isHelix: # Update the display r.ribbonDisplay = True r.ribbonDrawMode = chimera.Residue.Ribbon_Round
This does not seem to redisplay/recompute the helix through C Atoms, the helix still goes through CA but not C atoms.
I am not confident with the way I altered the guide Atom or maybe is it another problem like updating the ribbon or so... If someone can help...
Thanks to all
PL
_______________________________________________ Chimera-dev mailing list Chimera-dev@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-dev
import chimera from chimera import RibbonResidueClass as RRC # Set up a new ribbon residue class with guide atom "C" # instead of "CA". The four arguments are # the name of the guide atom, # the name of the atom defining the plane of the ribbon, # whether the plane should be flipped 90 degrees, and # whether the residue is a nucleic acid rather than amino acid # The positions determine where the mainchain atoms are mapped # along the ribbon, which is visible when you display bonds to # the mainchain atoms. myRRC = RRC("C", "O", False, False) myRRC.addPosition("N", 1.0 / 6.0) myRRC.addPosition("CA", 1.0 / 2.0) myRRC.addPosition("C", 5.0 / 6.0) myRRC.addPosition("O", 1.0) myRRC.addPosition("OXT", 1.0) mol = chimera.openModels.list()[0] for r in mol.residues: r.ribbonResidueClass = myRRC if r.isHelix: r.ribbonDisplay = True r.ribbonDrawMode = chimera.Residue.Ribbon_Round else: r.ribbonDisplay = False
participants (2)
-
Conrad Huang
-
Patrick Ladam