[chimera-dev] Drawing arrows to point at atoms

Thomas Goddard goddard at cgl.ucsf.edu
Mon Dec 15 14:49:17 PST 2008


Hi Miguel,

   The trouble with your code was you needed to use

	needle(a.xformCoord())

instead of

	needle(a.coord())

The a.coord() gives the coordinates in the molecule's local coordinates 
while a.xformCoord() gives the coordinates in global Chimera coordinates 
which is what the place_marker() routine wants.

	Tom


Miguel Ortiz Lombardia wrote:
> Dear Tom,
> 
> I'm naively trying to modify your molecular voodoo script to have 
> needles pointing to selected residues (specifically to their CA atoms) I 
> would really appreciate if you can help me with two probably simple 
> questions. Firstly, this is my current code
> 
> 8<-----------------------------
> def needle(center):
> 
>     xyz_in = center
>     xyz_out = center[0]+5,center[1]+5,center[2]+5
> 
>     from chimera import selection
>     selection.clearCurrent()
>     from VolumePath import place_marker
>     place_marker(xyz_in)
>     place_marker(xyz_out)
> 
> from chimera import selection, UserError
> atoms = [a for a in selection.currentAtoms() if a.name == 'CA']
> if not atoms:
>     raise UserError("No CA atoms selected")
> 
> for a in atoms:
>     needle(a.coord())
> ------------------------------>8
> 
> And these are the questions:
> 
> 1. Why the positions of the m1 markers don't correspond to those of the 
> CA atoms?
> 2. How could I modify the code to make every marker go to a different 
> set, so I can then rotate them one by one appropriately so the figure 
> shows the 'needles' in different directions, so that I can label them 
> later on without overlap?
> 
> I hope it isn't too silly...
> 
> Cheers,
> 
> 
> -- 
> Miguel Ortiz Lombardía
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> !!!                  NEW ADDRESS                    !!!
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> Architecture et Fonction des Macromolécules Biologiques
> UMR6098, CNRS, Université Aix-Marseille I & II
> Case 932
> 163 Avenue de Luminy
> 13288 Marseille cedex 9
> France
> Tel : +33(0) 491 82 55 93
> Fax: +33(0) 491 26 67 20
> e-mail: miguel.ortiz-lombardia at afmb.univ-mrs.fr
> Web: http://www.pangea.org/mol/spip.php?rubrique2
> 
> 



More information about the Chimera-dev mailing list