[Chimera-users] labeling residues

Eric Pettersen pett at cgl.ucsf.edu
Mon May 16 14:38:05 PDT 2011


On May 16, 2011, at 10:49 AM, Daniel Gurnon wrote:

> As I understand it, if the script is to work with any pdb structure,  
> I will need two segments of python code:
>
> 1) custom residue labeling to display only 1-letter code and number,  
> and
> 2) something that creates a separate tube for each chain in a model,  
> without connecting one tube to the next.

Hi Dan,
	It's actually easier to combine the two, something like this:

from chimera import openModels, Molecule, runCommand
from chimera.resCode import res3to1
for m in openModels.list(modelTypes=[Molecule]):
	for chain in m.sequences():
		for r in chain.residues:
			if not r:
				# SEQRES sequence may include missing structure
				continue
			r.label = "%s %d" % (res3to1(r.type), r.id.position)
		runCommand("shape tube %s:.%s at ca radius 0.35 bandLength 2" %  
(m.oslIdent(), chain.chainID))

--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/20110516/3011e991/attachment.html>


More information about the Chimera-users mailing list