Writing each rotamers to individual PDB file

Dear Developers, I am trying to write a PDB for each rotamer in Chimera. I run the command: `swapaa RES :RESNUM lib Dunbrack criteria manual` I get the enumeration for each rotamers from SCRWL library. I was wondering if there was a way to write each of those rotamers into separate PDB file using a script. Some residues have large number of possible rotamers and manually selecting the rotamer and saving the PDB file is not tractable. Thank you very much ! Ilan

Hi Ilan, 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: http://dunbrack.fccc.edu/bbdep2010/ . And of course if any publication results from it, cite the paper shown in the Rotamers dialog. 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: from chimera import runCommand as run from Rotamers import getRotamers from chimera import selection rot_type = "LYS" res = selection.currentResidues()[0] rots = getRotamers(res, resType=rot_type) for i in range(len(rots)): run("swapaa %s sel criteria %d" % (rot_type, i+1)) run("write 0 /path/to/save/folder/struct%s%d.%d.pdb" % (rot_type, res.id.position, i+1)) Let me know If you need more help than that. --Eric Eric Pettersen UCSF Computer Graphics Lab

Hi Eric, Thank you for the reply. I have a couple of follow up questions if I may. (i) I have run the script you attached but I get a few errors: rot_type=“GLU" rots=get_rotamers(res, resType=rot_type) gives only two rotamers (`len(rots))`. When I run this on the GUI, I get 54 rotamers which is what I would expect. (ii) I get a Chimera error: File "/opt/chimera-1.14-1.fc31/share/chimera/triggerSet.py", line 83, in invoke self._funcData, triggerData) File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 401, in wrapper2 s._residueCB(a1, a2, a3) File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 626, in _residueCB if res3to1(res.type) != ungapped[pos]: IndexError: string index out of range Error processing trigger "Residue": IndexError: string index out of range File "/opt/chimera-1.14-1.fc31/share/chimera/Sequence.py", line 626, in _residueCB if res3to1(res.type) != ungapped[pos]: I found a workaround in the mean time. 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. Then I just did some file manipulations and split the PDB appropriately. Thanks again ! Ilan On Feb 17, 2021, at 2:40 PM, Eric Pettersen <pett@cgl.ucsf.edu<mailto:pett@cgl.ucsf.edu>> wrote: Hi Ilan, 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: https://urldefense.proofpoint.com/v2/url?u=http-3A__dunbrack.fccc.edu_bbdep2... . And of course if any publication results from it, cite the paper shown in the Rotamers dialog. 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: from chimera import runCommand as run from Rotamers import getRotamers from chimera import selection rot_type = "LYS" res = selection.currentResidues()[0] rots = getRotamers(res, resType=rot_type) for i in range(len(rots)): run("swapaa %s sel criteria %d" % (rot_type, i+1)) run("write 0 /path/to/save/folder/struct%s%d.%d.pdb" % (rot_type, res.id.position, i+1)) Let me know If you need more help than that. --Eric Eric Pettersen UCSF Computer Graphics Lab On Feb 16, 2021, at 7:24 PM, Chemmama, Ilan <Ilan.Chemmama@ucsf.edu<mailto:Ilan.Chemmama@ucsf.edu>> wrote: Dear Developers, I am trying to write a PDB for each rotamer in Chimera. I run the command: `swapaa RES :RESNUM lib Dunbrack criteria manual` I get the enumeration for each rotamers from SCRWL library. I was wondering if there was a way to write each of those rotamers into separate PDB file using a script. Some residues have large number of possible rotamers and manually selecting the rotamer and saving the PDB file is not tractable. Thank you very much ! Ilan _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu<mailto:Chimera-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Chemmama, Ilan
-
Eric Pettersen