.. _ref-Align: BioSimSpace.Align ================= The *Align* package provides functionality for aligning and merging molecules. Molecules are aligned using a Maximum Common Substructure (MCS) search, which is used to find mappings between atom indices in the two molecules. Functionality is provided for sorting the mappings according to a scoring function, such as the root mean squared displacement of the alignment that is generated by the mapping. Some examples: .. code-block:: python import BioSimSpace as BSS # Here we assume that we have already created two BioSimSpace molecules, # mol0 and mol1. # Find the best MCS mapping from mol0 to mol1. mapping = BSS.Align.matchAtoms(mol0, mol1) # Return a maximum of 10 matches, scored by RMSD and sorted from best to worst. mappings = BSS.Align.matchAtoms(mol0, mol1, matches=10) # Align mol0 to mol1 based on the best mapping. The molecule is aligned based # on a root mean squared displacement fit to find the optimal translation vector # (as opposed to merely taking the difference of centroids). mol0 = BSS.Align.rmsdAlign(mol0, mol1, mapping) # Merge the properties of the two molecules based on the atom mapping. # The resulting "merged-molecule" can be used in free energy perturbation # simulations. merged = BSS.Align.merge(mol0, mol1, mappings) .. automodule:: BioSimSpace.Align .. toctree:: :maxdepth: 1