
On 7 Jan 2011, at 19:12, Tom Goddard wrote:
You can use the Chimera BILD format without creating a temporary file by creating a string containing the commands, then use StringIO to make a file object from that string and open it. For example,
from StringIO import StringIO bild = StringIO(".cylinder %g %g %g %g %g %g %g\n" % (end1[0], end1[1], end1[2], end2[0], end2[1], end2[2], radius)) from chimera import openModels model = openModels.open(bild, type="Bild", identifyAs='My annotations', sameAs = mol)
That's already a lot better than my temporary file solution.
The identifyAs argument assigns the name to the new model that will be shown in the Model Panel dialog. The sameAs argument says that the new model should be aligned with the specified model (same positioning transform).
And those options make it even better.
To avoid that limitation I have sometimes resorted to using (some say abusing) the Chimera Molecule object for showing annotations. The Chimera Volume Tracer tool lets you place spherical markers and connect them by cylindrical links,
That's what I have been doing until now, but I don't see how I can get arrows through Molecule objects.
None of the annotation display techniques combine flexibility with ease of use. I suggest using BILD if possible.
Sounds reasonable. Thanks for your explanations! Konrad. -- --------------------------------------------------------------------- Konrad Hinsen Centre de Biophysique Moléculaire, CNRS Orléans Synchrotron Soleil - Division Expériences Saint Aubin - BP 48 91192 Gif sur Yvette Cedex, France Tel. +33-1 69 35 97 15 E-Mail: research at khinsen dot fastmail dot net ---------------------------------------------------------------------