<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Pablo,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>It sounds like what you want to do is open a PDB file, fit it to a map, and then write out the PDB with the fitted coordinates rather than the original coordinates. Is that right? If so, you should look at the <a href="https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/basicPrimer.html" class="">Very Basic Chimera Programming Primer</a> for an example of looping through a series of data files and performing operations on them. The key thing for your purposes is that you want to use the “write” command with the “relative” option in order to write the PDB file relative to the map — so if the map was model 0 and the PDB was model 1, then “write relative 0 1 output_file_name.pdb”.</div><div class=""><br class=""></div><div class="">—Eric</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>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Mar 12, 2018, at 1:42 AM, Pablo Solar Rodríguez <<a href="mailto:pablosolar.r@gmail.com" class="">pablosolar.r@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Hello all!</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">I'm looking to the scripts (<a href="http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/" class="">http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/</a>) and can not see a simple example of how to open a PDB.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">What I need to my extension is to save a PDB relative to a map and then open it to the model panel.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Copying it to the model panel does not make sense to me because I need to fix the positions of the moved PDB relative to the map.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br class=""></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)">Could it be something like this?</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small;color:rgb(68,68,68)"><br class=""></div><div class="gmail_default"><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> # Get opened molecule (the one selected in the menu)</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> m = self.object_menu.getvalue()</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> </i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> # Make copy using the copy_molecule native functionality from Chimera</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> from Molecule import copy_molecule</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> mc = copy_molecule(m)</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> </i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> # Set copy name</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> <a href="http://mc.name/" class="">mc.name</a> = m.name.split('.')[0] + '_' + self.chosen_solution + '.pdb'</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""><span style="white-space:pre" class=""> </span>copy_path = self.cwd + <a href="http://mc.name/" class="">mc.name</a></i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""><br class=""></i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> from Midas import open, write</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""> write(mc, self.map_menu.volume(), self.cwd)</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""><span style="white-space:pre" class=""> </span>open(self.cwd)</i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class=""><i class=""><br class=""></i></font></div><div class="gmail_default"><font color="#444444" face="monospace, monospace" class="">Thank you in advance!</font></div></div><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""></div></div></div></div></div>
</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>