This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ons = rdf.createStore() | |
| // output: RDFStore: 0 triples | |
| rdf.importURL(ons, | |
| "http://github.com/egonw/onssolubility/raw/master/ons.solubility.rdf/ons.rdf") | |
| // output: RDFStore: 1206 triples | |
| var results = rdf.sparql(ons, "PREFIX owl: <http://www.w3.org/2002/07/owl#> " + | |
| "PREFIX ons: <http://spreadsheet.google.com/plwwufp30hfq0udnEmRD1aQ/onto#> " + | |
| "SELECT DISTINCT ?same WHERE { " + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ons = rdf.createStore() | |
| rdf.importURL(ons, | |
| "http://github.com/egonw/onssolubility/raw/master/ons.solubility.rdf/ons.rdf") | |
| var results = rdf.sparql(ons, "PREFIX ons: <http://spreadsheet.google.com/plwwufp30hfq0udnEmRD1aQ/onto#> " + | |
| "PREFIX chemblog: <http://blueobelisk.sourceforge.net/chemistryblogs/>" + | |
| "PREFIX dc: <http://purl.org/dc/elements/1.1/> " + | |
| "SELECT DISTINCT ?title ?smiles WHERE { " + | |
| " ?solvent dc:title ?title . " + | |
| " ?solvent chemblog:smiles ?smiles ." + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xmpp.connect(); | |
| service = xmpp.getService("descriptor.ws1.bmc.uu.se"); | |
| service.discoverSync(5000); | |
| service.getFunctions(); | |
| f = service.getFunction("XLogP"); | |
| ios = f.getIoSchemataSync(90000); | |
| // and it fails with: | |
| iof = xmpp.getIoFactory(ios); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <rdf:RDF | |
| xmlns:mw="http://metware.sf.net/onto/#" | |
| xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
| xmlns:owl="http://www.w3.org/2002/07/owl#" > | |
| <rdf:Description rdf:about="urn:lsid:localhost:net.sf.metware.beans.MetidMetabolitesAddonPubchemBean:297"> | |
| <owl:sameAs rdf:resource="urn:lsid:localhost:net.sf.metware.beans.MetidMetabolitesBean:16"/> | |
| <mw:PubChemCID>297</mw:PubChemCID> | |
| <rdf:type rdf:resource="http://metware.sf.net/onto/#PubChemExtras"/> | |
| </rdf:Description> | |
| <rdf:Description rdf:about="urn:lsid:localhost:net.sf.metware.beans.MetidMetabolitesBean:16"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var owl = rdf.createStore(); | |
| rdf.importURL(owl, | |
| "http://qsar.svn.sf.net/viewvc/qsar/trunk/qsar-dicts/descriptor-algorithms.owl?revision=210" | |
| ); | |
| // list of topological descriptors | |
| rdf.sparql(owl, | |
| "PREFIX qsar: <http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#> " + | |
| "SELECT ?s WHERE { ?s ?p qsar:topologicalDescriptor}" | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // connect to the XMPP hive | |
| xmpp.connect(); | |
| // we are going to call the XLogP function of the descriptor service | |
| service = xmpp.getService("descriptor.ws1.bmc.uu.se"); | |
| service.discoverSync(5000); | |
| service.getFunctions(); | |
| f = service.getFunction("XLogP"); | |
| // we use Bioclipse to create a CML document, starting from a SMILES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************************************************************************* | |
| * Bioclipse-script to iteratively build a molecule in JChemPaint | |
| * Author: Ola Spjuth | |
| * Author: Egon Willighagen | |
| ******************************************************************************/ | |
| //Start with a carbon and open in JCP | |
| mol=cdk.fromSMILES("C") | |
| mol2=cdk.generate2dCoordinates(mol) | |
| ui.open(mol2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.openscience.cdk.* | |
| import org.openscience.cdk.io.* | |
| import org.openscience.cdk.nonotify.* | |
| cid = 5282253 | |
| reader = new PCCompoundXMLReader( | |
| new URL( | |
| "http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=$cid&disopt=SaveXML" | |
| ).newInputStream() | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Get a copy of PubChem | |
| $ mkdir pubchem | |
| $ cd pubchem | |
| $ wget -r ftp://ftp.ncbi.nlm.nih.gov/pubchem/Compound/CURRENT-Full/XML/ -c | |
| $ ln -s ftp.ncbi.nlm.nih.gov/pubchem/Compound/CURRENT-Full/XML XML | |
| 2. Set up MySQL | |
| CREATE TABLE IF NOT EXISTS `compounds` ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // connect to the XMPP hive | |
| xmpp.connect(); | |
| // we are going to call the TPSA function of the descriptor service | |
| service = xmpp.getService("descriptor.ws1.bmc.uu.se"); | |
| service.discoverSync(5000); | |
| service.getFunctions(); | |
| f = service.getFunction("TPSA"); | |
| // we use Bioclipse to create a CML document, starting from a SMILES |