<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 6, 2012, at 7:01 PM, Uppal, Karan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; ">Hi,<br><br>I am writing a custom extension based on MultiAlign Viewer that highlights regions in a multiple sequence alignment based on numerical values stored in an external file. I modified the RegionBrowser.py script, and added a function that works just like "showSS".</div></div></div></div></span></blockquote><div><br></div>There may be ways to accomplish what you modification does without changing the MAV code. Just using an imported MAV rather than your custom mod has the advantage of gaining any additional functionality and bug fixes that MAV gets in later releases.</div><div><br></div><div>One possibility is for you to use "sequence coloring files" that MAV already reads (they can also optionally color associated structures). The format is documented here:</div><div><br></div><div><a href="http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/multalignviewer/jevtrace.html">JEvTrace File Formats</a></div><div><br></div><div>Such files can be read programatically with the MAViewer.loadScfFile method.</div><div><br></div><div>Another possibility is to directly create the new regions you want with the MAViewer.newRegion method. The 'blocks' argument to that method is a series of 4-tuples describing the rectangles composing the region: (top-seq, bottom-seq, left, right) where left/right are zero-based sequence indices.</div><div><br></div><div><blockquote type="cite"><div><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; "><div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt; ">It works fine for one structure and sequence combination. However, I am trying to associate multiple copies of the same protein structure and its sequence. So, the structures are identical and so are the sequences in the sequence alignment, but each copy represents different information. My problem is that the sequences in the alignment viewer dialog box are highlighted in a random fashion. And, I want the sequences to be highlighted in an ordered fashion starting from first sequence to last sequence since we want to be able to map the highlighted regions back to the external file.<br><br>Is there a way to control the order in which the sequences are highlighted in the alignment viewer dialog? Or is there a way to get the model # associated with a particular sequence and using the model # to highlight the alignment viewer?</div></div></div></div></blockquote><br></div><div>I'm not 100% sure what "highlighted" means here, but I presume the problem is that your first structure isn't necessarily associating with your first sequence, since the structure and alignment sequences are all identical? If that's the issue, then you need to explicitly control the structure association rather than allowing automatic association to occur. You do that by providing the argument 'autoAssociate=False' to the MAViewer constructor. Then you need to call the MAViewer's 'associate' method for every structure association you want to set up. Now, there's a big doc string for that method, but briefly you want to call associate like so:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>mav.associate(mseq, seq=aseq)</div><div><br></div><div>where mseq is the Sequence from the structure you want to associate and aseq is the Sequence in alignment you want to associate with. You get the Sequences from a model with:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>mol.sequences()</div><div><br></div><div>or, if you know the chain ID you want (e.g. 'A'):</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>mol.sequence('A')</div><div><br></div><div>--Eric</div><div><br></div><div>P.S. I cc'ed this to chimera-dev and set replies to go there since this seems like much more a developer topic than a user topic.</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; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><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"></div></span> </div><br></body></html>