<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 Eric,
<div class=""><br class="">
</div>
<div class="">Thank you for the reply. </div>
<div class="">I have a couple of follow up questions if I may. </div>
<div class=""><br class="">
</div>
<div class="">(i) I have run the script you attached but I get a few errors:</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class="">
<div class="">rot_type=“GLU"</div>
<div class="">rots=get_rotamers(res, resType=rot_type)</div>
</blockquote>
<div class=""><br class="">
<div>gives only two rotamers (`len(rots))`. When I run this on the GUI, I get 54 rotamers which is what I would expect.</div>
<div><br class="">
</div>
<div>(ii) I get a Chimera error:</div>
<div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">File "/opt/chimera-1.14-1.fc31/share/chimera/triggerSet.py", line 83, in invoke</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> self._funcData, triggerData)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 401, in wrapper2</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> s._residueCB(a1, a2, a3)</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 626, in _residueCB</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> if res3to1(res.type) != ungapped[pos]:</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">IndexError: string index out of range</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902); min-height: 20px;" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">Error processing trigger "Residue":</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class="">IndexError: string index out of range</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902); min-height: 20px;" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 626, in _residueCB</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 18px; line-height: normal; font-family: "Courier New"; background-color: rgba(63, 63, 63, 0.74902);" class="">
<span style="font-variant-ligatures: no-common-ligatures;" class=""> if res3to1(res.type) != ungapped[pos]:</span></div>
</div>
<div><br class="">
</div>
<div>I found a workaround in the mean time. </div>
<div>I managed to make Chimera saved all the rotamers in a single PDB file, and an extra character was added to RES_NAME entry in the PDB file to differentiate each rotamer. </div>
<div>Then I just did some file manipulations and split the PDB appropriately. </div>
<div><br class="">
</div>
<div>Thanks again ! </div>
<div>Ilan</div>
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Feb 17, 2021, at 2:40 PM, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi Ilan,<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>I see that the Dunbrack 2010 rotamer library is now being released under a more permissive license than previously, so this kind of quasi-bulk dumping of library info is probably okay. Nonetheless,
since you are using the library so extensively it would be nice of you to register as a library user here if you could:
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__dunbrack.fccc.edu_bbdep2010_&d=DwIFAg&c=iORugZls2LlYyCAZRB3XLg&r=mKSDZidXHAmavIl-Ov-liBnCRR7Q81s96Ue3o_9uiv0&m=WhkU7bXdiTiHIgdIWawwnAeUYVvhC0LnZfTGG8GEpVY&s=S3jcExeF5rf7cB2J3ns5Mwa8Btp-FXWolMsa3v2ysno&e=" class="">
https://urldefense.proofpoint.com/v2/url?u=http-3A__dunbrack.fccc.edu_bbdep2010_&d=DwIFAg&c=iORugZls2LlYyCAZRB3XLg&r=mKSDZidXHAmavIl-Ov-liBnCRR7Q81s96Ue3o_9uiv0&m=WhkU7bXdiTiHIgdIWawwnAeUYVvhC0LnZfTGG8GEpVY&s=S3jcExeF5rf7cB2J3ns5Mwa8Btp-FXWolMsa3v2ysno&e=</a>
. And of course if any publication results from it, cite the paper shown in the Rotamers dialog.<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>Okay, that said, you are going to have to use a Python script to do what you want. Assuming you have somehow selected the residue involved, to get all rotamers of LYS for it, the heart of the script
would be:<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>from chimera import runCommand as run<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>from Rotamers import getRotamers<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>from chimera import selection<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>rot_type = "LYS"<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>res = selection.currentResidues()[0]<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>rots = getRotamers(res, resType=rot_type)<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>for i in range(len(rots)):<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>run("swapaa %s sel criteria %d" % (rot_type, i+1))<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><span class="Apple-tab-span" style="white-space:pre"></span>run("write 0 /path/to/save/folder/struct%s%d.%d.pdb" % (rot_type, res.id.position, i+1))<br class="">
<br class="">
Let me know If you need more help than that.<br class="">
<br class="">
--Eric<br class="">
<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>Eric Pettersen<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span><br class="">
<br class="">
<blockquote type="cite" class="">On Feb 16, 2021, at 7:24 PM, Chemmama, Ilan <<a href="mailto:Ilan.Chemmama@ucsf.edu" class="">Ilan.Chemmama@ucsf.edu</a>> wrote:<br class="">
<br class="">
Dear Developers, <br class="">
<br class="">
I am trying to write a PDB for each rotamer in Chimera. <br class="">
I run the command: <br class="">
`swapaa RES :RESNUM lib Dunbrack criteria manual`<br class="">
<br class="">
I get the enumeration for each rotamers from SCRWL library. <br class="">
I was wondering if there was a way to write each of those rotamers into separate PDB file using a script.
<br class="">
Some residues have large number of possible rotamers and manually selecting the rotamer and saving the PDB file is not tractable.
<br class="">
<br class="">
Thank you very much ! <br class="">
Ilan<br class="">
_______________________________________________<br class="">
Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" class="">
Chimera-users@cgl.ucsf.edu</a><br class="">
Manage subscription: <a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">
https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class="">
</blockquote>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>