Package com.im.df.api.chem
Class MarvinStructure
- java.lang.Object
-
- com.im.df.api.chem.Structure<chemaxon.struc.Molecule>
-
- com.im.df.api.chem.MarvinStructure
-
public class MarvinStructure extends Structure<chemaxon.struc.Molecule>
A representation of a molecular structure that uses the ChemAxonMolecule
as its native format.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STANDARDIZED_2D
Key for storing 2D standardized molecules withStructure.storeMolecules(String, Molecule[], Object)
.static java.lang.String
STANDARDIZED_NATIVE
Key for storing standardized molecules withStructure.storeMolecules(String, Molecule[], Object)
.-
Fields inherited from class com.im.df.api.chem.Structure
encodedMol
-
-
Constructor Summary
Constructors Constructor Description MarvinStructure()
Creates a new instance of MarvinStructure with an empty Molecule.MarvinStructure(chemaxon.struc.Molecule mol)
Create a new instance with a molecule specified as a Marvin Molecule instance.MarvinStructure(java.lang.String mol)
Create a new instance with the structure specified as a String.MarvinStructure(java.lang.String molecule, boolean validate)
Create, but optionally check that the molecule is a valid.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asSimpleText(DFOperator operator)
Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available).boolean
equals(java.lang.Object obj)
chemaxon.struc.Molecule[]
getAllMolecules()
chemaxon.struc.Molecule[]
getAllNative2D()
Get the Molecules in 2 dimensional representation.java.lang.String
getEncodedMol()
Get the molecule in its original String form.chemaxon.struc.Molecule
getNative()
Get underlying Molecule.chemaxon.struc.Molecule
getNative2D()
Get the Molecule in 2 dimensional representation.int
hashCode()
java.lang.Exception
parseExceptionException()
java.lang.String
toString()
static MarvinStructure
valueOf(java.lang.Object value)
Create new instance from an instance.-
Methods inherited from class com.im.df.api.chem.Structure
retrieveMolecule, retrieveMolecules, setEncodedMol, storeMolecule, storeMolecules
-
-
-
-
Field Detail
-
STANDARDIZED_2D
public static final java.lang.String STANDARDIZED_2D
Key for storing 2D standardized molecules withStructure.storeMolecules(String, Molecule[], Object)
.- See Also:
- Constant Field Values
-
STANDARDIZED_NATIVE
public static final java.lang.String STANDARDIZED_NATIVE
Key for storing standardized molecules withStructure.storeMolecules(String, Molecule[], Object)
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MarvinStructure
public MarvinStructure()
Creates a new instance of MarvinStructure with an empty Molecule.
-
MarvinStructure
public MarvinStructure(java.lang.String mol)
Create a new instance with the structure specified as a String. No validation of the format is performed, and if an invalid structure is used exception will occur later when the molecule needs to be converted. Only use this approach if you are sure that the structures are valid. Use the 2 argument constructor is you want to perform validation.- Parameters:
mol
- The molecule, in one of the formats that Marvin recognises.
-
MarvinStructure
public MarvinStructure(chemaxon.struc.Molecule mol)
Create a new instance with a molecule specified as a Marvin Molecule instance. This is the internal representation that is used by MarvinStructure.- Parameters:
mol
- The Molecule instance
-
MarvinStructure
public MarvinStructure(java.lang.String molecule, boolean validate) throws java.lang.IllegalArgumentException
Create, but optionally check that the molecule is a valid. Throws an IllegalArgumentException if the string can't be converted into a MarvinMolecule
object usingMolImporter
- Parameters:
molecule
- The structurevalidate
- Whether to validate the structure. If so the native form of the molecule is created immediately.- Throws:
java.lang.IllegalArgumentException
- if structure is invalid
-
-
Method Detail
-
getEncodedMol
public java.lang.String getEncodedMol()
Description copied from class:Structure
Get the molecule in its original String form.- Overrides:
getEncodedMol
in classStructure<chemaxon.struc.Molecule>
- Returns:
- Value of property encodedMol.
-
toString
public java.lang.String toString()
-
parseExceptionException
public java.lang.Exception parseExceptionException()
- Returns:
- The exception if parsing of molecule failed
-
asSimpleText
public java.lang.String asSimpleText(DFOperator operator)
Description copied from class:Structure
Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available). ChemAxon extended smiles/smarts will be used if it is not possible to describe the structure in Daylight smiles/smarts.The decission on smiles vs. smarts is taken based on the operator. For perfect, similarity and superstructure type smiles is used, for other types smarts is used. If operator is not specified then smarts format is returned.
To convert
Molecule
you can use also these two methods:ChemUtils.convertToSmilesRepresentation(chemaxon.struc.Molecule)
andChemUtils.convertToSmartsRepresentation(chemaxon.struc.Molecule)
.- Specified by:
asSimpleText
in classStructure<chemaxon.struc.Molecule>
- Parameters:
operator
- The search operator if it's available. It's allowed to put null here- Returns:
- The smiles/smarts string
-
getNative
public chemaxon.struc.Molecule getNative()
Get underlying Molecule.
-
getAllMolecules
public chemaxon.struc.Molecule[] getAllMolecules()
- Returns:
- clone of native molecules
-
getNative2D
public chemaxon.struc.Molecule getNative2D()
Get the Molecule in 2 dimensional representation.- Specified by:
getNative2D
in classStructure<chemaxon.struc.Molecule>
- Returns:
- clone of molecule in 2D
-
getAllNative2D
public chemaxon.struc.Molecule[] getAllNative2D()
Get the Molecules in 2 dimensional representation.- Returns:
- clones of molecules in 2D
-
valueOf
public static MarvinStructure valueOf(java.lang.Object value)
Create new instance from an instance.- Parameters:
value
- either MarvinStructure or String.- Returns:
- null if the value is not structure.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-