19package denoptim.utils;
21import java.util.HashMap;
24import org.openscience.cdk.interfaces.IAtomContainer;
25import org.openscience.cdk.isomorphism.Mappings;
26import org.openscience.cdk.isomorphism.Pattern;
27import org.openscience.cdk.smarts.SmartsPattern;
39 private Map<String,Mappings>
allMatches =
new HashMap<>();
42 private Map<String,Integer>
numMatches =
new HashMap<>();
54 for (String smartsRef : smarts.keySet())
57 String oneSmarts = smarts.get(smartsRef);
60 Pattern sp = SmartsPattern.create(oneSmarts);
68 Mappings listOfIds = sp.matchAll(mol);
73 }
catch (Throwable t) {
74 java.lang.StackTraceElement[] stes = t.getStackTrace();
78 java.lang.StackTraceElement ste = stes[0];
79 cause = ste.getClassName();
81 cause =
"'unknown' (try to process this molecule alone to "
84 err =
"WARNING! For query " + err +
" => Exception returned "
Container of lists of atoms matching a list of SMARTS.
Map< String, Mappings > getAllMatches()
Mappings getMatchesOfSMARTS(String ref)
Map< String, Integer > numMatches
Map< String, Mappings > allMatches
ManySMARTSQuery(IAtomContainer mol, Map< String, String > smarts)
int getNumMatchesOfQuery(String query)
Utilities for molecule conversion.
static void setZeroImplicitHydrogensToAllAtoms(IAtomContainer iac)
Sets zero implicit hydrogen count to all atoms.
static void ensureNoUnsetBondOrdersSilent(IAtomContainer iac)
Sets bond order = single to all otherwise unset bonds.