Skip to content

Instantly share code, notes, and snippets.

@johnmay
Created May 16, 2016 19:39
Show Gist options
  • Save johnmay/7fede753272f488bb29f9a24f192bfad to your computer and use it in GitHub Desktop.
Save johnmay/7fede753272f488bb29f9a24f192bfad to your computer and use it in GitHub Desktop.
IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
SmilesParser smipar = new SmilesParser(bldr);
Pattern ptrn = SmartsPattern.create("O=[C,N]aa[N,O;!H0]", null);
try (Reader frdr = new FileReader(fname);
BufferedReader brdr = new BufferedReader(frdr)) {
String line;
while ((line = brdr.readLine()) != null)
if (ptrn.matches(smipar.parseSmiles(line)))
System.out.println(line);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment