jalview-applet loading alignments in the same frame

Hi Jim,
we fixed the jmol-jalview communication problem by loading it from our server, but came across some other problems.
We would like to use an embedded jalview to show different alignments with annotations on request (and the structures to it on jmol). So we need to load a new alignment in the same view, replacing the old one. However, with the jalview methods it seems only possible to load new alignments in a new window. Is this somehow possible to change?
Perfect would be a possibility to load a new alignment with annotation and colouring of the alignment and the structure by annotation. However, the possibility to load new alignments would be a very good start.
I would also like to know how to get the AlignFrame-object of the first view loaded onthe page.
Thanks
Nils

Hello Nils.

we fixed the jmol-jalview communication problem by loading it from our
server,

That's good. There are often some subtle differences in applet environment when pages are loaded from a local file instead of from a URL.

  but came across some other problems.

:frowning: oh dear.

We would like to use an embedded jalview to show different alignments
with annotations on request (and the structures to it on jmol). So we
need to load a new alignment in the same view, replacing the old one.
However, with the jalview methods it seems only possible to load new
alignments in a new window. Is this somehow possible to change?

It is possible, but not trivial. Whilst the way the applet is constructed would allow this capability, the applet's user interface is currently not set up to allow one alignment to be replaced by another, so some of the initialisation code would need to be refactored to allow this. Finally, new API methods would also be needed to allow a whole new applet dataset to be provided (basically, allow a new alignment, tree, annotation, features and structure(s) fileset to be supplied). I'd very much like to see this implemented, however, and would be willing to guide someone to make the necessary changes!

Perfect would be a possibility to load a new alignment with annotation
and colouring of the alignment and the structure by annotation.
However, the possibility to load new alignments would be a very good
start.

Realistically, this is not something I'd have time to do myself until 2012 at the earliest. Do you have enough Java development experience to consider patching Jalview yourself ?

I would also like to know how to get the AlignFrame-object of the
first view loaded onthe page.

This is a little easier! <jalviewApplet>.currentAlignFrame will return the alignment frame currently targeted by the Jalview object. If you use the 'oninit' parameter to register a javascript function on the page, then just record the value of currentAlignFrame when it is called - this is the alignFrame shown in the embedded frame.

If you're interested in working with me to achieve what you want, I suggest you email me directly and tell me a little more about what you'd like to do. It's possible that there's a simpler way to achieve the same effect with existing code, but that very much depends on your requirements!

Jim.

···

On 13/11/2011 08:20, Nils.Petersen-3@studium.uni-hamburg.de wrote: