[chimera-dev] copy_molecule does not keep representation
Tom Goddard
goddard at sonic.net
Fri Feb 28 12:04:06 PST 2020
Yes, the code that that example Chimera script is using is intended only to copy the atoms and residues but not their display styles. You can see the script does
from Molecule import copy_molecule
mc = copy_molecule(m)
and if we look at the copy_molecule() code it is clear it does not copy colors or styles
http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/Molecule/copymolecule.py <http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/Molecule/copymolecule.py>
But you could call the Python routine for mcopy which copies styles, colors, visibility after making the new atoms and residues
from MoleculeCopy import molecule_copy
molecule_copy(m.atoms, mc.atoms)
http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/MoleculeCopy/mcopy.py <http://plato.cgl.ucsf.edu/trac/chimera/browser/trunk/libs/MoleculeCopy/mcopy.py>
We don't have detailed Chimera Python API documentation so you have to be resourceful and look around in your Chimera distribution to find the stuff you need. If you want programming documentation you'd have to move on to ChimeraX our next generation program.
Tom
> On Feb 27, 2020, at 11:27 PM, Pablo Solar Rodríguez <pablosolar.r at gmail.com> wrote:
>
> Hello all again!!
>
> I am using the copy_molecule from Molecule (http://www.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/copymol.py <http://www.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/copymol.py>) but when I add the new pdb to the ModelPanel it is in atoms view and grey-colored.
>
> For example, if I copy 5 pdbs that are in ribbons view, the new 5 pdb copies will be opened in atoms view and all in grey color. Is normal this behaviour when using copy_molecule? Is there a way to fix this?
>
> Thank you in advance!
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20200228/6a23ae07/attachment.html>
More information about the Chimera-dev
mailing list