<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 8, 2015, at 5:11 PM, Matthew Tiffany <<a href="mailto:matt.tiffany@icloud.com">matt.tiffany@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">To Whom It May Concern:<br><br>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: <a href="http://qpmf.rx.umaryland.edu/XoverDemo.html">http://qpmf.rx.umaryland.edu/XoverDemo.html</a><br><br>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.</blockquote><br></div><div>Hi Matthew,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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:</div><div>---</div><div>from chimera import openModels, Molecule</div><div>m = openModels.list(modelTypes=[Molecule])[0]</div><div>relatedChain = m.sequence('A') # chain A</div><div>from MultAlignViewer.MAViewer import MAViewer</div><div>mav = MAViewer([relatedChain])</div><div>mav.alignSeq(chimericSequence)</div><div>matchMap = mav.seqs[0].matchMaps[m]</div><div>for r in relatedChain.residues:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if not r:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>continue # missing structure</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>index = matchMaps[r]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>gappedIndex = mav.seqs[0].ungapped2gapped(index)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>chimericIndex = mav.seqs[1].gapped2ungapped(gappedIndex)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if not chimericIndex:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>continue # falls in gap in chimera</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>parent = chimera2parent[chimericIndex] # computed previously</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>r.parentNum = parent</div><div>---</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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'.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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. :-)</div><div><br></div><div>--Eric</div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>