com.im.df.api 14.10.20.0

com.im.df.api.chem
Class MarvinStructure

java.lang.Object
  extended by com.im.df.api.chem.Structure<Molecule>
      extended by com.im.df.api.chem.MarvinStructure

public class MarvinStructure
extends Structure<Molecule>

A representation of a molecular structure that uses the ChemAxon Molecule as its native format.


Field Summary
static String STANDARDIZED_2D
          Key for storing 2D standardized molecules with Structure#storeMolecules(java.lang.String, T[], java.lang.Object) .
static String STANDARDIZED_NATIVE
          Key for storing standardized molecules with Structure#storeMolecules(java.lang.String, T[], java.lang.Object) .
 
Fields inherited from class com.im.df.api.chem.Structure
encodedMol
 
Constructor Summary
MarvinStructure()
          Creates a new instance of MarvinStructure with an empty Molecule.
MarvinStructure(Molecule mol)
          Create a new instance with a molecule specified as a Marvin Molecule instance.
MarvinStructure(String mol)
          Create a new instance with the structure specified as a String.
MarvinStructure(String molecule, boolean validate)
          Create, but optionally check that the molecule is a valid.
 
Method Summary
 String asSimpleText(DFOperator operator)
          Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available).
 boolean equals(Object obj)
           
 Molecule[] getAllMolecules()
           
 Molecule[] getAllNative2D()
          Get the Molecules in 2 dimensional representation.
 String getEncodedMol()
          Get the molecule in its original String form.
 Molecule getNative()
          Get underlying Molecule.
 Molecule getNative2D()
          Get the Molecule in 2 dimensional representation.
 int hashCode()
           
 Exception parseExceptionException()
           
 String toString()
           
static MarvinStructure valueOf(Object value)
          Create new instance from an instance.
 
Methods inherited from class com.im.df.api.chem.Structure
retrieveMolecule, retrieveMolecules, setEncodedMol, storeMolecule, storeMolecules
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STANDARDIZED_2D

public static final String STANDARDIZED_2D
Key for storing 2D standardized molecules with Structure#storeMolecules(java.lang.String, T[], java.lang.Object) .

See Also:
Constant Field Values

STANDARDIZED_NATIVE

public static final String STANDARDIZED_NATIVE
Key for storing standardized molecules with Structure#storeMolecules(java.lang.String, T[], java.lang.Object) .

See Also:
Constant Field Values
Constructor Detail

MarvinStructure

public MarvinStructure()
Creates a new instance of MarvinStructure with an empty Molecule.


MarvinStructure

public MarvinStructure(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(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(String molecule,
                       boolean validate)
                throws IllegalArgumentException
Create, but optionally check that the molecule is a valid. Throws an IllegalArgumentException if the string can't be converted into a Marvin Molecule object using MolImporter

Parameters:
molecule - The structure
validate - Whether to validate the structure. If so the native form of the molecule is created immediately.
Throws:
IllegalArgumentException - if structure is invalid
Method Detail

getEncodedMol

public String getEncodedMol()
Description copied from class: Structure
Get the molecule in its original String form.

Overrides:
getEncodedMol in class Structure<Molecule>
Returns:
Value of property encodedMol.

toString

public String toString()
Overrides:
toString in class Structure<Molecule>

parseExceptionException

public Exception parseExceptionException()
Returns:
The exception if parsing of molecule failed

asSimpleText

public 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) and ChemUtils.convertToSmartsRepresentation(chemaxon.struc.Molecule).

Specified by:
asSimpleText in class Structure<Molecule>
Parameters:
operator - The search operator if it's available. It's allowed to put null here
Returns:
The smiles/smarts string

getNative

public Molecule getNative()
Get underlying Molecule.

Specified by:
getNative in class Structure<Molecule>
Returns:
clone of the source Molecule.

getAllMolecules

public Molecule[] getAllMolecules()
Returns:
clone of native molecules

getNative2D

public Molecule getNative2D()
Get the Molecule in 2 dimensional representation.

Specified by:
getNative2D in class Structure<Molecule>
Returns:
clone of molecule in 2D

getAllNative2D

public Molecule[] getAllNative2D()
Get the Molecules in 2 dimensional representation.

Returns:
clones of molecules in 2D

valueOf

public static MarvinStructure valueOf(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(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

com.im.df.api 14.10.20.0