Class AlignOnPairedAtoms

java.lang.Object
chemaxon.alignment.AlignmentBase
chemaxon.alignment.AlignOnPairedAtoms
All Implemented Interfaces:
Licensable

@PublicApi public final class AlignOnPairedAtoms extends AlignmentBase
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 Details

    • AlignOnPairedAtoms

      public AlignOnPairedAtoms()
  • Method Details

    • removeMolecules

      public void removeMolecules()
    • setReferenceMolecule

      public void setReferenceMolecule(Molecule m, boolean flexible) throws 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:
      AlignmentException
    • setMolecules

      public void setMolecules(AlignmentMolecule reference, AlignmentMolecule toAlign)
    • setConformerCount

      public void setConformerCount(int count)
    • setMoleculeToAlign

      public void setMoleculeToAlign(Molecule m, boolean flexible) throws 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:
      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 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:
      AlignmentException - if there is no such atom
    • addAtomPair

      public void addAtomPair(int atom0, int atom1) throws 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:
      AlignmentException - if there is no such atom
    • findFirst

      public void findFirst() throws AlignmentException
      Overlays the molecule to align on the reference using the predefined atom pairs.
      Throws:
      AlignmentException
    • findNext

      public void findNext() throws AlignmentException
      Randomizes dihedral angles of the input conformation for flexible molecules and aligns. If only rigid molecules selected does nothing.
      Throws:
      AlignmentException
    • align

      public double align()
    • 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.
    • setConvergenceLimit

      public void setConvergenceLimit(double converg)