The jalviewLite applet's application programming interface (API) includes two components. A JalviewLite Javascript Library and the public methods on the JalviewLite applet. -
The best way to learn how to use the API is to see it in action on the demonstration pages below:
--
-
- use Javascript to control and get data from JalviewLite -
- use Javascript to make two jalviewLite instances talk to each other. -
- configure JalviewLite to talk to a Jmol applet on the page (EXPERIMENTAL! please provide feedback!). -
- launch JalviewLite from a javascript button - -
Notes
+ +Notes
- Unfortunately Javascript - Java communication is not possible using Internet Explorer or Opera on Macs. Please use Safari or @@ -153,7 +180,7 @@ pageTracker._trackPageview();
JalviewLite's Java API
+JalviewLite's Javascript API
The following public methods on the jalviewLite applet are available to be called from javascript:
//get list of IDs of selected sequences public String getSelectedSequences() @@ -215,11 +242,21 @@ public String getAlignmentFrom(AlignFrame alf, String format) public String getAlignmentFrom(AlignFrame alf, String format, String suffix) // add the given features or annotation to the current alignment +// if features are loaded, feature display is automatically enabled public void loadAnnotation(String annotation) // add the given features or annotation to the given alignment view +// if features are loaded, feature display is automatically enabled public void loadAnnotationFrom(AlignFrame alf, String annotation) +// parse the given string as a jalview or GFF features file and optionally enable feature display on the current alignment +// (v2.8) +public abstract void loadFeatures(String features, boolean autoenabledisplay) + +// parse the given string as a jalview or GFF features file and optionally enable feature display on the given alignment +// (v2.8) +public abstract void loadFeaturesFrom(AlignFrame alf, String features, boolean autoenabledisplay) + // get the sequence features in the given format (Jalview or GFF) public String getFeatures(String format) @@ -246,6 +283,8 @@ public AlignFrame newViewFrom(AlignFrame alf) public AlignFrame newViewFrom(AlignFrame alf, String name) // load a new alignment +// remember to store the AlignFrame object reference +// if you want to manipulate the new alignment view. public AlignFrame loadAlignment(String text, String title) @@ -371,9 +410,31 @@ public static String getVersion() // debug flag - controls output to standard out public static boolean debug -