Skip to content

Instantly share code, notes, and snippets.

View egonw's full-sized avatar
💭
I don't want a status.

Egon Willighagen egonw

💭
I don't want a status.
View GitHub Profile
propane = cdk.fromSMILES("CCC");
cdk.calculateMass(propane)
dimethylether = cdk.fromSMILES( "COC" );
cdk.addExplicitHydrogens( dimethylether );
cdk.generate3dCoordinates( dimethylether );
// save as CML
cdk.saveCML( dimethylether, "/Virtual/dimethylether.cml" );
ui.open( "/Virtual/dimethylether.cml" ); // this should open a JmolEditor
jmol.minimize();
cdk.determineFormat("/DemoData/3D Structures/cml/alcohols/(2R,3R,4R,5S)-hexane-1,2,3,4,5,6-hexol.cml")
cdk.determineFormat("/DemoData/3D Structures/mol/alcohols/(2R,3R,4R,5S)-hexane-1,2,3,4,5,6-hexol.mol")
xmpp.connect();
service = xmpp.getService("cdk.ws1.bmc.uu.se");
service.discoverSync(5000);
service.getFunctions();
f = service.getFunction("calculateMass");
ios = f.getIoSchemataSync(90000);
iof = xmpp.getIoFactory(ios);
smiDoc = iof.createSmilesDocument();
smiDoc.setSmiles("CCC");
result = f.invokeSync(smiDoc.toString(), 900000);
ui.open( "/CDK Demo Scripts/propan-2-ol.cml" )
cdkMolecule1 = cdk.loadMolecule( "/CDK Demo Scripts/propan-2-ol.cml" )
cdkdebug.depictCDKAtomTypes( cdkMolecule1 )
@egonw
egonw / sstructuredb test script.js
Created November 17, 2008 10:13 — forked from jonalv/sstructuredb test script.js
Creates a local structure database and adds three molecules to it.
var dbName = "exampleScriptDB";
if ( structuredb.allDatabaseNames().contains(dbName) ) {
structuredb.deleteDatabase(dbName);
}
structuredb.createDatabase(dbName);
smiles = new Array("Cc1ccccc1", "CCO", "O=O");
names = new Array("toluene", "beer", "air");
# just illustrative, and only works on a file only I have, but you get the idea
ui.open("/PeptideMimetics/10.cml")
oxygen = jcp.getModel().getAtomContainer().getAtom(11)
jcp.addAtom("C", oxygen)
newCarbon = jcp.getModel().getAtomContainer().getAtom(12)
jcp.addPhenyl(newCarbon)
mol = cdk.fromSMILES("C");
inchi1 = inchi.generate(mol);
js.print(inchi1 + "\n");
js.print("Key: " + inchi1.getKey() + "\n");
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?c WHERE {
?c a dbpedia-owl:ChemicalCompound
} ORDER BY ?c LIMIT 1000 OFFSET 0
xmpp.connect();
service = xmpp.getService("cdk.ws1.bmc.uu.se");
service.discoverSync(5000);
service.getFunctions();
f = service.getFunction("TPSA");
result = f.invokeSync(cdk.fromSMILES("CC").CML, 5000);
tpsaString = result.getTextContent()