Package com.im.df.api.chem
Class ChemUtils
- java.lang.Object
-
- com.im.df.api.chem.ChemUtils
-
public final class ChemUtils extends java.lang.Object
Utilities related to chemical classes. Currently support to search of the core when molecule search is executed. UI can color the molecule core using different color.- Author:
- Petr Hamernik
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChemUtils.MolCoreDescriptor
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
convertToSmartsRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smarts representation of the molecule.static java.lang.String
convertToSmilesRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smiles representation of the molecule.static java.lang.String
convertToStringRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smiles representation of the molecule.static java.lang.String
convertToStringRepresentation(chemaxon.struc.Molecule m, java.lang.String... formats)
Converts given molecule into a format.static ChemUtils.MolCoreDescriptor
findMolCoreDescriptor(DFTermExpression expression, DFField field)
static int
genSearchType(DFOperator op)
Temporary method finding appropriateJChemSearch
search type constant for the given operator.static chemaxon.standardizer.Standardizer
getStandardizer(JChemEntityCapability cap)
Gets standardizer fromJChemEntityCapability
.static chemaxon.standardizer.Standardizer
getStandardizer(DFEntity entity)
Gets standardizer from entity based onJChemEntityCapability
.static com.google.common.base.Optional<DFField>
getStructureField(DFEntity entity)
static void
setDissimilarityScore(chemaxon.struc.Molecule target, float dissimilarity)
Sets dissimilarity score property to target molecule.static DFOperator
toStructureOperator(int jchemSearchType)
ConvertsJChemSearch
search type to structureDFOperator
.
-
-
-
Method Detail
-
findMolCoreDescriptor
public static ChemUtils.MolCoreDescriptor findMolCoreDescriptor(DFTermExpression expression, DFField field)
-
genSearchType
public static int genSearchType(DFOperator op)
Temporary method finding appropriateJChemSearch
search type constant for the given operator.- Parameters:
op
- Operator must be a structure operator- Returns:
- The one of
JChemSearch
search type constant
-
toStructureOperator
public static DFOperator toStructureOperator(int jchemSearchType)
- Parameters:
jchemSearchType
-JChemSearch
search type constant- Returns:
- structure
DFOperator
-
convertToSmilesRepresentation
public static java.lang.String convertToSmilesRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smiles representation of the molecule. It tries in this order: Daylight smiles, Chemaxon Extended smiles, Daylight smarts, Chemaxon Extended smarts.- Parameters:
m
- The molecule- Returns:
- The first smiles variant that is supported
- Throws:
java.lang.IllegalArgumentException
- If none of the smiles variants are supported. Your code should expect this to happen on occasion.
-
convertToSmartsRepresentation
public static java.lang.String convertToSmartsRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smarts representation of the molecule. It tries in this order: Daylight smarts, Chemaxon Extended smarts.- Parameters:
m
- The molecule- Returns:
- The first smarts variant that is supported
- Throws:
java.lang.IllegalArgumentException
- If none of the smiles variants are supported. Your code should expect this to happen on occasion.
-
convertToStringRepresentation
public static java.lang.String convertToStringRepresentation(chemaxon.struc.Molecule m)
Generates the simplest smiles representation of the molecule. It tries in this order: Daylight smiles, Chemaxon Extended smiles, Daylight smarts, Chemaxon Extended smarts.- Parameters:
m
- The molecule- Returns:
- The first smiles variant that is supported
- Throws:
java.lang.IllegalArgumentException
- If none of the smiles variants are supported. Your code should expect this to happen on occasion.
-
convertToStringRepresentation
public static java.lang.String convertToStringRepresentation(chemaxon.struc.Molecule m, java.lang.String... formats)
Converts given molecule into a format. Tries format by format in given order.- Parameters:
m
- the moleculeformats
- export formats like "smiles", "smarts", "mrv", ...- Returns:
- the first succesfull result
- Throws:
java.lang.IllegalArgumentException
- if none of the given format is supported. Your code should expect this to happen on occasion.- Since:
- 18.15.0
-
getStructureField
public static com.google.common.base.Optional<DFField> getStructureField(DFEntity entity)
- Parameters:
entity
- JChemBase entity- Returns:
- structure field
-
getStandardizer
public static chemaxon.standardizer.Standardizer getStandardizer(DFEntity entity)
Gets standardizer from entity based onJChemEntityCapability
.- Parameters:
entity
- structure entity- Returns:
- standardizer or
null
if entity doesn't haveJChemEntityCapability
-
getStandardizer
public static chemaxon.standardizer.Standardizer getStandardizer(JChemEntityCapability cap)
Gets standardizer fromJChemEntityCapability
.- Parameters:
cap
-JChemEntityCapability
, cannot be null- Returns:
- standardizer, never
null
-
setDissimilarityScore
public static void setDissimilarityScore(chemaxon.struc.Molecule target, float dissimilarity)
Sets dissimilarity score property to target molecule. For example HitDisplayTool is able to pick it up from there.- Parameters:
target
- the molecule which will obtain the new propertydissimilarity
- new dissimilarity score
-
-