<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
</head>
<body style="word-wrap:break-word">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi Eric,<br>
<br>
Thanks for your prompt response! I was able to color/highlight sequences in the alignment viewer dialog box in a sequential order from first to last using a for loop to access sequences from the "self.seqCanvas.seqs" list. I will try to associate structures
and sequences using the mav.associate() function.<br>
<br>
I will look into the MAViewer.loadScfFile method as well.<br>
<br>
Thanks again!<br>
Karan<br>
<div><br>
</div>
<br>
<br>
<br>
<br>
<div style="font-family:Times New Roman; color:rgb(0,0,0); font-size:16px">
<hr tabindex="-1">
<div id="divRpF438990" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Eric Pettersen [pett@cgl.ucsf.edu]<br>
<b>Sent:</b> Tuesday, February 07, 2012 2:45 PM<br>
<b>To:</b> Uppal, Karan<br>
<b>Cc:</b> UCSF Chimera Mailing List; chimera-dev BB<br>
<b>Subject:</b> Re: [Chimera-users] associating multiple structures and sequences<br>
</font><br>
</div>
<div></div>
<div>
<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-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing: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" target="_blank">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><span class="Apple-style-span" style="border-collapse:separate; border-spacing: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-indent:0px; text-transform:none; orphans:2; white-space:normal; widows:2; word-spacing:0px">
<div style="word-wrap:break-word">
<p style="margin:0px"><font face="Helvetica" size="5" style="font:16px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p>
<p style="margin:0px"><font face="Helvetica" size="5" style="font:16px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p>
<p style="margin:0px"><font face="Helvetica" size="5" style="font:16px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu" target="_blank">http://www.cgl.ucsf.edu</a></font></p>
<br class="Apple-interchange-newline">
</div>
</span></div>
<br>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This e-mail message (including any attachments) is for the sole use of<br>
the intended recipient(s) and may contain confidential and privileged<br>
information. If the reader of this message is not the intended<br>
recipient, you are hereby notified that any dissemination, distribution<br>
or copying of this message (including any attachments) is strictly<br>
prohibited.<br>
<br>
If you have received this message in error, please contact<br>
the sender by reply e-mail message and destroy all copies of the<br>
original message (including attachments).<br>
</font>
</body>
</html>