<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Pablo,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>I couldn’t quite puzzle out what you were saying below. In particular, I didn’t understand:</div><div class=""><br class=""></div><div class="">"<span style="font-family: Helvetica, Arial, sans-serif; font-size: 10pt;" class="">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" class="">”</font></div><div class=""><font face="Helvetica, Arial, sans-serif" size="2" class=""><br class=""></font></div><div class=""><font face="Helvetica, Arial, sans-serif" size="2" class=""><span class="Apple-tab-span" style="white-space:pre"> </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 class="">inverse</i> of the map’s transformation matrix, and use those coordinates.</font></div><div class=""><font face="Helvetica, Arial, sans-serif" size="2" class=""><span class="Apple-tab-span" style="white-space:pre"> </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 class=""><br class=""></div><div class=""><font face="Helvetica, Arial, sans-serif" size="2" class="">Hope this helps,</font></div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>UCSF Computer Graphics Lab</div><div class=""><br class=""></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 28, 2017, at 12:32 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" class="">pablo.solar@delogica.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""><div style="font-size: 10pt; font-family: Helvetica,Arial,sans-serif" class=""><div class=""> <br class="webkit-block-placeholder"></div>
<div class="">Hello again!<br class=""><br class="">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 class=""><br class="">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 class=""><br class="">I'm gonna explain it with the example.</div>
<div class=""> </div>
<div class="">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 class=""> </div>
<div class="">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 class=""> </div>
<div class="">3. However, If I open "temporal.pdb" in Chimera and I execute the process, it works fine.</div>
<div class=""> </div>
<div class="">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 class=""><br class="">I hope to have explained myself correctly.<br class=""><br class="">Thank you so much in advance</div>
<div class=""> </div>
<div class=""><br class=""><p class=""><span style="color: #0a4aab;" class=""><strong class=""><span style="font-family: helvetica, arial, sans-serif;" class=""><span id="cid:e3596d503f6182bae8ee8dd94a5be1a3@delogica.com"><e3596d50.png></span> Pablo Solar Rodríguez<br class=""> <span style="color: #e88802;" class=""> </span></span></strong></span><span style="font-family: helvetica, arial, sans-serif; color: #ff6600;" class=""><a href="mailto:pablo.solar@delogica.com" class="">pablo.solar@delogica.com</a></span><span style="font-family: helvetica, arial, sans-serif;" class=""></span><span style="color: #0a4aab;" class=""><strong class=""><span style="font-family: helvetica, arial, sans-serif;" class=""><br class=""> Delógica - </span></strong><span style="font-family: helvetica, arial, sans-serif; color: #ff6600;" class=""><a style="color: #ff6600;" href="http://www.delogica.com/" class="">www.delogica.com</a></span></span></p><p class=""><span style="color: #0a4aab;" class=""><span style="font-size: 8pt;" class=""><span style="font-family: helvetica, arial, sans-serif;" class="">España: C/Nuñez de Balboa 31, 2ª Planta - 2, 28001 Madrid, Tel.: (34) 91 431 31 09</span><span style="font-family: helvetica, arial, sans-serif;" class=""><br class="">Colombia: Edificio Torre Zimma - Carrera 15 88-70 Bogotá, PBX (571) 3000302</span></span></span><span style="font-family: helvetica, arial, sans-serif;" class=""><span style="font-size: 8pt;" class=""><strong class=""> </strong></span> </span></p>
<hr class=""><p class=""><span style="color: #999999; font-family: helvetica, arial, sans-serif; font-size: 8pt;" class=""><em class=""><strong class=""><span id="cid: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 class=""><span style="color: #999999; font-family: helvetica, arial, sans-serif; font-size: 8pt;" class=""><em class="">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 class=""><span style="color: #999999; font-family: helvetica, arial, sans-serif; font-size: 8pt;" class=""><em class="">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></p>
</div><div class=""> <br class="webkit-block-placeholder"></div><p class="">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" class=""><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr" class="">
<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 class="">
<div class="gmail_quote">2017-04-26 19:28 GMT+02:00 Eric Pettersen <span class=""><<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>></span>:<br class="">
<blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">
<div style="word-wrap: break-word;" class="">Hi Pablo,
<div class=""><span class="m_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 class=""><span class="m_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 class=""><span class="m_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 class=""> </div>
<div class=""><a href="https://www.cgl.ucsf.edu/chimera/current/docs/ProgrammersGuide/Examples/Main_AtomTrigger.html" class="">https://www.cgl.ucsf.edu/<wbr class="">chimera/current/docs/<wbr class="">ProgrammersGuide/Examples/<wbr class="">Main_AtomTrigger.html</a></div>
<div class=""> </div>
<div class="">—Eric</div>
<div class=""> </div>
<div class=""><span class="HOEnZb"><span class="HOEnZb"><span style="color: #888888;" class=""><br class=""></span></span></span>
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class="">
<div class=""><span class="m_6618495568121931941Apple-tab-span" style="white-space: pre-wrap;"> </span>Eric Pettersen</div>
<div class=""><span class="m_6618495568121931941Apple-tab-span" style="white-space: pre-wrap;"> </span>UCSF Computer Graphics Lab</div>
<div class=""> </div>
</div>
</div>
<span class="HOEnZb"><span style="color: #888888;" class=""><br class=""></span></span>
<div class="">
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0" class="">
<div class="">
<div class="h5">
<div class="">On Apr 26, 2017, at 12:41 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" class="">pablo.solar@delogica.com</a>> wrote:</div>
</div>
</div>
<div class="">
<div class="">
<div class="h5">
<div style="font-size: 10pt; font-family: Helvetica,Arial,sans-serif;" class="">
<div class=""> </div>
<div class="">Hello Elaine, <br class=""><br class="">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 class=""><br class="">Thank you!</div>
<div class=""> </div>
<div class=""> </div><p class="">El 25-04-2017 18:21, Elaine Meng escribió:</p>
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;" class="">
<div class="m_6618495568121931941pre" style="margin: 0; padding: 0; font-family: monospace;">Hi Pablo,<br class=""> 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 class=""><br class=""> <<a href="http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/savemodel.html#afterfitting" class="">http://www.rbvi.ucsf.edu/<wbr class="">chimera/docs/UsersGuide/<wbr class="">savemodel.html#afterfitting</a>><br class=""><br class=""> I hope this helps,<br class=""> Elaine<br class=""> ----------<br class=""> Elaine C. Meng, Ph.D. <br class=""> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab<br class=""> Department of Pharmaceutical Chemistry<br class=""> University of California, San Francisco<br class=""><br class="">
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;" class="">On Apr 25, 2017, at 2:24 AM, Pablo Solar Rodríguez <<a href="mailto:pablo.solar@delogica.com" class="">pablo.solar@delogica.com</a>> wrote:<br class=""> <br class=""> Hello Tom,<br class=""> 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 class=""><br class=""> 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 class=""><br class=""> 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 class=""> Thank you in advance and kind regards,<br class=""> Pablo.</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
______________________________<wbr class="">_________________<span class=""><br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class=""><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="">http://plato.cgl.ucsf.edu/<wbr class="">mailman/listinfo/chimera-dev</a><br class=""></span></div>
</blockquote>
</div>
</div>
</div>
<br class="">______________________________<wbr class="">_________________<br class=""> Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class=""><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="">http://plato.cgl.ucsf.edu/<wbr class="">mailman/listinfo/chimera-dev</a><br class=""><br class=""></blockquote>
</div>
<br class=""><br clear="all" class="">
<div class=""> </div>
-- <br class="">
<div class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class=""><div class=""> <br class="webkit-block-placeholder"></div><p class=""><span style="color: #38761d; font-family: tahoma, sans-serif; font-size: xx-small;" class=""><strong class=""><u class="">Pablo Solar Rodríguez</u></strong></span></p>
<div class=""><a style="font-weight: normal;" href="mailto:pablosolar.r@gmail.com" class=""><strong class="">pablosolar.r@gmail.com</strong></a></div>
<div class="">
<div class=""><div class=""> <br class="webkit-block-placeholder"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br class=""> Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class=""><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev</a></div>
</blockquote>
</div>
_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>