public class RBlastSmilesGenerator
extends java.lang.Object
Constructor and Description |
---|
RBlastSmilesGenerator()
Create the SMILES generator.
|
RBlastSmilesGenerator(boolean useAromaticityFlag)
Create the SMILES generator.
|
RBlastSmilesGenerator(boolean useAromaticityFlag,
ICanonicalMoleculeLabeller labeller) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createChiralSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule,
boolean[] doubleBondConfiguration)
Generate canonical and chiral SMILES from the
molecule . |
java.lang.String |
createSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule)
Generate canonical SMILES from the
molecule . |
java.lang.String |
createSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule,
boolean chiral,
boolean[] doubleBondConfiguration)
Generate canonical SMILES from the
molecule . |
java.lang.String |
createSMILES(org.openscience.cdk.interfaces.IReaction reaction)
Generate a SMILES for the given
Reaction . |
java.lang.String |
createSMILESWithoutCheckForMultipleMolecules(org.openscience.cdk.interfaces.IAtomContainer molecule,
boolean chiral,
boolean[] doubleBondConfiguration)
Generate canonical SMILES from the
molecule . |
org.openscience.cdk.ringsearch.AllRingsFinder |
getRingFinder()
Returns the current AllRingsFinder instance
|
boolean |
isValidDoubleBondConfiguration(org.openscience.cdk.interfaces.IAtomContainer container,
org.openscience.cdk.interfaces.IBond bond)
Tells if a certain bond is center of a valid double bond configuration.
|
void |
setRingFinder(org.openscience.cdk.ringsearch.AllRingsFinder ringFinder)
Sets the current AllRingsFinder instance Use this if you want to
customize the timeout for the AllRingsFinder.
|
RBlastSmilesGenerator |
setRings(org.openscience.cdk.interfaces.IRingSet rings)
Provide a reference to a RingSet that holds ALL rings of the
molecule.
During creation of a SMILES the aromaticity of the molecule has to be detected. |
void |
setUseAromaticityFlag(boolean useAromaticityFlag)
Indicates whether output should be an aromatic SMILES.
|
public RBlastSmilesGenerator()
public RBlastSmilesGenerator(boolean useAromaticityFlag)
useAromaticityFlag
- if false only SP2-hybridized atoms will be
lower case (default), true=SP2 or aromaticity trigger lower case (same as
using setUseAromaticityFlag later)public RBlastSmilesGenerator(boolean useAromaticityFlag, ICanonicalMoleculeLabeller labeller)
useAromaticityFlag
- labeller
- public boolean isValidDoubleBondConfiguration(org.openscience.cdk.interfaces.IAtomContainer container, org.openscience.cdk.interfaces.IBond bond)
container
- The atomcontainer.bond
- The bond.public RBlastSmilesGenerator setRings(org.openscience.cdk.interfaces.IRingSet rings)
rings
- RingSet that holds ALL rings of the moleculepublic java.lang.String createSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule)
molecule
. This method
canonically labels the molecule but does not perform any checks on the
chemical validity of the molecule. IMPORTANT: A precomputed Set of All
Rings (SAR) can be passed to this SmilesGenerator in order to avoid
recomputing it. Use setRings() to assign the SAR.molecule
- The molecule to evaluateCanonicalLabeler.canonLabel(IAtomContainer)
public java.lang.String createSMILES(org.openscience.cdk.interfaces.IReaction reaction) throws org.openscience.cdk.exception.CDKException
Reaction
.reaction
- the reaction in questionorg.openscience.cdk.exception.CDKException
- if there is an error
during SMILES generationpublic java.lang.String createChiralSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule, boolean[] doubleBondConfiguration) throws org.openscience.cdk.exception.CDKException
molecule
. This
method canonicaly lables the molecule but dose not perform any checks on
the chemical validity of the molecule. The chiral smiles is done like in
the
daylight theory manual . I did not find rules for canonical and
chiral smiles, therefore there is no guarantee that the smiles complies
to any externeal rules, but it is canonical compared to other smiles
produced by this method. The method checks if there are 2D coordinates
but does not check if coordinates make sense. Invalid stereo
configurations are ignored; if there are no valid stereo configuration
the smiles will be the same as the non-chiral one. Note that often stereo
configurations are only complete and can be converted to a smiles if
explicit Hs are given. IMPORTANT: A precomputed Set of All Rings (SAR)
can be passed to this SmilesGenerator in order to avoid recomputing it.
Use setRings() to assign the SAR.molecule
- The molecule to evaluate.doubleBondConfiguration
- Should E/Z configurations be read at these
positions? If the flag at position X is set to true, an E/Z configuration
will be written from coordinates around bond X, if false, it will be
ignored. If flag is true for a bond which does not constitute a valid
double bond configuration, it will be ignored (meaning setting all to
true will create E/Z indication will be pu in the smiles wherever
possible, but note the coordinates might be arbitrary).org.openscience.cdk.exception.CDKException
- At least one atom has no Point2D; coordinates are
needed for creating the chiral smiles.CanonicalLabeler.canonLabel(IAtomContainer)
public java.lang.String createSMILES(org.openscience.cdk.interfaces.IAtomContainer molecule, boolean chiral, boolean[] doubleBondConfiguration) throws org.openscience.cdk.exception.CDKException
molecule
. This method
canonicaly lables the molecule but dose not perform any checks on the
chemical validity of the molecule. This method also takes care of
multiple molecules. IMPORTANT: A precomputed Set of All Rings (SAR) can
be passed to this SmilesGenerator in order to avoid recomputing it. Use
setRings() to assign the SAR.molecule
- The molecule to evaluate.chiral
- true=SMILES will be chiral, false=SMILES. will not be
chiral.doubleBondConfiguration
- Should E/Z configurations be read at these
positions? If the flag at position X is set to true, an E/Z configuration
will be written from coordinates around bond X, if false, it will be
ignored. If flag is true for a bond which does not constitute a valid
double bond configuration, it will be ignored (meaning setting all to
true will create E/Z indication will be pu in the smiles wherever
possible, but note the coordinates might be arbitrary).org.openscience.cdk.exception.CDKException
- At least one atom has no Point2D; coordinates are
needed for crating the chiral smiles. This excpetion can only be thrown
if chiral smiles is created, ignore it if you want a non-chiral smiles
(createSMILES(GraphAtomContainer) does not throw an exception).CanonicalLabeler.canonLabel(IAtomContainer)
public java.lang.String createSMILESWithoutCheckForMultipleMolecules(org.openscience.cdk.interfaces.IAtomContainer molecule, boolean chiral, boolean[] doubleBondConfiguration) throws org.openscience.cdk.exception.CDKException
molecule
. This method
canonicaly lables the molecule but dose not perform any checks on the
chemical validity of the molecule. Does not care about multiple
molecules. IMPORTANT: A precomputed Set of All Rings (SAR) can be passed
to this SmilesGenerator in order to avoid recomputing it. Use setRings()
to assign the SAR.molecule
- The molecule to evaluate.chiral
- true=SMILES will be chiral, false=SMILES will not be
chiral.doubleBondConfiguration
- Should E/Z configurations be read at these
positions? If the flag at position X is set to true, an E/Z configuration
will be written from coordinates around bond X, if false, it will be
ignored. If flag is true for a bond which does not constitute a valid
double bond configuration, it will be ignored (meaning setting all to
true will create E/Z indication will be pu in the smiles wherever
possible, but note the coordinates might be arbitrary).org.openscience.cdk.exception.CDKException
- At least one atom has no Point2D; coordinates are
needed for creating the chiral smiles. This excpetion can only be thrown
if chiral smiles is created, ignore it if you want a non-chiral smiles
(createSMILES(GraphAtomContainer) does not throw an exception).CanonicalLabeler.canonLabel(IAtomContainer)
public org.openscience.cdk.ringsearch.AllRingsFinder getRingFinder()
public void setRingFinder(org.openscience.cdk.ringsearch.AllRingsFinder ringFinder)
ringFinder
- The value to assign ringFinder.AllRingsFinder
public void setUseAromaticityFlag(boolean useAromaticityFlag)
useAromaticityFlag
- if false only SP2-hybridized atoms will be
lower case (default), true=SP2 or aromaticity trigger lower case