Scripting in Bioclipse 2
Bioclipse 2 contains scripting consoles, one for each supported scripting language. These consoles give the user access to data and plugins through a command-oriented environment.
Try typing in
2 + 2
at the console. You should be getting this back:
> 2 + 2 4
Now, press the <code>Tab key twice. A list of commands should appear. Try
and you'll get a summary of the
You can also write
and get this description of the manager method
> help js.say ---------------------- js.say(String message) ---------------------- Prints a message to the console, adding a trailing newline.
Now, try typing
cdk.fromSM, and have the console complete the method name by hitting the Tab key. The result should be this:
You get an opening parenthesis, because this is a method call. If the method expected no parameters, you'd get a closing parenthesis too. But here, let's provide a SMILES string:
The result is this:
> cdk.fromSMILES("CCCC") CDKMolecule:C4H10
If you want to store the molecule for later, you can assign the result to a variable:
var butane = cdk.fromSMILES("CCCC")
General idea of script support
Most functionality could be made available to input as scripting commands in a console. GUIs should merely collect data and call on one/many commands. This ensures clear separation between code, scripting, and the GUI. This also allows for recording of screen activities into a script to automate tasks.
The idea is that you are able to work your way towards a final script by using the GUI. In real research, you don't know where you'll end up from the start. If you, for example, query a database for something unknown you have no idea what you expect as results or how many results you will get. If you adjust your filters iteratively until you get the subset of the results, you end up with a small sequence of scripting commands, that can serve as one step in your project/analysis. Then you can look at the problem from a different viewpoint, maybe a new database. After you find out what information you want from it, you copy those scripting commands to the script. Now you have data resources that you can integrate. The point is, with a work-flow system it would not have been feasible to construct such a work-flow, since it was developed iteratively with user curation at a number of steps.