|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmol.smiles.PatternMatcher
public class PatternMatcher
A class to match a SMILES pattern with a Jmol molecule.
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
}
SmilesMolecule| Field Summary | |
|---|---|
private int |
atomCount
|
private ModelSet |
modelSet
|
| Constructor Summary | |
|---|---|
PatternMatcher()
Constructs a PatternMatcher. |
|
| Method Summary | |
|---|---|
java.util.BitSet |
getSubstructureSet(SmilesMolecule pattern)
Returns a vector of bits indicating which atoms match the pattern. |
java.util.BitSet |
getSubstructureSet(java.lang.String smiles)
Returns a vector of bits indicating which atoms match the pattern. |
private void |
searchMatch(java.util.BitSet bs,
SmilesMolecule pattern,
int atomNum)
Recursively search matches. |
private void |
searchMatch(java.util.BitSet bs,
SmilesMolecule pattern,
SmilesAtom patternAtom,
int atomNum,
int i)
Recursively search matches. |
void |
setViewer(Viewer viewer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int atomCount
private ModelSet modelSet
| Constructor Detail |
|---|
public PatternMatcher()
PatternMatcher.
| Method Detail |
|---|
public void setViewer(Viewer viewer)
setViewer in interface SmilesMatcherInterface
public java.util.BitSet getSubstructureSet(java.lang.String smiles)
throws java.lang.Exception
getSubstructureSet in interface SmilesMatcherInterfacesmiles - SMILES pattern.
java.lang.Exception - Raised if smiles is not a valid SMILES pattern.public java.util.BitSet getSubstructureSet(SmilesMolecule pattern)
pattern - SMILES pattern.
private void searchMatch(java.util.BitSet bs,
SmilesMolecule pattern,
int atomNum)
bs - Resulting BitSet (each atom in a structure is set to 1).pattern - SMILES pattern.atomNum - Current atom of the pattern.
private void searchMatch(java.util.BitSet bs,
SmilesMolecule pattern,
SmilesAtom patternAtom,
int atomNum,
int i)
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||