Try typing in:
2 + 2
at the console. You should be getting this back:
> 2 + 2 4
Press the <code>Tab key twice. A list of commands should appear. Try also typing help js
and you'll get a summary of the js manager.
Test to write: help js.say and you will get this description of the manager method js.say.
Manipulating molecules in BSL
Type 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:
If you want to store the molecule for later, you can assign the result to a variable:
var butane = cdk.fromSMILES("CCCC")
You can create files in the Bioclipse Navigator (File > New ... and select File) - name it HelloBSL.js, Write the following script:
butane = cdk.fromSMILES("CCCC");res = cdk.calculateMass(butane);js.say("Mass is: " + res);
Mass is: 58.1224
We promote sharing of scripts using MyExperiment and Gist. You can download gists using the command gist.download(GIST_NUMBER). You can query MyExperiment using the command: myexperiment.search("RDF").