Skip to content

Commit

Permalink
Recursive SMARTS atom should use the Pattern API, not sure why I used…
Browse files Browse the repository at this point in the history
… Ullmann here. Also remove redundant logger.
  • Loading branch information
johnmay committed Feb 15, 2018
1 parent 6516c8a commit 5e7a9d9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.isomorphism.ComponentGrouping;
import org.openscience.cdk.isomorphism.Pattern;
import org.openscience.cdk.isomorphism.SmartsStereoMatch;
import org.openscience.cdk.isomorphism.Ullmann;
import org.openscience.cdk.isomorphism.matchers.IQueryAtom;
import org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;

import java.util.BitSet;

Expand All @@ -43,9 +41,6 @@
*/
public final class RecursiveSmartsAtom extends SMARTSAtom {

private final static ILoggingTool logger = LoggingToolFactory
.createLoggingTool(RecursiveSmartsAtom.class);

/** The IQueryAtomContainer created by parsing the recursive smarts */
private final IQueryAtomContainer query;

Expand All @@ -66,7 +61,7 @@ public RecursiveSmartsAtom(final IQueryAtomContainer query) {
@Override
public BitSet load(IAtomContainer target) throws Exception {
BitSet hits = new BitSet();
for (int[] mapping : FluentIterable.from(Ullmann.findSubstructure(query).matchAll(target))
for (int[] mapping : FluentIterable.from(Pattern.findSubstructure(query).matchAll(target))
.filter(new SmartsStereoMatch(query, target))
.filter(new ComponentGrouping(query, target))) {
hits.set(mapping[0]);
Expand Down

0 comments on commit 5e7a9d9

Please sign in to comment.