Package org.openscience.cdk.smirks
Class SmirksTransform
- java.lang.Object
-
- org.openscience.cdk.isomorphism.Transform
-
- org.openscience.cdk.smirks.SmirksTransform
-
public final class SmirksTransform extends Transform
A SMIRKS transform, is aTransform
which can optionally (on by default) perform ring and aromaticity (Daylight) perception. Before applying the transform the molecule is matched it is passed toSmartsPattern.prepare(org.openscience.cdk.interfaces.IAtomContainer, int)
. The prepare function ensures ring and aromatic flags are consistent. You can turn off by settingsetPrepare(boolean)
to false.
Basic usage:SmirksTransform smirks = Smirks.compile("[C:1][H]>>[C:1]Cl"); smirks.apply(mol);
- See Also:
Transform
,Pattern
,SmartsPattern
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openscience.cdk.isomorphism.Transform
Transform.Mode
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
apply(IAtomContainer mol)
Applies the exclusive transform to the provided molecule modifying it as required.Iterable<IAtomContainer>
apply(IAtomContainer mol, Transform.Mode mode)
Apply the transform to the provided molecule and obtain the results of applying the transform.SmirksTransform
setPrepare(boolean doPrep)
Sets whether the molecule should be "prepared" for a SMIRKS transform, including set ring flags and perceiving aromaticity.
-
-
-
Method Detail
-
setPrepare
public SmirksTransform setPrepare(boolean doPrep)
Sets whether the molecule should be "prepared" for a SMIRKS transform, including set ring flags and perceiving aromaticity. The main reason to skip preparation (viaSmartsPattern.prepare(IAtomContainer)
) is if it has already been done, for example when matching multiple SMIRKS transforms.- Parameters:
doPrep
- whether preparation should be done- Returns:
- self for inline calling
-
apply
public Iterable<IAtomContainer> apply(IAtomContainer mol, Transform.Mode mode)
Description copied from class:Transform
Apply the transform to the provided molecule and obtain the results of applying the transform. The original molecule is NOT modified.
-
apply
public boolean apply(IAtomContainer mol)
Description copied from class:Transform
Applies the exclusive transform to the provided molecule modifying it as required.
-
-