Using the Jalview Applet for Input to an HTML Form

First Start Jalview, then click the Javascript button below





**Unfortunately Javascript - Java communication is not possible using Internet Explorer or Opera on Macs. Please use Safari or Firefox.

JalviewLite has the public method getAlignment(String outputFormat, boolean suffix) which can be called using Javascript.

If more than one Jalview window is open, Jalview returns the alignment in the active window.

The output format can be either Fasta, PFAM, Clustal, MSF, PIR, or BLC.

The boolean value refers to whether the sequence limits should be appended to the sequence, eg /35-287

Note: You must either give Jalview a name in the applet tag or use the applets index in your Javascript.

Since Jalview 2.2.1, the following public methods are availble to be called via Javascript:

public String getSelectedSequences() // list of IDs of selected sequences with each terminated by '¬' (¬)
public String getSelectedSequences(sep) // list of IDs of selected sequences terminated by sep or, if sep is null, '¬' (¬)
public String getSelectedSequencesFrom(AlignFrame alf) // list of IDs of selected seqences from AlignFrame alf with each terminated by '¬' (¬)
public String getSelectedSequencesFrom(AlignFrame alf,sep) // list of IDs of selected seqences from AlignFrame alf with each terminated by sep or, if sep is null, '¬' (¬)
public String getAlignment(String format) // get alignment as format
public String getAlignment(AlignFrame alf, String format) // get alignment displayed in alf as format
public String getAlignment(String format, String suffix) // get alignment as format with jalview start-end sequence suffix appended
public String getAlignment(AlignFrame alf, String format, String suffix) // get alignment displayed in alf as format with jalview start-end sequence suffix appended
public String getSelectedSequencesAsAlignment(String format, String suffix) // get selected region as an alignment as format with jalview start-end sequence suffix appended
public String getSelectedSequencesAsAlignmentFrom(AlignFrame alf, String format, String suffix) // get selected region from alf as an alignment as format with jalview start-end sequence suffix appended
public void loadAnnotation(String annotation) // add the given annotation to the current alignment
public void loadAnnotation(AlignFrame alf, String annotation) // add the given annotation to the given alignment view
public String getFeatures(String format) // get the sequence features in the given format (Jalview or GFF)
public String getFeatures(AlignFrame alf, String format) // get the sequence features in alf in the given format (Jalview or GFF)
public String getAnnotation() // get current alignment's annotation as an annotation file
public String getAnnotation(AlignFrame alf) // get alignment view alf's annotation as an annotation file
public AlignFrame loadAlignment(String text, String title) // load a new alignment 
public AlignFrame newView() // create a new view and return the alignFrame instance
public AlignFrame newView(AlignFrame alf) // create a new view on alf and return the alignFrame instance
public AlignFrame newView(String name) // create a new view named name and return the alignFrame instance
public AlignFrame newView(AlignFrame alf, String name) // create a new view named name on alf and return the alignFrame instance
public String getFeatureGroups() // return tab separated list of feature groups on the current alignment
public String getFeatureGroups(AlignFrame alf) // return tab separated list of feature groups on alf
public String getFeatureGroupsOfState(boolean state) // return tab separated list of feature groups either visible or hidden
public String getFeatureGroupsOfState(AlignFrame alf, boolean state) // return tab separated list of feature groups either visible or hidden on alf
public void setFeatureGroupState(String groupList, boolean state) // set the tab separated list of feature groups as visible or hidden on the current alignment
public void setFeatureGroupState(AlignFrame alf, String groupList, boolean state) // set the tab separated list of feature groups as visible or hidden on alf