<div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font color="#444444" face="monospace, monospace">Hi Eric, </font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace"><br></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace">Or even better, would it be possible to update the old pdb xform and coordinates to the new ones that Midas write command already does? I think that would work, wouldn't it?</font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace"><br></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace">Regards!</font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-02 11:19 GMT+02:00 Pablo Solar Rodríguez <span dir="ltr"><<a href="mailto:pablosolar.r@gmail.com" target="_blank">pablosolar.r@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Hello Eric, </div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">I'm sorry fornot explaining myself correctly. I'm gonna try it again with two example situations:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">1) Simple situation: I open the PDB and the Map and apply my exhaustive fitting plugin. After it is finished, I can move the molecule to the different fitted coordinates solutions and even I give the chance to copy a solution into a new molecule in the model panel (there is a question in this forum about this I posted some weeks ago)</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Now the second example and the problem of this post:</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">2) Advanced situations: I open the PDB and the Map and, before fitting, I move them unchecking de 'A' checkbox in the model panel. Let's suppose that I move only the PDB. Well, with this, I need to save the moved PDB to disk (temp.pdb with the python scrip save.py you told me) before fitting to have the new coordinates and execute the fitting algorithm with the map and this saved molecule (fitting Map and temp.pdb). When the fitting is finished, I should move the original molecule to the different fitted coordinates solutions but it doesnt work properly.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Related with 2, if I save the original moved molecule to disk (temp.pdb) and I open this new copy in Chimera and I fit it with the map directly, it works fine. There's something wrong between the acts of opening the molecule, moving it, writing it to disk, fitting, and trying to move the original one with the fitted coordinates (between the copy and the map) and I don't know why.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Hope it is more clear now. If not, let me know and I try to explain it better.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Thank you in advance and regards from Spain.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-05-01 23:12 GMT+02:00 Eric Pettersen <span dir="ltr"><<a href="mailto:pett@cgl.ucsf.edu" target="_blank">pett@cgl.ucsf.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Pablo,<div><span class="m_-4293450926908266571m_-8119178370330207587Apple-tab-span" style="white-space:pre-wrap"> </span>I couldn’t quite puzzle out what you were saying below. In particular, I didn’t understand:</div><div><br></div><div>"<span style="font-family:Helvetica,Arial,sans-serif;font-size:10pt">Then, I get the coordinates that are result from fitting "temporal.pdb" -- "mapY.ccp4" and move "chainX.pdb" opened in Chimera to these coordinates. But does not work fine.</span><font face="Helvetica, Arial, sans-serif" size="2">”</font></div><div><font face="Helvetica, Arial, sans-serif" size="2"><br></font></div><div><font face="Helvetica, Arial, sans-serif" size="2"><span class="m_-4293450926908266571m_-8119178370330207587Apple-tab-span" style="white-space:pre-wrap"> </span>So instead of trying to answer directly, I’ll just try to outline the principles involved and see if that helps. You open your map and your original PDB. Then you fit your PDB into the map. If you want to save the fitted PDB in the same coordinate reference frame as the map, then you need to take the transformed coordinates of the PDB, apply the <i>inverse</i> of the map’s transformation matrix, and use those coordinates.</font></div><div><font face="Helvetica, Arial, sans-serif" size="2"><span class="m_-4293450926908266571m_-8119178370330207587Apple-tab-span" style="white-space:pre-wrap"> </span>You don’t really say what API you use to save the PDB file, but you could just use the “write” command with the “relative” keyword to save the PDB file. Also, Midas.write(pdb_model, map_model, file_name) would do it. If you then open the map and new PDB file together they will be in their fitted orientation.</font></div><div><br></div><div><font face="Helvetica, Arial, sans-serif" size="2">Hope this helps,</font></div><div><span><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div><span class="m_-4293450926908266571m_-8119178370330207587Apple-tab-span" style="white-space:pre-wrap"> </span>Eric Pettersen</div><div><span class="m_-4293450926908266571m_-8119178370330207587Apple-tab-span" style="white-space:pre-wrap"> </span>UCSF Computer Graphics Lab</div><div><br></div></div>
</div>
<br></span><div><blockquote type="cite"><span><div>On Apr 28, 2017, at 12:32 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" target="_blank">pablo.solar@delogica.com</a>> wrote:</div><br class="m_-4293450926908266571m_-8119178370330207587Apple-interchange-newline"></span><div><div style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"><span><div> <br class="m_-4293450926908266571m_-8119178370330207587webkit-block-placeholder"></div>
<div>Hello again!<br><br>Well, I've been testing the PDB saving in my plugin and it doesn't work as I expected. I'm gonna try to explain the best I know because maybe my theoretical concepts are wrong.<br><br>The aim of saving PDB is beacuse if I move (rotate and translate) my molecule on Chimera I need to save it before executing the exhaustive fitting to have the correct coordinates on disk. But when the process is finished and I move the molecule on Chimera to the fitting coordinates, it doesn't work properly. This not happens if I open the saved PDB and I execute the exhaustive fitting; in that case, the molecule moves correctly to the fitting coordinates.<br><br>I'm gonna explain it with the example.</div>
<div> </div>
<div>1. Suppouse I have opened "chainX.pdb" and "mapY.ccp4" in Chimera and I move the molecule (uncheckin the 'A' in the model panel):</div>
<div> </div>
<div>2. If I execute the exhaustive fitting in Chimera, the process will save "temporal.pdb" from "chainX.pdb" on disk. Then, I get the coordinates that are result from fitting "temporal.pdb" -- "mapY.ccp4" and move "chainX.pdb" opened in Chimera to these coordinates. But does not work fine.</div>
<div> </div>
<div>3. However, If I open "temporal.pdb" in Chimera and I execute the process, it works fine.</div>
<div> </div>
<div>Could be a desynchronization between the opened "chainX.pdb" in Chimera, the "temporal.pdb" saved on disk and the "mapY.ccp4"? I cannot see what could be happening...<br><br>I hope to have explained myself correctly.<br><br>Thank you so much in advance</div>
<div> </div>
</span><div><br><p><span style="color:#0a4aab"><strong><span style="font-family:helvetica,arial,sans-serif"><span id="m_-4293450926908266571m_-8119178370330207587cid:e3596d503f6182bae8ee8dd94a5be1a3@delogica.com"><e3596d50.png></span> Pablo Solar Rodríguez<br> <span style="color:#e88802"> </span></span></strong></span><span style="font-family:helvetica,arial,sans-serif;color:#ff6600"><a href="mailto:pablo.solar@delogica.com" target="_blank">pablo.solar@delogica.com</a></span><span style="font-family:helvetica,arial,sans-serif"></span><span style="color:#0a4aab"><strong><span style="font-family:helvetica,arial,sans-serif"><br> Delógica - </span></strong><span style="font-family:helvetica,arial,sans-serif;color:#ff6600"><a style="color:#ff6600" href="http://www.delogica.com/" target="_blank">www.delogica.com</a></span></span></p><span><p><span style="color:#0a4aab"><span style="font-size:8pt"><span style="font-family:helvetica,arial,sans-serif">España: C/Nuñez de Balboa 31, 2ª Planta - 2, 28001 Madrid, Tel.: <a href="tel:914%2031%2031%2009" value="+34914313109" target="_blank">(34) 91 431 31 09</a></span><span style="font-family:helvetica,arial,sans-serif"><br>Colombia: Edificio Torre Zimma - Carrera 15 88-70 Bogotá, PBX (571) 3000302</span></span></span><span style="font-family:helvetica,arial,sans-serif"><span style="font-size:8pt"><strong> </strong></span> </span></p>
<hr></span><p><span style="color:#999999;font-family:helvetica,arial,sans-serif;font-size:8pt"><em><strong><span id="m_-4293450926908266571m_-8119178370330207587cid:2057ace719ad2697a26fa6a59bed89fd@delogica.com"><2057ace7.png></span> Por favor, antes de imprimir este mensaje, asegúrate de que es necesario. Ayudemos a cuidar el medio ambiente.</strong> </em></span><br></p><div><div class="m_-4293450926908266571h5"><span style="color:#999999;font-family:helvetica,arial,sans-serif;font-size:8pt"><em>Este mensaje puede contener información confidencial o privilegiada. Si le ha llegado por error, rogamos no haga uso del mismo, avise al remitente y bórrelo. Consulte aviso legal. </em></span><br><span style="color:#999999;font-family:helvetica,arial,sans-serif;font-size:8pt"><em>This message may contain confidential or privileged information. If it has been sent to you in error, please do not use it, notify the sender of the error and delete it. See legal notice.</em></span></div></div><p></p>
</div><div><div class="m_-4293450926908266571h5"><div> <br class="m_-4293450926908266571m_-8119178370330207587webkit-block-placeholder"></div><p>El 27-04-2017 20:04, Pablo Solar Rodríguez escribió:</p>
<blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">
<div dir="ltr">
<div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Hello Eric, </div>
<div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"> </div>
<div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Thank you for the response. I will check it!!</div>
<div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444"> </div>
<div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:#444444">Kind regards!</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-04-26 19:28 GMT+02:00 Eric Pettersen <span><<a href="mailto:pett@cgl.ucsf.edu" target="_blank">pett@cgl.ucsf.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Pablo,
<div><span class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941Apple-tab-span" style="white-space:pre-wrap"> </span>Every model has an 'openState' attribute which in turn has a 'xform' attribute which holds the model's transformation matrix. A newly opened model, if it's the only model, will have the identity matrix as it's initial xform. If there are other models open, then its initial xform will be the same as that of the currently open model with the lowest ID number, in a "best effort" attempt to keep the newly opened model in the same frame of reference as the other models.</div>
<div><span class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941Apple-tab-span" style="white-space:pre-wrap"> </span>So to see if you need to resave it you should compare the current xform to the one it had the last time you saved it.</div>
<div><span class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941Apple-tab-span" style="white-space:pre-wrap"> </span>There is a trigger that fires when a model's transformation matrix changes — the 'OpenState' trigger will fire in the chimera.triggers trigger set, with the trigger data '.reasons' attribute containing 'transformation change'. However, there is a convenience trigger, chimera.MOTION_STOP, that you probably want to register for instead, that will collate all the many OpenState trigger firings that will occur during a mouse motion. That trigger is also in the chimera.triggers trigger set. If you aren't familiar with triggers, there is a programmer example about them:</div>
<div> </div>
<div><a href="https://www.cgl.ucsf.edu/chimera/current/docs/ProgrammersGuide/Examples/Main_AtomTrigger.html" target="_blank">https://www.cgl.ucsf.edu/chime<wbr>ra/current/docs/ProgrammersGui<wbr>de/Examples/Main_AtomTrigger.h<wbr>tml</a></div>
<div> </div>
<div>—Eric</div>
<div> </div>
<div><span class="m_-4293450926908266571m_-8119178370330207587HOEnZb"><span class="m_-4293450926908266571m_-8119178370330207587HOEnZb"><span style="color:#888888"><br></span></span></span>
<div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div><span class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941Apple-tab-span" style="white-space:pre-wrap"> </span>Eric Pettersen</div>
<div><span class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941Apple-tab-span" style="white-space:pre-wrap"> </span>UCSF Computer Graphics Lab</div>
<div> </div>
</div>
</div>
<span class="m_-4293450926908266571m_-8119178370330207587HOEnZb"><span style="color:#888888"><br></span></span>
<div>
<blockquote type="cite" style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">
<div>
<div class="m_-4293450926908266571m_-8119178370330207587h5">
<div>On Apr 26, 2017, at 12:41 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" target="_blank">pablo.solar@delogica.com</a>> wrote:</div>
</div>
</div>
<div>
<div>
<div class="m_-4293450926908266571m_-8119178370330207587h5">
<div style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">
<div> </div>
<div>Hello Elaine, <br><br>Thank you for the quick response. I'll check the info to find a way to do it. Just one more thing. Is there a manner to know when the map has been moved? Just to not resampling it each time needlessly.<br><br>Thank you!</div>
<div> </div>
<div> </div><p>El 25-04-2017 18:21, Elaine Meng escribió:</p>
<blockquote style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">
<div class="m_-4293450926908266571m_-8119178370330207587m_6618495568121931941pre" style="margin:0;padding:0;font-family:monospace">Hi Pablo,<br> The map format doesn't include rotation information. You would have to resample it on a new grid to create a new map, such as with command "vop resample"... details here on saving maps after fitting (bottom of the page):<br><br> <<a href="http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/savemodel.html#afterfitting" target="_blank">http://www.rbvi.ucsf.edu/chim<wbr>era/docs/UsersGuide/savemodel.<wbr>html#afterfitting</a>><br><br> I hope this helps,<br> Elaine<br> ----------<br> Elaine C. Meng, Ph.D. <br> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab<br> Department of Pharmaceutical Chemistry<br> University of California, San Francisco<br><br>
<blockquote style="padding:0 0.4em;border-left:#1010ff 2px solid;margin:0">On Apr 25, 2017, at 2:24 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" target="_blank">pablo.solar@delogica.com</a>> wrote:<br> <br> Hello Tom,<br> Thank you for your quick response. I've checked the code in my plugin and the PDB saving works fine as I expected, even if I move the molecule.<br><br> My question is about saving the map. I tried to move it (rotate&translate unchecking the 'A' in the ModelPanel) and then save it with this code, but when I open the saved map, it is similar to the original one and does not keep the new coordinates. This could be a problem in my plugin, because I need to save them case of moving to get correct results in the fitting process.<br><br> So, how can I handle this situation? Is there any other way for saving the new map coordinates in the same way the PDB saving does? Hope I have explained myself correctly.<br> Thank you in advance and kind regards,<br> Pablo.</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
______________________________<wbr>_________________<span><br>Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu" target="_blank">Chimera-dev@cgl.ucsf.edu</a><br><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" target="_blank">http://plato.cgl.ucsf.edu/mail<wbr>man/listinfo/chimera-dev</a><br></span></div>
</blockquote>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br> Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu" target="_blank">Chimera-dev@cgl.ucsf.edu</a><br><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" target="_blank">http://plato.cgl.ucsf.edu/mail<wbr>man/listinfo/chimera-dev</a><br><br></blockquote>
</div>
<br><br clear="all">
<div> </div>
-- <br>
<div class="m_-4293450926908266571m_-8119178370330207587gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr"><div> <br class="m_-4293450926908266571m_-8119178370330207587webkit-block-placeholder"></div><p><span style="color:#38761d;font-family:tahoma,sans-serif;font-size:xx-small"><strong><u>Pablo Solar Rodríguez</u></strong></span></p>
<div><a style="font-weight:normal" href="mailto:pablosolar.r@gmail.com" target="_blank"><strong>pablosolar.r@gmail.com</strong></a></div>
<div>
<div><div> <br class="m_-4293450926908266571m_-8119178370330207587webkit-block-placeholder"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="m_-4293450926908266571m_-8119178370330207587pre" style="margin:0;padding:0;font-family:monospace">______________________________<wbr>_________________<br> Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu" target="_blank">Chimera-dev@cgl.ucsf.edu</a><br><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" target="_blank">http://plato.cgl.ucsf.edu/mail<wbr>man/listinfo/chimera-dev</a></div>
</blockquote>
</div></div></div><div><div class="m_-4293450926908266571h5">
______________________________<wbr>_________________<br>Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu" target="_blank">Chimera-dev@cgl.ucsf.edu</a><br><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" target="_blank">http://plato.cgl.ucsf.edu/mail<wbr>man/listinfo/chimera-dev</a><br></div></div></div></blockquote></div><br></div></div><br>______________________________<wbr>_________________<br>
Chimera-dev mailing list<br>
<a href="mailto:Chimera-dev@cgl.ucsf.edu" target="_blank">Chimera-dev@cgl.ucsf.edu</a><br>
<a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" rel="noreferrer" target="_blank">http://plato.cgl.ucsf.edu/mail<wbr>man/listinfo/chimera-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-4293450926908266571gmail_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><font size="1" face="tahoma, sans-serif" color="#0b5394"><b><div><a href="mailto:pablosolar.r@gmail.com" style="font-weight:normal" target="_blank"><b>pablosolar.r@gmail.com</b></a><br></div></b></font><div><div>
<p><br></p></div></div></div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div 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><font size="1" face="tahoma, sans-serif" color="#0b5394"><b><div><a href="mailto:pablosolar.r@gmail.com" style="font-weight:normal" target="_blank"><b>pablosolar.r@gmail.com</b></a><br></div></b></font><div><div>
<p><br></p></div></div></div></div></div></div>
</div>