chemaxon.marvin.alignment
Class Alignment

java.lang.Object
  extended by chemaxon.marvin.alignment.Alignment
All Implemented Interfaces:
chemaxon.license.Licensable

public class Alignment
extends java.lang.Object

3D Alignment aligns two or more 3D molecules onto each other. The conformation of all molecules can be kept flexible so as to maximize the molecular overlap or also the input conformation of some of the molecules can be frozen. Alignment tries to maximize the overlap of atoms of the same type of different molecules.
Example source

           Molecule[] mols = new Molecule[2];
           mols[0] = MolImporter.importMol("CCCCC");
           mols[1] = MolImporter.importMol("CCCCCCC");
           mols[0].aromatize();
           mols[1].aromatize();
           mols[0].clean(3, null);
           mols[1].clean(3, null);
           Alignment aa = new Alignment();
           aa.addMolecule(mols[0], false, false); // adds a molecule no roatation / no conformational flexibility
           aa.addMolecule(mols[1], true, true);   // adds a molecule with roatation/ with conformational flexibility
           aa.addUserConstraint(0, 3, 1, 4);      // optional: add user constraint between atoms of two different molecules. Any constraint can be added
           aa.align();
           Molecule result = aa.getMoleculeWithAlignedCoordinates();
           double tanimoto = aa.tanimoto();
 

Since:
5.2
Author:
Adrian Kalaszi

Constructor Summary
Alignment()
           
Alignment(AlignmentProperties props)
           
 
Method Summary
 void addConstraintsFromUserMappedAtoms()
          An atomMap can be added to some of the atoms in MarvinSketch using the single reaction arrow.
 void addMolecule(Molecule m, boolean flexible, boolean enableTranslateAndRotate)
          Add molecule to align
 void addNodeColorWeight(int t1, int t2, double w)
          User may define extra weights between colors defined at setColoringScheme.
 void addUserConstraint(int molSeq0, int atomSeq0, int molSeq1, int atomSeq1)
          Adds user constraint between two atoms of two different molecules The addMol method calls must precede this method.
 void align()
          3D alignment on two or more molecules.
 Molecule getAlignedMoleculesAsFragments()
           
 java.util.Collection<AlignmentMolecule> getMolecules()
           
 Molecule getMoleculeWithAlignedCoordinates(int molID)
          After the alignment result molecule can be obtained.
 chemaxon.marvin.alignment.NodeColor getNodeColor()
           
 AlignmentProperties.NodeType getNodeType()
           
 AlignmentProperties.OrientationType getOrientationType()
           
 double getRmsd()
           
 chemaxon.marvin.alignment.Status getStatus()
           
 int getStepLimit()
           
 int getTimeLimit()
           
 double getVolumeScore()
           
 boolean isLicensed()
          Returns information about the licensing of the product.
static Molecule randomizeRotatableDihedrals(Molecule m)
           
 void removeAllConstraints()
           
 void removeAllMolecules()
          before every new alignment the molecules have to be removed.
 void setAromatize(boolean aromatize)
           
 void setColoringScheme(AlignmentProperties.ColoringScheme c)
           
 void setConformerCount(int conformerCount)
          The the dihedral angles of every flexible molecule should be randomized before alignment.
 void setDefaultNodeWeightBehavior(AlignmentProperties.ColorNotSpecifiedCase n)
           
 void setDehidrogenize(boolean hy)
           
 void setFlexibleRingRotatableBondCount(int b)
           
 void setFlexibleRingSize(int s)
           
 void setLicenseEnvironment(java.lang.String env)
          Every license can have a modifier environment that's typically an integration environment.
 void setMinimumCommonSize(int minimumCommonSize)
          Before the real volume like alignment a several prealign step is optionally called.
 void setMode(AlignmentAccuracyMode mode)
           
 void setNodeType(AlignmentProperties.NodeType t)
           
 void setOrientationType(AlignmentProperties.OrientationType orientationType)
           
 void setProgressMonitor(chemaxon.common.util.MProgressMonitor progressMonitor)
           
 void setProperty(AlignmentProperties props)
           
 void setProximity(chemaxon.marvin.alignment.AlignmentProperties.ProximityPotentialType pot)
           
 void setStepLimit(int stepLimit)
           
 void setTimeLimit(int timeLimit)
          Sets the maximum time used for the alignment.
 double tanimoto()
          Calculates the atomic colored volume Tanimoto similarity of two 3D molecules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alignment

public Alignment()

Alignment

public Alignment(AlignmentProperties props)
Method Detail

getMoleculeWithAlignedCoordinates

public Molecule getMoleculeWithAlignedCoordinates(int molID)
After the alignment result molecule can be obtained.

Parameters:
molID - input sequence / Which molecule to return.
Returns:
the result molecule

setMode

public void setMode(AlignmentAccuracyMode mode)

getAlignedMoleculesAsFragments

public Molecule getAlignedMoleculesAsFragments()

getOrientationType

public AlignmentProperties.OrientationType getOrientationType()

setProperty

public final void setProperty(AlignmentProperties props)

setConformerCount

public void setConformerCount(int conformerCount)
The the dihedral angles of every flexible molecule should be randomized before alignment.

Parameters:
conformerCount - number of randomized conformations to try to align

randomizeRotatableDihedrals

