<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>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="Apple-tab-span" style="white-space:pre"> </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="Apple-tab-span" style="white-space:pre"> </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=""><br 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/chimera/current/docs/ProgrammersGuide/Examples/Main_AtomTrigger.html</a></div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""></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 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><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 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=""> <br class="webkit-block-placeholder"></div><p class="">El 25-04-2017 18:21, Elaine Meng 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 class="pre" 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/chimera/docs/UsersGuide/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 type="cite" 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>
_______________________________________________<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>