Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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");
label = structuredb.createTextAnnotation(dbName, "label", "substances")
for (i=0; i<3; i++) {
mol = cdk.fromSMILES(smiles[i]);
dbmol = structuredb.createMolecule(dbName, names[i], mol);
label.addDBMolecule(dbmol);
}
structuredb.save(dbName, label);
js.print("Starting sub structure search");
var hits = structuredb.subStructureSearch( dbName, cdk.fromSMILES("C") );
js.print(hits);
hits;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment