com.im.df.api 5.9

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
           
static String STANDARDIZED_NATIVE
           
 
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()
           
 Molecule getNative()
          Get the molecule in its native format Never returns null.
 Molecule getNative2D()
          Get the Molecule in 2 dimensional representation
 int hashCode()
           
 Exception parseExceptionException()
           
 String toString()
           
 
Methods inherited from class com.im.df.api.chem.Structure
getEncodedMol, 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
See Also:
Constant Field Values

STANDARDIZED_NATIVE

public static final String STANDARDIZED_NATIVE
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:
The - Molecule instance

MarvinStructure

public MarvinStructure(String molecule,
                       boolean validate)
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

toString

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

getNative

public Molecule getNative()
Description copied from class: Structure
Get the molecule in its native format Never returns null.

Specified by:
getNative in class Structure<Molecule>
Returns:
The source Molecule. this is not a clone, so do not edit this unless you want your changes to be permanent. Clone it instead.

getAllMolecules

public Molecule[] getAllMolecules()

parseExceptionException

public Exception parseExceptionException()
Returns:
The exception if parsing of melecule 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

getNative2D

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

Specified by:
getNative2D in class Structure<Molecule>
Returns:
The Molecule in 2 dimensional representation. If the original is in 3D or less than 2D then it will be converted to 2D. If its already in 2D then a copy of the molecule is returned to prevent unwanted modification to the original.

getAllNative2D

public Molecule[] getAllNative2D()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

com.im.df.api 5.9