saving custom molecular attributes

If you are writing any code that adds non-standard attributes to Atoms/Molecules/Residues/Bonds and you want those attributes preserved in sessions, you can now use the registerAttribute() function to do this. I've appended more info below. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu Custom Molecular Attributes If you add non-standard attributes to Molecules/Residues/Bonds/Atoms that you want preserved in restored sessions, use SimpleSession's restoreAttribute() function, e.g,: import chimera from SimpleSession import registerAttribute registerAttribute(chimera.Molecule, "qsarVal") Note that the Define Attribute tool automatically does this registration, so it's only attributes that you add directly from your own Python code that need to be registered as above. Also, only attributes whose values are recoverable from their repr() can be saved by this mechanism, so values that are C++ types (Atoms, MaterialColors, etc.) could not be preserved this way.
participants (1)
-
Eric Pettersen