[Chimera-users] associating multiple structures and sequences

Uppal, Karan kuppal2 at emory.edu
Tue Feb 7 12:02:48 PST 2012

Hi Eric,

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.

I will look into the MAViewer.loadScfFile method as well.

Thanks again!

From: Eric Pettersen [pett at cgl.ucsf.edu]
Sent: Tuesday, February 07, 2012 2:45 PM
To: Uppal, Karan
Cc: UCSF Chimera Mailing List; chimera-dev BB
Subject: Re: [Chimera-users] associating multiple structures and sequences

On Feb 6, 2012, at 7:01 PM, Uppal, Karan wrote:


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".

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.

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:

JEvTrace File Formats<http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/multalignviewer/jevtrace.html>

Such files can be read programatically with the MAViewer.loadScfFile method.

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.

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.

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?

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:

mav.associate(mseq, seq=aseq)

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:


or, if you know the chain ID you want (e.g. 'A'):



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.

                        Eric Pettersen

                        UCSF Computer Graphics Lab



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20120207/91e52278/attachment.html>

More information about the Chimera-users mailing list