Aligns two molecules on the largest common substructure
Molecule) – The reference molecule on which to align
Molecule) – The second molecule which will be rotated and translated to align on mol1
fields (tuple) – A tuple of the fields that are used to match atoms
tolerance (float) – How different can distances be between to atom pairs for them to match in the product graph
visualize (bool) – If set to True it will visualize the alignment
newmol – A copy of mol2 aligned on mol1
Maximum common substructure atom matching.
Given two molecules it will find their maximum common substructure using rdkit and return the atoms in both molecules which matched.
atm1 (list) – A list of atom indexes of the first molecule which matched to the second
atm2 (list) – A list of atom indexes of the second molecule which matched to the first
>>> mol1 = Molecule("OIC.cif") >>> mol1.atomtype = mol1.element >>> mol2 = Molecule("5vbl") >>> mol2.filter("resname OIC") >>> atm1, atm2 = mcsAtomMatching(mol1, mol2, bondCompare="any") >>> print(mol1.name[atm1], mol2.name[atm2]) ['N' 'CA' 'C' 'O' 'CB' 'CG' 'CD' 'C7' 'C6' 'C5' 'C4'] ['N' 'CA' 'C' 'O' 'CB' 'CG' 'CD' 'C7' 'C6' 'C5' 'C4']