[Chimera-users] Alternate conformations in residues

Eric Pettersen pett at cgl.ucsf.edu
Wed Jan 21 13:31:33 PST 2015

On Jan 20, 2015, at 3:34 PM, Alejandro Virrueta <alejandro.virrueta at yale.edu> wrote:

> Hello all,
> Is there a way to get the all the information for an alternate conformation from a residue object? I have res.altLocs resulting in set([a,b]), but how can I get chi1-4 for conformation b for example?

Hi Alex,
	It's a little ugly but very possible.  The treatment of alt locs in Chimera 2 will be less arcane, but Chimera 1 is all there is right now.  Anyway, You can get the atoms involved in a particular chi angle by using the "chiAtoms" function:

from chimera.phipsi import chiAtoms
chiExemplar = chiAtoms(res, 2)  # for chi2

Now, these are just the first atoms in the residue, usually alt loc A (or blank, for residues with no alt locs).  To find the corresponding B alt loc atoms, you will have to rummage through the residue:

bAtoms = []
for ce in chiExemplar:
	for a in res.atomsMap[ce.name]:
		if a.altLoc == 'B':
		raise AssertionError("No B alt loc for atom %s" % ce.name)

Then finally you can compute the chi angle:

from chimera import dihedral
chi = dihedral(*[a.coord() for a in bAtoms])

Like I said, a little ugly, but doable.


                        Eric Pettersen
                        UCSF Computer Graphics Lab

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20150121/e3378767/attachment.html>

More information about the Chimera-users mailing list