[Chimera-users] Auto-associate define attribute/render by attribute

Eric Pettersen pett at cgl.ucsf.edu
Wed Nov 27 15:56:06 PST 2019

> On Nov 27, 2019, at 1:07 PM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> Python is beyond my skill set, though… somebody else would have to advise on that.

The first thing I should say is that Multalign Viewer is only available as a graphical tool, so you will only be able to script this for a Chimera that is running its graphical interface, not in any headless “batch” mode.  Okay, with that out of the way, the first job is to get a Python instance of Multalign Viewer showing the sequence you want with the chains you want associated.  Unlike ChimeraX, which associates on a per-chain basis, Chimera associates on a per-structure basis, so you will have to first split your structure apart by chains (with the “split” command).  If you have the pertinent sequence in a file, you could do this:

	from MultAlignViewer.MAViewer import MAViewer
	mav = MAViewer(“full-path-to-sequence-file”)

If you don’t have a file, but you know you want to use the sequence of chain C, you could do this:

	from chimera import openModels, Molecule
	for m in openModels.list(modelTypes=[Molecule]):
			seq = m.sequence(‘C’)
		except KeyError:
	from MultAlignViewer.MAViewer import MAViewer
	mav = MAViewer([seq])

You then add your custom header file with:


After that, the residues will have the necessary attribute (prefixed with “mav”, so if the header attribute is ChouFasmanImmuno, the residue attribute is mavChouFasmanImmuno).


	Eric Pettersen
	UCSF Computer Graphics Lab

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

More information about the Chimera-users mailing list