|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.util.ErrorHandler
chemaxon.util.MolHandler
public class MolHandler
Class for handling molecules for systems based on ChemAxon's
programming intaface.
A MolHandler object contains the structure of a molecule.
Operations on the object:
| Field Summary |
|---|
| Fields inherited from class chemaxon.util.ErrorHandler |
|---|
CLASS_NOT_FOUND_ERROR, DATABASE_SEARCH_ERROR, exception, ILLEGAL_ACCESS_ERROR, INSTANTIATION_ERROR, IO_ERROR, MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR, MOL_FORMAT_ERROR, NO_ERROR, PROPERTY_NOT_SET_ERROR, SQL_ERROR, UNIDENTIFIED_ERROR |
| Constructor Summary | |
|---|---|
MolHandler()
Creates an uninitialized MolHandler object. |
|
MolHandler(byte[] molecule)
Creates a MolHandler object from a byte array. |
|
MolHandler(byte[] molecule,
boolean queryMode)
Creates a MolHandler object from a byte array. |
|
MolHandler(Molecule mol)
Creates a MolHandler object from a Molecule. |
|
MolHandler(java.lang.String molecule)
Creates a MolHandler object from a String. |
|
MolHandler(java.lang.String molecule,
boolean queryMode)
Creates a MolHandler object from a String. |
|
| Method Summary | |
|---|---|
void |
addHydrogens()
Adds explicit H atoms instead of the current implicit ones. |
void |
addHydrogensToAromaticHeteroAtoms()
Adds the implicit Hydrogen atoms to heteroatoms in aromatic rings. |
double |
align(Molecule mol,
int[] indexes)
Alignes (rotates) a specified molecule realtive to the contained molecule according to the specified atom pairs. |
void |
aromatize()
Converts the bonds in an aromatic system entered using single and double bonds to aromatic bonds. |
void |
aromatize(int method)
Converts the bonds in an aromatic system entered using single and double bonds to aromatic bonds. |
java.lang.String |
calcMolFormula()
Calculates the molecular formula of the molecule. |
float |
calcMolWeight()
Calculates the molecular weight of the molecule. |
double |
calcMolWeightInDouble()
Calculates the molecular weight of the molecule. |
void |
clean(boolean always,
java.lang.String options)
Calculates 2D coordinates. |
boolean |
containsHydrogens()
True if the molecule contains explicit Hydrogen atoms, false otherwise. |
byte[] |
generateFingerprintInBytes(int numberOfInts,
int numberOfOnes,
int numberOfBonds)
Generates chemical hashed fingerprint for the molecule and returns it in byte units. |
int[] |
generateFingerprintInInts(int numberOfInts,
int numberOfOnes,
int numberOfBonds)
Generates chemical hashed fingerprint for the molecule and returns it in int units. |
int |
getAtomCount()
Retrieves the number of atoms in the Molecule stored in the MolHandler object. |
byte[] |
getFingerprintInBytes(int numberOfBits,
int numberOfOnes,
int numberOfBonds)
Deprecated. since JChem 3.1 the usage of generateFingerprintInBytes(int, int, int)
is recommended |
int[] |
getFingerprintInInts(int numberOfBits,
int numberOfOnes,
int numberOfBonds)
Deprecated. since JChem 3.1 the usage of generateFingerprintInInts(int, int, int)
is recommended |
int |
getHeavyAtomCount()
Retrieves the number of non-hydrogen atoms in the Molecule stored in the MolHandler object. |
int |
getImplicitHCount()
Counts the number of implicir hydrogens on the molecule |
Molecule |
getMolecule()
Retrieves the Molecule from the MolHandler object. |
static java.util.ArrayList |
getNonHitBondEndpoints(Molecule query,
Molecule target,
int[] hit)
Returns the bonds of the target molecule that should not be colored in hit highlighting. |
static java.util.ArrayList |
getNonHitBonds(Molecule query,
Molecule target,
int[] hit)
Returns the bonds of the target molecule that should not be colored in hit highlighting. |
boolean |
getQueryMode()
Gets query mode. |
static boolean |
isDaylightFormat(java.lang.String format)
Decides whether the given molecule format belongs to the Daylight family of languages. |
static boolean |
isPlainH(MolAtom atom)
Decides if atom is a plain H atom. |
static void |
main(java.lang.String[] args)
|
static Molecule |
readFromVMN(MRecord rec)
Reads in the molecule from the VMN record and returns the molecule. |
void |
removeHydrogens()
Removes all hydrogen atoms. |
void |
removeHydrogensFromCarbons()
Removes Hydrogen atoms attached to Carbon atoms. |
void |
setMolecule_BNE(byte[] molecule)
Deprecated. since JChem 5.2 use setMolecule(byte[]) |
void |
setMolecule_SNE(java.lang.String molecule)
Deprecated. since JChem 5.2 use setMolecule(String) |
void |
setMolecule(byte[] molecule)
Initializes a MolHandler object from a byte array. |
void |
setMolecule(Molecule molecule)
Initializes a MolHandler object from a Molecule. |
void |
setMolecule(java.lang.String molecule)
Initializes a MolHandler object from a String. |
void |
setQueryMode(boolean q)
Sets query mode. |
byte[] |
toBinFormat(java.lang.String format)
Converts the molecule to the specified binary format. |
java.lang.String |
toFormat(java.lang.String format)
Converts the molecule to the specified text format. |
| Methods inherited from class chemaxon.util.ErrorHandler |
|---|
checkError, checkException, getError, getErrorMessage, getException, getStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MolHandler()
public MolHandler(Molecule mol)
mol - a clone of this parameter is stored in the MolHandler object
public MolHandler(java.lang.String molecule)
throws MolFormatException
molecule - the String must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles format.
MolFormatException
public MolHandler(java.lang.String molecule,
boolean queryMode)
throws MolFormatException
molecule - the String must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles format.queryMode - if set to trueSMILES strings are imported as
SMARTS. Default is false.
since 2.2
MolFormatException
public MolHandler(byte[] molecule)
throws MolFormatException
molecule - the byte array must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles format.
MolFormatException
public MolHandler(byte[] molecule,
boolean queryMode)
throws MolFormatException
molecule - the byte array must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles formatqueryMode - if set to trueSMILES strings are imported as
SMARTS. Default is false.
since 2.2
MolFormatException| Method Detail |
|---|
public void setMolecule(Molecule molecule)
molecule - a clone of this parameter is stored in the MolHandler object
public void setMolecule(java.lang.String molecule)
throws MolFormatException
molecule - the String must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles format.
MolFormatExceptionpublic void setMolecule_SNE(java.lang.String molecule)
setMolecule(String)
setMolecule(String),
but exceptions are caught and stored.
ErrorHandler,
setMolecule(String)
public void setMolecule(byte[] molecule)
throws MolFormatException
molecule - the byte array must contain a molecule in
MDL's Molfile or
Compressed Molfile
or Smiles format.
MolFormatExceptionpublic void setMolecule_BNE(byte[] molecule)
setMolecule(byte[])
setMolecule(byte[]),
but exceptions are caught and stored.
ErrorHandler,
setMolecule(byte[])public Molecule getMolecule()
public int getAtomCount()
public int getHeavyAtomCount()
public void addHydrogens()
public void addHydrogensToAromaticHeteroAtoms()
public void removeHydrogens()
public void removeHydrogensFromCarbons()
public boolean containsHydrogens()
public void aromatize()
public void aromatize(int method)
method - specifies the algorithm for aromatization. Possible
values:
MoleculeGraph.AROM_CHEMAXON,
MoleculeGraph.AROM_DAYLIGHT,
Aromatapublic float calcMolWeight()
public double calcMolWeightInDouble()
double value.
public java.lang.String calcMolFormula()
public void clean(boolean always,
java.lang.String options)
O1 option of cleaning.
always - if false then
cleaning will only be performed if the
present coordinates are different from zero.options - specifies the options used for 2D
calculation. (E.g.: "O1e")MoleculeGraph.clean(int,java.lang.String)public java.lang.String toFormat(java.lang.String format)
format - "mol", "csmol", "smiles", ...public byte[] toBinFormat(java.lang.String format)
format - "png", "jpeg", "ppm", ...
public byte[] getFingerprintInBytes(int numberOfBits,
int numberOfOnes,
int numberOfBonds)
generateFingerprintInBytes(int, int, int)
is recommended
aromatize() call. The structure
should not be modified between these two calls.
If aromatize() hasn't been called yet,
or the structure was modified, calls it.
numberOfBits - the length of the binary fingerprint in bits.numberOfOnes - the number of bits to switch on
for each pattern.numberOfBonds - the maximum length of edges in
patterns used for generating the fingerprint.
public int[] getFingerprintInInts(int numberOfBits,
int numberOfOnes,
int numberOfBonds)
generateFingerprintInInts(int, int, int)
is recommended
int units.
aromatize() call. The structure
should not be modified between these two calls.
If aromatize() hasn't been called yet,
or the structure was modified, calls it.
numberOfBits - the length of the binary fingerprint in bits.numberOfOnes - the number of bits to switch on
for each pattern.numberOfBonds - the maximum length of edges in
patterns used for generating the fingerprint.
public int[] generateFingerprintInInts(int numberOfInts,
int numberOfOnes,
int numberOfBonds)
int units.
numberOfInts - the length of the binary fingerprint in int
(32 bit) units.numberOfOnes - the number of bits to switch on
for each pattern.numberOfBonds - the maximum length of edges in
patterns used for generating the fingerprint.generateFingerprintInBytes(int, int, int)
public byte[] generateFingerprintInBytes(int numberOfInts,
int numberOfOnes,
int numberOfBonds)
byte units.
numberOfInts - the length of the binary fingerprint in int
(32 bit) units.numberOfOnes - the number of bits to switch on
for each pattern.numberOfBonds - the maximum length of edges in
patterns used for generating the fingerprint.generateFingerprintInInts(int, int, int)public int getImplicitHCount()
public double align(Molecule mol,
int[] indexes)
throws java.lang.IllegalArgumentException
mol - the molecule to be alignedindexes - the atom indexes of the pattern in the order of the
atoms of the molecule to be aligned. Negative values are ignored.
The size of this array should be at least the number of atoms in the pattern
molecule (in case of RgMolecules, the number of non R-group atoms of
the root structure).
If the size of the array is grater, the excess elements are ignored.
java.lang.IllegalArgumentException
public static java.util.ArrayList getNonHitBondEndpoints(Molecule query,
Molecule target,
int[] hit)
query - the query Moleculetarget - the target Moleculehit - the hit list
ArrayList contains int[2]
objects.
public static java.util.ArrayList getNonHitBonds(Molecule query,
Molecule target,
int[] hit)
query - the query Moleculetarget - the target Moleculehit - the hit list
ArrayList contains MolBond
objects.public boolean getQueryMode()
public void setQueryMode(boolean q)
q - query mode
public static Molecule readFromVMN(MRecord rec)
throws java.io.IOException
rec - the VMN record
java.io.IOException - on errorpublic static boolean isDaylightFormat(java.lang.String format)
format - The molecular format, as used in Molecule.getInputFormat().
public static boolean isPlainH(MolAtom atom)
atom - MolAtom to decide.
public static void main(java.lang.String[] args)
throws MolFormatException,
java.io.IOException
MolFormatException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||