<div dir="ltr"><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br>
</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">It is not clear to me how the removeObject function works… If I load a multi chain pdb such as</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif"><div class="gmail_default" style="font-size:small">universe = InfiniteUniverse(CalphaForceField(2.5))</div><div class="gmail_default" style="font-size:small">
universe.protein = Protein('pdbname, model='calpha')</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Suppose this has 6 chains in it, say now that I want to delete the 2nd chain from the universe, how do I do that?</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This did not work to me:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">
<div class="gmail_default" style="font-size:small">chainB=universe.protein[1]</div><div class="gmail_default" style="font-size:small">universe.removeObject(chainB)<br></div><div class="gmail_default" style="font-size:small">
<br></div><div class="gmail_default"><blockquote><font size="1"><span class="" style="color:rgb(139,0,0)">---------------------------------------------------------------------------<br></span></font><font size="1"><span class="" style="color:rgb(139,0,0)">ValueError</span>                                Traceback (most recent call last)<br>
</font><font size="1"><span class="" style="color:rgb(0,100,0)"><ipython-input-48-fbb49aaaad9a></span> in <span class="" style="color:rgb(70,130,180)"><module><span class="" style="color:rgb(0,0,139)">()</span>
<span class="" style="color:rgb(0,100,0)">      2<br></span> </span></font><font size="1"><span class="" style="color:rgb(70,130,180)"><span class="" style="color:rgb(0,100,0)">      2</span> </span>chainB<span class="" style="color:rgb(0,0,139)">=</span>universe<span class="" style="color:rgb(0,0,139)">.</span>protein<span class="" style="color:rgb(0,0,139)">[</span><span class="" style="color:rgb(70,130,180)">1</span><span class="" style="color:rgb(0,0,139)">]<br>
</span></font><font size="1"><span class="" style="color:rgb(0,100,0)">      3<br></span> </font><font size="1"><span class="" style="color:rgb(0,100,0)">----> 4<span class="" style="color:rgb(139,0,0)"> </span>universe</span><span class="" style="color:rgb(0,0,139)">.</span>removeObject<span class="" style="color:rgb(0,0,139)">(</span>chainB<span class="" style="color:rgb(0,0,139)">)<br>
</span></font><font size="1">
</font><font size="1"><span class="" style="color:rgb(0,100,0)">/Users/guarnera/env/lib/python2.7/site-packages/MMTK/Universe.pyc</span> in <span class="" style="color:rgb(70,130,180)">removeObject<span class="" style="color:rgb(0,0,139)">(self, object)</span>
<span class="" style="color:rgb(0,100,0)">    225</span>         <span class="" style="color:rgb(0,100,0)">if<br></span> </span></font><font size="1"><span class="" style="color:rgb(70,130,180)"><span class="" style="color:rgb(0,100,0)">    225</span>         <span class="" style="color:rgb(0,100,0)">if</span> </span>ChemicalObjects<span class="" style="color:rgb(0,0,139)">.</span>isChemicalObject<span class="" style="color:rgb(0,0,139)">(</span>object<span class="" style="color:rgb(0,0,139)">)</span><span class="" style="color:rgb(0,0,139)">:<br>
</span></font><font size="1"><span class="" style="color:rgb(0,100,0)">    226</span>             <span class="" style="color:rgb(0,100,0)">if</span> object<span class="" style="color:rgb(0,0,139)">.</span>parent <span class="" style="color:rgb(0,0,139)">!=</span> self<span class="" style="color:rgb(0,0,139)">:<br>
</span></font><font size="1"><span class="" style="color:rgb(0,100,0)">--> 227<span class="" style="color:rgb(139,0,0)">                 <span class="" style="color:rgb(0,100,0)">raise</span> </span>ValueError</span><span class="" style="color:rgb(0,0,139)">(</span><span class="" style="color:rgb(0,0,139)">`</span>object<span class="" style="color:rgb(0,0,139)">`</span> <span class="" style="color:rgb(0,0,139)">+</span> <span class="" style="color:rgb(0,0,139)">' is not in this universe.'</span><span class="" style="color:rgb(0,0,139)">)<br>
</span></font><font size="1"><span class="" style="color:rgb(0,100,0)">    228</span>             object<span class="" style="color:rgb(0,0,139)">.</span>parent <span class="" style="color:rgb(0,0,139)">=</span> None<br></font><font size="1"><span class="" style="color:rgb(0,100,0)">    229</span>             self<span class="" style="color:rgb(0,0,139)">.</span>_objects<span class="" style="color:rgb(0,0,139)">.</span>removeObject<span class="" style="color:rgb(0,0,139)">(</span>object<span class="" style="color:rgb(0,0,139)">)<br>
</span></font><font size="1">
</font><font size="1"><span class="" style="color:rgb(139,0,0)">ValueError</span>: PeptideChain .P2 is not in this universe.</font></blockquote></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">
Any hint?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Best,</div><div class="gmail_default" style="font-size:small">Enrico</div></div></div></div>