com.im.df.api 5.9

com.im.df.api.chem
Class Structure<T>

java.lang.Object
  extended by com.im.df.api.chem.Structure<T>
Direct Known Subclasses:
MarvinStructure

public abstract class Structure<T>
extends Object

A molecular structure based on some particular implementation. The Structure must be definable as a String, but the actual implementation is up to the sub-class. Multiple formats are expected to be supported (e.g smiles, CTAB...)


Constructor Summary
Structure()
          Creates a new instance of Structure
Structure(String mol)
           
 
Method Summary
abstract  String asSimpleText(DFOperator operator)
          Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available).
 String getEncodedMol()
          Get the molecule in its original String form.
abstract  T getNative()
          Get the molecule in its native format Never returns null.
abstract  T getNative2D()
          Get the molecule in 2D coordinates.
 T retrieveMolecule(String key, Object version)
          Retrieve a particular representation of the molecule from the store
 T[] retrieveMolecules(String key, Object version)
           
 void setEncodedMol(String encodedMol)
          Setter for property encodedMol.
 void storeMolecule(String key, T mol, Object version)
          Cache some particular representation of the molecule
 void storeMolecules(String key, T[] mols, Object version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Structure

public Structure()
Creates a new instance of Structure


Structure

public Structure(String mol)
Method Detail

asSimpleText

public abstract String asSimpleText(DFOperator operator)
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).

Parameters:
operator - The search operator if it's available. It's allowed to put null here
Returns:
The smiles/smarts string

getEncodedMol

public String getEncodedMol()
Get the molecule in its original String form.

Returns:
Value of property encodedMol.

setEncodedMol

public void setEncodedMol(String encodedMol)
Setter for property encodedMol.

Parameters:
encodedMol - New value of property encodedMol.

toString

public String toString()
Overrides:
toString in class Object

getNative

public abstract T getNative()
Get the molecule in its native format Never returns null.


getNative2D

public abstract T getNative2D()
Get the molecule in 2D coordinates. If it can't be converted to 2D it should be returned in original coordinates. Never returns null.


storeMolecule

public void storeMolecule(String key,
                          T mol,
                          Object version)
Cache some particular representation of the molecule

Parameters:
key - The key to use to store a particular representation of the structure
mol - The molecule
version - A version number for the molecule. Can be null.

storeMolecules

public void storeMolecules(String key,
                           T[] mols,
                           Object version)

retrieveMolecule

public T retrieveMolecule(String key,
                          Object version)
Retrieve a particular representation of the molecule from the store

Parameters:
key -
version - The version number of the current molecule. If the version number is not the same as the one used to store the molecule then the store molecule is removed from the cache and should be re-generated using the current version (and then probably added back to the cache).
Returns:
The molecule from the cache. Can be null.

retrieveMolecules

public T[] retrieveMolecules(String key,
                             Object version)

com.im.df.api 5.9