public static Molecule randomizeRotatableDihedrals(Molecule m)

setColoringScheme

public void setColoringScheme(AlignmentProperties.ColoringScheme c)

addNodeColorWeight

public void addNodeColorWeight(int t1,
                               int t2,
                               double w)
User may define extra weights between colors defined at setColoringScheme. The default weights are 1 for the same and 0 for the dissimilar types.

Parameters:
t1 - color 1 (Atomtype)
t2 - color 2 (Atomtype)
w - weight

setDefaultNodeWeightBehavior

public void setDefaultNodeWeightBehavior(AlignmentProperties.ColorNotSpecifiedCase n)

setOrientationType

public void setOrientationType(AlignmentProperties.OrientationType orientationType)

removeAllConstraints

public void removeAllConstraints()

removeAllMolecules

public void removeAllMolecules()
before every new alignment the molecules have to be removed.


addMolecule

public void addMolecule(Molecule m,
                        boolean flexible,
                        boolean enableTranslateAndRotate)
                 throws chemaxon.marvin.alignment.AlignmentException
Add molecule to align

Parameters:
m - Molecule to align
flexible - if "false" the molecule kept rigid. If "true" the rotatable bonds are rotated to achieve the best alignment.
enableTranslateAndRotate - Turn translation and rotation on if true. If false molecule is frozen.
Throws:
chemaxon.marvin.alignment.AlignmentException

addUserConstraint

public void addUserConstraint(int molSeq0,
                              int atomSeq0,
                              int molSeq1,
                              int atomSeq1)
                       throws chemaxon.marvin.alignment.AlignmentException
Adds user constraint between two atoms of two different molecules The addMol method calls must precede this method.

Parameters:
molSeq0 -
atomSeq0 -
molSeq1 -
atomSeq1 -
Throws:
chemaxon.marvin.alignment.AlignmentException - if there is no such atom or molecule.

tanimoto

public double tanimoto()
                throws chemaxon.marvin.alignment.AlignmentException
Calculates the atomic colored volume Tanimoto similarity of two 3D molecules.

Returns:
the 3D volume Tanimoto between 0..1 If more than two molecules are added returns -1.
Throws:
chemaxon.marvin.alignment.AlignmentException

getStatus

public chemaxon.marvin.alignment.Status getStatus()

align

public void align()
           throws chemaxon.marvin.alignment.AlignmentException
3D alignment on two or more molecules. WARNING! The new coordinates are written back to the input molecules.

Throws:
chemaxon.marvin.alignment.AlignmentException - if there is an error with the molecule: not 3d or multi-fragment.

getVolumeScore

public double getVolumeScore()

getRmsd

public double getRmsd()

addConstraintsFromUserMappedAtoms

public void addConstraintsFromUserMappedAtoms()
                                       throws chemaxon.marvin.alignment.AlignmentException
An atomMap can be added to some of the atoms in MarvinSketch using the single reaction arrow. These maps are imported as user pairs.

Throws:
chemaxon.marvin.alignment.AlignmentException

setMinimumCommonSize

public void setMinimumCommonSize(int minimumCommonSize)
Before the real volume like alignment a several prealign step is optionally called. These prealign runs are for getting an initial orientation.

Parameters:
minimumCommonSize - if > 0 consider atom/atom pairings from mcs algorithm also. Number of common atoms in mcs to try to align on.

getNodeType

public AlignmentProperties.NodeType getNodeType()

getNodeColor

public chemaxon.marvin.alignment.NodeColor getNodeColor()

setAromatize

public void setAromatize(boolean aromatize)

setDehidrogenize

public void setDehidrogenize(boolean hy)

setFlexibleRingSize

public void setFlexibleRingSize(int s)

setFlexibleRingRotatableBondCount

public void setFlexibleRingRotatableBondCount(int b)

getMolecules

public java.util.Collection<AlignmentMolecule> getMolecules()

isLicensed

public boolean isLicensed()
Description copied from interface: chemaxon.license.Licensable
Returns information about the licensing of the product. Example implementation: return LicenseHandler.isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );

Specified by:
isLicensed in interface chemaxon.license.Licensable
Returns:
true if the product is correctly licensed

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Description copied from interface: chemaxon.license.Licensable
Every license can have a modifier environment that's typically an integration environment. All being Licensable should be prepared to store and show a set environment to the LicenseHandler. Example implementation:
 private String licenseEnvironment = "";
 public void setLicenseEnvironment(String env) {
     licenseEnvironment = env;
 }
 

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable
Parameters:
env - environment String to be stored and passed to the LicenseHandler in the isLicensed method

getStepLimit

public int getStepLimit()

setStepLimit

public void setStepLimit(int stepLimit)

getTimeLimit

public int getTimeLimit()

setNodeType

public void setNodeType(AlignmentProperties.NodeType t)

setTimeLimit

public void setTimeLimit(int timeLimit)
Sets the maximum time used for the alignment. If reached returns the partly aligned structures.

Parameters:
timeLimit - time limit in millisecond. if -1 then disabled.

setProgressMonitor

public void setProgressMonitor(chemaxon.common.util.MProgressMonitor progressMonitor)

setProximity

public void setProximity(chemaxon.marvin.alignment.AlignmentProperties.ProximityPotentialType pot)