Standard plugins:
PACKAGE:charite.christo. PACKAGE:charite.christo.strap. PACKAGE:charite.christo.strap.interfaces. PACKAGE:charite.christo.interfaces. A plugin is a WIKI:Java_class or a collection of Java classes to extend the functionallity of STRAP. It might use stanndard libraries which are downloaded when the plugin is used as well as C/C++, Perl, Python and Fortran code. Plugins are stored the directory ~/.StrapAlign/plugins as WIKI:Jar-file with the ending .jar When the menu-item "BUTTON:StrapAlign#ACTION_openPlugin" is clicked in the plugin-menu all files ./classes.txt within jar-archives are concatenated to build up the list of plugins. These files contain the names of the main classes optionally followed by white space and a menu name. STRAP loads all classes listed in the classes.txt files with a customized class-loader.

Standard plugins versus hotswapped plugins:
The hotswap mechanism provides a very convenient way to develop a plugin whereas standard plugins can be deployed. Hotswap plugins are defined by one single Java source file stored in the "~/.StrapAlign/hotswap" directory. For each Java file in this directory STRAP runs the integrated Java compiler and loads the compiled class. The Java compiler can be deactivated if an IDE with an integrated compiler is used. The special feature of hotswap plugins is that any change in a Java-file takes effect immediately. Immagine you write a plugin of type ValueOfResidue which returns a numeric value for each amino acid of the protein. These values are displayed as a profile plot along the sequence. When you change the algorithm in the java source file (file ending .java) and save the file to disk the plot will be immediately redrawn using the new version of the plugin. For more details please see DIALOG:StrapHotswap.
Once your plugin is finished you can turn it into a standard plugin and send it to your friends. It can the be deployed as a jar-archive. In order to use the standard plugin it must be present in the directory "~/.StrapAlign/plugins". If you have a standard plugin, however, the plot will not be updated automatically when a new version of the plugin is installed. Thus, standard plugin is the preferred form for finished plugins to be deployed.
feature standard plugins hotswapped plugins
automatical compilation no yes
changes take effect immediately after reinitiation of the object
has package declaration yes no


Interfaces define the type of plugins:
Plugins are Java classes that extend the functionallity of STRAP. The complete documentation of all STRAP interfaces and classes is found in http://www.bioinformatics.org/strap/javadoc/. The following table describes the Java-interfaces that the plugins can implement.
Interface Description on pressing BUTTON:StrapHotswap#BUT_LAB_Apply
StrapExtension Plugins that can be started and that can react on events in STRAP Usually an application frame or application panel is opened.
ResidueSelection Selects residues of proteins. A dialog is opened to chose the proteins and the highlighting style.
SequenceDisSimilarity Compares two gapped sequences. Returns a value between 0 and 1 or NaN. A Dialog for protein comparison is opened. Specifying the SequenceDisSimilarity requires opening another control panel.
ProteinProteinDistance Assigns float values to tuples of proteins. Is an extendsion of ProteinProteinValue that should return 0.0 for identical proteins and a maximum value for dissimilar proteins. A table is created comparing a number of proteins with another set of proteins. Alternatively, a graph is drawn.
ProteinProteinSimilarity Assigns float values to tuples of proteins. Is an extendsion of ProteinProteinValue that should return a high values for identical proteins and low value for dissimilar proteins. A table is created comparing a number of proteins with another set of proteins. Alternatively, a graph is drawn.
SequenceAligner Calculates gaps for a given set of proteins. Either it returns an alignment of the entire sequences or a local one. The alignment can be probed for a number of proteins and the result can be realized in the alignment or disposed.
ProteinViewer Displays proteins three-dimensionally. A given set of residues can be drawn in different styles. A dialog is shown to select the protein to be viewed.
ProteinParser Extracts the data from a protein file and sets the amino acid sequence and other information. A protein file selector is shown. When the proteins are loaded all protein parsers are tried until one succeeds.
ProteinWriter These classes require a setProtein and a getText method. In addition the NeedsProteins interface can be implemented to get protein data in addition to the amino acid sequence. Protein files can be written for the selected proteins..
AlignmentWriter These classes require a setProteins and a getText method. An alignment file can be written for the selected proteins..
Superimpose3D Superimposes one protein (mobile) upon another (reference). A 3x3 rotation matrix and an (dx,dy,dz) translation vector is calculated.
ValueOfAlignPosition Assigns float values to sequence alignment positions. A profile is plotted along the multiple sequence alignment.
ValueOfResidue Returns a float value for each residue of a protein. A profile is plotted along the sequence of the protein.
ValueOfProtein Returns a float value for a given protein. The values are charted as bars in the row header of the multiple sequence alignment.
ProteinsSorter ProteinsSorter-objects reorder the proteins by returning a permutation of the series 0, 1, 2, 3 ,4 ... n via the method of sortProteins(StrapProtein[]). A dialog is opened to change the order of the selected proteins.
TransmembraneHelix_Predictor TransmembraneHelix_Predictor objects take the amino acid sequence and predict membrane spanning helices. They return a string with the character 'H' at positions which are likely to be transmembrane helices. SecondaryStructure_Predictor and CoiledCoil_Predictor follow the same principle. A dialog is opened to select the prediction method.
CoiledCoil_Predictor as above
SecondaryStructure_Predictor as above


Packaging a standard plugins The class-name followed by white space and the name of the menu must be written into the file classes.txt. Optionally a png- or gif-file with the same base name as the class-file can contain the icon. Documentation may be saved as a file with the suffix "Help.html". All files are bundled in one jar-file. This jar file is the plugin file. As soon as it is copied to the file "~/.StrapAlign/plugins" the plugin is available in STRAP.

The class path The WIKI:Classpath_(Java) may contain additional jar-files downloaded to the directory "~/.StrapAlign/plugins". The URLs of these jar-files need to be specified in a file "download.txt" in the jar-file of the plugin.