Package chemaxon.marvin.alignment
Class MMPAlignment
java.lang.Object
chemaxon.marvin.alignment.MMPAlignment
3D Molecular alignment that uses the maximum common substructure to align a pair of
structures. The name MMP comes from the expression of matched molecule pairs, as this kind of alignment is an extension
of the traditional shape based approach for MMP cases. The coordinates of the atoms in the MCS of the "toAlign" structure will be exactly the same as in the MCS atoms of the
reference structure. While the non-MCS parts of the "toAlign" are flexibly aligned to the non-MCS parts reference, to maximize the overall shape score.
If multiple MCSes were found, the first 10 are examined as above and the overlay returning the best shape score is returned.
If the MCS Tanimoto similarity
McsSearchResult.getSimilarity()
does not reach a predefined limit,
shape based Alignment
is applied on the molecule pair.
Example usage: final Molecule reference = MolImporter.importMol("CCCCOC"); final Molecule toAlign = MolImporter.importMol("CCCCNCC"); // Either you can generate 3D coordinates : // Cleaner.clean(reference, 3, ""); // Cleaner.clean(toAlign, 3, ""); // Molecule referenceP = reference; // Molecule toAlignP = toAlign; // or alternatively: boolean beautify = true; final Molecule referenceP = MMPAlignment.preprocess(reference, beautify); final Molecule toAlignP = MMPAlignment.preprocess(toAlign, beautify); // In this latter case the following actions are performed on Molecules: // 1. keep largest fragment, 2. generate 3D coordinates, if the structure is not in 3D, // 3. Additionally, if the "beautify" parameter is true: // - remove atom aliases // - remove lone pairs // - remove explicit Hydrogen atoms // - fix valence errors (needs Checker license) final MMPAlignment mmp = new MMPAlignment(referenceP, toAlignP); final MMPAlignmentResult result = mmp.calculate(); final Molecule aligned = result.getMolecule2Aligned(); System.err.println("3D Tanimoto score: " + result.getShapeScore()); System.err.println("Coordinate RMSD of the MCS after the alignment: " + result.getRmsd()); // Call a simple utility to write Molecule object into mrv format MolGeom.writeMol(result.toMolecule(), "alignedResult.mrv"); }
- Since:
- Marvin 6.0.0
-
Constructor Summary
ConstructorDescriptionMMPAlignment
(Molecule reference, Molecule toAlign) Constructs an MMPAlignment object for later alignment of two structures.MMPAlignment
(Molecule reference, Molecule toAlign, MMPAlignmentProperties props) Constructs an MMPAlignment object for later alignment of two structures. -
Method Summary
Modifier and TypeMethodDescriptionRuns the MCS alignment calculation on the two structures of the constructor.void
cancel()
Cancel the ongoing calculationstatic Molecule
Utility for preprocessing structure for alignment.static Molecule
Utility for preprocessing structure for alignment.static Molecule
Utility for preprocessing structure for alignment.static Molecule
preprocess
(Molecule m, boolean beautify) Utility for preprocessing structure for alignment.static void
Utility for preprocessing structure for alignment.static void
Utility for preprocessing structure for alignment.
-
Constructor Details
-
MMPAlignment
Constructs an MMPAlignment object for later alignment of two structures. The conformational flexibility of the two molecules during the alignment can be adjusted usingMMPAlignmentProperties.getFlexibilityMode()
. The coordinates of the MCS atoms of the reference Molecule are transferred to the MCS atoms of the "toAlign" Molecule. The conformation of the non-MCS parts can be optimized to obtain the best alignment.- Parameters:
reference
- The reference structure in the alignment. The coordinates of this structure remains intact during the alignment, ifMMPAlignmentProperties.getFlexibilityMode()
is set toAlignmentProperties.FlexibilityMode.KEEP_BOTH_RIGID
,AlignmentProperties.FlexibilityMode.KEEP_FIRST_RIGID_SECOND_FLEXIBLE
orAlignmentProperties.FlexibilityMode.KEEP_FIRST_RIGID_SECOND_FLEXIBLE_EXTRA
toAlign
- The structure to align. The coordinates of this structure changes: rotates, translates as a rigid body, and also the rotatable bonds are tweaked in order to align to the reference structure.props
- Properties to control the alignment process.
-
MMPAlignment
Constructs an MMPAlignment object for later alignment of two structures. The conformational flexibility of the two molecules during the alignment can be adjusted usingMMPAlignmentProperties.getFlexibilityMode()
. The coordinates of the MCS atoms of the reference Molecule are transferred to the MCS atoms of the "toAlign" Molecule. The conformation of the non-MCS parts can be optimized to obtain the best alignment.- Parameters:
reference
- The reference structure in the alignment. The coordinates of this structure remains intact during the alignment, ifMMPAlignmentProperties.getFlexibilityMode()
is set toAlignmentProperties.FlexibilityMode.KEEP_BOTH_RIGID
,AlignmentProperties.FlexibilityMode.KEEP_FIRST_RIGID_SECOND_FLEXIBLE
orAlignmentProperties.FlexibilityMode.KEEP_FIRST_RIGID_SECOND_FLEXIBLE_EXTRA
toAlign
- The structure to align. The coordinates of this structure changes: rotates, translates as a rigid body, and also the rotatable bonds are tweaked in order to align to the reference structure.
-
-
Method Details
-
cancel
public void cancel()Cancel the ongoing calculation -
calculate
Runs the MCS alignment calculation on the two structures of the constructor.- Returns:
- the calculation result object.
-
clean3d
Utility for preprocessing structure for alignment. Generates 3D coordinates for a 2D structure. The lowest energy conformer will be selected from maximum 50 diverse conformations.- Parameters:
m
- The 2D input structure.- Returns:
- the lowest energy conformer found
-
clean3d
Utility for preprocessing structure for alignment. Generates 3D coordinates for a 2D structure.- Parameters:
m
- The 2D input structureconformerCount
- The lowest energy conformer will be selected from maximum conformerCount diverse conformations.- Returns:
- the lowest energy conformer found
-
removeAtomAliases
Utility for preprocessing structure for alignment. Removes atom aliases that usually exist on molecules if read from pdb.- Parameters:
m
- removes aliases on this instance.
-
removeLonePairs
Utility for preprocessing structure for alignment. Removes lone pair atoms that usually exist on molecules if read from pdb.- Parameters:
m
- removes LP atoms on this instance.
-
keepLargestFragment
Utility for preprocessing structure for alignment. Keeps the largest fragment of the moleculegraph.- Parameters:
m
- finds the largest fragment of this Molecule- Returns:
- a new clone of the largest fragment.
-
preprocess
Utility for preprocessing structure for alignment. Performs the following actions on the Molecule required by the alignment:keepLargestFragment(Molecule)
- Generates 3D coordinates, if the structure is not in 3D
removeAtomAliases(Molecule)
removeLonePairs(Molecule)
- remove explicit Hydrogen atoms
- Fix valence errors
- Returns:
- the clone of the input molecule preprocessed.
-