[Chimera-users] axes

Eric Pettersen pett at cgl.ucsf.edu
Fri Jul 10 13:44:45 PDT 2020


Hi Hernando,
	Mostly yes.  The function is chimera.StructMeasure.axis().  There is a doc string for the function describing its arguments and return values.  In its simplest form it takes a numpy array of xyz values and returns a Point (centroid) instance and a Vector (unit direction vector) instance.  To get a length you would also have to supply the findBounds=True keyword argument, in which case it will return two additional floating-point values, the scale factors to apply to the unit vector to get it to the approximate bounds of the axis in each direction (so one of the scale factors will be negative).
	If you have a list of Atom instances, the easiest way to generate the numpy xyz array is with numpyArrayFromAtoms, e.g.:

import chimera
xyzs = chimera.numpyArrayForAtoms(atoms)

If you only really have an atom spec, let me know and I can help with how to generate a list of Atoms from that.

--Eric

	Eric Pettersen
	UCSF Computer Graphics Lab

> On Jul 10, 2020, at 11:54 AM, Hernando J Sosa <hernando.sosa at einsteinmed.org> wrote:
> 
> Dear Chimera,
> 
> Is there a way to run a  command within a python script equivalent to the chimera command 'define axis' to be able to retrieve the results (length,center, direction) ?  Something like:
> 
> (length,center,direction) = mydefineaxis(atomspec)
> 
> Thanks
> 
> Hernando
> 
> 
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu <mailto:Chimera-users at cgl.ucsf.edu>
> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20200710/1aa58b3f/attachment-0001.html>


More information about the Chimera-users mailing list