Skip to content

Instantly share code, notes, and snippets.

@gilleain
Created April 27, 2009 23:02
Show Gist options
  • Save gilleain/102810 to your computer and use it in GitHub Desktop.
Save gilleain/102810 to your computer and use it in GitHub Desktop.
var iter = cdk.createMoleculeIterator("/tmp/C10H16_filtered.sdf");
var substructure = cdk.fromSMILES("C1CCCCC1");
var filepath = "/tmp/matches.sdf";
var molList = cdk.createMoleculeList();
while (iter.hasNext()) {
var mol = cdk.create(iter.next());
if (cdk.subStructureMatches(mol, substructure)) {
molList.add(mol);
}
}
cdk.createSDFile(filepath, molList);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment