Table 1. Benchmarking of CerebralWeb. Comparison of network rendering times for Java Web Start Cerebral and CerebralWeb (via the InnateDB web site) across Chrome, Safari and Firefox Web Browsers (MAC OS, Core i5, 16Gb). Mean rendering (N=5 trials) times (seconds) are given for small (198 IRAK1 interactors) and large (800 EGFR Interactors) protein-protein interaction networks.
JavaWebStart Cerebral | CerebralWeb | |||||
---|---|---|---|---|---|---|
Network (Edges) | Mean(sec) | S.E. | Mean(sec) | S.E. | Speed-up | |
Chrome | IRAK1 (198) | 35.72 | 0.71 | 8.78 | 0.06 | 4.1 |
EGFR (800) | 69.10 | 0.84 | 10.58 | 0.37 | 6.5 | |
Safari | IRAK1 (198) | 39.42 | 0.42 | 9.91 | 0.19 | 4.0 |
EGFR (800) | 78.52 | 0.50 | 10.93 | 0.42 | 7.2 | |
FireFox | IRAK1 (198) | 36.80 | 0.50 | 10.18 | 0.18 | 3.6 |
EGFR (800) | 78.28 | 0.59 | 10.93 | 0.19 | 7.2 |
<!-- jQuery --> <script type="text/javascript" charset="utf8" src="/path.to.jquery/jquery.min.js"></script> <!-- Cytoscape.js --> <script type="text/javascript" charset="utf8" src="/path.to.cytoscape/cytoscape.min.js"></script> <!-- Cerebral: cerebral.js --> <script type="text/javascript" charset="utf8" src="/path.to.cerebral/cerebral.js"></script> <!-- Cerebral: Horizontal layout --> <script type="text/javascript" charset="utf8" src="/path.to.cerebral/layout.horizontal.js"></script>
<!-- Div with an unique identifier and class "cerebral-dropbox" --> <div class="cerebral-dropbox" style="height:400px;" id="unique_id"> <div id="drag_text"> <!-- Text with directions about how to upload the xgmml --> Drag & drop your XGMML file here and wait ... </div> </div>
<!-- Div with an unique identifier --> <div id="cy"></div>The following JavaScript can also be placed within the HTML directly or within an included *.js file:
<!-- List of Cytoscape objects: nodes and edges. Nodes contain the localisation attribute --> elements = [ { "data": { "id": "1", "name": "Node 1", "localization": "Nucleus", "color": defaultNodeColor }, "group": "nodes" }, { "data": { "id": "2", "name": "Node 2", "localization": "Extracellular", "color": defaultNodeColor }, "group": "nodes" }, { "data": { "id": "3", "name": "Node 3", "localization": "Cytoplasm", "color": defaultNodeColor }, "group": "nodes" }, { "data": { "id": "12", "name": "name of interaction 12", "source": "1", "target": "2", "idgroup": "12" }, "group": "edges" }, { "data": { "id": "23", "name": "name of interaction 23", "source": "2", "target": "3", "idgroup": "23" }, "group": "edges" }, { "data": { "id": "22", "name": "name of interaction 22", "source": "2", "target": "2", "idgroup": "22" }, "group": "edges" }, ]; <!-- Inizialization of the Cytoscape object. --> $('#cy').cytoscape({ layout: options, showOverlay: false, zoom: 1, style: cerebral_style, elements: elements, ready: function() { cy = this; cerebral_ready(cy); } });
<!-- Div with an unique identifier --> <div id="cy"></div>The following JavaScript can also be placed within the HTML directly or within an included *.js file:
<!-- Map of genes: id_gene: name_gene. The id_gene can be any of the accepted ids on the subcellular localisation WebService :InnateDB,Ensembl,Entrez,UniProt --> var genes = {"ENSG00000160691": "SHC1", "ENSG00000142192": "APP", "ENSG00000169783": "LINGO1", "ENSG00000105290": "APLP1"}; <!-- List of Cytoscape objects: only edges. --> var edges = [ { "data": { "id": "375184", "name": "physical interaction", "source": "ENSG00000142192", "target": "ENSG00000160691", "idgroup": "375184" }, "group": "edges" }, { "data": { "id": "367978", "name": "direct interaction", "source": "ENSG00000142192", "target": "ENSG00000105290", "idgroup": "367978" }, "group": "edges" }, { "data": { "id": "26032", "name": "interologs mapping", "source": "ENSG00000142192", "target": "ENSG00000169783", "idgroup": "26032" }, "group": "edges" } ]; var elements = []; <!-- Ajax function to query the webservice to get the subcellular localisation from InnateDB. --> $.ajax({ dataType: "json", async: false, type: "GET", url: "http://www.innatedb.com/cerebralLocalizationWS.do", data: 'xref=Ensembl&ids=' + JSON.stringify(Object.keys(genes)).replace('\[', '').replace('\]', '').replaceAll('"', ''), success: function(data){ for (d in data) { var obj = { data: { id: d, name: genes[d], localization: data[d], color: defaultNodeColor }, group: "nodes" }; elements.push(obj) } elements = elements.concat(edges); }, error: function(jqXHR, textStatus, errorThrown) { console.log(errorThrown); } }); <!-- Inizialization of the Cytoscape_object. --> $('#cy').cytoscape({ layout: options, showOverlay: false, zoom: 1, style: cerebral_style, elements: elements, ready: function() { cy = this; cerebral_ready(cy); } });