org.jmol.smiles
public class PatternMatcher extends Object implements SmilesMatcherInterface
The SMILES specification can been found at the SMILES Home Page.
An example on how to use it:
PatternMatcher matcher = new PatternMatcher(jmolViewer);
try {
BitSet bitSet = matcher.getSubstructureSet(smilesString);
// Use bitSet...
} catch (InvalidSmilesException e) {
// Exception management
}
See Also: SmilesMolecule
| Field Summary | |
|---|---|
| int | atomCount |
| ModelSet | modelSet |
| Constructor Summary | |
|---|---|
| PatternMatcher()
Constructs a PatternMatcher.
| |
| Method Summary | |
|---|---|
| BitSet | getSubstructureSet(String smiles)
Returns a vector of bits indicating which atoms match the pattern.
|
| BitSet | getSubstructureSet(SmilesMolecule pattern)
Returns a vector of bits indicating which atoms match the pattern.
|
| void | searchMatch(BitSet bs, SmilesMolecule pattern, int atomNum)
Recursively search matches.
|
| void | searchMatch(BitSet bs, SmilesMolecule pattern, SmilesAtom patternAtom, int atomNum, int i)
Recursively search matches.
|
| void | setViewer(Viewer viewer) |
PatternMatcher.
Parameters: smiles SMILES pattern.
Returns: BitSet Array indicating which atoms match the pattern.
Throws: Exception Raised if smiles is not a valid SMILES pattern.
Parameters: pattern SMILES pattern.
Returns: BitSet Array indicating which atoms match the pattern.
Parameters: bs Resulting BitSet (each atom in a structure is set to 1). pattern SMILES pattern. atomNum Current atom of the pattern.
Parameters: bs Resulting BitSet (each atom in a structure is set to 1). pattern SMILES pattern. patternAtom Atom of the pattern that is currently tested. atomNum Current atom of the pattern. i Atom number of the atom that is currently tested to match patternAtom.