chemaxon.util
Class MolAligner

java.lang.Object
  extended by chemaxon.util.MolAligner

public final class MolAligner
extends java.lang.Object

Tool for aligning molecules

Author:
Szilard Dorant

Nested Class Summary
 class MolAligner.AlignmentResult
           
 
Field Summary
 double[][] fragCenter
          Rotation center - a double[] for each fragment
 
Constructor Summary
MolAligner()
          Creates a new instance of MolAligner
 
Method Summary
 double align(Molecule mol, int[] indexes)
          Alignes (rotates) a specified molecule to the pattern molecule in 2D according to the specified atom pairs.
 MolAligner.AlignmentResult calculate(int[] indexes)
           
static void main(java.lang.String[] args)
          For testing purposes.
 void rotate(MolAligner.AlignmentResult alignment)
          Rotates the target structure according to the specified alignment. 2D target will be set to 3D if query was 3D.
 void setPatternMolecule(Molecule mol)
          Sets the molecule that will be used as a pattern for alignment.
 void setTargetMolecule(Molecule mol)
          Sets the molecule to rotate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fragCenter

public double[][] fragCenter
Rotation center - a double[] for each fragment

Constructor Detail

MolAligner

public MolAligner()
Creates a new instance of MolAligner

Method Detail

setPatternMolecule

public void setPatternMolecule(Molecule mol)
Sets the molecule that will be used as a pattern for alignment. WARNING: S-groups will be expanded.


setTargetMolecule

public void setTargetMolecule(Molecule mol)
Sets the molecule to rotate. S-groups will be temporarily expanded for alignment, but later restored after alignment;

Parameters:
mol - the molecle to rotate

align

public double align(Molecule mol,
                    int[] indexes)
             throws java.lang.IllegalArgumentException
Alignes (rotates) a specified molecule to the pattern molecule in 2D according to the specified atom pairs. S-groups will be temporarily expanded for alignment, but later restored.

Parameters:
mol - the molecule to be aligned
indexes - the atom indexes of the pattern in the order of the atoms of the molecule to be aligned. Negative values are ignored. The size of this array should be at least the number of atoms in the pattern molecule (in case of RgMolecules, the non R-group atoms of the root). If the size of the array is grater, the excess elements are ignored.
Returns:
the error of the alignment, can be used to try to align multiple hits and choose the best solution.
Throws:
java.lang.IllegalArgumentException

rotate

public void rotate(MolAligner.AlignmentResult alignment)
Rotates the target structure according to the specified alignment. 2D target will be set to 3D if query was 3D. S-groups will be restored to their original state.

Parameters:
alignment - the alignment result to use

calculate

public MolAligner.AlignmentResult calculate(int[] indexes)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
For testing purposes.

Throws:
java.lang.Exception