jalview-jmol communication

Hi jalview developers,
we would like to use the Jalview-applet linked with an external Jmol-applet. In the example on the jalview web page the structure is highlighted when the mouse is moved over the according sequence and the coloring of the structure happens immediately. Unfortunately this does not work when loaded from my computer (not even with the same example page that comes with the source code). However, the function colourStructs() works fine. Do you have an idea how to fix this?
It would be also very useful to be able to colour the alignment by annotation with a javascript method and to link more than 10 pdb structures to sequences. Would it be possible to add this?
Thanks,
Nils Petersen

Hi there, Nils.

we would like to use the Jalview-applet linked with an external
Jmol-applet.

Great !

  In the example on the jalview web page the structure is
highlighted when the mouse is moved over the according sequence and
the coloring of the structure happens immediately. Unfortunately this
does not work when loaded from my computer (not even with the same
example page that comes with the source code).

ah. It sounds like you need to submit a bug report. Could you join at http://issues.jalview.org, and then hit the 'Create Issue' button ? The most important details that I'll need are the versions of your java, browser, and operating system.

  However, the function
colourStructs() works fine. Do you have an idea how to fix this?

The jalview/jmol applet communication is very new. I have experienced a couple of situations when the colouring did not appear, but put it down to browser caching issues, since reloading the page always made it work again. I suspect the problem is a race condition, where the colourStructs function is being called by the jalview applet before Jmol is ready to colour the structure. This should be simple to fix - providing I can reproduce it.

It would be also very useful to be able to colour the alignment by
annotation with a javascript method

Great idea! Would you like to add that as a feature request ?

  and to link more than 10 pdb
structures to sequences. Would it be possible to add this?

This is slightly more difficult to implement, but certainly possible. Alternately, you could also add structure bindings directly using the jalviewLite API (http://www.jalview.org/examples/jalviewLiteJs.html):

// bind a pdb file to a sequence in the given alignFrame - this will be searched
// for sequences matching sequenceId. The PDB file in pdbFile is either the contents
// of a PDB file or a URI that can be used to retrieve the file, and the pdbEntryString
// is the user friendly name (or PDBID) shown in jalview's user interface.
// returns true if binding was as success (v2.7)
public boolean addPdbFile(AlignFrame alFrame,
     String sequenceId, String pdbEntryString, String pdbFile)

This function should be safe to call from the JalviewLite 'oninit' function, but let me know if there are any problems. Here, pdbFile can be the same relative or absolute path part of the PDB file's URL, or alternately, you can pass in a PDB file directly in a text string.

Jim.

···

On 02/11/2011 19:39, Nils.Petersen-3@studium.uni-hamburg.de wrote: