Skip to content

Instantly share code, notes, and snippets.

@jonalv
Created March 5, 2009 14:44
Show Gist options
  • Save jonalv/74367 to your computer and use it in GitHub Desktop.
Save jonalv/74367 to your computer and use it in GitHub Desktop.
var file = "/Sample Data/SDF/borken.sdf";
iterator = cdk.createMoleculeIterator(file);
var i = 0;
js.print("\n");
var numberOff = cdk.numberOfEntriesInSDF(file);
var molecules = cdk.createMoleculeList();
while ( iterator.hasNext() ) {
m = iterator.next();
i++;
js.print("Read molecule" + i + " " + m.toString() + "\n");
molecules.add(m);
}
js.print("Managed to parse " + i + " molecules out of " + numberOff
+ " found by cdk.numberOfEntriesInSDF");
cdk.createSDFile("/Virtual/moleculesThatParse.sdf", molecules);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment