chemaxon.marvin.alignment
Class AlignOnPairedAtoms

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

public class AlignOnPairedAtoms
extends java.lang.Object

Overlays two molecules using the user defined atom pairs
Example:

 Molecule mRef = null;
 Molecule m = null;
 AlignOnPairedAtoms ap = new AlignOnPairedAtoms();
 ap.setReferenceMolecule(mRef, false); // reference will be kept rigid
 ap.setMoleculeToAlign(m, true); // this will be kept flexible
 //add pairs where you want
 for (int i = 0; i < m.getAtomCount(); i++) {
    p.addAtomPair(i, i);
 }  
 ap.findFirst(); // aligns in the input conformation
 ap.findNext(); // randomizes the flexible molecules if flexible alignment selected and aligns.
 System.out.println("rmsd: " + p.getRmsd());
 Molecule result = p.getAlignedWithNewCoordinates();
 

Since:
marvin 5.2.3

Constructor Summary
AlignOnPairedAtoms()
           
 
Method Summary
 void addAtomPair(int atom0, int atom1)
          Adds an alignment constraint between the reference and aligned molecule.
 void addAtomPair(int atom0, int atom1, double weight)
          Adds an alignment constraint between the reference and aligned molecule.
 void findFirst()
          Overlays the molecule to align on the reference using the predefined atom pairs.
 void findNext()
          Randomizes dihedral angles of the input conformation for flexible molecules and aligns.
 Molecule getAlignedWithNewCoordinates()
           
 double[][] getCoordinatesOfAligned()
           
 double[][] getCoordinatesOfReference()
           
 java.util.Collection<AlignmentMolecule> getMolecules()
           
 chemaxon.marvin.alignment.NodeColor getNodeColor()
           
 AlignmentProperties.NodeType getNodeType()
           
 Molecule getReferenceWithNewCoordinates()
           
 double getRmsd()
           
 int getStepLimit()
           
 int getTimeLimit()
           
 boolean isLicensed()
          Returns information about the licensing of the product.
 void removeAllPairs()
          Removes all user defined atom pairs.
 void removeMolecules()
           
 void setAromatize(boolean aromatize)
           
 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 setMoleculeToAlign(Molecule m, boolean flexible)
          Sets the molecule to align to the reference.
 void setNodeType(AlignmentProperties.NodeType t)
           
 void setProgressMonitor(chemaxon.common.util.MProgressMonitor progressMonitor)
           
 void setProperty(AlignmentProperties props)
           
 void setProximity(chemaxon.marvin.alignment.AlignmentProperties.ProximityPotentialType pot)
           
 void setReferenceMolecule(Molecule m, boolean flexible)
          Sets the reference molecule to align to.
 void setStepLimit(int stepLimit)
           
 void setTimeLimit(int timeLimit)
          Sets the maximum time used for the alignment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignOnPairedAtoms

public AlignOnPairedAtoms()
Method Detail

removeMolecules

public void removeMolecules()

setReferenceMolecule

public void setReferenceMolecule(Molecule m,
                                 boolean flexible)
                          throws chemaxon.marvin.alignment.AlignmentException
Sets the reference molecule to align to. All previously added molecules are removed.

Parameters:
m - reference molecule
flexible - if true treat this molecule flexible. If false its conformation is frozen.
Throws:
chemaxon.marvin.alignment.AlignmentException

setMoleculeToAlign

public void setMoleculeToAlign(Molecule m,
                               boolean flexible)
                        throws chemaxon.marvin.alignment.AlignmentException
Sets the molecule to align to the reference.

Parameters:
m - this molecule will be translated and rotated
flexible - if true treat this molecule flexible. If false its conformation is frozen.
Throws:
chemaxon.marvin.alignment.AlignmentException

getCoordinatesOfReference

public double[][] getCoordinatesOfReference()

getCoordinatesOfAligned

public double[][] getCoordinatesOfAligned()

getReferenceWithNewCoordinates

public Molecule getReferenceWithNewCoordinates()

getAlignedWithNewCoordinates

public Molecule getAlignedWithNewCoordinates()

addAtomPair

public void addAtomPair(int atom0,
                        int atom1,
                        double weight)
                 throws chemaxon.marvin.alignment.AlignmentException
Adds an alignment constraint between the reference and aligned molecule. Both molecules must be added beforehand.

Parameters:
atom0 - atom seq starting from 0 from the reference molecule
atom1 - atom seq starting from 0 from the other molecule
weight - weight of the constraint of this pair
Throws:
chemaxon.marvin.alignment.AlignmentException - if there is no such atom

addAtomPair

public void addAtomPair(int atom0,
                        int atom1)
                 throws chemaxon.marvin.alignment.AlignmentException
Adds an alignment constraint between the reference and aligned molecule. Both molecules must be added beforehand.

Parameters:
atom0 - atom seq starting from 0 from the reference molecule
atom1 - atom seq starting from 0 from the other molecule
Throws:
chemaxon.marvin.alignment.AlignmentException - if there is no such atom

findFirst

public void findFirst()
               throws chemaxon.marvin.alignment.AlignmentException
Overlays the molecule to align on the reference using the predefined atom pairs.

Throws:
chemaxon.marvin.alignment.AlignmentException

findNext

public void findNext()
              throws chemaxon.marvin.alignment.AlignmentException
Randomizes dihedral angles of the input conformation for flexible molecules and aligns. If only rigid molecules selected does nothing.

Throws:
chemaxon.marvin.alignment.AlignmentException

getRmsd

public double getRmsd()
Returns:
the root mean square deviation of the current orientation of the two molecules.

removeAllPairs

public void removeAllPairs()
Removes all user defined atom pairs.


setProperty

public void setProperty(AlignmentProperties props)

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)