<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Hello all, </div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Optimizing my plugin, I need to hide atoms and show ribbons for some opened Molecules.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">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:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i><br></i></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i>def adjust_visualization(self, final_pdbs):</i></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i> """<br> Adjust atoms and ribbons visualization for FitOpt final solutions<br> """<br> indexes = []<br> chimera.openModels.add(final_pdbs)<br> molecule_list = om.list(modelTypes=[Molecule])</i></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i><br> for index, molecule in enumerate(molecule_list):</i></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i> if self.fitopt_tag in <a href="http://molecule.name">molecule.name</a>:<br> indexes.append('#' + str(index))</i></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><i><br> makeCommand(' '.join(['~show', ' '.join(indexes)]))<br> makeCommand(' '.join(['ribbon', ' '.join(indexes)]))</i><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">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??</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Thank you all in advance!</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br>Regards!!</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"><br></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">
<p></p>
<p><font size="1" face="tahoma, sans-serif" color="#38761d"><b><u>Pablo Solar Rodríguez</u></b></font></p><div><div>
<p><br></p></div></div></div></div></div></div></div>