[Chimera-users] Making a composite residue

Eric Pettersen pett at cgl.ucsf.edu
Thu Apr 23 10:35:25 PDT 2015


On Apr 23, 2015, at 8:42 AM, Repic Matej <matej.repic at epfl.ch> wrote:

> Hello,
> 
> I wonder if it is possible to construct a composite residue from two existing residues in Chimera?
> 
> What I would like to do is concatenate residues ALA100 (mid chain) and GLY200 (end of chain) to make a composite residue AGL100.
> 
> Chimera won't let me set the same residue number via the "resrenumber" command. Preferably, the composite residue would have all the atoms listed where ALA100 was in the original pdb. 
> 
> While I realize there are trivial text editor-based workarounds I would like to know if there is a native way.

Hi Matej,
	This is kind of an unusual request, and I don't think there's any way to do it with the standard tools or commands.  Nonetheless, almost anything is possible via Chimera's Python interface, so I believe this Python code will do what you want:

# find the two residues;  assumes they're in chain A and that only one structure is open
from chimera import openModels, Molecule
mol = openModels.list(modelTypes=[Molecule])[0]
for r in mol.residues:
	if r.id.chainId == 'A' and r.id.position == 100:
		a100 = r
	if r.id.chainId == 'A' and r.id.position == 200:
		g200 = r

# transfer the GLY200 atoms into ALA100
for a in g200.atoms:
	g200.removeAtom(a)
	a100.addAtom(a)

# delete the now empty GLY200 residue, which would otherwise be problematic
mol.deleteResidue(g200)

# change the combined residue's type to "AGL"
a100.type = "AGL"

	So if you put the above in a file that ends with '.py' then you can run it simply by opening it (either with File->Open or with the "open" command).  I hope this helps somehow. :-)

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab
                        http://www.cgl.ucsf.edu


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


More information about the Chimera-users mailing list