Skip to content

Instantly share code, notes, and snippets.

@jonalv
Forked from egonw/sstructuredb test script.js
Created February 4, 2009 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonalv/58079 to your computer and use it in GitHub Desktop.
Save jonalv/58079 to your computer and use it in GitHub Desktop.
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