JOELib
Computational Chemistry Package

joelib.molecule
Class JOEMol

java.lang.Object
  extended byjoelib.molecule.JOEMol
All Implemented Interfaces:
Cloneable, Serializable

public class JOEMol
extends Object
implements Cloneable, Serializable

Molecule representation.

There are different possibilities to build a molecule.

  1. Using SMILES notation to build a molecule.
     JOEMol mol=new JOEMol();
     String smiles="c1cc(OH)cc1";
     if (!JOESmilesParser.smiToMol(mol, smiles, setTitle.toString()))
     {
       System.err.println("SMILES entry \"" + smiles + "\" could not be loaded.");
     }
     System.out.println(mol.toString());
     
  2. Using plain atoms and bonds to build a molecule.
     JOEMol mol = new JOEMol();
     // start molecule modification
     mol.beginModify();
     mol.reserveAtoms(2);
    
     // build carbon atom
     JOEAtom C = new JOEAtom();
     atomC.setAtomicNum(6);
    
     // build molecule
     for (int i=0; i<2; i++) {
       mol.addAtom(atom);
     }
    
     // add double bond
     mol.addBond(1,2, 2);
    
     //end molecule modification and store all
     //coordinates in coordinate array
     mol.endModify();
     
  3. 2D coordinates can be generated using CDKTools which uses the structure layout module from the CDK.
    3D coordinates can be generated using an external processing module (External), if available, for 3D generation programs, like Corina.

    For speed optimization of loading descriptor molecule files have a look at the ResultFactory.

    See Also:
    JOESmilesParser, CDKTools, External, Title2Data, Serialized Form
    Author:
    Jörg Kurt Wegner (wegnerj at informatik.uni-tuebingen.de) at the Department of Cognitive Systems
    CVS Version:
    Revision: 1.80Date: 2004/07/25 20:43:23source code (CVS head)
    License:
    Licensed under the terms of the GNU General Public License (GPL).
    References:
    1. clr98complexity
    2. zup89c
    3. fig96
    4. gm78
    5. smilesFormat

    Field Summary
    static int JOE_AROM_CORRECTED_MOL
              Molecule flag: aromaticity corrected molecule.
    static int JOE_AROMATIC_MOL
              Molecule flag: aromaticity calculated.
    static int JOE_ATOMTYPES_MOL
              Molecule flag: atom types perceived.
    static int JOE_CHAINS_MOL
              Molecule flag: chain molecule.
    static int JOE_CHIRALITY_MOL
              Molecule flag: atom chirality flags perceived.
    static int JOE_CLOSURE_MOL
              Molecule flag: closure bonds perceived.
    static int JOE_CURRENT_CONFORMER
              Molecule flag: current conformer.
    static int JOE_H_ADDED_MOL
              Molecule flag: H atoms added molecule.
    static int JOE_HYBRID_MOL
              Molecule flag: atom hybridisation perceived.
    static int JOE_IMPVAL_MOL
              Molecule flag: implicit valences perceived.
    static int JOE_KEKULE_MOL
              Molecule flag: kekulization perceived.
    static int JOE_PCHARGE_MOL
              Molecule flag: partitial charges perceived.
    static int JOE_PH_CORRECTED_MOL
              Molecule flag: PH value perceived.
    static int JOE_RINGFLAGS_MOL
              Molecule flag: rings perceived.
    static int JOE_SSSR_MOL
              Molecule flag: SSSR calculated.
     
    Constructor Summary
    JOEMol()
              Constructor for the JOEMol.
    JOEMol(IOType itype, IOType otype)
              Constructor for the JOEMol.
    JOEMol(JOEMol source)
              Clones the molecule without data elements.
    JOEMol(JOEMol source, boolean cloneDesc)
              Constructor for the JOEMol.
    JOEMol(JOEMol source, boolean cloneDesc, String[] descriptors)
              Constructor for the JOEMol.
     
    Method Summary
     boolean addAtom(JOEAtom atom)
              Adds (cloned) atom to the JOEMol.
     boolean addBond(int first, int second, int order)
              Adds a bond to the JOEMol.
     boolean addBond(int first, int second, int order, int flags)
              Adds a bond to the JOEMol.
     boolean addBond(int first, int second, int order, int stereo, int insertpos)
              Adds a bond to the JOEMol.
     boolean addBond(JOEBond bond)
              Adds (cloned) bond to the JOEMol.
     void addConformer(double[] f)
              Adds conformer coordinates to this molecule.
     void addData(JOEGenericData d)
              Adds a JOEGenericData object to this molecule but don't overwrite existing data elements with the same name, if they exists already.
     void addData(JOEGenericData d, boolean overwrite)
              Adds a JOEGenericData object to this molecule.
     boolean addHydrogens()
              Adds hydrogens atoms to this molecule.
     boolean addHydrogens(boolean polaronly)
              Adds hydrogens atoms to this molecule.
     boolean addHydrogens(boolean polaronly, boolean correctForPH)
              Adds hydrogens atoms to this molecule.
     boolean addHydrogens(boolean polaronly, boolean correctForPH, boolean useCoordV)
              Adds hydrogens atoms to this molecule.
     boolean addHydrogens(JOEAtom atom)
              Adds hydrogens atoms to the given atom.
     boolean addPolarHydrogens()
              Add polar hydrogens to molecule.
     boolean addResidue(JOEResidue residue)
              Adds residue information to this molecule.
     void align(JOEAtom a1, JOEAtom a2, XYZVector p1, XYZVector p2)
              Aligns atom a1 on p1 and atom a2 along p1->p2 vector.
     AtomIterator atomIterator()
              Gets an iterator over all atoms in this molecule.
     boolean automaticFormalCharge()
              Gets the flag if the automatic calculation of the formal charge of the atoms is allowed.
     boolean automaticPartialCharge()
              Gets the flag if the automatic calculation of the partial charge of the atoms is allowed.
     void beginModify()
              Begins modification of atoms and increase modification counter.
     BondIterator bondIterator()
              Gets an iterator over all bonds.
     void center()
              Centers molecule.
     XYZVector center(int nconf)
              Centers conformer.
     boolean clear()
              Clears molecule.
     Object clone()
              Clones molecule without additional data (e.g.
     Object clone(boolean cloneDesc)
              Clones this molecule.
     Object clone(boolean cloneDesc, String[] descriptors)
              Clones this molecule.
     ConformerIterator conformerIterator()
              Gets an iterator over all conformers.
     int conformerNum()
              Returns the number of conformers.
     void connectTheDots()
              Use inter-atomic distances to identify bonds.
     void contiguousFragments(Vector cfl)
              Each Vector contains the atom numbers of a contiguous fragment.
     void copyConformer(double[] src, int idx)
              Copies given conformer to this molecule.
     void copyConformer(float[] src, int idx)
              Copies given conformer to this molecule.
     boolean correctForPH()
              Corrects pH value of the molecule.
     JOEAtom createAtom()
              Creates only a new atom.
     JOEBond createBond()
              Creates only a new bond.
     int dataSize()
              Returns the number of data elements in this molecule.
     void decrementMod()
              Decrease modification counter.
     boolean deleteAtom(JOEAtom atom)
              Delete atom from molecule.
     boolean deleteBond(JOEBond bond)
              Delete the given JOEBond from this molecule.
     void deleteConformer(int idx)
              Delete conformer from molecule.
     void deleteData(JOEDataType dt)
              Deletes all data elements os the given JOEDataType .
     void deleteData(JOEGenericData gd)
              Delete all data elements which are equal to the given JOEGenericData element.
     boolean deleteData(String s)
              Description of the Method
     void deleteData(Vector vg)
              Description of the Method
     boolean deleteHydrogen(JOEAtom atom)
              Deletes hydrogen atom.
     boolean deleteHydrogens()
              Delete all hydrogen atoms from molecule.
     boolean deleteHydrogens(JOEAtom atom)
              Delete all hydrogen atoms from given atom.
     boolean deleteNonPolarHydrogens()
              Delete all non polar hydrogens from molecule.
     boolean deleteResidue(JOEResidue residue)
              Description of the Method
     void destroyAtom(JOEAtom atom)
              Destroys atom.
     void destroyBond(JOEBond bond)
              Destroys all bond.
     boolean empty()
              Returns true if this molecule contains no atoms.
     void endModify()
              Ends modification of atoms and decrease modification counter.
     void endModify(boolean nukePerceivedData)
              Ends modification of atoms and decrease modification counter.
     boolean equals(JOEMol type)
              Checks if two molecules are equal, ignoring descriptor values.
     boolean equals(Object obj)
              Checks if two molecules are equal, ignoring descriptor values.
     boolean existsBond(int bgn, int end)
              Returns true if this bond exists.
     void finalize()
              Destructor for this molecule.
     void findChildren(Vector children, int first, int second)
              Locates all atoms for which there exists a path to second without going through first children does not include second .
     void findChildren(Vector children, JOEAtom bgn, JOEAtom end)
              locates all atoms for which there exists a path to 'second' without going through 'first' children does not include 'second'
     void findChiralCenters()
              Description of the Method
     void findLargestFragment(JOEBitVec lf)
              each vector contains the atom numbers of a contig fragment the vectors are sorted by size from largest to smallest
     void findRingAtomsAndBonds()
              Description of the Method
     void findSSSR()
              Finds the Smallest Set of Smallest Rings (SSSR).
     GenericDataIterator genericDataIterator()
              Gets an iterator over the generic data elements of this molecule.
     JOEAtom getAtom(int idx)
              Gets an atom of the JOEMol object Atom index must be between 1 to numAtoms() .
     JOEBond getBond(int idx)
              Gets a bond of the JOEMol object.
     JOEBond getBond(int bgn, int end)
              Gets the bond attribute of the JOEMol object Atom index must be between 1 to numAtoms() .
     JOEBond getBond(JOEAtom bgn, JOEAtom end)
              Gets the bond attribute of the JOEMol object
     double[] getConformer(int i)
              Gets the conformer attribute of the JOEMol object
     Vector getConformers()
              Returns a Vector of all conformer coordinates (double[] values).
     double[] getCoordinates()
              Gets the coordinate array of this molecule.
     JOEGenericData getData(JOEDataType dt)
              Returns the first data entry of the given data type.
     JOEGenericData getData(String s)
              Returns the data entry with the given name, if multiple data entries exists only the first one is taken.
     JOEGenericData getData(String s, boolean parse)
              Returns the data entry with the given name, if multiple data entries exists only the first one is taken.
     double getEnergy()
              Gets the energy attribute of the JOEMol object
     double getExactMass()
              Gets mass given by isotopes (or most abundant isotope as necessary).
     JOEAtom getFirstAtom()
              Gets the firstAtom attribute of the JOEMol object
     int getFlags()
              Gets the flags attribute of the JOEMol object
     boolean getGTDVector(int[] gtd)
              Gets the gTDVector attribute of the JOEMol object
     IOType getInputType()
              Gets the inputType attribute of the JOEMol object
     int getMod()
              Gets the mod attribute of the JOEMol object
     double getMolWt()
              Gets standard molar mass given by IUPAC atomic masses.
     IOType getOutputType()
              Gets the outputType attribute of the JOEMol object
     String getPartialChargeVendor()
               
     JOEResidue getResidue(int idx)
              Gets the residue attribute of the JOEMol object
     RingIterator getRingIterator()
              Gets iterator for the Smallest Set of Smallest Rings (SSSR).
     Vector getSSSR()
              Gets the Smallest Set of Smallest Rings (SSSR).
     String getTitle()
              Gets the title attribute of the JOEMol object.
     double getTorsion(int a, int b, int c, int d)
              Gets the torsion attribute of the JOEMol object
     double getTorsion(JOEAtom a, JOEAtom b, JOEAtom c, JOEAtom d)
              Gets the torsion attribute of the JOEMol object
     boolean has2D()
              Description of the Method
     boolean has3D()
              Description of the Method
     boolean hasAromaticCorrected()
              Description of the Method
     boolean hasAromaticPerceived()
              Description of the Method
     boolean hasAtomTypesPerceived()
              Description of the Method
     boolean hasChainsPerceived()
              Description of the Method
     boolean hasChiralityPerceived()
              Description of the Method
     boolean hasClosureBondsPerceived()
              Description of the Method
     boolean hasData(JOEDataType dt)
              Returns true if one ore more entries of the given JOEDataType exists.
     boolean hasData(String s)
              Description of the Method
     int hashCode()
              Calculates the hashcode of a molecule using the methods AbstractDatabase.getHashcode and AbstractDatabase.getSMILESHashcode.
     boolean hasHybridizationPerceived()
              Description of the Method
     boolean hasHydrogensAdded()
              Description of the Method
     boolean hasImplicitValencePerceived()
              Description of the Method
     boolean hasKekulePerceived()
              Description of the Method
     boolean hasNonZeroCoords()
              Description of the Method
     boolean hasPartialChargesPerceived()
              Description of the Method
     boolean hasRingAtomsAndBondsPerceived()
              Description of the Method
     boolean hasSSSRPerceived()
              Description of the Method
     void incrementMod()
              Increase modification counter.
     boolean insertAtom(JOEAtom atom)
              Description of the Method
     boolean isChiral()
              Gets the chiral attribute of the JOEMol object
     boolean isCorrectedForPH()
              Gets the correctedForPH attribute of the JOEMol object
     boolean kekulize()
              Kekulizes the molecule.
     NativeValueIterator nativeValueIterator()
              Gets an iterator over native descriptor values (int or double) of this molecule.
     JOEAtom newAtom()
              Creates a new atom and adds it to molecule.
     JOEResidue newResidue()
              Returns and adds new residue informations for this molecule.
     int numAtoms()
              Returns the number of atoms.
     int numBonds()
              Returns the number of bonds.
     int numConformers()
              Returns the number of conformers of this molecule.
     int numHvyAtoms()
              Returns the number of heavy atoms.
     int numResidues()
              Returns the number of residues.
     int numRotors()
              Returns the number of rotatable bonds.
     boolean perceiveKekuleBonds()
              Description of the Method
     int reHash()
               
     void renumberAtoms(Vector v)
               
     void reserveAtoms(int natoms)
              Reserves a initial capacity of atoms.
     ResidueIterator residueIterator()
              Description of the Method
     void rotate(double[] m)
               
     void rotate(double[][] u)
               
     void rotate(double[] m, int nconf)
               
     JOEMol set(JOEMol source)
              Clones molecule without additional data (e.g.
     JOEMol set(JOEMol source, boolean cloneDesc, String[] descriptors)
              Clones molecule.
     JOEMol set(JOEMol source, boolean cloneDesc, String[] descriptors, boolean addDescIfNotExist)
              Clones molecule.
     JOEMol setAdd(JOEMol source)
              Sets the add attribute of the JOEMol object
     void setAromaticCorrected()
              Sets the aromaticCorrected attribute of the JOEMol object
     void setAromaticPerceived()
              Sets the aromaticPerceived attribute of the JOEMol object
     void setAtomTypesPerceived()
              Sets the atomTypesPerceived attribute of the JOEMol object
     void setAutomaticFormalCharge(boolean val)
              Sets the flag if the automatic calculation of the formal charge of the atoms is allowed.
     void setAutomaticPartialCharge(boolean val)
              Sets the automaticPartialCharge attribute of the JOEMol object
     void setChainsPerceived()
              Sets the chainsPerceived attribute of the JOEMol object
     void setChiralityPerceived()
              Sets the chiralityPerceived attribute of the JOEMol object
     void setClosureBondsPerceived()
              Sets the closureBondsPerceived attribute of the JOEMol object
     void setConformer(int i)
              Sets the conformer attribute of the JOEMol object
     void setConformers(Vector v)
              Sets the conformers attribute of the JOEMol object
     void setCorrectedForPH()
              Sets the correctedForPH attribute of the JOEMol object
     void setEnergy(double energy)
              Sets the energy attribute of the JOEMol object
     void setHybridizationPerceived()
              Sets the hybridizationPerceived attribute of the JOEMol object
     void setHydrogensAdded()
              Sets the hydrogensAdded attribute of the JOEMol object
     void setImplicitValencePerceived()
              Sets the implicitValencePerceived attribute of the JOEMol object
     void setInputType(IOType type)
              Sets the inputType attribute of the JOEMol object
     void setKekulePerceived()
              Sets the kekulePerceived attribute of the JOEMol object
     void setOutputType(IOType type)
              Sets the outputType attribute of the JOEMol object
     void setPartialChargesPerceived()
              Sets the partialChargesPerceived attribute of the JOEMol object
     void setPartialChargeVendor(String vendor)
               
     void setRingAtomsAndBondsPerceived()
              Sets the ringAtomsAndBondsPerceived attribute of the JOEMol object
     void setSSSRPerceived()
              Sets the sSSRPerceived attribute of the JOEMol object
     void setTitle(String title)
              Sets the title attribute of the JOEMol object
     void setTorsion(JOEAtom a, JOEAtom b, JOEAtom c, JOEAtom d, double ang)
              Sets the torsion attribute of the JOEMol object
     void sortBonds()
              Description of the Method
     boolean stripSalts()
              Deletes all atoms except for the largest contiguous fragment.
     void toInertialFrame()
              Description of the Method
     void toInertialFrame(int conf, double[] rmat)
              Description of the Method
     String toString()
              Description of the Method
     String toString(boolean writeDescriptors)
              Description of the Method
     String toString(IOType type)
              Description of the Method
     String toString(IOType type, boolean writeDescriptors)
              Description of the Method
     void translate(XYZVector v)
              Description of the Method
     void translate(XYZVector v, int nconf)
              Description of the Method
     void unsetAromaticPerceived()
              Description of the Method
     void unsetImplicitValencePerceived()
              Description of the Method
     void unsetPartialChargesPerceived()
              Description of the Method
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
     

    Field Detail

    JOE_SSSR_MOL

    public static final int JOE_SSSR_MOL
    Molecule flag: SSSR calculated.

    See Also:
    Constant Field Values

    JOE_RINGFLAGS_MOL

    public static final int JOE_RINGFLAGS_MOL
    Molecule flag: rings perceived.

    See Also:
    Constant Field Values

    JOE_AROMATIC_MOL

    public static final int JOE_AROMATIC_MOL
    Molecule flag: aromaticity calculated.

    See Also:
    Constant Field Values

    JOE_ATOMTYPES_MOL

    public static final int JOE_ATOMTYPES_MOL
    Molecule flag: atom types perceived.

    See Also:
    Constant Field Values

    JOE_CHIRALITY_MOL

    public static final int JOE_CHIRALITY_MOL
    Molecule flag: atom chirality flags perceived.

    See Also:
    Constant Field Values

    JOE_PCHARGE_MOL

    public static final int JOE_PCHARGE_MOL
    Molecule flag: partitial charges perceived.

    See Also:
    Constant Field Values

    JOE_HYBRID_MOL

    public static final int JOE_HYBRID_MOL
    Molecule flag: atom hybridisation perceived.

    See Also:
    Constant Field Values

    JOE_IMPVAL_MOL

    public static final int JOE_IMPVAL_MOL
    Molecule flag: implicit valences perceived.

    See Also:
    Constant Field Values

    JOE_KEKULE_MOL

    public static final int JOE_KEKULE_MOL
    Molecule flag: kekulization perceived.

    See Also:
    Constant Field Values

    JOE_CLOSURE_MOL

    public static final int JOE_CLOSURE_MOL
    Molecule flag: closure bonds perceived.

    See Also:
    Constant Field Values

    JOE_H_ADDED_MOL

    public static final int JOE_H_ADDED_MOL
    Molecule flag: H atoms added molecule.

    See Also:
    Constant Field Values

    JOE_PH_CORRECTED_MOL

    public static final int JOE_PH_CORRECTED_MOL
    Molecule flag: PH value perceived.

    See Also:
    Constant Field Values

    JOE_AROM_CORRECTED_MOL

    public static final int JOE_AROM_CORRECTED_MOL
    Molecule flag: aromaticity corrected molecule.

    See Also:
    Constant Field Values

    JOE_CHAINS_MOL

    public static final int JOE_CHAINS_MOL
    Molecule flag: chain molecule.

    See Also:
    Constant Field Values

    JOE_CURRENT_CONFORMER

    public static final int JOE_CURRENT_CONFORMER
    Molecule flag: current conformer.

    See Also:
    Constant Field Values
    Constructor Detail

    JOEMol

    public JOEMol()
    Constructor for the JOEMol. The 'Structured Data File' (SDF) molecule data format is used for default.

    See Also:
    JOEMol(IOType, IOType), JOEMol(JOEMol), JOEMol(JOEMol, boolean), JOEMol(JOEMol, boolean, String[])
    References:
    1. mdlMolFormat

    JOEMol

    public JOEMol(IOType itype,
                  IOType otype)
    Constructor for the JOEMol.

    Parameters:
    itype - input type for this molecule
    otype - output type for this molecule
    See Also:
    JOEMol(), JOEMol(JOEMol), JOEMol(JOEMol, boolean), JOEMol(JOEMol, boolean, String[])

    JOEMol

    public JOEMol(JOEMol source,
                  boolean cloneDesc,
                  String[] descriptors)
    Constructor for the JOEMol.

    Parameters:
    source - The source molecule
    cloneDesc - clones the PairData descriptors if true
    descriptors - the descriptors to clone. If null all descriptors are cloned
    See Also:
    JOEMol(), JOEMol(IOType, IOType), JOEMol(JOEMol), JOEMol(JOEMol, boolean)

    JOEMol

    public JOEMol(JOEMol source,
                  boolean cloneDesc)
    Constructor for the JOEMol.

    Parameters:
    source - The source molecule
    cloneDesc - clones the PairData descriptors if true
    See Also:
    JOEMol(), JOEMol(IOType, IOType), JOEMol(JOEMol), JOEMol(JOEMol, boolean), JOEMol(JOEMol, boolean, String[])

    JOEMol

    public JOEMol(JOEMol source)
    Clones the molecule without data elements.

    Parameters:
    source - The source molecule
    See Also:
    JOEMol(), JOEMol(IOType, IOType), JOEMol(JOEMol, boolean), JOEMol(JOEMol, boolean, String[])
    Method Detail

    setAdd

    public JOEMol setAdd(JOEMol source)
    Sets the add attribute of the JOEMol object

    Parameters:
    source - The new add value
    Returns:
    Description of the Return Value

    setAromaticCorrected

    public void setAromaticCorrected()
    Sets the aromaticCorrected attribute of the JOEMol object


    setAromaticPerceived

    public void setAromaticPerceived()
    Sets the aromaticPerceived attribute of the JOEMol object


    getAtom

    public JOEAtom getAtom(int idx)
    Gets an atom of the JOEMol object Atom index must be between 1 to numAtoms() .

    Parameters:
    idx - Description of the Parameter
    Returns:
    The atom value

    setAtomTypesPerceived

    public void setAtomTypesPerceived()
    Sets the atomTypesPerceived attribute of the JOEMol object


    setAutomaticFormalCharge

    public void setAutomaticFormalCharge(boolean val)
    Sets the flag if the automatic calculation of the formal charge of the atoms is allowed. This is for example used in the PH value correction method.

    Parameters:
    val - true if the calculation of the formal charge is allowed.

    setAutomaticPartialCharge

    public void setAutomaticPartialCharge(boolean val)
    Sets the automaticPartialCharge attribute of the JOEMol object

    Parameters:
    val - The new automaticPartialCharge value

    getBond

    public JOEBond getBond(int idx)
    Gets a bond of the JOEMol object. Bond index must be between 0 to (numBonds()-1) .

    Parameters:
    idx - Description of the Parameter
    Returns:
    The bond value

    getBond

    public JOEBond getBond(int bgn,
                           int end)
    Gets the bond attribute of the JOEMol object Atom index must be between 1 to numAtoms() .

    Parameters:
    bgn - atom index of the start atom
    end - atom index of the end atom
    Returns:
    The bond value

    getBond

    public JOEBond getBond(JOEAtom bgn,
                           JOEAtom end)
    Gets the bond attribute of the JOEMol object

    Parameters:
    bgn - Description of the Parameter
    end - Description of the Parameter
    Returns:
    The bond value

    setChainsPerceived

    public void setChainsPerceived()
    Sets the chainsPerceived attribute of the JOEMol object


    isChiral

    public boolean isChiral()
    Gets the chiral attribute of the JOEMol object

    Returns:
    The chiral value

    setChiralityPerceived

    public void setChiralityPerceived()
    Sets the chiralityPerceived attribute of the JOEMol object


    setClosureBondsPerceived

    public void setClosureBondsPerceived()
    Sets the closureBondsPerceived attribute of the JOEMol object


    setConformer

    public void setConformer(int i)
    Sets the conformer attribute of the JOEMol object

    Parameters:
    i - The new conformer value

    getConformer

    public double[] getConformer(int i)
    Gets the conformer attribute of the JOEMol object

    Parameters:
    i - Description of the Parameter
    Returns:
    The conformer value

    setConformers

    public void setConformers(Vector v)
    Sets the conformers attribute of the JOEMol object

    Parameters:
    v - The new conformers value (v is of type double[])

    getConformers

    public Vector getConformers()
    Returns a Vector of all conformer coordinates (double[] values).

    Returns:
    The conformers coordinates

    getCoordinates

    public double[] getCoordinates()
    Gets the coordinate array of this molecule.

    Returns:
    The coordinates array

    setCorrectedForPH

    public void setCorrectedForPH()
    Sets the correctedForPH attribute of the JOEMol object


    isCorrectedForPH

    public boolean isCorrectedForPH()
    Gets the correctedForPH attribute of the JOEMol object

    Returns:
    The correctedForPH value

    getData

    public JOEGenericData getData(JOEDataType dt)
    Returns the first data entry of the given data type. If this data type don't exists in this molecule, null is returned.

    There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    Parameters:
    dt - data type
    Returns:
    null if no element of this data type exists
    See Also:
    getData(String), getData(String, boolean), genericDataIterator(), addData(JOEGenericData), addData(JOEGenericData, boolean)

    getData

    public JOEGenericData getData(String s)
    Returns the data entry with the given name, if multiple data entries exists only the first one is taken. If the data element is a JOEPairData element with a unparsed String value, the descriptor value will be automatically parsed from a String value to the representing result (DescResult) class. If no data element with this name exists in this molecule, null is returned.

    There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    Missing descriptor values can be calculated by using DescriptorHelper.descFromMol(JOEMol, String).
    Example:

     DescResult result=null;
     try
     {
             result=DescriptorHelper.instance().descFromMol(mol, descriptorName);
     }
     catch (DescriptorException ex)
     {
             // descriptor can not be calculated
     }
     
    Notice the difference between JOEGenericData and DescResult. DescResult values can be added to molecules by using JOEPairData
     JOEPairData dp = new JOEPairData();
     dp.setAttribute(descriptorName);
     dp.setValue(result);
     mol.addData(dp);
     

    Parameters:
    s - The data element (descriptor) name
    Returns:
    null if no element with this name exists
    See Also:
    getData(JOEDataType), getData(String, boolean), genericDataIterator(), addData(JOEGenericData), addData(JOEGenericData, boolean), JOEDataType, JOEPairData, DescResult, GenericDataHolder.getData(String, boolean), DescriptorHelper.descFromMol(JOEMol, String), DescriptorHelper.descFromMol(JOEMol, String, DescResult), DescriptorHelper.descFromMol(JOEMol, String, DescResult, boolean)

    getData

    public JOEGenericData getData(String s,
                                  boolean parse)
    Returns the data entry with the given name, if multiple data entries exists only the first one is taken. If the data element is a JOEPairData the parse flag can be used to parse this data elements. If no data element with this name exists in this molecule, null is returned.

    There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    Missing descriptor values can be calculated by using DescriptorHelper.descFromMol(JOEMol, String).
    Example:

     DescResult result=null;
     try
     {
             result=DescriptorHelper.instance().descFromMol(mol, descriptorName);
     }
     catch (DescriptorException ex)
     {
             // descriptor can not be calculated
     }
     
    Notice the difference between JOEGenericData and DescResult. DescResult values can be added to molecules by using JOEPairData
     JOEPairData dp = new JOEPairData();
     dp.setAttribute(descriptorName);
     dp.setValue(result);
     mol.addData(dp);
     

    Parameters:
    s - The data element (descriptor) name
    parse - Parse data element
    Returns:
    null if no element with this name exists
    See Also:
    getData(JOEDataType), getData(String), genericDataIterator(), addData(JOEGenericData), addData(JOEGenericData, boolean), JOEDataType, JOEPairData, DescResult, GenericDataHolder.getData(String, boolean), DescriptorHelper.descFromMol(JOEMol, String), DescriptorHelper.descFromMol(JOEMol, String, DescResult), DescriptorHelper.descFromMol(JOEMol, String, DescResult, boolean)

    setEnergy

    public void setEnergy(double energy)
    Sets the energy attribute of the JOEMol object

    Parameters:
    energy - The new energy value

    getEnergy

    public double getEnergy()
    Gets the energy attribute of the JOEMol object

    Returns:
    The energy value

    getExactMass

    public double getExactMass()
    Gets mass given by isotopes (or most abundant isotope as necessary).

    Returns:
    The molWt value

    getFirstAtom

    public JOEAtom getFirstAtom()
    Gets the firstAtom attribute of the JOEMol object

    Returns:
    The firstAtom value

    getFlags

    public int getFlags()
    Gets the flags attribute of the JOEMol object

    Returns:
    The flags value
    See Also:
    JOE_SSSR_MOL, JOE_RINGFLAGS_MOL, JOE_AROMATIC_MOL, JOE_ATOMTYPES_MOL, JOE_CHIRALITY_MOL, JOE_PCHARGE_MOL, JOE_HYBRID_MOL, JOE_IMPVAL_MOL, JOE_KEKULE_MOL, JOE_CLOSURE_MOL, JOE_H_ADDED_MOL, JOE_PH_CORRECTED_MOL, JOE_AROM_CORRECTED_MOL, JOE_CHAINS_MOL, JOE_CURRENT_CONFORMER

    getGTDVector

    public boolean getGTDVector(int[] gtd)
    Gets the gTDVector attribute of the JOEMol object

    Parameters:
    gtd - Description of the Parameter
    Returns:
    The gTDVector value

    setHybridizationPerceived

    public void setHybridizationPerceived()
    Sets the hybridizationPerceived attribute of the JOEMol object


    setHydrogensAdded

    public void setHydrogensAdded()
    Sets the hydrogensAdded attribute of the JOEMol object


    setImplicitValencePerceived

    public void setImplicitValencePerceived()
    Sets the implicitValencePerceived attribute of the JOEMol object


    setInputType

    public void setInputType(IOType type)
    Sets the inputType attribute of the JOEMol object

    Parameters:
    type - The new inputType value

    setKekulePerceived

    public void setKekulePerceived()
    Sets the kekulePerceived attribute of the JOEMol object


    getMod

    public int getMod()
    Gets the mod attribute of the JOEMol object

    Returns:
    The mod value

    getTitle

    public final String getTitle()
    Gets the title attribute of the JOEMol object.

    Returns:
    The title value

    getInputType

    public IOType getInputType()
    Gets the inputType attribute of the JOEMol object

    Returns:
    The inputType value

    getMolWt

    public double getMolWt()
    Gets standard molar mass given by IUPAC atomic masses.

    Returns:
    The molWt value

    setOutputType

    public void setOutputType(IOType type)
    Sets the outputType attribute of the JOEMol object

    Parameters:
    type - The new outputType value

    getOutputType

    public IOType getOutputType()
    Gets the outputType attribute of the JOEMol object

    Returns:
    The outputType value

    setPartialChargeVendor

    public void setPartialChargeVendor(String vendor)

    getPartialChargeVendor

    public String getPartialChargeVendor()

    setPartialChargesPerceived

    public void setPartialChargesPerceived()
    Sets the partialChargesPerceived attribute of the JOEMol object


    getResidue

    public JOEResidue getResidue(int idx)
    Gets the residue attribute of the JOEMol object

    Parameters:
    idx - Description of the Parameter
    Returns:
    The residue value

    setRingAtomsAndBondsPerceived

    public void setRingAtomsAndBondsPerceived()
    Sets the ringAtomsAndBondsPerceived attribute of the JOEMol object


    getRingIterator

    public RingIterator getRingIterator()
    Gets iterator for the Smallest Set of Smallest Rings (SSSR).
     RingIterator rit = mol.getRingIterator();
     JOERing ring;
     while(rit.hasNext())
     {
       ring = rit.nextRing();
    
     }
     

    Returns:
    The ring iterator
    See Also:
    getSSSR(), findSSSR(), atomIterator(), bondIterator(), conformerIterator(), genericDataIterator(), nativeValueIterator(), RingIterator
    References:
    1. fig96

    getSSSR

    public Vector getSSSR()
    Gets the Smallest Set of Smallest Rings (SSSR).

    Returns:
    Vector of JOERing
    See Also:
    getRingIterator(), findSSSR()
    References:
    1. fig96

    setSSSRPerceived

    public void setSSSRPerceived()
    Sets the sSSRPerceived attribute of the JOEMol object


    setTitle

    public void setTitle(String title)
    Sets the title attribute of the JOEMol object

    Parameters:
    title - The new title value

    setTorsion

    public void setTorsion(JOEAtom a,
                           JOEAtom b,
                           JOEAtom c,
                           JOEAtom d,
                           double ang)
    Sets the torsion attribute of the JOEMol object

    Parameters:
    a - The new torsion value
    b - The new torsion value
    c - The new torsion value
    d - The new torsion value
    ang - The new torsion value

    getTorsion

    public double getTorsion(int a,
                             int b,
                             int c,
                             int d)
    Gets the torsion attribute of the JOEMol object

    Parameters:
    a - Description of the Parameter
    b - Description of the Parameter
    c - Description of the Parameter
    d - Description of the Parameter
    Returns:
    The torsion value

    getTorsion

    public double getTorsion(JOEAtom a,
                             JOEAtom b,
                             JOEAtom c,
                             JOEAtom d)
    Gets the torsion attribute of the JOEMol object

    Parameters:
    a - Description of the Parameter
    b - Description of the Parameter
    c - Description of the Parameter
    d - Description of the Parameter
    Returns:
    The torsion value

    addAtom

    public boolean addAtom(JOEAtom atom)
    Adds (cloned) atom to the JOEMol. Also checks for any bonds that should be made to the new atom. Atoms starts with the index 1, which is a difference to bonds which starts with the bond index 0.

    It's recommended calling the beginModify() method before the first atom will be added and calling the endModify() method after the last atom has been added. This causes, that the coordinates of the atoms will also be stored in a coordinate array in the molecule.

    Parameters:
    atom - The JOEAtom to add, which will be deep cloned.
    Returns:
    true if successfull
    See Also:
    addBond(int, int, int), addBond(int, int, int, int), addBond(int, int, int, int, int), addBond(JOEBond), beginModify(), endModify(), endModify(boolean)

    addBond

    public boolean addBond(int first,
                           int second,
                           int order)
    Adds a bond to the JOEMol. Bonds starts with the index 0, which is a difference to atoms which starts with the atom index 1.

    Parameters:
    first - The start atom index (atoms begins with index 1)
    second - The end atom index (atoms begins with index 1)
    order - The bond order
    Returns:
    true if successfull
    See Also:
    addAtom(JOEAtom), addBond(int, int, int, int), addBond(int, int, int, int, int), addBond(JOEBond), connectTheDots()

    addBond

    public boolean addBond(int first,
                           int second,
                           int order,
                           int flags)
    Adds a bond to the JOEMol. Bonds starts with the index 0, which is a difference to atoms which starts with the atom index 1.

    Parameters:
    first - The start atom index (atoms begins with index 1)
    second - The end atom index (atoms begins with index 1)
    order - The bond order
    flags - The stereo flag
    Returns:
    true if successfull
    See Also:
    addBond(int, int, int), addBond(int, int, int, int, int), addBond(JOEBond), connectTheDots()

    addBond

    public boolean addBond(int first,
                           int second,
                           int order,
                           int stereo,
                           int insertpos)
    Adds a bond to the JOEMol. Bonds starts with the index 0, which is a difference to atoms which starts with the atom index 1.

    Parameters:
    first - The start atom index (atoms begins with index 1)
    second - The end atom index (atoms begins with index 1)
    order - The bond order
    stereo - The stereo flag
    insertpos - The position at which the bond should be inserted
    Returns:
    true if successfull
    See Also:
    addAtom(JOEAtom), addBond(int, int, int), addBond(int, int, int, int), addBond(JOEBond), connectTheDots()

    addBond

    public boolean addBond(JOEBond bond)
    Adds (cloned) bond to the JOEMol. Bonds starts with the index 0, which is a difference to atoms which starts with the atom index 1.

    Parameters:
    bond - The JOEBond to add, which will be deep cloned.
    Returns:
    Description of the Return Value
    See Also:
    addAtom(JOEAtom), addBond(int, int, int), addBond(int, int, int, int), addBond(int, int, int, int, int), connectTheDots()

    addConformer

    public void addConformer(double[] f)
    Adds conformer coordinates to this molecule.

    Parameters:
    f - The conformer coordinates

    addData

    public void addData(JOEGenericData d)
    Adds a JOEGenericData object to this molecule but don't overwrite existing data elements with the same name, if they exists already.

    There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    Missing descriptor values can be calculated by using DescriptorHelper.descFromMol(JOEMol, String).
    Example:

     DescResult result=null;
     try
     {
             result=DescriptorHelper.instance().descFromMol(mol, descriptorName);
     }
     catch (DescriptorException ex)
     {
             // descriptor can not be calculated
     }
     
    Notice the difference between JOEGenericData and DescResult. DescResult values can be added to molecules by using JOEPairData
     JOEPairData dp = new JOEPairData();
     dp.setAttribute(descriptorName);
     dp.setValue(result);
     mol.addData(dp);
     

    Parameters:
    d - The new data value
    See Also:
    addData(JOEGenericData, boolean), getData(JOEDataType), getData(String), getData(String, boolean), genericDataIterator(), JOEDataType, JOEPairData, DescriptorHelper.descFromMol(JOEMol, String), DescriptorHelper.descFromMol(JOEMol, String, DescResult), DescriptorHelper.descFromMol(JOEMol, String, DescResult, boolean)

    addData

    public void addData(JOEGenericData d,
                        boolean overwrite)
    Adds a JOEGenericData object to this molecule.

    There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    Missing descriptor values can be calculated by using DescriptorHelper.descFromMol(JOEMol, String).
    Example:

     DescResult result=null;
     try
     {
             result=DescriptorHelper.instance().descFromMol(mol, descriptorName);
     }
     catch (DescriptorException ex)
     {
             // descriptor can not be calculated
     }
     
    Notice the difference between JOEGenericData and DescResult. DescResult values can be added to molecules by using JOEPairData
     JOEPairData dp = new JOEPairData();
     dp.setAttribute(descriptorName);
     dp.setValue(result);
     mol.addData(dp);
     

    Parameters:
    d - The new data value
    overwrite - Overwrite already existing data element, if true
    See Also:
    addData(JOEGenericData), getData(JOEDataType), getData(String), getData(String, boolean), genericDataIterator(), JOEDataType, JOEPairData, DescriptorHelper.descFromMol(JOEMol, String), DescriptorHelper.descFromMol(JOEMol, String, DescResult), DescriptorHelper.descFromMol(JOEMol, String, DescResult, boolean)

    addHydrogens

    public boolean addHydrogens()
    Adds hydrogens atoms to this molecule. The pH value will be corrected.

    Returns:
    true if successfull
    See Also:
    JOEPhModel

    addHydrogens

    public boolean addHydrogens(boolean polaronly)
    Adds hydrogens atoms to this molecule. All hydrogens in neighbourhood to N,O,P or S are treated as polar. The pH value will be corrected.

    Parameters:
    polaronly - Add only polar hydrogens, if true
    Returns:
    true if successfull
    See Also:
    JOEPhModel

    addHydrogens

    public boolean addHydrogens(boolean polaronly,
                                boolean correctForPH)
    Adds hydrogens atoms to this molecule. All hydrogens in neighbourhood to N,O,P or S are treated as polar. The pH value correction mode can be choosen. Dont't use (experimental) coordinate vector for added hydrogens.

    Parameters:
    polaronly - Add only polar hydrogens, if true
    correctForPH - Corrects molecule for pH if true
    Returns:
    true if successfull
    See Also:
    JOEPhModel

    addHydrogens

    public boolean addHydrogens(boolean polaronly,
                                boolean correctForPH,
                                boolean useCoordV)
    Adds hydrogens atoms to this molecule. All hydrogens in neighbourhood to N,O,P or S are treated as polar. The pH value correction mode can be choosen. The (experimental) coordinate vector for added hydrogens mode can be choosen.

    If useCoordV is true the coordinate vector for added H atoms will be used. This will be slower, because endModify() will be called after every added hydrogen atom. If useCoordV is false the coordinate vector for added H atoms will be ignored, which will be faster.

    Parameters:
    polaronly - Add only polar hydrogens, if true
    correctForPH - Corrects molecule for pH if true
    useCoordV - The coordinate vector for added hydrogens will be used if true
    Returns:
    true if successfull
    See Also:
    JOEPhModel, endModify(), endModify(boolean)

    addHydrogens

    public boolean addHydrogens(JOEAtom atom)
    Adds hydrogens atoms to the given atom. The pH value will not be corrected.

    Parameters:
    atom - The atom to which the hydogens should be added
    Returns:
    true if successfull

    addPolarHydrogens

    public boolean addPolarHydrogens()
    Add polar hydrogens to molecule. All hydrogens in neighbourhood to N,O,P or S are treated as polar. The pH value will be corrected.

    Returns:
    Description of the Return Value
    See Also:
    JOEPhModel

    addResidue

    public boolean addResidue(JOEResidue residue)
    Adds residue information to this molecule.

    Parameters:
    residue - The residue information
    Returns:
    true if successfull

    align

    public void align(JOEAtom a1,
                      JOEAtom a2,
                      XYZVector p1,
                      XYZVector p2)
    Aligns atom a1 on p1 and atom a2 along p1->p2 vector.

    Parameters:
    a1 - first atom
    a2 - second atom
    p1 - start point
    p2 - end point

    atomIterator

    public AtomIterator atomIterator()
    Gets an iterator over all atoms in this molecule. Possibility one:
     AtomIterator ait = mol.atomIterator();
     JOEAtom atom;
     while (ait.hasNext())
     {
       atom = ait.nextAtom();
    
     }
     
    Atoms starts with the index 1, which is a difference to bonds which starts with the bond index 0. Possibility two:
     int atoms = mol.numAtoms();
     JOEAtom atom;
     for (int i=1; i<=atoms; i++)
     {
       atom=mol.getAtom(i);
    
     }
     

    Returns:
    the atom iterator for this molecule
    See Also:
    bondIterator(), conformerIterator(), getRingIterator(), genericDataIterator(), nativeValueIterator()

    automaticFormalCharge

    public boolean automaticFormalCharge()
    Gets the flag if the automatic calculation of the formal charge of the atoms is allowed. This is for example used in the PH value correction method.

    Returns:
    true if the calculation of the formal charge is allowed.

    automaticPartialCharge

    public boolean automaticPartialCharge()
    Gets the flag if the automatic calculation of the partial charge of the atoms is allowed.

    Returns:
    true if the calculation of the partial charge is allowed.
    See Also:
    JOEGastChrg
    References:
    1. gm78

    beginModify

    public void beginModify()
    Begins modification of atoms and increase modification counter. The modification will be only processed if getMod() is 0!!! If you have called beginModify/endModify twice you can not expect that these changes are already available correctly. This fits especially for deleted and added atoms, because endModify updates the atomId's, writes the atom coordinates to the rotamer arrays and checks the aromaticity.

    See Also:
    endModify(), endModify(boolean), decrementMod(), incrementMod(), getMod()

    bondIterator

    public BondIterator bondIterator()
    Gets an iterator over all bonds. Possibility one:
     BondIterator bit = bondIterator();
     JOEBond bond;
     while (bit.hasNext())
     {
       bond = bit.nextBond();
    
     }
     
    Bonds starts with the index 0, which is a difference to atoms which starts with the atom index 1. Possibility two:
     int bonds = mol.numBonds();
     JOEBond bond;
     for (int i=0; i<bonds; i++)
     {
       bond=mol.getBond(i);
    
     }
     

    Returns:
    the bond iterator
    See Also:
    atomIterator(), conformerIterator(), getRingIterator(), genericDataIterator(), nativeValueIterator()

    center

    public void center()
    Centers molecule.

    See Also:
    center(int)

    center

    public XYZVector center(int nconf)
    Centers conformer.

    Parameters:
    nconf - number of the conformer
    Returns:
    the center of the conformer
    See Also:
    center()

    clear

    public boolean clear()
    Clears molecule.

    Returns:
    true if successfull

    clone

    public Object clone()
    Clones molecule without additional data (e.g. descriptor data).

    Returns:
    the cloned molecule

    clone

    public Object clone(boolean cloneDesc)
    Clones this molecule.

    Parameters:
    cloneDesc - clones the PairData descriptors if true
    Returns:
    the cloned molecule

    clone

    public Object clone(boolean cloneDesc,
                        String[] descriptors)
    Clones this molecule.

    Parameters:
    cloneDesc - clones the PairData descriptors if true
    Returns:
    the cloned molecule

    conformerIterator

    public ConformerIterator conformerIterator()
    Gets an iterator over all conformers.
     ConformerIterator cit = mol.conformerIterator();
     double conformer[];
     while (cit.hasNext())
     {
       conformer = cit.nextConformer();
    
     }
     

    Returns:
    the conformer iterator
    See Also:
    atomIterator(), bondIterator(), getRingIterator(), genericDataIterator(), nativeValueIterator()

    conformerNum

    public final int conformerNum()
    Returns the number of conformers.

    Returns:
    number of conformers

    connectTheDots

    public void connectTheDots()
    Use inter-atomic distances to identify bonds.

    For assigning atom types using a geometry-based algorithm have a look at ml91 and the structure based expert rules in JOEAtomTyper.

    References:
    1. ml91

    contiguousFragments

    public void contiguousFragments(Vector cfl)
    Each Vector contains the atom numbers of a contiguous fragment. The integer arrays are sorted by size from largest to smallest.
    Example:
     Vector fragments=new Vector();
     mol.contiguousFragments(fragments);
     int fragmentAtomIdx[];
     System.out.println(""+fragments.size()+" contiguous fragments in molecule '"+
                        mol.getTitle()+"' (salt ?).");
     for (int i = 0; i < fragments.size(); i++)
     {
       fragmentAtomIdx=(int[])fragments.get(i);
       System.out.print("Atoms of fragment "+i+":");
              for (int j = 0; j < fragmentAtomIdx.length; j++)
       {
         System.out.print(fragmentAtomIdx[j]);
         System.out.print(' ');
       }
       System.out.println();
     }
     

    Parameters:
    cfl - a Vector that stores the integer arrays for the contiguous fragments atom numbers
    See Also:
    stripSalts()

    copyConformer

    public void copyConformer(double[] src,
                              int idx)
    Copies given conformer to this molecule.

    Parameters:
    src - the conformer
    idx - the index of the conformer

    copyConformer

    public void copyConformer(float[] src,
                              int idx)
    Copies given conformer to this molecule.

    Parameters:
    src - the conformer
    idx - the index of the conformer

    correctForPH

    public boolean correctForPH()
    Corrects pH value of the molecule.

    Returns:
    true if successfull
    See Also:
    JOEPhModel

    createAtom

    public JOEAtom createAtom()
    Creates only a new atom.

    Returns:
    the created atom
    See Also:
    createBond(), addAtom(JOEAtom), newAtom()

    createBond

    public JOEBond createBond()
    Creates only a new bond.

    Returns:
    the created bond
    See Also:
    createAtom()

    dataSize

    public int dataSize()
    Returns the number of data elements in this molecule.

    Returns:
    number of data elements in this molecule

    decrementMod

    public void decrementMod()
    Decrease modification counter.

    See Also:
    incrementMod(), getMod(), beginModify(), endModify(), endModify(boolean)

    deleteAtom

    public boolean deleteAtom(JOEAtom atom)
    Delete atom from molecule.

    Parameters:
    atom - The atom to delete
    Returns:
    true if successfull

    deleteBond

    public boolean deleteBond(JOEBond bond)
    Delete the given JOEBond from this molecule.

    Parameters:
    bond - The bond to delete
    Returns:
    true if successfull

    deleteConformer

    public void deleteConformer(int idx)
    Delete conformer from molecule.

    Parameters:
    idx - The conformer number

    deleteData

    public boolean deleteData(String s)
    Description of the Method

    Parameters:
    s - Description of the Parameter
    Returns:
    Description of the Return Value

    deleteData

    public void deleteData(JOEDataType dt)
    Deletes all data elements os the given JOEDataType .

    Parameters:
    dt - type of the elements to delete

    deleteData

    public void deleteData(JOEGenericData gd)
    Delete all data elements which are equal to the given JOEGenericData element.

    Parameters:
    gd - the element to delete

    deleteData

    public void deleteData(Vector vg)
    Description of the Method

    Parameters:
    vg - Description of the Parameter

    deleteHydrogen

    public boolean deleteHydrogen(JOEAtom atom)
    Deletes hydrogen atom.

     mol.beginModify();
     deleteHydrogen(atom );
     mol.endModify();
     

    Parameters:
    atom - Hydrogen atom to delete
    Returns:
    true if successfull

    deleteHydrogens

    public boolean deleteHydrogens()
    Delete all hydrogen atoms from molecule.

     mol.beginModify();
     deleteHydrogens();
     mol.endModify();
     

    Returns:
    true if successfull

    deleteHydrogens

    public boolean deleteHydrogens(JOEAtom atom)
    Delete all hydrogen atoms from given atom.

     mol.beginModify();
     deleteHydrogens(atom);
     mol.endModify();
     

    Parameters:
    atom - Atom from which hydrogen atoms should be deleted
    Returns:
    true if successfull

    deleteNonPolarHydrogens

    public boolean deleteNonPolarHydrogens()
    Delete all non polar hydrogens from molecule. All hydrogens in neighbourhood to N,O,P or S are treated as polar.

    Returns:
    true if successfull

    deleteResidue

    public boolean deleteResidue(JOEResidue residue)
    Description of the Method

    Parameters:
    residue - Description of the Parameter
    Returns:
    Description of the Return Value

    destroyAtom

    public void destroyAtom(JOEAtom atom)
    Destroys atom.

    Parameters:
    atom - the atom

    destroyBond

    public void destroyBond(JOEBond bond)
    Destroys all bond.

    Parameters:
    bond - the bond

    empty

    public boolean empty()
    Returns true if this molecule contains no atoms.

    Returns:
    true if this molecule contains no atoms

    endModify

    public void endModify()
    Ends modification of atoms and decrease modification counter. All flags will be deleted. The modification will be only processed if getMod() is 0!!! If you have called beginModify/endModify twice you can not expect that these changes are already available correctly. This fits especially for deleted and added atoms, because endModify updates the atomId's, writes the atom coordinates to the rotamer arrays and checks the aromaticity.

    See Also:
    endModify(boolean), beginModify(), decrementMod(), incrementMod(), getMod()

    endModify

    public void endModify(boolean nukePerceivedData)
    Ends modification of atoms and decrease modification counter. The modification will be only processed if getMod() is 0!!! If you have called beginModify/endModify twice you can not expect that these changes are already available correctly. This fits especially for deleted and added atoms, because endModify updates the atomId's, writes the atom coordinates to the rotamer arrays and checks the aromaticity.

    Parameters:
    nukePerceivedData - if true all flags will be deleted
    See Also:
    endModify(), beginModify(), decrementMod(), incrementMod(), getMod()

    equals

    public boolean equals(Object obj)
    Checks if two molecules are equal, ignoring descriptor values. This method uses the full equality check if the atom and bonds.


    equals

    public boolean equals(JOEMol type)
    Checks if two molecules are equal, ignoring descriptor values. This method uses the full equality check if the atom and bonds.


    existsBond

    public boolean existsBond(int bgn,
                              int end)
    Returns true if this bond exists.

    Parameters:
    bgn - atom index of the start atom
    end - atom index of the end atom
    Returns:
    true if this bond exists

    finalize

    public void finalize()
    Destructor for this molecule.


    findChildren

    public void findChildren(Vector children,
                             int first,
                             int second)
    Locates all atoms for which there exists a path to second without going through first children does not include second .

    Parameters:
    children - Description of the Parameter
    first - Description of the Parameter
    second - Description of the Parameter

    findChildren

    public void findChildren(Vector children,
                             JOEAtom bgn,
                             JOEAtom end)
    locates all atoms for which there exists a path to 'second' without going through 'first' children does not include 'second'

    Parameters:
    children - Description of the Parameter
    bgn - Description of the Parameter
    end - Description of the Parameter

    findChiralCenters

    public void findChiralCenters()
    Description of the Method


    findLargestFragment

    public void findLargestFragment(JOEBitVec lf)
    each vector contains the atom numbers of a contig fragment the vectors are sorted by size from largest to smallest

    Parameters:
    lf - Description of the Parameter

    findRingAtomsAndBonds

    public void findRingAtomsAndBonds()
    Description of the Method


    findSSSR

    public void findSSSR()
    Finds the Smallest Set of Smallest Rings (SSSR).

    See Also:
    getSSSR(), #getSSSRIterator(Vector)
    To Do:
    • Find correct reference: Frerejacque, Bull. Soc. Chim. Fr., 5, 1008 (1939)
    References:
    1. fig96

    genericDataIterator

    public GenericDataIterator genericDataIterator()
    Gets an iterator over the generic data elements of this molecule. There exist a lot of default data types which where defined in JOEDataType. These data types are used for caching ring searches and storing special data types like comments or virtual bonds. Furthermore there exist the most important data type JOEPairData for storing descriptor values. Read the JOEDataType description for details.

    1. For getting all data elements the simple data iterator can be used.
       GenericDataIterator gdit = mol.genericDataIterator();
       JOEGenericData genericData;
       while(gdit.hasNext())
       {
         genericData = gdit.nextGenericData();
      
       }
       
    2. For getting all descriptor data elements a slightly modified iterator can be used.
       GenericDataIterator gdit = mol.genericDataIterator();
       JOEGenericData genericData;
       while(gdit.hasNext())
       {
         genericData = gdit.nextGenericData();
         if (genericData.getDataType() == JOEDataType.JOE_PAIR_DATA)
         {
                 JOEPairData pairData = (JOEPairData)genericData;
      
         }
       }
       
    3. For getting all native value descriptors the simple data iterator can be used, also. Because this is a little bit tricky, the nativeValueIterator() would be the recommended method for getting these values. Though the complex access will be presented, because it's really instructive for understanding the data access under JOELib.
       GenericDataIterator gdit = mol.genericDataIterator();
       JOEGenericData genericData;
       while(gdit.hasNext())
       {
         genericData = gdit.nextGenericData();
         if (genericData.getDataType() == JOEDataType.JOE_PAIR_DATA)
         {
                 JOEPairData pairData = (JOEPairData)genericData;
                 // data must be parsed to check data type
                 genericData = mol.getData(pairData.getAttribute(), true);
                 pairData = (JOEPairData)genericData;
                   if(JOEHelper.hasInterface(pairData, "NativeValue"))
                   {
              double tmpDbl=((NativeValue) pairData).getDoubleNV();
      
                   }
         }
       }
       

    Returns:
    the generic data iterator
    See Also:
    atomIterator(), bondIterator(), conformerIterator(), getRingIterator(), nativeValueIterator(), getData(String), getData(String, boolean), addData(JOEGenericData), addData(JOEGenericData, boolean), DescriptorHelper.molDescriptors(JOEMol), JOEDataType, JOEGenericData

    has2D

    public boolean has2D()
    Description of the Method

    Returns:
    Description of the Return Value

    has3D

    public boolean has3D()
    Description of the Method

    Returns:
    Description of the Return Value

    hasAromaticCorrected

    public boolean hasAromaticCorrected()
    Description of the Method

    Returns:
    Description of the Return Value

    hasAromaticPerceived

    public boolean hasAromaticPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasAtomTypesPerceived

    public boolean hasAtomTypesPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasChainsPerceived

    public boolean hasChainsPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasChiralityPerceived

    public boolean hasChiralityPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasClosureBondsPerceived

    public boolean hasClosureBondsPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasData

    public boolean hasData(String s)
    Description of the Method

    Parameters:
    s - Description of the Parameter
    Returns:
    true if the generic attribute/value pair exists

    hasData

    public boolean hasData(JOEDataType dt)
    Returns true if one ore more entries of the given JOEDataType exists.

    Parameters:
    dt - Description of the Parameter
    Returns:
    true if the generic attribute/value pair exists

    hasHybridizationPerceived

    public boolean hasHybridizationPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasHydrogensAdded

    public boolean hasHydrogensAdded()
    Description of the Method

    Returns:
    Description of the Return Value

    hasImplicitValencePerceived

    public boolean hasImplicitValencePerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasKekulePerceived

    public boolean hasKekulePerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasNonZeroCoords

    public boolean hasNonZeroCoords()
    Description of the Method

    Returns:
    Description of the Return Value

    hasPartialChargesPerceived

    public boolean hasPartialChargesPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasRingAtomsAndBondsPerceived

    public boolean hasRingAtomsAndBondsPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hasSSSRPerceived

    public boolean hasSSSRPerceived()
    Description of the Method

    Returns:
    Description of the Return Value

    hashCode

    public int hashCode()
    Calculates the hashcode of a molecule using the methods AbstractDatabase.getHashcode and AbstractDatabase.getSMILESHashcode.


    incrementMod

    public void incrementMod()
    Increase modification counter.

    See Also:
    decrementMod(), getMod(), beginModify(), endModify(), endModify(boolean)

    insertAtom

    public boolean insertAtom(JOEAtom atom)
    Description of the Method

    Parameters:
    atom - Description of the Parameter
    Returns:
    Description of the Return Value

    kekulize

    public boolean kekulize()
    Kekulizes the molecule.

    Returns:
    true if successfull

    nativeValueIterator

    public NativeValueIterator nativeValueIterator()
    Gets an iterator over native descriptor values (int or double) of this molecule.
     NativeValueIterator nativeIt = mol.nativeValueIterator();
     double value;
     String descName;
     while (nativeIt.hasNext())
     {
       value = nativeIt.nextDouble();
       descName = nativeIt.actualName();
    
     }
     

    Returns:
    The native value iterator
    See Also:
    atomIterator(), bondIterator(), conformerIterator(), getRingIterator(), genericDataIterator()

    newAtom

    public JOEAtom newAtom()
    Creates a new atom and adds it to molecule.

    Returns:
    the new atom
    See Also:
    addAtom(JOEAtom), createAtom()

    newResidue

    public JOEResidue newResidue()
    Returns and adds new residue informations for this molecule.

    Returns:
    The residue informations.

    numAtoms

    public int numAtoms()
    Returns the number of atoms.

    Returns:
    The number of atoms

    numBonds

    public int numBonds()
    Returns the number of bonds.

    Returns:
    The number of bonds

    numConformers

    public int numConformers()
    Returns the number of conformers of this molecule.

    Returns:
    The number of conformers of this molecule

    numHvyAtoms

    public int numHvyAtoms()
    Returns the number of heavy atoms. That is the number of all atoms except hydrogen atoms.

    Returns:
    The number of heavy atoms

    numResidues

    public int numResidues()
    Returns the number of residues.

    Returns:
    The number of residues

    numRotors

    public int numRotors()
    Returns the number of rotatable bonds.

    Returns:
    The number of rotatable bonds

    perceiveKekuleBonds

    public boolean perceiveKekuleBonds()
    Description of the Method

    Returns:
    Description of the Return Value

    reHash

    public int reHash()

    renumberAtoms

    public void renumberAtoms(Vector v)
    Parameters:
    v - of type JOEAtom

    reserveAtoms

    public void reserveAtoms(int natoms)
    Reserves a initial capacity of atoms.

    Parameters:
    natoms - The number of atoms to reserve

    residueIterator

    public ResidueIterator residueIterator()
    Description of the Method

    Returns:
    Description of the Return Value

    rotate

    public void rotate(double[][] u)
    Parameters:
    u - Description of the Parameter

    rotate

    public void rotate(double[] m)
    Parameters:
    m - of size 9.

    rotate

    public void rotate(double[] m,
                       int nconf)
    Parameters:
    m - of size 9.
    nconf - Description of the Parameter

    set

    public JOEMol set(JOEMol source)
    Clones molecule without additional data (e.g. descriptor data).

    Parameters:
    source - Description of the Parameter
    Returns:
    Description of the Return Value

    set

    public JOEMol set(JOEMol source,
                      boolean cloneDesc,
                      String[] descriptors)
    Clones molecule. Missing descriptor entries, defined in descriptors will be ignored.

    Parameters:
    source - Description of the Parameter
    cloneDesc - clones the PairData descriptors if true
    descriptors - descriptors to clone. If null all descriptors are cloned
    Returns:
    The new molecule

    set

    public JOEMol set(JOEMol source,
                      boolean cloneDesc,
                      String[] descriptors,
                      boolean addDescIfNotExist)
    Clones molecule.

    Parameters:
    source - Description of the Parameter
    cloneDesc - clones the PairData descriptors if true
    descriptors - descriptors to clone. If null all descriptors are cloned
    addDescIfNotExist - Missing descriptor entries, defined in descriptors will be automatically added to the molecule if true
    Returns:
    The new molecule

    sortBonds

    public void sortBonds()
    Description of the Method


    stripSalts

    public boolean stripSalts()
    Deletes all atoms except for the largest contiguous fragment.

    Returns:
    true if all smaller contiguous fragments were deleted
    See Also:
    contiguousFragments(Vector)

    toInertialFrame

    public void toInertialFrame(int conf,
                                double[] rmat)
    Description of the Method

    Parameters:
    conf - Description of the Parameter
    rmat - Description of the Parameter

    toInertialFrame

    public void toInertialFrame()
    Description of the Method


    toString

    public String toString()
    Description of the Method

    Returns:
    Description of the Return Value

    toString

    public String toString(IOType type)
    Description of the Method

    Parameters:
    type - Description of the Parameter
    Returns:
    Description of the Return Value

    toString

    public String toString(boolean writeDescriptors)
    Description of the Method

    Parameters:
    writeDescriptors - Description of the Parameter
    Returns:
    Description of the Return Value

    toString

    public String toString(IOType type,
                           boolean writeDescriptors)
    Description of the Method

    Parameters:
    type - Description of the Parameter
    writeDescriptors - Description of the Parameter
    Returns:
    Description of the Return Value

    translate

    public void translate(XYZVector v)
    Description of the Method

    Parameters:
    v - Description of the Parameter

    translate

    public void translate(XYZVector v,
                          int nconf)
    Description of the Method

    Parameters:
    v - Description of the Parameter
    nconf - Description of the Parameter

    unsetAromaticPerceived

    public void unsetAromaticPerceived()
    Description of the Method


    unsetImplicitValencePerceived

    public void unsetImplicitValencePerceived()
    Description of the Method


    unsetPartialChargesPerceived

    public void unsetPartialChargesPerceived()
    Description of the Method


    JOELib
    Computational Chemistry Package

    Comments and Questions? mail to J.K.Wegner