[chimera-dev] Get Molecule Index in Model Panel
Pablo Solar Rodríguez
pablosolar.r at gmail.com
Thu Feb 27 04:27:28 PST 2020
Hello all,
Optimizing my plugin, I need to hide atoms and show ribbons for some opened
Molecules.
What I am trying is to loop over opened molecules in the ModelPanel and, If
the Molecule matches a specific tag, save its index in a indexes list.
Then, hide atoms and show ribbons by makeCommand with the indexes:
*def adjust_visualization(self, final_pdbs):*
* """ Adjust atoms and ribbons visualization for FitOpt final
solutions """ indexes = [] chimera.openModels.add(final_pdbs)
molecule_list = om.list(modelTypes=[Molecule])*
* for index, molecule in enumerate(molecule_list):*
* if self.fitopt_tag in molecule.name <http://molecule.name>:
indexes.append('#' + str(index))*
* makeCommand(' '.join(['~show', ' '.join(indexes)])) makeCommand('
'.join(['ribbon', ' '.join(indexes)]))*
It seems that the index from enumerate is not corresponding to the index in
the ModelPanel so how could I get the proper molecule index??
Thank you all in advance!
Regards!!
*Pablo Solar Rodríguez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20200227/5593304d/attachment.html>
More information about the Chimera-dev
mailing list