[chimera-dev] Using Chimera to display family shuffling information.

Eric Pettersen pett at cgl.ucsf.edu
Mon Apr 13 14:24:57 PDT 2015


On Apr 8, 2015, at 5:11 PM, Matthew Tiffany <matt.tiffany at icloud.com> wrote:

> To Whom It May Concern:
> 
> I am interested in displaying results from DNA shuffling experiments on a crystal structure. Here is a graphical tool that I have found to do this: http://qpmf.rx.umaryland.edu/XoverDemo.html
> 
> What I would like to do is input an alignment of parental sequences and separately a chimeric protein that is derived from the parental sequences by domain shuffling. Then color code a related structure based upon which domain of a parent the chimeric protein came from. The Xover program does this in a graph, but I would like to be able to do this in 3D space. It is similar to color coding by conservation in MultiAlign, but not exactly. Is there any existing plugin that you may be aware of that does this already or a potential backbone plugin that I can use as a starting point to try and code it myself.

Hi Matthew,
	I'm not aware of any pre-existing plugin that does this.  I think that with some effort on your part you would be able to code something in Chimera that does what you want.  The most basic thing to know here is that you can read sequence/alignment files via the various parsers (named after the formats they read) found in Chimera's MultAlignViewer.parsers module [corresponding code in <your Chimera installation>/share/MultAlignViewer/parsers].  For instance the parse() function in MultAlignViewer.parsers.readALN takes a Clustal ALN file as its argument and returns a 3-tuple, the first item of which is a list of Sequence objects and the rest of which you can ignore in this context.
	Is the length of the chimera protein sequence going to be same as the length of the alignment of parents, or are you going to have to insert gaps (including possible beginning/end gaps) to match up the chimera to the parents alignment?  The latter is certainly more complicated.  Anyway, once they are the same length you would need to identify the "runs" in the chimera that match the various parent domains.  I have some ideas but maybe you already know what you're going to do there.
	Then open the related structure, make a sequence viewer window for it, align the chimeric sequence to it, and assign attributes based on the domain matching to the related structure's residues, and color them however you like either directly in Python or via the Render By Attribute tool.  Say you've opened the structure, some vague example code:
---
from chimera import openModels, Molecule
m = openModels.list(modelTypes=[Molecule])[0]
relatedChain = m.sequence('A') # chain A
from MultAlignViewer.MAViewer import MAViewer
mav = MAViewer([relatedChain])
mav.alignSeq(chimericSequence)
matchMap = mav.seqs[0].matchMaps[m]
for r in relatedChain.residues:
	if not r:
		continue # missing structure
	index = matchMaps[r]
	gappedIndex = mav.seqs[0].ungapped2gapped(index)
	chimericIndex = mav.seqs[1].gapped2ungapped(gappedIndex)
	if not chimericIndex:
		continue # falls in gap in chimera
	parent = chimera2parent[chimericIndex] # computed previously
	r.parentNum = parent
---
	After executing the above, the residues of the related structure will have a 'parentNum' attribute.  You could use the Render By Attribute tool to color based on that attr, or use it in commands with the atom spec ':/parentNum=X'.
	Obviously, I've omitted a bunch of detail, but I thought it better to send this and have to ask questions about what you can't figure out yourself rather than try to write out everything in excruciating detail. :-)

--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-dev/attachments/20150413/a6de6b00/attachment.html>


More information about the Chimera-dev mailing list