using standards to gain interoperability: bioclipse-opentox scripting

23
Using standards to gain interoperability: Bioclipse-OpenTox scripting Egon Willighagen http://egonw.github.com/ http://chem-bla-ics.blogspot.com/ IMM Karolinska Institutet, Stockholm

Upload: egon-willighagen

Post on 26-Jan-2015

112 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Using standards to gain interoperability: Bioclipse-OpenTox scripting

Using standards to gain interoperability:Bioclipse-OpenTox scripting

Egon Willighagen

http://egonw.github.com/

http://chem-bla-ics.blogspot.com/

IMM

Karolinska Institutet, Stockholm

Page 2: Using standards to gain interoperability: Bioclipse-OpenTox scripting

2

Managers: the vital organs of Bioclipse

Some theory

● Make sure that things happen● They provide all domain-related functionality● All Bioclipse GUI is using managers in the background● Takes care of threading (background processes)

● They are plugged into the system● Bioclipse dynamically discovers managers when booted

● Extend the JavaScript Console

Spjuth, O., Alvarsson, J., Berg, A., Eklund, M., Kuhn, S., Mäsak, C., Torrance, G., Wagener, J., Willighagen, E. L., Steinbeck, C., Wikberg, J. E., Dec. 2009. Bioclipse 2: A scriptable integration platform for the life sciences. BMC Bioinformatics 10 (1), 397+.

Page 3: Using standards to gain interoperability: Bioclipse-OpenTox scripting

3

JavaScript Console

Page 4: Using standards to gain interoperability: Bioclipse-OpenTox scripting

4

TAB TAB

Discover manager in the JavaScript console with:

1) TAB TAB (auto-completion)

2) man

Page 5: Using standards to gain interoperability: Bioclipse-OpenTox scripting

5

Many Managers

Cheminformatics1. cdk

2. opsin

3. jmol

4. balloon

General1. bioclipse

2. ui

3. rdf

Online1. chemspider

2. pubchem

3. gist

4. opentox

Many more can be installed via update sites...

Page 6: Using standards to gain interoperability: Bioclipse-OpenTox scripting

6

man <manager>

Discover what functionality a manager has

Page 7: Using standards to gain interoperability: Bioclipse-OpenTox scripting

7

Ctrl-N → JavaScript editor

Ctrl-N → JavaScript Wizard → Editor → Save As …

Page 8: Using standards to gain interoperability: Bioclipse-OpenTox scripting

8

Running JavaScripts in the Editor

JavaScript Editor → Run → Action

Page 9: Using standards to gain interoperability: Bioclipse-OpenTox scripting

9

Managers can be combined ...

var alkanesIUPACNames = ["methane", "ethane", "propane", "butane"];

var alkanes = cdk.createMoleculeList()

for (var i=0; i<alkanesIUPACNames.length; i++) {

js.say("Adding: " + alkanesIUPACNames[i]);

alkanes.add(

opsin.parseIUPACName(alkanesIUPACNames[i])

);

}

var filename = "/OpenTox/alkanes.sdf";

cdk.saveSDFile(filename, alkanes);

ui.open(filename);

Page 10: Using standards to gain interoperability: Bioclipse-OpenTox scripting

10

OpenTox: downloading data sets

var service = "http://apps.ideaconsult.net:8080/ambit2/";

var datasets = opentox.listDataSets(service);

for (set=0; set<5; set++) {

var dataset = datasets.get(set);

js.say("Downloading set: " + dataset);

ui.open(

opentox.downloadDataSetAsMDLSDfile(

service, dataset, "/OpenTox/ambit/" + set + ".sdf"

)

)

}

Page 11: Using standards to gain interoperability: Bioclipse-OpenTox scripting

11

OpenTox: download-ed data sets

Page 12: Using standards to gain interoperability: Bioclipse-OpenTox scripting

12

OpenTox: authentication(if needed)

opentox.getToken(); // return a null

// log in on the OpenTox network

opentox.login("user", "password")

opentox.getToken(); // returns the active token

// log out again

opentox.logout()

opentox.getToken(); // return again

Page 13: Using standards to gain interoperability: Bioclipse-OpenTox scripting

13

OpenTox: searching data sets

var ontologyService = "http://apps.ideaconsult.net:8080/ontology/";

js.clear();

sets = opentox.searchDataSets(ontologyService, "EPA");

js.say(sets);

Page 14: Using standards to gain interoperability: Bioclipse-OpenTox scripting

14

OpenTox: finding descriptors

serviceSPARQL = "http://apps.ideaconsult.net:8080/ontology/";

stringMat = opentox.listDescriptors(serviceSPARQL);

stringMat.getColumn("algo"); // returns the descriptor services

stringMat.getColumn("desc"); // returns the descriptor ontology entries

js.say(stringMat);

Page 15: Using standards to gain interoperability: Bioclipse-OpenTox scripting

15

OpenTox: XLogP calculation

molecules = cdk.createMoleculeList();

molecules.add(cdk.fromSMILES("COC"));

molecules.add(cdk.fromSMILES("CNC"));

js.say(opentox.calculateDescriptor(service, descriptor, molecules));

js.say(opentox.calculateDescriptor(

service, descriptor,

cdk.fromSMILES("CCC")

));

Page 16: Using standards to gain interoperability: Bioclipse-OpenTox scripting

16

OpenTox: searching descriptors(next release; a 5 min hack)

var ontologyService = "http://apps.ideaconsult.net:8080/ontology/";

js.clear();

descriptors = opentox.searchDescriptors(

ontologyService, "LogP"

);

js.say(descriptors);

Page 17: Using standards to gain interoperability: Bioclipse-OpenTox scripting

17

OpenTox: searching models(next release; another 5 min hack)

var ontologyService = "http://apps.ideaconsult.net:8080/ontology/";

js.clear();

descriptors = opentox.searchModels(

ontologyService, "ToxTree"

);

js.say(descriptors);

Page 18: Using standards to gain interoperability: Bioclipse-OpenTox scripting

18

OpenTox: running models

models = opentox.listModels(ontologyService);

model = models.get(3); // third model

js.say(

opentox.predictWithModel(

service,

model,

molecules

)

);

Page 19: Using standards to gain interoperability: Bioclipse-OpenTox scripting

19

Ontology development needed...

… just saying ...

Page 20: Using standards to gain interoperability: Bioclipse-OpenTox scripting

20

More OpenTox: man opentox

Or type: “opentox.” and hit TAB TAB ...

Page 21: Using standards to gain interoperability: Bioclipse-OpenTox scripting

21

Under the hood...

Some more theory...

Internally, the opentox manager uses RDF and SPARQL for a lot of communication with the OpenTox network.

For this, it uses the rdf manager. For example, directly to the ontology server:

1. rdf.sparqlRemote(String url, String SPARQL)

Or to a REST service:

1. rdf.createInMemoryStore()

2. rdf.importFromStream(IRDFStore store, InputStream stream, String format)

3. rdf.sparql(IRDFStore store, String query)

Page 22: Using standards to gain interoperability: Bioclipse-OpenTox scripting

22

Where to get more scripts ...

Page 23: Using standards to gain interoperability: Bioclipse-OpenTox scripting

23

Future ...

● Continued development● Computation without downloading data (pass by reference)● More ontology development for further standardization

Pointers● Bug tracker: http://bugs.bioclipse.net/● Feature requests: http://wishes.bioclipse.net/